Author: dragonking
Date: Mon Apr 13 02:04:33 2009
New Revision: 34838
URL: http://svn.gna.org/viewcvs/wesnoth?rev=34838&view=rev
Log:
Small fix for level_up candidate move
Modified:
trunk/data/ai/formula/level_up_attack_eval.fai
trunk/data/ai/formula/level_up_attack_move.fai
Modified: trunk/data/ai/formula/level_up_attack_eval.fai
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/data/ai/formula/level_up_attack_eval.fai?rev=34838&r1=34837&r2=34838&view=diff
==============================================================================
--- trunk/data/ai/formula/level_up_attack_eval.fai (original)
+++ trunk/data/ai/formula/level_up_attack_eval.fai Mon Apr 13 02:04:33 2009
@@ -7,6 +7,12 @@
# function calc_exp returns exp gain for a kill of unit with level#
def calc_exp(level)
if(level = 0, 4, level * 8);
+
+# function returns best defensive loc reachable by attacker to attack enemy
#
+def get_best_defense_loc(moves, attacker, enemy)
+ choose(filter(map(filter(moves, src=attacker.loc), dst),
+ distance_between(self, enemy.loc) = 1),
+ defense_on(attacker.loc, self));
if(calc_exp(target.level) > (me.max_experience - me.experience),
if(battle_outcome[1].hitpoints_left[0] = 0,
Modified: trunk/data/ai/formula/level_up_attack_move.fai
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/data/ai/formula/level_up_attack_move.fai?rev=34838&r1=34837&r2=34838&view=diff
==============================================================================
--- trunk/data/ai/formula/level_up_attack_move.fai (original)
+++ trunk/data/ai/formula/level_up_attack_move.fai Mon Apr 13 02:04:33 2009
@@ -5,12 +5,6 @@
# can level up with a kill of target and has a high probability of killing in
#
# a single round
#
-# function returns best defensive loc reachable by attacker to attack enemy
#
-def get_best_defense_loc(moves, attacker, enemy)
- choose(filter(map(filter(moves, src=attacker.loc), dst),
- distance_between(self, enemy.loc) = 1),
- defense_on(attacker.loc, self));
-
attack(me.loc, get_best_defense_loc(my_moves.moves, me, target), target.loc)
faiend
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits