Add healer support micro AI to experimental multiplayer AI

This commit is contained in:
Simon Forsyth 2013-01-12 23:31:59 +00:00
parent 5cca2a1988
commit 1ea4ff0f26
4 changed files with 23 additions and 1 deletions

View File

@ -11,6 +11,7 @@ Version 1.11.1+svn:
* Fix bug when playing on maps with a turn limit
* Fix bug handling regeneration
* Minor improvements in switching between castles
* Add healer support micro AI to improve healer use
* New [micro_ai] tag, 18 different Micro AIs, and 14 test scenarios
* This includes AIs for 7 different animal behaviors, bottleneck defense,
2 different guardians and a coward, healer support, lurkers,

View File

@ -54,5 +54,12 @@
evaluation="return (...):spread_poison_eval()"
execution="(...):spread_poison_exec()"
[/candidate_action]
[candidate_action]
engine=lua
name=move_to_enemy
max_score=95000
evaluation="return (...):place_healers_eval()"
execution="(...):place_healers_exec()"
[/candidate_action]
[/stage]
[/ai]

View File

@ -9,6 +9,7 @@ return {
local AH = wesnoth.require "ai/lua/ai_helper.lua"
local BC = wesnoth.require "ai/lua/battle_calcs.lua"
local LS = wesnoth.require "lua/location_set.lua"
local HS = wesnoth.require("ai/micro_ais/ais/mai_healer_support_engine.lua").init(ai)
------ Stats at beginning of turn -----------
@ -69,7 +70,8 @@ return {
formula = '($this_unit.moves = $this_unit.max_moves) and ($this_unit.hitpoints = $this_unit.max_hitpoints)'
}[1]
if not leader then
-- CA is irrelevant if no leader
-- CA is irrelevant if no leader or the leader may have moved from another CA
self.data.leader_target = nil
AH.done_eval_messages(start_time, ca_name)
return 0
end
@ -465,6 +467,17 @@ return {
self.data.attack = nil
end
generic_rush.healer_support_eval = HS.healer_support_eval
function generic_rush:place_healers_eval()
if generic_rush:healer_support_eval() > 0 then
return 95000
end
return 0
end
generic_rush.place_healers_exec = HS.healer_support_exec
return generic_rush
end
}

View File

@ -15,6 +15,7 @@ Version 1.11.1+svn:
* Fix bug when playing on maps with a turn limit.
* Fix bug handling regeneration.
* Minor improvements in switching between castles.
* Add healer support micro AI to improve healer use.
* New [micro_ai] tag, 18 different Micro AIs, and 14 test scenarios
* This includes AIs for 7 different animal behaviors, bottleneck defense,
2 different guardians and a coward, healer support, lurkers,