AI leaders set to defensive will now follow human-set leader goals
anyway, even to the death.
This commit is contained in:
Iurii Chernyi 2011-08-11 21:36:17 +00:00
parent ba0345781f
commit 1f667d3bf8
2 changed files with 36 additions and 3 deletions

View file

@ -2,8 +2,9 @@ Version 1.9.8+svn:
* AI:
* Fixed bug #16117: added a way to supress E_NOT_REACHED_DESTINATION to lua
api via an optional boolean parameter - ai.move_full(from,to_x,to_y,true)
* Fixed bug #18057: AI leaders should now attack when they should.
* Fixed bug #18356: AI leaders now won't move to avoided keeps.
* Fixed bug #18057: AI leaders should now attack when they should
* Fixed bug #18122: AI leaders set to defensive will now follow goals anyway
* Fixed bug #18356: AI leaders now won't move to avoided keeps
* Applied patch #2846 by thonsew: let AI forget about invisible enemy units
in villages during get_villages phase (bug #18101)
* Campaigns:

View file

@ -449,6 +449,24 @@
[/facet]
#enddef
####
# internal macro
#
#define _AI_ASPECT_LEADER_GOAL_RISKY_MOVE_TO X Y AUTOREMOVE_VALUE
[facet]
id="always"
[value]
id="always"
x={X}
y={Y}
max_risk=10000
auto_remove={AUTOREMOVE_VALUE}
[/value]
[/facet]
#enddef
#define AI_ASPECT_LEADER_GOAL_MOVE_TO X Y
# leader goal: move to X Y and be free
@ -467,6 +485,20 @@
{MODIFY_AI_DELETE_ASPECT {SIDE} leader_goal always}
#enddef
#define AI_ASPECT_LEADER_GOAL_RISKY_MOVE_TO X Y
# leader goal: move to X Y and be free
{_AI_ASPECT_LEADER_GOAL_RISKY_MOVE_TO {X} {Y} "yes"}
#enddef
#define AI_ASPECT_LEADER_GOAL_RISKY_MOVE_TO_AND_STAY_THERE X Y
# leader goal: move to X Y and stay there
{_AI_ASPECT_LEADER_GOAL_RISKY_MOVE_TO {X} {Y} "no"}
#enddef
############################################################
# AI CONTROLLER SUPPORT
############################################################
@ -501,7 +533,7 @@
[/show_if]
[command]
{CLEAR_AI_ALWAYS_ASPECT_LEADER_GOAL {CONTROLLED_SIDE} }
{MODIFY_AI_ADD_ASPECT {CONTROLLED_SIDE} leader_goal {AI_ASPECT_LEADER_GOAL_MOVE_TO $x1 $y1} }
{MODIFY_AI_ADD_ASPECT {CONTROLLED_SIDE} leader_goal {AI_ASPECT_LEADER_GOAL_RISKY_MOVE_TO $x1 $y1} }
[/command]
[/set_menu_item]
[/then]