Simple Attack MAI: add optional parameter 'weapon'

This commit is contained in:
mattsc 2013-11-25 19:29:21 -08:00
parent ea915d36c2
commit ffbf2c2891
2 changed files with 2 additions and 2 deletions

View file

@ -79,7 +79,7 @@ function ca_simple_attack:execution(ai, cfg, self)
local defender = wesnoth.get_unit(self.data.attack.target.x, self.data.attack.target.y)
AH.movefull_outofway_stopunit(ai, attacker, self.data.attack.dst.x, self.data.attack.dst.y)
ai.attack(attacker, defender)
ai.attack(attacker, defender, (cfg.weapon or -1))
self.data.attack = nil
end

View file

@ -496,7 +496,7 @@ function wesnoth.wml_actions.micro_ai(cfg)
--------- Simple Attack Micro AI ---------------------------
elseif (cfg.ai_type == 'simple_attack') then
optional_keys = { "filter", "filter_second" }
optional_keys = { "filter", "filter_second", "weapon" }
CA_parms = { { ca_id = 'mai_simple_attack', location = 'ai/micro_ais/cas/ca_simple_attack.lua', score = cfg.ca_score or 110000 } }
-- If we got here, none of the valid ai_types was specified