Refactor the boarding events for TRoW S8 Clearwater Port.

Resolves #6298.
This commit is contained in:
Wedge009 2021-11-16 12:45:36 +11:00
parent 49e43694f4
commit 76fda0bf3d

View file

@ -731,33 +731,35 @@
#The victory
#define BOARDING_EVENT SHIP_EVENT ABSCISSA ORDINATE BONUS
# Refactor repeated boarding events
[event]
name=moveto
first_time_only=no
[filter]
side=1
x=31
y=16
x={ABSCISSA}
y={ORDINATE}
[/filter]
[if]
[have_unit]
id=Prince Haldric
x=31
y=16
x={ABSCISSA}
y={ORDINATE}
[/have_unit]
[then]
[if]
[variable]
name=First_Ship
name={SHIP_EVENT}
numerical_equals=1
[/variable]
[then]
{CLEAR_VARIABLE First_Ship}
{CLEAR_VARIABLE {SHIP_EVENT}}
[endlevel]
result=victory
bonus=no
bonus={BONUS}
{NEW_GOLD_CARRYOVER 40}
[/endlevel]
[/then]
@ -784,116 +786,11 @@
[/else]
[/if]
[/event]
#enddef
[event]
name=moveto
first_time_only=no
[filter]
side=1
x=32
y=14
[/filter]
[if]
[have_unit]
id=Prince Haldric
x=32
y=14
[/have_unit]
[then]
[if]
[variable]
name=Second_Ship
numerical_equals=1
[/variable]
[then]
{CLEAR_VARIABLE Second_Ship}
[endlevel]
result=victory
bonus=no
{NEW_GOLD_CARRYOVER 40}
[/endlevel]
[/then]
[else]
[message]
speaker=Commander Aethyr
message= _ "My lord, the ship isnt here yet. Come help us defend against the orcs."
[/message]
[allow_undo]
[/allow_undo]
[/else]
[/if]
[/then]
[else]
[message]
speaker=narrator
message= _ "Shirk not your duty, soldier. When the boat arrives, this is where Prince Haldric must go to lead you to the ship. Until then, help us defend against the orcs."
image=wesnoth-icon.png
[/message]
[allow_undo]
[/allow_undo]
[/else]
[/if]
[/event]
[event]
name=moveto
first_time_only=no
[filter]
side=1
x=29
y=16
[/filter]
[if]
[have_unit]
id=Prince Haldric
x=29
y=16
[/have_unit]
[then]
[if]
[variable]
name=Third_Ship
numerical_equals=1
[/variable]
[then]
{CLEAR_VARIABLE Third_Ship}
[endlevel]
result=victory
bonus=yes
{NEW_GOLD_CARRYOVER 40}
[/endlevel]
[/then]
[else]
[message]
speaker=Commander Aethyr
message= _ "My lord, the ship isnt here yet. Come help us defend against the orcs."
[/message]
[allow_undo]
[/allow_undo]
[/else]
[/if]
[/then]
[else]
[message]
speaker=narrator
message= _ "Shirk not your duty, soldier. When the boat arrives, this is where Prince Haldric must go to lead you to the ship. Until then, help us defend against the orcs."
image=wesnoth-icon.png
[/message]
[allow_undo]
[/allow_undo]
[/else]
[/if]
[/event]
{BOARDING_EVENT First_Ship 31 16 no}
{BOARDING_EVENT Second_Ship 32 14 no}
{BOARDING_EVENT Third_Ship 29 16 yes}
[event]
name=last breath