mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-17 02:43:26 +00:00
simplified WML by using [switch] and removing useless loops
This commit is contained in:
parent
d8e8317150
commit
550366a1af
@ -154,28 +154,14 @@
|
||||
message= _ "Lord Logalmier, I shall defeat your dragon."
|
||||
image=portraits/haldric-mad.png
|
||||
[/message]
|
||||
[if]
|
||||
[variable]
|
||||
name=the_dragon
|
||||
numerical_equals=0
|
||||
[/variable]
|
||||
[then]
|
||||
[endlevel]
|
||||
result=victory
|
||||
bonus=no
|
||||
{NEW_GOLD_CARRYOVER 100}
|
||||
carryover_report=no
|
||||
linger_mode=no
|
||||
next_scenario=The_Dragon
|
||||
[/endlevel]
|
||||
[/then]
|
||||
[else]
|
||||
[message]
|
||||
speaker=Lady Jessene
|
||||
message= _ "Umm, you already beat the dragon, Haldric."
|
||||
[/message]
|
||||
[/else]
|
||||
[/if]
|
||||
[endlevel]
|
||||
result=victory
|
||||
bonus=no
|
||||
{NEW_GOLD_CARRYOVER 100}
|
||||
carryover_report=no
|
||||
linger_mode=no
|
||||
next_scenario=The_Dragon
|
||||
[/endlevel]
|
||||
[/command]
|
||||
[/option]
|
||||
#enddef
|
||||
@ -197,28 +183,14 @@
|
||||
message= _ "Those cold blooded monsters will feel my wrath!"
|
||||
image=portraits/haldric-mad.png
|
||||
[/message]
|
||||
[if]
|
||||
[variable]
|
||||
name=a_beach
|
||||
numerical_equals=0
|
||||
[/variable]
|
||||
[then]
|
||||
[endlevel]
|
||||
result=victory
|
||||
bonus=no
|
||||
{NEW_GOLD_CARRYOVER 100}
|
||||
carryover_report=no
|
||||
linger_mode=no
|
||||
next_scenario=A_Beach
|
||||
[/endlevel]
|
||||
[/then]
|
||||
[else]
|
||||
[message]
|
||||
speaker=Lady Jessene
|
||||
message= _ "Umm, you already cleared the beach."
|
||||
[/message]
|
||||
[/else]
|
||||
[/if]
|
||||
[endlevel]
|
||||
result=victory
|
||||
bonus=no
|
||||
{NEW_GOLD_CARRYOVER 100}
|
||||
carryover_report=no
|
||||
linger_mode=no
|
||||
next_scenario=A_Beach
|
||||
[/endlevel]
|
||||
[/command]
|
||||
[/option]
|
||||
#enddef
|
||||
@ -239,28 +211,14 @@
|
||||
speaker=Prince Haldric
|
||||
message= _ "So what exactly is a troll?"
|
||||
[/message]
|
||||
[if]
|
||||
[variable]
|
||||
name=troll_hole
|
||||
numerical_equals=0
|
||||
[/variable]
|
||||
[then]
|
||||
[endlevel]
|
||||
result=victory
|
||||
bonus=no
|
||||
{NEW_GOLD_CARRYOVER 100}
|
||||
carryover_report=no
|
||||
linger_mode=no
|
||||
next_scenario=Troll_Hole
|
||||
[/endlevel]
|
||||
[/then]
|
||||
[else]
|
||||
[message]
|
||||
speaker=Lady Jessene
|
||||
message= _ "Haldric, the trolls, scales and fangs - you don't remember?"
|
||||
[/message]
|
||||
[/else]
|
||||
[/if]
|
||||
[endlevel]
|
||||
result=victory
|
||||
bonus=no
|
||||
{NEW_GOLD_CARRYOVER 100}
|
||||
carryover_report=no
|
||||
linger_mode=no
|
||||
next_scenario=Troll_Hole
|
||||
[/endlevel]
|
||||
[/command]
|
||||
[/option]
|
||||
#enddef
|
||||
@ -281,28 +239,14 @@
|
||||
speaker=Prince Haldric
|
||||
message= _ "Undead. Bah! We're pros at fighting them."
|
||||
[/message]
|
||||
[if]
|
||||
[variable]
|
||||
name=cursed_isle
|
||||
numerical_equals=0
|
||||
[/variable]
|
||||
[then]
|
||||
[endlevel]
|
||||
result=victory
|
||||
bonus=no
|
||||
{NEW_GOLD_CARRYOVER 100}
|
||||
carryover_report=no
|
||||
linger_mode=no
|
||||
next_scenario=Cursed_Isle
|
||||
[/endlevel]
|
||||
[/then]
|
||||
[else]
|
||||
[message]
|
||||
speaker=Lady Jessene
|
||||
message= _ "How could you possibly forget the horror of the Isle of Tears?"
|
||||
[/message]
|
||||
[/else]
|
||||
[/if]
|
||||
[endlevel]
|
||||
result=victory
|
||||
bonus=no
|
||||
{NEW_GOLD_CARRYOVER 100}
|
||||
carryover_report=no
|
||||
linger_mode=no
|
||||
next_scenario=Cursed_Isle
|
||||
[/endlevel]
|
||||
[/command]
|
||||
[/option]
|
||||
#enddef
|
||||
@ -374,54 +318,37 @@
|
||||
#enddef
|
||||
|
||||
#define GREET
|
||||
[if]
|
||||
[variable]
|
||||
name=last_done
|
||||
equals="Dragon"
|
||||
[/variable]
|
||||
[then]
|
||||
[switch]
|
||||
variable=last_done
|
||||
[case]
|
||||
value="Dragon"
|
||||
[message]
|
||||
speaker=Lord Logalmier
|
||||
message= _ "Ahh, you have defeated the dragon, man of the west-north, you are truly impressive for a human."
|
||||
[/message]
|
||||
[/then]
|
||||
[/if]
|
||||
[if]
|
||||
[variable]
|
||||
name=last_done
|
||||
equals="Hole"
|
||||
[/variable]
|
||||
[then]
|
||||
[/case]
|
||||
[case]
|
||||
value="Hole"
|
||||
[message]
|
||||
speaker=Lord Aryad
|
||||
message= _ "So, you have defeated the trolls. Welcome back, Haldric."
|
||||
[/message]
|
||||
[/then]
|
||||
[/if]
|
||||
[if]
|
||||
[variable]
|
||||
name=last_done
|
||||
equals="Isle"
|
||||
[/variable]
|
||||
[then]
|
||||
[/case]
|
||||
[case]
|
||||
value="Isle"
|
||||
[message]
|
||||
speaker="Lord El'Isomithir"
|
||||
message= _ "Finally the souls of our poor kin may rest. Thank you."
|
||||
[/message]
|
||||
[/then]
|
||||
[/if]
|
||||
[if]
|
||||
[variable]
|
||||
name=last_done
|
||||
equals="Beach"
|
||||
[/variable]
|
||||
[then]
|
||||
[/case]
|
||||
[case]
|
||||
value="Beach"
|
||||
[message]
|
||||
speaker=Lady Dionli
|
||||
message= _ "Our beaches are free again. I knew I could trust you, Haldric."
|
||||
[/message]
|
||||
[/then]
|
||||
[/if]
|
||||
[/case]
|
||||
[/switch]
|
||||
#enddef
|
||||
|
||||
[event]
|
||||
@ -432,13 +359,10 @@
|
||||
image=wesnoth-icon.png
|
||||
[/message]
|
||||
|
||||
[if]
|
||||
[variable]
|
||||
name=num_done
|
||||
numerical_equals=0
|
||||
[/variable]
|
||||
|
||||
[then]
|
||||
[switch]
|
||||
variable=num_done
|
||||
[case]
|
||||
value=0
|
||||
[message]
|
||||
speaker=Lord Logalmier
|
||||
message= _ "Dionli, why have you brought these humans before us?"
|
||||
@ -510,18 +434,10 @@
|
||||
[/message]
|
||||
{QUESTS}
|
||||
|
||||
#will have to use a [do] here if the future choices...
|
||||
{QUEST_CHOICES}
|
||||
[/then]
|
||||
[/if]
|
||||
|
||||
[if]
|
||||
[variable]
|
||||
name=num_done
|
||||
numerical_equals=1
|
||||
[/variable]
|
||||
|
||||
[then]
|
||||
[/case]
|
||||
[case]
|
||||
value=1
|
||||
{GREET}
|
||||
|
||||
[message]
|
||||
@ -531,25 +447,10 @@
|
||||
|
||||
{QUESTS}
|
||||
|
||||
[while]
|
||||
[variable]
|
||||
less_than=4
|
||||
name=num_done
|
||||
[/variable]
|
||||
[do]
|
||||
{QUEST_CHOICES}
|
||||
[/do]
|
||||
[/while]
|
||||
[/then]
|
||||
[/if]
|
||||
|
||||
[if]
|
||||
[variable]
|
||||
name=num_done
|
||||
numerical_equals=2
|
||||
[/variable]
|
||||
|
||||
[then]
|
||||
{QUEST_CHOICES}
|
||||
[/case]
|
||||
[case]
|
||||
value=2
|
||||
{GREET}
|
||||
|
||||
[message]
|
||||
@ -559,25 +460,10 @@
|
||||
|
||||
{QUESTS}
|
||||
|
||||
[while]
|
||||
[variable]
|
||||
less_than=4
|
||||
name=num_done
|
||||
[/variable]
|
||||
[do]
|
||||
{QUEST_CHOICES}
|
||||
[/do]
|
||||
[/while]
|
||||
[/then]
|
||||
[/if]
|
||||
|
||||
[if]
|
||||
[variable]
|
||||
name=num_done
|
||||
numerical_equals=3
|
||||
[/variable]
|
||||
|
||||
[then]
|
||||
{QUEST_CHOICES}
|
||||
[/case]
|
||||
[case]
|
||||
value=3
|
||||
{GREET}
|
||||
|
||||
[message]
|
||||
@ -587,25 +473,10 @@
|
||||
|
||||
{QUESTS}
|
||||
|
||||
[while]
|
||||
[variable]
|
||||
less_than=4
|
||||
name=num_done
|
||||
[/variable]
|
||||
[do]
|
||||
{QUEST_CHOICES}
|
||||
[/do]
|
||||
[/while]
|
||||
[/then]
|
||||
[/if]
|
||||
|
||||
[if]
|
||||
[variable]
|
||||
name=num_done
|
||||
numerical_equals=4
|
||||
[/variable]
|
||||
[then]
|
||||
{GREET}
|
||||
{QUEST_CHOICES}
|
||||
[/case]
|
||||
[case]
|
||||
value=4
|
||||
|
||||
[message]
|
||||
speaker=Lady Dionli
|
||||
@ -696,7 +567,7 @@
|
||||
linger_mode=no
|
||||
next_scenario=A_Spy_in_the_Woods
|
||||
[/endlevel]
|
||||
[/then]
|
||||
[/if]
|
||||
[/case]
|
||||
[/switch]
|
||||
[/event]
|
||||
[/scenario]
|
||||
|
Loading…
x
Reference in New Issue
Block a user