wesnoth/data/ai/formula/poisoner_eval.fai
Iurii Chernyi 6117d5b021 fixed a segfault in fai_candidate_action serialization code,
...removed some old stubs, used better and simpler AI syntax in LoW::1,
LoW::2, LoW::3 , split candidate action WML snippets to their own file
2009-12-25 01:25:34 +00:00

31 lines
904 B
Plaintext

fai 'poisoner_eval.fai'
{AI_CA_COMBAT_SCORE} + 100 +
#rate units with regeneration as worse targets #
if( find( villages, self = target.loc ), -10, 0 ) +
# units next to healers/curers are also bad targets #
min( map(
filter(
map( adjacent_locs(target.loc),
unit_at(self)
),
'unit', index_of(unit.side, enemies) != -1 and unit.abilities
), 'unit_with_sp',
if( index_of('healing',unit_with_sp.abilities) != -1, -5, 0 ) +
if( index_of('curing',unit_with_sp.abilities) != -1, -5, 0 )
)
) +
#leader is always a good target! #
if( target.leader, 50, 0 ) +
# consider target abilities if needed #
if( target.abilities,
if( index_of('regenerates', target.abilities) != -1, -10, 0 ) +
if( index_of('healing', target.abilities) != -1, 10, 0 ) +
if( index_of('curing', target.abilities) != -1, 10, 0 ) +
if( index_of('leadership', target.abilities) != -1, 15, 0 ),
0
)
faiend