Author: esr
Date: Thu Oct 23 01:39:04 2008
New Revision: 30319
URL: http://svn.gna.org/viewcvs/wesnoth?rev=30319&view=rev
Log:
Sukko's "wasn't 100% successful" (but better than nothing) attempt to
get the AI to include poson bonuses when it figures power projection.
>From r29531, previously reverted as an emergency fix.
Modified:
trunk/src/ai_attack.cpp
Modified: trunk/src/ai_attack.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/ai_attack.cpp?rev=30319&r1=30318&r2=30319&view=diff
==============================================================================
--- trunk/src/ai_attack.cpp (original)
+++ trunk/src/ai_attack.cpp Thu Oct 23 01:39:04 2008
@@ -677,8 +677,14 @@
int most_damage = 0;
for(std::vector<attack_type>::const_iterator att =
un.attacks().begin(); att != un.attacks().end();
++att) {
+ int poison_bonus = 0;
+
+ if (att->get_special_bool("poison", true))
+ poison_bonus = 800 * (1.0 -
+ std::pow(0.7,
+
static_cast<double>(att->num_attacks())));
int damage = att->damage() * att->num_attacks()
*
- (100 + tod_modifier);
+ (100 + tod_modifier) +
poison_bonus;
if(damage > most_damage) {
most_damage = damage;
}
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits