Move AI_CONTROLLER_ALLOW_LEADER_CONTROL macro

... from data/core/macros/ai.cfg to data/core/macros/ai_controller.cfg
This commit is contained in:
mattsc 2013-10-04 08:07:26 -07:00
parent 04390c5bac
commit 0ef41090c0
2 changed files with 51 additions and 55 deletions

View file

@ -508,61 +508,6 @@
{_AI_ASPECT_LEADER_GOAL_RISKY_MOVE_TO {X} {Y} "no"}
#enddef
############################################################
# AI CONTROLLER SUPPORT
############################################################
#define AI_CONTROLLER_ALLOW_LEADER_CONTROL CONTROLLER_SIDE CONTROLLED_SIDE
[store_unit]
[filter]
side={CONTROLLED_SIDE}
canrecruit=yes
[/filter]
kill=no
variable=ally_leader
[/store_unit]
[if]
[variable]
name=ally_leader.length
greater_than=0
[/variable]
[then]
[set_menu_item]
id=ai_controller_leader_control_{CONTROLLED_SIDE}
description= _ "Ask $ally_leader.name (leader of side $ally_leader.side) to move here"
[show_if]
side={CONTROLLER_SIDE}
[have_unit]
side={CONTROLLED_SIDE}
canrecruit=yes
[/have_unit]
[/show_if]
[command]
{CLEAR_AI_ALWAYS_ASPECT_LEADER_GOAL {CONTROLLED_SIDE} }
{MODIFY_AI_ADD_ASPECT {CONTROLLED_SIDE} leader_goal {AI_ASPECT_LEADER_GOAL_RISKY_MOVE_TO $x1 $y1} }
[/command]
[/set_menu_item]
[/then]
[/if]
[event]
name=victory #TODO: any scenario change
[set_menu_item]
id=ai_controller_leader_control_{CONTROLLED_SIDE}
[show_if]
[not]
[/not]
[/show_if]
[/set_menu_item]
[/event]
{CLEAR_VARIABLE ally_leader}
#enddef
############################################################
# EXPERIMENTAL AI
############################################################

View file

@ -1,5 +1,56 @@
#textdomain wesnoth
#define AI_CONTROLLER_ALLOW_LEADER_CONTROL CONTROLLER_SIDE CONTROLLED_SIDE
[store_unit]
[filter]
side={CONTROLLED_SIDE}
canrecruit=yes
[/filter]
kill=no
variable=ally_leader
[/store_unit]
[if]
[variable]
name=ally_leader.length
greater_than=0
[/variable]
[then]
[set_menu_item]
id=ai_controller_leader_control_{CONTROLLED_SIDE}
description= _ "Ask $ally_leader.name (leader of side $ally_leader.side) to move here"
[show_if]
side={CONTROLLER_SIDE}
[have_unit]
side={CONTROLLED_SIDE}
canrecruit=yes
[/have_unit]
[/show_if]
[command]
{CLEAR_AI_ALWAYS_ASPECT_LEADER_GOAL {CONTROLLED_SIDE} }
{MODIFY_AI_ADD_ASPECT {CONTROLLED_SIDE} leader_goal {AI_ASPECT_LEADER_GOAL_RISKY_MOVE_TO $x1 $y1} }
[/command]
[/set_menu_item]
[/then]
[/if]
[event]
name=victory #TODO: any scenario change
[set_menu_item]
id=ai_controller_leader_control_{CONTROLLED_SIDE}
[show_if]
[not]
[/not]
[/show_if]
[/set_menu_item]
[/event]
{CLEAR_VARIABLE ally_leader}
#enddef
#define AI_CONTROLLER_NOTE
[note]
description= _ "In this scenario, you may issue instructions to an allied side by right-clicking on a unit that belongs to it."