Lurkers MAI: add optional ca_score parameter
This commit is contained in:
parent
64b923f98f
commit
5b5964c1e4
2 changed files with 3 additions and 6 deletions
|
@ -12,11 +12,8 @@ return {
|
|||
{ "and", cfg.filter }, formula = '$this_unit.moves > 0'
|
||||
}
|
||||
|
||||
local eval = 0
|
||||
if units[1] then eval = 100010 end
|
||||
|
||||
--print("Lurker eval: ",eval)
|
||||
return eval
|
||||
if units[1] then return cfg.ca_score end
|
||||
return 0
|
||||
end
|
||||
|
||||
function engine:mai_lurkers_attack_exec(cfg)
|
||||
|
|
|
@ -186,7 +186,7 @@ function wesnoth.wml_actions.micro_ai(cfg)
|
|||
elseif (cfg.ai_type == 'lurkers') then
|
||||
required_keys = { "filter", "filter_location" }
|
||||
optional_keys = { "stationary", "filter_location_wander" }
|
||||
CA_parms = { { ca_id = 'mai_lurkers_attack', score = 100010 } }
|
||||
CA_parms = { { ca_id = 'mai_lurkers_attack', score = cfg.ca_score or 300000 } }
|
||||
|
||||
--------- Protect Unit Micro AI - side-wide AI ------------------------------------
|
||||
elseif (cfg.ai_type == 'protect_unit') then
|
||||
|
|
Loading…
Add table
Reference in a new issue