Revert 2011-08-14T15:46:08Z!thonsew@yahoo.com

Bugs are in C++ bugs related to recruitment and $this_unit not the WML
This commit is contained in:
Thonsew 2011-08-15 15:01:17 +00:00
parent ebbe106e49
commit 4bb5e2f825

View File

@ -96,7 +96,7 @@
side=3 side=3
canrecruit=yes canrecruit=yes
[ai] [ai]
recruitment_pattern=mixed fighter, mixed fighter, mixed fighter, fighter, fighter, mixed fighter, mixed fighter, scout recruitment_pattern=scout, scout, scout, fighter, fighter, mixed fighter, mixed fighter
aggression=1.0 aggression=1.0
caution=0.0 caution=0.0
villages_per_scout=0 villages_per_scout=0
@ -171,7 +171,6 @@
facing={FACING_VALUE} facing={FACING_VALUE}
upkeep=free upkeep=free
role="docked transport" role="docked transport"
goto_x,goto_y={X},{Y}
[variables] [variables]
transport_num={ID_VALUE} transport_num={ID_VALUE}
@ -361,7 +360,7 @@
[/variables] [/variables]
[/filter_wml] [/filter_wml]
count=3-100 count=3
[/filter_adjacent] [/filter_adjacent]
[/have_unit] [/have_unit]
[/filter_condition] [/filter_condition]
@ -436,7 +435,6 @@
[fire_event] [fire_event]
name=start_boarding_next_transport name=start_boarding_next_transport
[/fire_event] [/fire_event]
#{DEBUG_MSG "Boarding "}
{CLEAR_VARIABLE transport} {CLEAR_VARIABLE transport}
[/event] [/event]
@ -613,51 +611,6 @@
[/do] [/do]
[/while] [/while]
# {FOREACH possible_boarders j}
# {DEBUG_MSG "Possible boarder $possible_boarders[$j].name"}
# {NEXT j}
#Pick 3 different random units
#Better way would be to randomize the vector.
{RANDOM "0..$($possible_boarders.length - 1)"}
{VARIABLE unit1 $random}
{RANDOM "0..$($possible_boarders.length - 2)"}
{VARIABLE unit2 $random}
[if]
[variable]
name=unit2
equals=$unit1
[/variable]
[then]
{CLEAR_VARIABLE unit2}
{VARIABLE unit2 "$($possible_boarders.length - 1)" }
[/then]
[/if]
{RANDOM "0..$($possible_boarders.length - 3)"}
{VARIABLE unit3 $random}
[if]
[variable]
name=unit3
equals=$unit1
[/variable]
[or]
[variable]
name=unit3
equals=$unit2
[/variable]
[/or]
[then]
{CLEAR_VARIABLE unit3}
{VARIABLE unit3 "$($possible_boarders.length - 1)" }
[/then]
[/if]
#{DEBUG_MSG "unit1 = $unit1, unit2 = $unit2, unit3 = $unit3"}
[if] [if]
[variable] [variable]
name=possible_boarders.length name=possible_boarders.length
@ -665,33 +618,14 @@
[/variable] [/variable]
[then] [then]
{VARIABLE possible_boarders[$unit1].variables.boarding_transport yes} {RANDOM "0..$($possible_boarders.length - 1)"}
#{DEBUG_MSG "Setting $possible_boarders[$unit1].name the $possible_boarders[$unit1].language_name to board transport $transport_to_board"} {VARIABLE possible_boarders[$random].variables.boarding_transport yes}
#{DEBUG_MSG "Setting $possible_boarders[$random].name the $possible_boarders[$random].language_name to board transport $transport_to_board"}
[unstore_unit] [unstore_unit]
variable=possible_boarders[$unit1] variable=possible_boarders[$random]
find_vacant=no
[/unstore_unit]
[/then]
#[else]
# {DEBUG_MSG "Found no one to go to board transport $transport_to_board|..."}
#[/else]
[/if]
[if]
[variable]
name=possible_boarders.length
greater_than_equal_to=2
[/variable]
[then]
{VARIABLE possible_boarders[$unit2].variables.boarding_transport yes}
#{DEBUG_MSG "Setting $possible_boarders[$unit2].name the $possible_boarders[$unit2].language_name to board transport $transport_to_board"}
[unstore_unit]
variable=possible_boarders[$unit2]
find_vacant=no find_vacant=no
[/unstore_unit] [/unstore_unit]
[/then] [/then]
@ -701,28 +635,7 @@
#[/else] #[/else]
[/if] [/if]
[if] {CLEAR_VARIABLE possible_boarders}
[variable]
name=possible_boarders.length
greater_than_equal_to=3
[/variable]
[then]
{VARIABLE possible_boarders[$unit3].variables.boarding_transport yes}
#{DEBUG_MSG "Setting $possible_boarders[$unit3].name the $possible_boarders[$unit3].language_name to board transport $transport_to_board"}
[unstore_unit]
variable=possible_boarders[$unit3]
find_vacant=no
[/unstore_unit]
[/then]
#[else]
# {DEBUG_MSG "Found no one to go to board transport $transport_to_board|..."}
#[/else]
[/if]
{CLEAR_VARIABLE possible_boarders,unit1,unit2,unit3}
[/event] [/event]
# This makes units which have been designated to board a transport to move # This makes units which have been designated to board a transport to move
@ -773,23 +686,9 @@
[/filter_adjacent_location] [/filter_adjacent_location]
[not] [not]
[variable]
name=i
greater_than=0
[/variable]
[filter] [filter]
x,y=$moving_to_transport[0].goto_x,$moving_to_transport[0].goto_y
[/filter] [/filter]
[/not] [/not]
# [not]
# [variable]
# name=i
# greater_than=1
# [/variable]
# [filter]
# x,y=$moving_to_transport[1].goto_x,$moving_to_transport[1].goto_y
# [/filter]
# [/not]
[and] [and]
[filter] [filter]
@ -840,24 +739,19 @@
variable=moving_to_transport[$i] variable=moving_to_transport[$i]
find_vacant=no find_vacant=no
[/unstore_unit] [/unstore_unit]
{NEXT i} {NEXT i}
{CLEAR_VARIABLE moving_to_transport,boarding_locs} {CLEAR_VARIABLE moving_to_transport,boarding_locs}
[/event] [/event]
# Zero the movement of docked transports
[event] [event]
name=side 4 turn refresh name=side 4 turn refresh
first_time_only=no first_time_only=no
[store_unit] # Zero the movement of docked transports
[filter] {MODIFY_UNIT (
type=Transport Galleon type=Transport Galleon
[and]
x,y=$this_unit.variables.dock_x,$this_unit.variables.dock_y x,y=$this_unit.variables.dock_x,$this_unit.variables.dock_y
[/and]
[not] [not]
[filter_wml] [filter_wml]
@ -867,28 +761,7 @@
[/variables] [/variables]
[/filter_wml] [/filter_wml]
[/not] [/not]
[/filter] ) moves 0}
kill=yes
variable=locked_down_transports
[/store_unit]
{FOREACH locked_down_transports i}
{VARIABLE locked_down_transports[$i].moves 0}
#{DEBUG_MSG "Setting transport $locked_down_transports[$i].variables.transport_num to stay at $locked_down_transports[$i].variables.dock_x|,$locked_down_transports[$i].variables.dock_y"}
[unstore_unit]
variable=locked_down_transports[$i]
[/unstore_unit]
{NEXT i}
{CLEAR_VARIABLE locked_down_transports}
[/event]
[event]
name=side 4 turn refresh
first_time_only=no
# Zero the movement of units waiting to board a transport # Zero the movement of units waiting to board a transport
{MODIFY_UNIT ( {MODIFY_UNIT (
@ -987,19 +860,9 @@
[/then] [/then]
[/if] [/if]
#It is possible to strand units on the ship by completely blocking the shoreline
[if]
[variable]
name=disembark_loc.length
greater_than=0
[/variable]
[then]
{RANDOM "0..$($disembark_loc.length - 1)"}
[move_unit_fake] [move_unit_fake]
x=$unit.x,$disembark_loc[$random].x x=$unit.x,$disembark_loc.x
y=$unit.y,$disembark_loc[$random].y y=$unit.y,$disembark_loc.y
type=$unit.variables.landing_party[$i].type type=$unit.variables.landing_party[$i].type
gender=$unit.variables.landing_party[$i].gender gender=$unit.variables.landing_party[$i].gender
side=4 side=4
@ -1007,19 +870,10 @@
[unstore_unit] [unstore_unit]
variable=unit.variables.landing_party[$i] variable=unit.variables.landing_party[$i]
x,y=$disembark_loc[$random].x,$disembark_loc[$random].y x,y=$disembark_loc.x,$disembark_loc.y
[/unstore_unit] [/unstore_unit]
[/then]
[/if]
{NEXT i} {NEXT i}
#It is possible to strand units on the ship by completely blocking the shoreline
[if]
[variable]
name=disembark_loc.length
greater_than=0
[/variable]
[then]
{VARIABLE_OP landing_parties_landed add 1} {VARIABLE_OP landing_parties_landed add 1}
[switch] [switch]
variable=landing_parties_landed variable=landing_parties_landed
@ -1028,7 +882,7 @@
value=1 value=1
[message] [message]
x,y=$disembark_loc[$random].x,$disembark_loc[$random].y x,y=$disembark_loc.x,$disembark_loc.y
message= _ "Charge!" message= _ "Charge!"
[/message] [/message]
[/case] [/case]
@ -1037,7 +891,7 @@
value=2 value=2
[message] [message]
x,y=$disembark_loc[$random].x,$disembark_loc[$random].y x,y=$disembark_loc.x,$disembark_loc.y
message= _ "Get them!" message= _ "Get them!"
[/message] [/message]
[/case] [/case]
@ -1051,8 +905,6 @@
variable=unit variable=unit
find_vacant=no find_vacant=no
[/unstore_unit] [/unstore_unit]
[/then]
[/if]
[/event] [/event]
# This makes transports which have no landing party and aren't at their dock # This makes transports which have no landing party and aren't at their dock
@ -1065,6 +917,7 @@
[store_unit] [store_unit]
[filter] [filter]
type=Transport Galleon type=Transport Galleon
[not] [not]
x,y=$this_unit.variables.dock_x,$this_unit.variables.dock_y x,y=$this_unit.variables.dock_x,$this_unit.variables.dock_y
[/not] [/not]