Messenger Escort MAI: add optional ca_score parameter

This commit is contained in:
mattsc 2013-07-02 17:34:24 -07:00
parent 3059a11602
commit b7fdf80ec2
2 changed files with 10 additions and 6 deletions

View file

@ -162,7 +162,7 @@ return {
if attack then
self.data.best_attack = attack
return 300000
return cfg.ca_score or 300000
end
return 0
@ -185,7 +185,9 @@ return {
local messenger = wesnoth.get_units{ id = cfg.id, formula = '$this_unit.moves > 0' }[1]
if messenger then return 290000 end
if messenger then
return (cfg.ca_score or 300000) - 1
end
return 0
end
@ -316,7 +318,9 @@ return {
local my_units = wesnoth.get_units{ side = wesnoth.current.side, formula = '$this_unit.moves > 0' }
if my_units[1] then return 280000 end
if my_units[1] then
return (cfg.ca_score or 300000) - 2
end
return 0
end

View file

@ -189,15 +189,15 @@ function wesnoth.wml_actions.micro_ai(cfg)
CA_parms = {
{
ca_id = 'attack', eval_name = 'mai_messenger_attack_eval', exec_name = 'mai_messenger_attack_exec',
max_score = 300000
max_score = cfg.ca_score or 300000
},
{
ca_id = 'messenger_move', eval_name = 'mai_messenger_move_eval', exec_name = 'mai_messenger_move_exec',
max_score = 290000
max_score = (cfg.ca_score or 300000) - 1
},
{
ca_id = 'other_move', eval_name = 'mai_messenger_other_move_eval', exec_name = 'mai_messenger_other_move_exec',
max_score = 280000
max_score = (cfg.ca_score or 300000) - 2
},
}