fai 'level_up_attack_move.fat'

# If move is chosen, attacker (me) will attack enemy unit (target) from the hex #
# with highest defensive value.  This move will only be chosen if the attacker  #
# 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
