simplified WML by using [switch] and removing useless loops

This commit is contained in:
Gunter Labes 2009-08-20 18:59:53 +00:00
parent d8e8317150
commit 550366a1af

View File

@ -154,28 +154,14 @@
message= _ "Lord Logalmier, I shall defeat your dragon." message= _ "Lord Logalmier, I shall defeat your dragon."
image=portraits/haldric-mad.png image=portraits/haldric-mad.png
[/message] [/message]
[if] [endlevel]
[variable] result=victory
name=the_dragon bonus=no
numerical_equals=0 {NEW_GOLD_CARRYOVER 100}
[/variable] carryover_report=no
[then] linger_mode=no
[endlevel] next_scenario=The_Dragon
result=victory [/endlevel]
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]
[/command] [/command]
[/option] [/option]
#enddef #enddef
@ -197,28 +183,14 @@
message= _ "Those cold blooded monsters will feel my wrath!" message= _ "Those cold blooded monsters will feel my wrath!"
image=portraits/haldric-mad.png image=portraits/haldric-mad.png
[/message] [/message]
[if] [endlevel]
[variable] result=victory
name=a_beach bonus=no
numerical_equals=0 {NEW_GOLD_CARRYOVER 100}
[/variable] carryover_report=no
[then] linger_mode=no
[endlevel] next_scenario=A_Beach
result=victory [/endlevel]
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]
[/command] [/command]
[/option] [/option]
#enddef #enddef
@ -239,28 +211,14 @@
speaker=Prince Haldric speaker=Prince Haldric
message= _ "So what exactly is a troll?" message= _ "So what exactly is a troll?"
[/message] [/message]
[if] [endlevel]
[variable] result=victory
name=troll_hole bonus=no
numerical_equals=0 {NEW_GOLD_CARRYOVER 100}
[/variable] carryover_report=no
[then] linger_mode=no
[endlevel] next_scenario=Troll_Hole
result=victory [/endlevel]
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]
[/command] [/command]
[/option] [/option]
#enddef #enddef
@ -281,28 +239,14 @@
speaker=Prince Haldric speaker=Prince Haldric
message= _ "Undead. Bah! We're pros at fighting them." message= _ "Undead. Bah! We're pros at fighting them."
[/message] [/message]
[if] [endlevel]
[variable] result=victory
name=cursed_isle bonus=no
numerical_equals=0 {NEW_GOLD_CARRYOVER 100}
[/variable] carryover_report=no
[then] linger_mode=no
[endlevel] next_scenario=Cursed_Isle
result=victory [/endlevel]
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]
[/command] [/command]
[/option] [/option]
#enddef #enddef
@ -374,54 +318,37 @@
#enddef #enddef
#define GREET #define GREET
[if] [switch]
[variable] variable=last_done
name=last_done [case]
equals="Dragon" value="Dragon"
[/variable]
[then]
[message] [message]
speaker=Lord Logalmier speaker=Lord Logalmier
message= _ "Ahh, you have defeated the dragon, man of the west-north, you are truly impressive for a human." message= _ "Ahh, you have defeated the dragon, man of the west-north, you are truly impressive for a human."
[/message] [/message]
[/then] [/case]
[/if] [case]
[if] value="Hole"
[variable]
name=last_done
equals="Hole"
[/variable]
[then]
[message] [message]
speaker=Lord Aryad speaker=Lord Aryad
message= _ "So, you have defeated the trolls. Welcome back, Haldric." message= _ "So, you have defeated the trolls. Welcome back, Haldric."
[/message] [/message]
[/then] [/case]
[/if] [case]
[if] value="Isle"
[variable]
name=last_done
equals="Isle"
[/variable]
[then]
[message] [message]
speaker="Lord El'Isomithir" speaker="Lord El'Isomithir"
message= _ "Finally the souls of our poor kin may rest. Thank you." message= _ "Finally the souls of our poor kin may rest. Thank you."
[/message] [/message]
[/then] [/case]
[/if] [case]
[if] value="Beach"
[variable]
name=last_done
equals="Beach"
[/variable]
[then]
[message] [message]
speaker=Lady Dionli speaker=Lady Dionli
message= _ "Our beaches are free again. I knew I could trust you, Haldric." message= _ "Our beaches are free again. I knew I could trust you, Haldric."
[/message] [/message]
[/then] [/case]
[/if] [/switch]
#enddef #enddef
[event] [event]
@ -432,13 +359,10 @@
image=wesnoth-icon.png image=wesnoth-icon.png
[/message] [/message]
[if] [switch]
[variable] variable=num_done
name=num_done [case]
numerical_equals=0 value=0
[/variable]
[then]
[message] [message]
speaker=Lord Logalmier speaker=Lord Logalmier
message= _ "Dionli, why have you brought these humans before us?" message= _ "Dionli, why have you brought these humans before us?"
@ -510,18 +434,10 @@
[/message] [/message]
{QUESTS} {QUESTS}
#will have to use a [do] here if the future choices...
{QUEST_CHOICES} {QUEST_CHOICES}
[/then] [/case]
[/if] [case]
value=1
[if]
[variable]
name=num_done
numerical_equals=1
[/variable]
[then]
{GREET} {GREET}
[message] [message]
@ -531,25 +447,10 @@
{QUESTS} {QUESTS}
[while] {QUEST_CHOICES}
[variable] [/case]
less_than=4 [case]
name=num_done value=2
[/variable]
[do]
{QUEST_CHOICES}
[/do]
[/while]
[/then]
[/if]
[if]
[variable]
name=num_done
numerical_equals=2
[/variable]
[then]
{GREET} {GREET}
[message] [message]
@ -559,25 +460,10 @@
{QUESTS} {QUESTS}
[while] {QUEST_CHOICES}
[variable] [/case]
less_than=4 [case]
name=num_done value=3
[/variable]
[do]
{QUEST_CHOICES}
[/do]
[/while]
[/then]
[/if]
[if]
[variable]
name=num_done
numerical_equals=3
[/variable]
[then]
{GREET} {GREET}
[message] [message]
@ -587,25 +473,10 @@
{QUESTS} {QUESTS}
[while] {QUEST_CHOICES}
[variable] [/case]
less_than=4 [case]
name=num_done value=4
[/variable]
[do]
{QUEST_CHOICES}
[/do]
[/while]
[/then]
[/if]
[if]
[variable]
name=num_done
numerical_equals=4
[/variable]
[then]
{GREET}
[message] [message]
speaker=Lady Dionli speaker=Lady Dionli
@ -696,7 +567,7 @@
linger_mode=no linger_mode=no
next_scenario=A_Spy_in_the_Woods next_scenario=A_Spy_in_the_Woods
[/endlevel] [/endlevel]
[/then] [/case]
[/if] [/switch]
[/event] [/event]
[/scenario] [/scenario]