mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-17 19:36:55 +00:00

...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
31 lines
904 B
Plaintext
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
|
|
|