Lurker MAI: rename internal engine functions

No change of functionality.  This is done to ensure that function names
are unique, a necessary step toward making different MAIs combinable.
This commit is contained in:
mattsc 2013-06-26 15:00:59 -07:00
parent 493af0053b
commit 5f5206465e
2 changed files with 5 additions and 5 deletions

View file

@ -1,12 +1,12 @@
return {
init = function(ai)
local lurkers = {}
local engine = {}
local LS = wesnoth.require "lua/location_set.lua"
local AH = wesnoth.require "ai/lua/ai_helper.lua"
function lurkers:lurker_attack_eval(cfg)
function engine:mai_lurkers_attack_eval(cfg)
-- If any lurker has moves left, we return score just above standard combat CA
local units = wesnoth.get_units { side = wesnoth.current.side,
{ "and", cfg.filter }, formula = '$this_unit.moves > 0'
@ -19,7 +19,7 @@ return {
return eval
end
function lurkers:lurker_attack_exec(cfg)
function engine:mai_lurkers_attack_exec(cfg)
-- We simply pick the first of the lurkers, they have no strategy
local me = wesnoth.get_units { side = wesnoth.current.side,
{ "and", cfg.filter }, formula = '$this_unit.moves > 0'
@ -102,6 +102,6 @@ return {
if me and me.valid then ai.stopunit_all(me) end
end
return lurkers
return engine
end
}

View file

@ -300,7 +300,7 @@ function wesnoth.wml_actions.micro_ai(cfg)
local CA_parms = {
{
id = 'lurker_moves_lua', eval_name = 'lurker_attack_eval', exec_name = 'lurker_attack_exec',
id = 'lurker_moves_lua', eval_name = 'mai_lurkers_attack_eval', exec_name = 'mai_lurkers_attack_exec',
max_score = 100010, cfg_table = cfg_lurk
},
}