Whitespace tweaks indicated by a reindent pass.

This commit is contained in:
Eric S. Raymond 2010-02-03 13:18:05 +00:00
parent 968d904a12
commit 5b08325791
5 changed files with 130 additions and 130 deletions

View file

@ -416,45 +416,45 @@ Orcish Archer, Orcish Assassin, Orcish Grunt, Wolf Rider, Goblin Spearman#enddef
#define LOW_STEAL_UNIT_TO ID SIDE
#if we have {ID} not in side {SIDE} transfer him to side {SIDE}
# at position determined by existing unit of {SIDE} with id={ID}
#if we have {ID} not in side {SIDE} transfer him to side {SIDE}
# at position determined by existing unit of {SIDE} with id={ID}
[store_unit]
variable=source_var
kill=yes
[filter]
id={ID}
[not]
side={SIDE}
[/not]
[/filter]
[/store_unit]
[store_unit]
variable=target_var
kill=no
[filter]
id={ID}
[store_unit]
variable=source_var
kill=yes
[filter]
id={ID}
[not]
side={SIDE}
[/filter]
[/store_unit]
[if]
[variable]
name=source_var.length
greater_than=0
[/variable]
[variable]
name=target_var.length
greater_than=0
[/variable]
[then]
{VARIABLE source_var[0].side {SIDE}}
[unstore_unit]
variable=source_var[0]
x=$target_var[0].x
y=$target_var[0].y
[/unstore_unit]
[/then]
[/if]
{CLEAR_VARIABLE source_var}
{CLEAR_VARIABLE target_var}
[/not]
[/filter]
[/store_unit]
[store_unit]
variable=target_var
kill=no
[filter]
id={ID}
side={SIDE}
[/filter]
[/store_unit]
[if]
[variable]
name=source_var.length
greater_than=0
[/variable]
[variable]
name=target_var.length
greater_than=0
[/variable]
[then]
{VARIABLE source_var[0].side {SIDE}}
[unstore_unit]
variable=source_var[0]
x=$target_var[0].x
y=$target_var[0].y
[/unstore_unit]
[/then]
[/if]
{CLEAR_VARIABLE source_var}
{CLEAR_VARIABLE target_var}
#enddef

View file

@ -759,7 +759,8 @@
[/role]
[/then]
[/if]
[if] [not]
[if]
[not]
[have_unit]
role=Admirer
[/have_unit]

View file

@ -2,143 +2,143 @@
# scores of well-known candidate actions
#define AI_CA_GOTO_SCORE
200000
200000
#enddef
#define AI_CA_RECRUITMENT_SCORE
180000
180000
#enddef
#define AI_CA_MOVE_LEADER_TO_GOALS_SCORE
140000
140000
#enddef
#define AI_CA_MOVE_LEADER_TO_KEEP_SCORE
120000
120000
#enddef
#define AI_CA_COMBAT_SCORE
100000
100000
#enddef
#define AI_CA_HEALING_SCORE
80000
80000
#enddef
#define AI_CA_VILLAGES_SCORE
60000
60000
#enddef
#define AI_CA_RETREAT_SCORE
40000
40000
#enddef
#define AI_CA_MOVE_TO_TARGETS_SCORE
20000
20000
#enddef
# well-known candidate actions
#define AI_CA_GOTO
[candidate_action]
id=goto
engine=cpp
name=testing_ai_default::goto_phase
max_score={AI_CA_GOTO_SCORE}
score={AI_CA_GOTO_SCORE}
[/candidate_action]
[candidate_action]
id=goto
engine=cpp
name=testing_ai_default::goto_phase
max_score={AI_CA_GOTO_SCORE}
score={AI_CA_GOTO_SCORE}
[/candidate_action]
#enddef
#define AI_CA_RECRUITMENT
[candidate_action]
id=recruitment
engine=cpp
name=testing_ai_default::aspect_recruitment_phase
max_score={AI_CA_RECRUITMENT_SCORE}
score={AI_CA_RECRUITMENT_SCORE}
[/candidate_action]
[candidate_action]
id=recruitment
engine=cpp
name=testing_ai_default::aspect_recruitment_phase
max_score={AI_CA_RECRUITMENT_SCORE}
score={AI_CA_RECRUITMENT_SCORE}
[/candidate_action]
#enddef
#define AI_CA_MOVE_LEADER_TO_GOALS
[candidate_action]
id=move_leader_to_goals
engine=cpp
name=testing_ai_default::move_leader_to_goals_phase
max_score={AI_CA_MOVE_LEADER_TO_GOALS_SCORE}
score={AI_CA_MOVE_LEADER_TO_GOALS_SCORE}
[/candidate_action]
[candidate_action]
id=move_leader_to_goals
engine=cpp
name=testing_ai_default::move_leader_to_goals_phase
max_score={AI_CA_MOVE_LEADER_TO_GOALS_SCORE}
score={AI_CA_MOVE_LEADER_TO_GOALS_SCORE}
[/candidate_action]
#enddef
#define AI_CA_MOVE_LEADER_TO_KEEP
[candidate_action]
id=move_leader_to_keep
engine=cpp
name=testing_ai_default::move_leader_to_keep_phase
max_score={AI_CA_MOVE_LEADER_TO_KEEP_SCORE}
score={AI_CA_MOVE_LEADER_TO_KEEP_SCORE}
[/candidate_action]
[candidate_action]
id=move_leader_to_keep
engine=cpp
name=testing_ai_default::move_leader_to_keep_phase
max_score={AI_CA_MOVE_LEADER_TO_KEEP_SCORE}
score={AI_CA_MOVE_LEADER_TO_KEEP_SCORE}
[/candidate_action]
#enddef
#define AI_CA_COMBAT
[candidate_action]
id=combat
engine=cpp
name=testing_ai_default::combat_phase
max_score={AI_CA_COMBAT_SCORE}
score={AI_CA_COMBAT_SCORE}
[/candidate_action]
[candidate_action]
id=combat
engine=cpp
name=testing_ai_default::combat_phase
max_score={AI_CA_COMBAT_SCORE}
score={AI_CA_COMBAT_SCORE}
[/candidate_action]
#enddef
#define AI_CA_HEALING
[candidate_action]
id=healing
engine=cpp
name=testing_ai_default::get_healing_phase
max_score={AI_CA_HEALING_SCORE}
score={AI_CA_HEALING_SCORE}
[/candidate_action]
[candidate_action]
id=healing
engine=cpp
name=testing_ai_default::get_healing_phase
max_score={AI_CA_HEALING_SCORE}
score={AI_CA_HEALING_SCORE}
[/candidate_action]
#enddef
#define AI_CA_VILLAGES
[candidate_action]
id=villages
engine=cpp
name=testing_ai_default::get_villages_phase
max_score={AI_CA_VILLAGES_SCORE}
score={AI_CA_VILLAGES_SCORE}
[/candidate_action]
[candidate_action]
id=villages
engine=cpp
name=testing_ai_default::get_villages_phase
max_score={AI_CA_VILLAGES_SCORE}
score={AI_CA_VILLAGES_SCORE}
[/candidate_action]
#enddef
#define AI_CA_RETREAT
[candidate_action]
id=retreat
engine=cpp
name=testing_ai_default::retreat_phase
max_score={AI_CA_RETREAT_SCORE}
score={AI_CA_RETREAT_SCORE}
[/candidate_action]
[candidate_action]
id=retreat
engine=cpp
name=testing_ai_default::retreat_phase
max_score={AI_CA_RETREAT_SCORE}
score={AI_CA_RETREAT_SCORE}
[/candidate_action]
#enddef
#define AI_CA_MOVE_TO_TARGETS
[candidate_action]
id=move_to_targets
engine=cpp
name=testing_ai_default::testing_move_to_targets_phase
max_score={AI_CA_MOVE_TO_TARGETS_SCORE}
score={AI_CA_MOVE_TO_TARGETS_SCORE}
[/candidate_action]
[candidate_action]
id=move_to_targets
engine=cpp
name=testing_ai_default::testing_move_to_targets_phase
max_score={AI_CA_MOVE_TO_TARGETS_SCORE}
score={AI_CA_MOVE_TO_TARGETS_SCORE}
[/candidate_action]
#enddef
# extra candidate actions
#define AI_CA_SIMPLE_MOVE_TO_TARGETS
[candidate_action]
id=simple_move_to_targets
engine=cpp
name=testing_ai_default::simple_move_and_targeting_phase
max_score={AI_CA_MOVE_TO_TARGETS_SCORE}
score={AI_CA_MOVE_TO_TARGETS_SCORE}
[/candidate_action]
[candidate_action]
id=simple_move_to_targets
engine=cpp
name=testing_ai_default::simple_move_and_targeting_phase
max_score={AI_CA_MOVE_TO_TARGETS_SCORE}
score={AI_CA_MOVE_TO_TARGETS_SCORE}
[/candidate_action]
#enddef
#define AI_CA_POISONING

View file

@ -153,8 +153,8 @@
[command]
{VARIABLE order_type aggression}
{MODIFY_AI_ADD_SIMPLE_ASPECT $ally_side aggression set_by_ai_controller "0.9"}
{MODIFY_AI_ADD_SIMPLE_ASPECT $ally_side caution set_by_ai_controller "0.1"}
{MODIFY_AI_ADD_SIMPLE_ASPECT $ally_side aggression set_by_ai_controller "0.9"}
{MODIFY_AI_ADD_SIMPLE_ASPECT $ally_side caution set_by_ai_controller "0.1"}
{VARIABLE ai_controller.side_$ally_side|_current_settings.current_behaviour aggression}
{VARIABLE ai_controller.side_$ally_side|_current_settings.currently_doing_behaviour_description _"aggressive."}
@ -189,8 +189,8 @@
{VARIABLE ai_controller.side_$ally_side|_current_settings.current_behaviour caution}
{VARIABLE ai_controller.side_$ally_side|_current_settings.currently_doing_behaviour_description _"defensive."}
{MODIFY_AI_ADD_SIMPLE_ASPECT $ally_side aggression set_by_ai_controller "0.1"}
{MODIFY_AI_ADD_SIMPLE_ASPECT $ally_side caution set_by_ai_controller "1.0"}
{MODIFY_AI_ADD_SIMPLE_ASPECT $ally_side aggression set_by_ai_controller "0.1"}
{MODIFY_AI_ADD_SIMPLE_ASPECT $ally_side caution set_by_ai_controller "1.0"}
[/command]
[/option]
[/caution]
@ -306,7 +306,7 @@
{VARIABLE ai_controller.side_$ally_side|_current_settings.current_objective focus_on_enemy}
{VARIABLE ai_controller.side_$ally_side|_current_settings.currently_doing_objective_description _"focusing on defeating $this_enemy_description|."}
{MODIFY_AI_ADD_GOAL $ally_side (
{MODIFY_AI_ADD_GOAL $ally_side (
[goal]
id=set_by_ai_controller
value=20
@ -314,7 +314,7 @@
side=$temp_i
[/criteria]
[/goal]
)}
)}
[/command]
[/value]
[/set_variables]
@ -462,7 +462,7 @@
{VARIABLE ai_controller.side_$ally_side|_current_settings.current_objective protect}
{VARIABLE ai_controller.side_$ally_side|_current_settings.currently_doing_objective_description _"focusing on protecting $this_ally_description|."}
{MODIFY_AI_ADD_GOAL $ally_side (
{MODIFY_AI_ADD_GOAL $ally_side (
[goal]
id=set_by_ai_controller
name=protect
@ -471,8 +471,7 @@
side=$temp_i
[/criteria]
[/goal]
)}
)}
[/command]
[/value]
[/set_variables]
@ -562,8 +561,6 @@
{VARIABLE ai_controller.side_$ally_side|_current_settings.current_objective defend_location}
{VARIABLE ai_controller.side_$ally_side|_current_settings.currently_doing_objective_description _"focusing on defending the area around $x1|,$y1|."}
{MODIFY_AI_ADD_GOAL $ally_side (
[goal]
id=set_by_ai_controller

View file

@ -832,6 +832,7 @@ Also, 0..9 = $below_ten, one,two,three = $ascii and the bonus answer is $mixed."
x,y,side=18,10,1
[/filter]
#wmlindent: stop
[lua]
# Uses the special syntax as described at
# http://www.wesnoth.org/wiki/DescriptionWML
@ -852,6 +853,7 @@ Also, 0..9 = $below_ten, one,two,three = $ascii and the bonus answer is $mixed."
wesnoth.message(string.format("User selected choice %d.", result))
>>
[/lua]
#wmlindent: stop
[/event]
[label]