Recruiting MAI: add optional ca_score parameter

This commit is contained in:
mattsc 2013-07-04 11:55:02 -07:00
parent c225c2a3e7
commit ff7a2590f4
2 changed files with 3 additions and 3 deletions

View file

@ -114,7 +114,7 @@ return {
recruit = wesnoth.sides[wesnoth.current.side].recruit[1]
end
return 180000
return cfg.ca_score
end
function engine:mai_random_recruit_exec()

View file

@ -405,11 +405,11 @@ function wesnoth.wml_actions.micro_ai(cfg)
elseif (cfg.ai_type == 'recruiting') then
if (cfg.recruiting_type == 'rushers') then
optional_keys = { "randomness" }
CA_parms = { { ca_id = "mai_rusher_recruit", score = 180000 } }
CA_parms = { { ca_id = "mai_rusher_recruit", score = cfg.ca_score or 180000 } }
elseif (cfg.recruiting_type == 'random') then
optional_keys = { "skip_low_gold_recruiting", "type", "prob" }
CA_parms = { { ca_id = "mai_random_recruit", score = 180000 } }
CA_parms = { { ca_id = "mai_random_recruit", score = cfg.ca_score or 180000 } }
-- The 'probability' tags need to be handled separately here
cfg.type, cfg.prob = {}, {}