From a941e3e7d1ac125981f60caf6a7f154b16ec8663 Mon Sep 17 00:00:00 2001 From: Charles Dang Date: Tue, 30 Dec 2014 03:37:49 +1100 Subject: [PATCH] T S1: completely refactored scenario code. More tweaks pending --- .../tutorial/scenarios/01_Tutorial_part_1.cfg | 1278 ++++++++--------- 1 file changed, 628 insertions(+), 650 deletions(-) diff --git a/data/campaigns/tutorial/scenarios/01_Tutorial_part_1.cfg b/data/campaigns/tutorial/scenarios/01_Tutorial_part_1.cfg index 4c717725cb1..78aefebb29a 100644 --- a/data/campaigns/tutorial/scenarios/01_Tutorial_part_1.cfg +++ b/data/campaigns/tutorial/scenarios/01_Tutorial_part_1.cfg @@ -47,17 +47,17 @@ name= _"Wesnoth Tutorial Part I" map_data="{campaigns/tutorial/maps/01_Tutorial_part_1.map}" turns=12 + next_scenario=2_Tutorial + victory_when_enemies_defeated=no + {DEFAULT_MUSIC_PLAYLIST} [music] name=elf-land.ogg play_once=yes [/music] - next_scenario=2_Tutorial {DEFAULT_SCHEDULE} - victory_when_enemies_defeated=no - [side] type=Fighter id=student @@ -149,22 +149,15 @@ {CLEAR_VARIABLE student_loc} - {VARIABLE next_turn.advice_chain[0].turn -1 } - {VARIABLE next_turn.advice_chain[1].turn -1 } - {VARIABLE next_turn.advice_chain[2].turn -1 } - {VARIABLE next_turn.advice_chain[3].turn -1 } - {VARIABLE next_turn.advice_chain[4].turn -1 } - {VARIABLE next_turn.advice_chain[5].turn -1 } - {LABEL (_"Delfador") (13,6)} [objectives] side=1 summary= _"You will learn the basics of: -Movement -Attacking -Healing -Recruiting" +• Movement +• Attacking +• Healing +• Recruiting" [objective] description= _"Destroy a fierce enemy" condition=win @@ -180,6 +173,12 @@ Recruiting" [event] name=start + + # We don't want players ending their turn before the requisite actions have been completed + # Therefor, we frequently disallow or allow end turn as needed + [disallow_end_turn][/disallow_end_turn] + + # TODO: possibly convert to a custom gui2 dialog [message] speaker=narrator message= _"Who would you like to play?" @@ -195,11 +194,13 @@ Recruiting" [command] {VARIABLE student _"Li’sar"} {VARIABLE gender female} + [kill] id=student fire_event=no animate=no [/kill] + [unit] type=Fighteress side=1 @@ -209,34 +210,37 @@ Recruiting" name= _"Li’sar" canrecruit=yes [/unit] - [redraw][/redraw] [/command] [/option] [/message] [unhide_unit][/unhide_unit] - {LABEL $student {STUDENT_START_LOC}} - [redraw][/redraw] -#wmlindent: start ignoring - # wmllint: display on - {GENDER ([message] + {LABEL $student {STUDENT_START_LOC}} + + {GENDER ( + [message] speaker=narrator caption= _"Welcome to Wesnoth!" message= _"For this tutorial, you are playing Konrad. You are standing in the keep, and your mentor Delfador is on the east side of the river." + {CONTINUE_MSG} - [/message]) ([message] + [/message] + ) ( + [message] speaker=narrator caption= _"Welcome to Wesnoth!" message= _"For this tutorial, you are playing Li’sar. You are standing in the keep, and your mentor Delfador is on the east side of the river." + {CONTINUE_MSG} - [/message])} - # wmllint: display off - {GENDER ({PRINT (_"Left click on Konrad")}) - ({PRINT (_"Left click on Li’sar")})} -#wmlindent: stop ignoring + [/message] + )} + + {GENDER ( + {PRINT (_"Left click on Konrad")} + ) ( + {PRINT (_"Left click on Li’sar")} + )} [/event] [event] @@ -246,41 +250,43 @@ You are standing in the keep, and your mentor Delfador is on the east side of th [/filter] {UNLABEL {STUDENT_START_LOC}} + {CLEAR_PRINT} - [redraw][/redraw] -#wmlindent: start ignoring - {GENDER ([message] + {GENDER ( + [message] speaker=narrator -#wmllint: display on message= _"You have selected Konrad. The places he can move to are highlighted." + - {CONTINUE_MSG} -#wmllint: display off - [/message]) ([message] + {CONTINUE_MSG} + [/message] + ) ( + [message] speaker=narrator -#wmllint: display on message= _"You have selected Li’sar. The places she can move to are highlighted." + - {CONTINUE_MSG} -#wmllint: display off - [/message])} -#wmlindent: stop ignoring - {LABEL (_"Here") {MARKER_LOC}} - [redraw][/redraw] + {CONTINUE_MSG} + [/message] + )} -#wmlindent: start ignoring - {GENDER ([message] + {LABEL (_"Here") {MARKER_LOC}} + + {GENDER ( + [message] speaker=narrator message= _"Move Konrad next to Delfador by clicking on the tile marked Here." + {CONTINUE_MSG} - [/message]) ([message] + [/message] + ) ( + [message] speaker=narrator message= _"Move Li’sar next to Delfador by clicking on the tile marked Here." + {CONTINUE_MSG} - [/message])} -#wmlindent: stop ignoring + [/message] + )} + {TARGET_HEX 12 5} + {PRINT (_"Left click on tile labeled Here")} [/event] @@ -288,7 +294,6 @@ The places she can move to are highlighted." + [event] name=moveto first_time_only=no - [allow_undo][/allow_undo] [filter] side=1 [filter_location] @@ -297,23 +302,22 @@ The places she can move to are highlighted." + [/not] [/filter_location] [/filter] - [if] + + [allow_undo][/allow_undo] + + [filter_condition] [variable] name=target_hex.is_set boolean_equals=yes [/variable] - [then] - [redraw][/redraw] - [message] - speaker=narrator - caption= _"Oops!" - #wmllint: display on - message= _"You moved to the wrong place! After this message, you can press u to undo, then try again." + - {CONTINUE_MSG} - #wmllint: display off - [/message] - [/then] - [/if] + [/filter_condition] + + [message] + speaker=narrator + caption= _"Oops!" + message= _"You moved to the wrong place! After this message, you can press u to undo, then try again." + + {CONTINUE_MSG} + [/message] [/event] [event] @@ -324,54 +328,66 @@ The places she can move to are highlighted." + [/filter] {CLEAR_PRINT} + {UNLABEL {MARKER_LOC}} {UNLABEL {DELFADOR_LOC}} + {NO_TARGET_HEX} - [redraw][/redraw] + [message] id=student message= _"Good morning, Delfador! Is it time to attack things?" [/message] + [message] id=Delfador message= _"Um, well..." [/message] + [message] id=student message= _"Have you found an orc for me to fight, huh? A troll?" [/message] + [message] id=Delfador message= _"Quiet! I will summon an enemy for you..." [/message] + [scroll_to_unit] id=Delfador [/scroll_to_unit] + [animate_unit] [filter] id=Delfador [/filter] flag=summon_quintain_raise_staff [/animate_unit] + [sound] name=lightning.ogg [/sound] + [color_adjust] red=100 green=100 blue=100 [/color_adjust] + [animate_unit] [filter] id=Delfador [/filter] flag=summon_quintain_lower_staff [/animate_unit] + [color_adjust] red=0 green=0 blue=0 [/color_adjust] + [unit] id=Quintain type=Quintain @@ -379,18 +395,19 @@ The places she can move to are highlighted." + x,y={QUINTAIN_LOC} side=2 [/unit] + {LABEL (_"Quintain") {QUINTAIN_LOC}} - [redraw][/redraw] + [message] id=Delfador message= _"... this quintain!" [/message] + [message] id=student message= _"A quintain? You want me to fight a dummy?" [/message] -#wmlindent: start ignoring {GENDER ( [message] id=Delfador @@ -402,23 +419,26 @@ The places she can move to are highlighted." + message= _"female^Young lady, you have 32 hitpoints and a sword. I’m fairly sure you’ll win." [/message] )} -#wmlindent: stop ignoring -#wmlindent: start ignoring - {GENDER ([message] + # wmllint: local spelling OK + {GENDER ( + [message] speaker=narrator caption= _"Attacking" - # wmllint: local spelling OK message= _"To attack the quintain, first select the attacker (Konrad) then the target (the quintain). You will see an attack description. When you click OK, Konrad will attack." + - {CONTINUE_MSG} - [/message]) ([message] + {CONTINUE_MSG} + [/message] + ) ( + [message] speaker=narrator caption= _"Attacking" message= _"To attack the quintain, first select the attacker (Li’sar) then the target (the quintain). You will see an attack description. When you click OK, Li’sar will attack." + - {CONTINUE_MSG} - [/message])} -#wmlindent: stop ignoring + {CONTINUE_MSG} + [/message] + )} + {MODIFY_UNIT id=student moves 0} + [event] name=select [filter] @@ -428,10 +448,11 @@ The places she can move to are highlighted." + {PRINT (_"Click on the quintain to attack it")} [/event] -#wmlindent: start ignoring - {GENDER ({PRINT (_"Left click on Konrad")}) - ({PRINT (_"Left click on Li’sar")})} -#wmlindent: stop ignoring + {GENDER ( + {PRINT (_"Left click on Konrad")} + ) ( + {PRINT (_"Left click on Li’sar")} + )} [/event] # We track student's hitpoints so Delfador can explain them. @@ -441,6 +462,7 @@ The places she can move to are highlighted." + [filter_second] id=student [/filter_second] + {VARIABLE_OP student_hp sub 3} [/event] @@ -450,629 +472,582 @@ The places she can move to are highlighted." + [filter] id=student [/filter] + {VARIABLE_OP student_hp sub 3} [/event] + # First time the student attacks the quintain [event] name=attack_end + first_time_only=yes + [filter] + id=student + [/filter] {CLEAR_PRINT} + {UNLABEL {QUINTAIN_LOC}} [message] id=student message= _"Hey! This quintain fights back!" [/message] + [message] id=Delfador message= _"Hmm, perhaps we should have started with a doll." [/message] + [message] id=student message= _"Should I retreat?" [/message] + [message] id=Delfador message= _"Good idea!" [/message] -#wmlindent: start ignoring - {GENDER ([message] + + {GENDER ( + [message] speaker=narrator caption= _"Crowns" message= _"The tiny metal crown above Delfador means you will lose the game if he is killed. You will also lose the game if your leader (Konrad) is killed." - [/message]) ([message] - speaker=narrator - caption= _"Crowns" - message= _"The tiny metal crown above Delfador means you will lose the game if he is killed. You will also lose the game if your leader (Li’sar) is killed." - [/message])} -#wmlindent: stop ignoring - - {MOVE_UNIT (id=Delfador) 14 8} - - {VARIABLE future_hp $student_hp} - {VARIABLE_OP future_hp sub 15} -#wmlindent: start ignoring - {GENDER ( - [message] - id=Delfador - message= _"Unfortunately, you’ve used up your turn attacking the quintain. The quintain now gets to attack." [/message] ) ( [message] - id=Delfador - message= _"female^Unfortunately, you’ve used up your turn attacking the quintain. The quintain now gets to attack." + speaker=narrator + caption= _"Crowns" + message= _"The tiny metal crown above Delfador means you will lose the game if he is killed. You will also lose the game if your leader (Li’sar) is killed." [/message] )} -#wmlindent: stop ignoring + + {MOVE_UNIT (id=Delfador) 14 8} + + {VARIABLE future_hp "$($student_hp-15)"} + + [message] + id=Delfador + message= _"Unfortunately, you’ve used up your turn attacking the quintain. The quintain now gets to attack." + [/message] + [message] id=student message= _"The dummy gets a turn?" [/message] + [message] id=Delfador - #wmllint: display on message= _"Yes. It’s a magical quintain. Now, this quintain gets 5 chances to hit you for 3 damage each. If it hits every time, you’ll drop from $student_hp to $future_hp hit points. Brace yourself!" - #wmllint: display off [/message] + + [allow_end_turn][/allow_end_turn] + {PRINT (_"Click on the End Turn button in the bottom right of the screen")} - {VARIABLE next_turn.capture_village $turn_number} - {VARIABLE_OP next_turn.capture_village add 1} [/event] + # TURN 2: lesson in healing + # There is a 1 in 170,000 chance that the quintain will miss on all + # 10 attacks. Ignoring that. [event] - name=new turn - first_time_only=no + name=turn 2 + + [disallow_end_turn][/disallow_end_turn] + + {CLEAR_PRINT} + + [message] + id=student + message= _"Ouch! I need to heal! Only $student_hp hitpoints left!" + [/message] + + {LABEL (_"Village") {VILLAGE_LOC}} + + [message] + id=Delfador + message= _"There is a village on the other side of the river. Visiting villages is a good idea, and ending your turn in one will heal you. To the village!" + [/message] + + {GENDER ( + {PRINT (_"Left click on Konrad")} + ) ( + {PRINT (_"Left click on Li’sar")} + )} + + [event] + name=select + [filter] + side=1 + [/filter] + + {GENDER ( + {PRINT (_"Click on the village to move Konrad")} + ) ( + {PRINT (_"Click on the village to move Li’sar")} + )} + [/event] + + {TARGET_HEX 11 7} + + [event] + name=moveto + [filter] + side=1 + x,y=11,7 + [/filter] + + {CLEAR_PRINT} + + {NO_TARGET_HEX} + + [message] + speaker=narrator + caption= _"Villages" + # We could say 'It now flies your colors...'. Maybe too subtle for a basic tutorial? + message= _"You have captured a village! It now flies your flag and has been added to your total village count (the house icon at the top of the screen shows how many villages you currently control). Villages provide the gold needed to recruit units. Each turn, you gain two gold plus one for every village you own." + + {CONTINUE_MSG} + [/message] + + [allow_end_turn][/allow_end_turn] + + {PRINT (_"Click on the End Turn button")} + [/event] + [/event] + + # TURN 3: lesson in recruiting + [event] + name=turn 3 + + [disallow_end_turn][/disallow_end_turn] + + {CLEAR_PRINT} + + {UNLABEL {VILLAGE_LOC}} + + [store_unit] + [filter] + id=student + [/filter] + kill=no + variable=student_hp_check + [/store_unit] + + {VARIABLE hp_difference "$($student_hp_check.max_hitpoints-$student_hp_check.hitpoints)"} [if] [variable] - name=turn_number - equals=$next_turn.capture_village + name=hp_difference + greater_than=7 [/variable] [then] - # There is a 1 in 170,000 chance that the quintain will miss on all - # 10 attacks. Ignoring that. - {CLEAR_PRINT} - [redraw][/redraw] - [message] - id=student - message= _"Ouch! I need to heal! Only $student_hp hitpoints left!" - [/message] - {LABEL (_"Village") {VILLAGE_LOC}} - #wmlindent: start ignoring - {GENDER ( - [message] - id=Delfador - message= _"There is a village on the other side of the river. Visiting villages is a good idea, and ending your turn in one will heal you. To the village!" - [/message] - ) ( - [message] - id=Delfador - message= _"female^There is a village on the other side of the river. Visiting villages is a good idea, and ending your turn in one will heal you. To the village!" - [/message] - )} - {GENDER ({PRINT (_"Left click on Konrad")}) - ({PRINT (_"Left click on Li’sar")})} - #wmlindent: stop ignoring - [event] - name=select - [filter] - side=1 - [/filter] + {VARIABLE hp_difference 8} + [/then] + [/if] - #wmlindent: start ignoring - {GENDER ({PRINT (_"Click on the village to move Konrad")}) - ({PRINT (_"Click on the village to move Li’sar")})} - #wmlindent: stop ignoring - [/event] + [message] + id=Delfador + message= _"You’re about to be healed by $hp_difference hitpoints, but it’s time to summon some help against that quintain." + [/message] - {TARGET_HEX 11 7} + [message] + id=student + message= _"I’ll recruit some elves!" + [/message] - [event] - name=moveto - [filter] - side=1 - x,y=11,7 - [/filter] + {LABEL (_"Keep") {KEEP_LOC}} + + [message] + id=Delfador + message= _"A splendid idea. You can recruit two units if you return to the keep. You have plenty of gold for that." + [/message] + + {TARGET_HEX 9 6} + + {GENDER ( + {PRINT (_"Move Konrad to the keep")} + ) ( + {PRINT (_"Move Li’sar to the keep")} + )} + + [event] + name=moveto + [filter] + x,y={KEEP_LOC} + [/filter] + + {CLEAR_PRINT} + + {UNLABEL {KEEP_LOC}} + + [set_recruit] + recruit=Elvish Fighter + side=1 + [/set_recruit] + + [message] + speaker=narrator + caption= _"Recruiting" + message= _"Whenever you’re on a keep, you can recruit into the castle tiles around it by right-clicking and selecting Recruit. This time you will only be given one type of unit to choose: the Elvish Fighter." + + {CONTINUE_MSG} + [/message] + + {PRINT (_"Right click on a castle tile and select Recruit")} + [/event] + + [event] + name=prerecruit + first_time_only=no + + # zookeeper suggested we eliminate traits by killing the recruit and replacing it + [kill] + x,y=$x1,$y1 + [/kill] + + # Each one needs a unique description for next level. + {VARIABLE_OP description_num add 1} + + {NOTRAIT_UNIT 1 "Elvish Fighter" $x1 $y1} + [+unit] + role="Recruit $description_num" + moves=0 + generate_name=yes + [/unit] + [/event] + + [event] + name=recruit + first_time_only=no + [filter] + side=1 + [/filter] + + [if] + [have_unit] + role="Recruit 2" + [/have_unit] + [then] {CLEAR_PRINT} - [redraw][/redraw] + + [message] + speaker=narrator + caption= _"New Recruits" + message= _"New units cannot act in the turn they appear; you will gain control of them next turn. +After this dialog, you can move the mouse over a unit to see a summary of its abilities on the right of the screen." + + {CONTINUE_MSG} + [/message] + + # They can move to the village if they're smart {NO_TARGET_HEX} - [message] - speaker=narrator - #wmllint: display on - caption= _"Villages" - # We could say 'It now flies your colors...'. Maybe too subtle for a basic tutorial? - message= _"You have captured a village! It now flies your flag and has been added to your total village count. (The house icon at the top of the screen shows how many villages you currently control.) Villages provide the gold needed to recruit units. Each turn, you gain two gold plus one for every village you own." + - {CONTINUE_MSG} - #wmllint: display off - [/message] + + [allow_end_turn][/allow_end_turn] + {PRINT (_"Click on the End Turn button")} - [/event] - {VARIABLE next_turn.do_recruit $turn_number} - {VARIABLE_OP next_turn.do_recruit add 1} - [/then] - [/if] + [/then] + [else] + {PRINT (_"Right click on the other castle tile and recruit another unit")} + [/else] + [/if] + [/event] + [/event] + + # TURN 4: enemy healing and attacking + [event] + name=turn 4 + + [disallow_end_turn][/disallow_end_turn] + [if] - [variable] - name=turn_number - equals=$next_turn.do_recruit - [/variable] + [have_unit] + id=Quintain + [/have_unit] [then] {CLEAR_PRINT} - {UNLABEL {VILLAGE_LOC}} - [store_unit] - [filter] - id=student - [/filter] - kill=no - variable=student_hp_check - [/store_unit] - {VARIABLE hp_difference $student_hp_check.max_hitpoints} - {VARIABLE_OP hp_difference sub $student_hp_check.hitpoints} - [if] - [variable] - name=hp_difference - greater_than=7 - [/variable] - [then] - {VARIABLE hp_difference 8} - [/then] - [/if] -#wmlindent: start ignoring - {GENDER ( - [message] - id=Delfador - message= _"You’re about to be healed by $hp_difference hitpoints, but it’s time to summon some help against that quintain." - [/message] - ) ( - [message] - id=Delfador - message= _"female^You’re about to be healed by $hp_difference hitpoints, but it’s time to summon some help against that quintain." - [/message] - )} -#wmlindent: stop ignoring + [message] id=student - message= _"I’ll recruit some elves!" + message= _"Hey, the quintain just healed 2 hitpoints! I’d better attack it at once!" [/message] - {LABEL (_"Keep") {KEEP_LOC}} -#wmlindent: start ignoring - {GENDER ( - [message] - id=Delfador - message= _"A splendid idea. You can recruit two units if you return to the keep. You have plenty of gold for that." - [/message] - ) ( - [message] - id=Delfador - message= _"female^A splendid idea. You can recruit two units if you return to the keep. You have plenty of gold for that." - [/message] - )} -#wmlindent: stop ignoring - {TARGET_HEX 9 6} - #wmlindent: start ignoring - {GENDER ({PRINT (_"Move Konrad to the keep")}) - ({PRINT (_"Move Li’sar to the keep")})} - #wmlindent: stop ignoring - [event] - name=moveto - [filter] - x,y={KEEP_LOC} - [/filter] - {CLEAR_PRINT} - {UNLABEL {KEEP_LOC}} - [set_recruit] - recruit=Elvish Fighter - side=1 - [/set_recruit] - [redraw][/redraw] - [message] - speaker=narrator - caption= _"Recruiting" - #wmllint: display on - message= _"Whenever you’re on a keep, you can recruit into the castle tiles around it by right-clicking and selecting Recruit. This time you will only be given one type of unit to choose: the Elvish Fighter." + - {CONTINUE_MSG} - #wmllint: display off - [/message] - {PRINT (_"Right click on a castle tile and select Recruit")} - [/event] - [event] - name=prerecruit - first_time_only=no - # zookeeper suggested we eliminate traits by killing - # the recruit and replacing it - [kill] - x,y=$x1,$y1 - [/kill] - # Each one needs a unique description for next level. - {VARIABLE_OP description_num add 1} - {NOTRAIT_UNIT 1 "Elvish Fighter" $x1 $y1} - [+unit] - role="Recruit $description_num" - moves=0 - generate_name=yes - [/unit] - [/event] - [event] - name=recruit - [filter] - x,y=10,6 - [/filter] - - [if] - [have_unit] - role="Recruit 2" - [/have_unit] - [then] - {CLEAR_PRINT} - [redraw][/redraw] - [message] - speaker=narrator - caption= _"New Recruits" - #wmllint: display on - message= _"New units cannot act in the turn they appear; you will gain control of them next turn. -After this dialog, you can move the mouse over a unit to see a summary of its abilities on the right of the screen." + - {CONTINUE_MSG} - #wmllint: display off - [/message] - # They can move to the village if they're smart - {NO_TARGET_HEX} - {PRINT (_"Click on the End Turn button")} - {VARIABLE next_turn.elves_attack $turn_number} - {VARIABLE_OP next_turn.elves_attack add 1} - [/then] - [else] - {PRINT (_"Right click on the other castle tile and recruit another unit")} - [/else] - [/if] - [/event] - [event] - name=recruit - [filter] - x,y=9,7 - [/filter] - - [if] - [have_unit] - role="Recruit 2" - [/have_unit] - [then] - {CLEAR_PRINT} - [redraw][/redraw] - [message] - speaker=narrator - caption= _"New Recruits" - #wmllint: display on - message= _"New units cannot act in the turn they appear; you will gain control of them next turn. -After this dialog, you can move the mouse over a unit to see a summary of its abilities on the right of the screen." + - {CONTINUE_MSG} - #wmllint: display off - [/message] - # They can move to the village if they're smart - {NO_TARGET_HEX} - {PRINT (_"Click on the End Turn button")} - {VARIABLE next_turn.elves_attack $turn_number} - {VARIABLE_OP next_turn.elves_attack add 1} - [/then] - [else] - {PRINT (_"Right click on the other castle tile and recruit another unit")} - [/else] - [/if] - [/event] - {VARIABLE next_turn.quintain_heals $turn_number} - {VARIABLE_OP next_turn.quintain_heals add 1} - [/then] - [/if] - [if] - [variable] - name=next_turn.quintain_heals - equals=$turn_number - [/variable] - [then] - [if] - [have_unit] - id=Quintain - [/have_unit] - [then] - {CLEAR_PRINT} - [message] - id=student - message= _"Hey, the quintain just healed 2 hitpoints! I’d better attack it at once!" - [/message] - [message] - id=Delfador - message= _"Yes, if a unit doesn’t do anything for a turn, it will slowly heal." - [/message] - [/then] - [else] - [message] - id=Delfador - message= _"Had the quintain survived your onslaught, it would have regained two hitpoints. If a unit doesn’t do anything for a turn, it will slowly heal." - [/message] - [/else] - [/if] - [/then] - [/if] - [if] - [variable] - name=next_turn.elves_attack - equals=$turn_number - [/variable] - [then] [message] id=Delfador - message= _"But before you send your fighters against the quintain, you should know they have two kinds of attack..." - [/message] - [message] - id=student - message= _"I’ll tell them to use the one that does the most damage!" + message= _"Yes, if a unit doesn’t do anything for a turn, it will slowly heal." [/message] + [/then] + [else] [message] id=Delfador - message= _"And which would that be? The sword (5–4) or the bow (3–3)? I suppose you’ll find out..." + message= _"Had the quintain survived your onslaught, it would have regained two hitpoints. If a unit doesn’t do anything for a turn, it will slowly heal." [/message] - {PRINT (_"Left click on an Elvish Fighter")} - {VARIABLE encourage (_"End your turn and attack again.")} - {VARIABLE trying_to_be_a_wiseguy yes} - [event] - name=select - first_time_only=no - [filter] - id=student - [/filter] + [/else] + [/if] + [message] + id=Delfador + message= _"Before you send your fighters against the quintain, you should know they have two kinds of attack..." + [/message] + + [message] + id=student + message= _"I’ll tell them to use the one that does the most damage!" + [/message] + + [message] + id=Delfador + message= _"And which would that be? The sword (5–4) or the bow (3–3)? I suppose you’ll find out..." + [/message] + + {PRINT (_"Left click on an Elvish Fighter")} + + {VARIABLE trying_to_be_a_wiseguy yes} + + [event] + name=select + first_time_only=no + [filter] + id=student + [/filter] + [filter_condition] + [variable] + name=trying_to_be_a_wiseguy + boolean_equals=yes + [/variable] + [/filter_condition] + + [message] + id=Delfador + message= _"You wouldn’t do anything stupid like charging that quintain yourself again, now would you? Use the fighters you recruited first; they’ll be a lot of help." + [/message] + [/event] + + [event] + name=select + [filter] + type=Elvish Fighter + [/filter] + + {PRINT (_"Left click on the quintain to attack it.")} + [/event] + + [event] + name=attack + [filter] + type=Elvish Fighter + [/filter] + + {VARIABLE trying_to_be_a_wiseguy no} + + {CLEAR_PRINT} + [/event] + + [event] + name=attack_end + [filter] + type=Elvish Fighter + [/filter] + [filter_attack] + name=sword + [/filter_attack] + + {VARIABLE used_sword yes} + + [if] + [variable] + name=used_bow + numerical_equals=1 + [/variable] + [then] [if] - [variable] - name=trying_to_be_a_wiseguy - equals=yes - [/variable] + [have_unit] + id=quintain + [/have_unit] [then] [message] id=Delfador - #wmllint: display on - message= _"You wouldn’t do anything stupid like charging that quintain yourself again, now would you? -Use the fighters you recruited first; they’ll be a lot of help." - #wmllint: display off - [/message] - [/then] - [/if] - [/event] - [event] - name=select - [filter] - type=Elvish Fighter - [/filter] - {PRINT (_"Left click on the quintain to attack it.")} - [/event] - [event] - name=attack - [filter] - type=Elvish Fighter - [/filter] - - {VARIABLE trying_to_be_a_wiseguy no} - {CLEAR_PRINT} - {VARIABLE next_turn.advice_chain[0].turn $turn_number} - {VARIABLE_OP next_turn.advice_chain[0].turn add 1} - [/event] - [event] - name=attack_end - [filter] - type=Elvish Fighter - [/filter] - [filter_attack] - name=sword - [/filter_attack] - - {VARIABLE used_sword 1} - [if] - [variable] - name=used_bow - numerical_equals=1 - [/variable] - [then] - [if] - [variable] - name=quintain_dead - numerical_equals=1 - [/variable] - [then] - [message] - id=Delfador - message= _"Your elf used a sword (5–4; or 5 damage, 4 attacks), which is a melee attack. The quintain defended with its melee attack (3–5)." + _" The ranged attack would have been safer." - [/message] - [/then] - [else] - [message] - id=Delfador - #wmllint: display on - message= _"Your elf used a sword (5–4; or 5 damage, 4 attacks), which is a melee attack. The quintain defended with its melee attack (3–5)." + _" The ranged attack would have been safer." + _" + message= _"Your elf used a sword (5–4; or 5 damage, 4 attacks), which is a melee attack. The quintain defended with its melee attack (3–5). The ranged attack would have been safer. End your turn, then attack again." - #wmllint: display off - [/message] - {PRINT (_"Click on the End Turn button")} - [/else] - [/if] + [/message] [/then] [else] [message] id=Delfador - #wmllint: display on - message= _"Your elf used a sword (5–4; or 5 damage, 4 attacks), which is a melee attack. The quintain defended with its melee attack (3–5)." + _" + message= _"Your elf used a sword (5–4; or 5 damage, 4 attacks), which is a melee attack. The quintain defended with its melee attack (3–5). The ranged attack would have been safer." + [/message] + + {PRINT (_"Click on the End Turn button")} + [/else] + [/if] + [/then] + [else] + [message] + id=Delfador + message= _"Your elf used a sword (5–4; or 5 damage, 4 attacks), which is a melee attack. The quintain defended with its melee attack (3–5). You should tell the other elf to use the bow." - #wmllint: display off - [/message] - {PRINT (_"Attack with the other elf")} - [event] - name=attack - {CLEAR_PRINT} - [/event] - [/else] - [/if] - [/event] - [event] - name=attack_end - [filter_attack] - name=bow - [/filter_attack] + [/message] - {VARIABLE used_bow 1} + {PRINT (_"Attack with the other elf")} + + [event] + name=attack + {CLEAR_PRINT} + [/event] + [/else] + [/if] + [/event] + + [event] + name=attack_end + [filter_attack] + name=bow + [/filter_attack] + + {VARIABLE used_bow 1} + + [if] + [variable] + name=used_sword + numerical_equals=1 + [/variable] + [then] [if] - [variable] - name=used_sword - numerical_equals=1 - [/variable] + [have_unit] + id=quintain + [/have_unit] [then] - [if] - [variable] - name=quintain_dead - numerical_equals=1 - [/variable] - [then] - [message] - id=Delfador - message= _"Your elf used a bow, which is a ranged attack (3–3; or 3 damage, 3 attacks). The quintain has no ranged attack, only a melee attack, so it could not defend itself." - [/message] - [/then] - [else] - [message] - id=Delfador - #wmllint: display on - message= _"Your elf used a bow, which is a ranged attack (3–3; or 3 damage, 3 attacks). The quintain has no ranged attack, only a melee attack, so it could not defend itself." + _" + [message] + id=Delfador + message= _"Your elf used a bow, which is a ranged attack (3–3; or 3 damage, 3 attacks). The quintain has no ranged attack, only a melee attack, so it could not defend itself. End your turn, then attack again." - #wmllint: display off - [/message] - {PRINT (_"Click on the End Turn button")} - [/else] - [/if] + [/message] [/then] [else] [message] id=Delfador message= _"Your elf used a bow, which is a ranged attack (3–3; or 3 damage, 3 attacks). The quintain has no ranged attack, only a melee attack, so it could not defend itself." [/message] - {PRINT (_"Attack with the other elf")} - [event] - name=attack - {CLEAR_PRINT} - [/event] + + {PRINT (_"Click on the End Turn button")} [/else] [/if] - [/event] - [/then] - [/if] - [if] - [variable] - name=next_turn.advice_chain[0].turn - equals=$turn_number - [/variable] - [then] - {CLEAR_PRINT} - [message] + [/then] + [else] + [message] + id=Delfador + message= _"Your elf used a bow, which is a ranged attack (3–3; or 3 damage, 3 attacks). The quintain has no ranged attack, only a melee attack, so it could not defend itself." + [/message] + + {PRINT (_"Attack with the other elf")} + + [event] + name=attack + {CLEAR_PRINT} + [/event] + [/else] + [/if] + [/event] + + # TODO: interface this better with the above events + # After this, we no longer need to restrict turn endings + [allow_end_turn][/allow_end_turn] + [/event] + + # TURN 5 onwards: advice + # Only fire this particular event if we didn't kill the quintain last turn + # If we didn't, Delf is still around + [event] + name=turn 5 + + {CLEAR_PRINT} + + [message] + id=Delfador + message= _"Keep attacking with both elves until the quintain is finished!" + [show_if] + [have_unit] id=Delfador - message= _"Keep attacking with both elves until the quintain is finished!" - [/message] - {VARIABLE next_turn.advice_chain[1].turn $turn_number} - {VARIABLE_OP next_turn.advice_chain[1].turn add 1} - [/then] - [/if] - [if] - [variable] - name=next_turn.advice_chain[1].turn - equals=$turn_number - [/variable] - [then] - [message] + [/have_unit] + [/show_if] + [/message] + [/event] + + # TURN 6: recruit more guys + [event] + name=turn 6 + + [message] + id=Delfador + message= _"Maybe you should recruit another elf?" + [show_if] + [have_unit] id=Delfador - message= _"Maybe you should recruit another elf?" - [/message] - [message] - speaker=narrator - caption= _"Unit Descriptions" - #wmllint: display on - message= _"You can right click on a unit to see a detailed Unit Description." - #wmllint: display off - [/message] - {VARIABLE next_turn.advice_chain[2].turn $turn_number} - {VARIABLE_OP next_turn.advice_chain[2].turn add 1} - [/then] - [/if] - [if] - [variable] - name=next_turn.advice_chain[2].turn - equals=$turn_number - [/variable] - [then] - [if] - [variable] - name=quintain_dead - numerical_equals=1 - [/variable] - [then] - [message] - speaker=narrator - caption= _"Protect Your Troops" - #wmllint: display on - message= _"Remember to pull back wounded units into villages and recruit more if needed. Take special care of units with the highest experience points (XP) so they can gain levels and become more powerful." - #wmllint: display off - [/message] - [/then] - [/if] - {VARIABLE next_turn.advice_chain[3].turn $turn_number} - {VARIABLE_OP next_turn.advice_chain[3].turn add 1} - [/then] - [/if] - [if] - [variable] - name=next_turn.advice_chain[3].turn - equals=$turn_number - [/variable] - [then] - [message] - speaker=narrator - caption= _"Support" - #wmllint: display on - message= _"Each village you control will support one unit for free. After that, each unit costs you one gold per turn." - #wmllint: display off - [/message] - {VARIABLE next_turn.advice_chain[4].turn $turn_number} - {VARIABLE_OP next_turn.advice_chain[4].turn add 1} - [/then] - [/if] - [if] - [variable] - name=next_turn.advice_chain[4].turn - equals=$turn_number - [/variable] - [then] - [message] - speaker=narrator - caption= _"Advancement" - #wmllint: display on - message= _"When a unit gains enough experience points (the experience bar, if present, is on the right of the hitpoints bar), it will go up a level. Elvish Fighters have two advancement options, and you will be able to choose which one you want. However, second level units cost twice as much to support as first level units." - #wmllint: display off - [/message] - {VARIABLE next_turn.advice_chain[5].turn $turn_number} - {VARIABLE_OP next_turn.advice_chain[5].turn add 1} - [/then] - [/if] - [if] - [variable] - name=next_turn.advice_chain[5].turn - equals=$turn_number - [/variable] - [then] - [message] - speaker=narrator - caption= _"Defenses" - # wmllint: local spelling quintains - #wmllint: display on - message= _"Whenever one of your units is selected, you’ll see varying percentages as you move the mouse over the map. The higher the percentage, the more defense that unit has in that kind of terrain. For example, most units have good defenses in castles and villages but poor defenses in rivers. However, these quintains use a magical attack, which always has a 70% chance of hitting no matter what terrain its target occupies." - #wmllint: display off - [/message] - [/then] - [/if] + [/have_unit] + [/show_if] + [/message] + + [message] + speaker=narrator + caption= _"Unit Descriptions" + message= _"You can right click on a unit to see a detailed Unit Description." + [/message] + [/event] + + # TURN 7: protect your troops + [event] + name=turn 7 + + [message] + speaker=narrator + caption= _"Protect Your Troops" + message= _"Remember to pull back wounded units into villages and recruit more if needed. Take special care of units with the highest experience points (XP) so they can gain levels and become more powerful." + [/message] + [/event] + + # TURN 8: support + [event] + name=turn 8 + + [message] + speaker=narrator + caption= _"Support" + message= _"Each village you control will support one unit for free. After that, each unit costs you one gold per turn." + [/message] + [/event] + + # TURN 9: advancement + [event] + name=turn 9 + + [message] + speaker=narrator + caption= _"Advancement" + message= _"When a unit gains enough experience points (the experience bar, if present, is on the right of the hitpoints bar), it will go up a level. Elvish Fighters have two advancement options, and you will be able to choose which one you want. However, second level units cost twice as much to support as first level units." + [/message] + [/event] + + # TURN 10: defenses + [event] + name=turn 10 + + [message] + speaker=narrator + caption= _"Defenses" + # wmllint: local spelling quintains + message= _"Whenever one of your units is selected, you’ll see varying percentages as you move the mouse over the map. The higher the percentage, the more defense that unit has in that kind of terrain. For example, most units have good defenses in castles and villages but poor defenses in rivers. However, these quintains use a magical attack, which always has a 70% chance of hitting no matter what terrain its target occupies." + [/message] + [/event] + + # Experience tracking needed in scenario 2 code + # Give them roles of 'Veteran' as well or instead? Lets you track 0XP units cleanly. + [event] + name=advance + first_time_only=no + + {VARIABLE_OP unit.variables.previous_xp add $unit.max_experience} + + [unstore_unit] + variable=unit + advance=false + [/unstore_unit] [/event] [event] @@ -1080,59 +1055,69 @@ End your turn, then attack again." [filter] id=student [/filter] + [endlevel] result=defeat [/endlevel] [/event] + # Death of the first quintain [event] name=die + first_time_only=yes [filter] type=Quintain [/filter] + {CLEAR_PRINT} + [message] speaker=second_unit message= _"The quintain is destroyed, and I have gained more experience!" [/message] -#wmlindent: start ignoring - # wmllint: display on - {GENDER ([message] + + {GENDER ( + [message] id=Delfador message= _"Yes, you gain experience through battle, especially by killing an opponent. Gain enough experience and you’ll become more powerful. Now, Konrad, I will leave you with more dummies to practice on! After that, we have real work to do..." - [/message]) ([message] + [/message] + ) ( + [message] id=Delfador message= _"Yes, you gain experience through battle, especially by killing an opponent. Gain enough experience and you’ll become more powerful. Now, Li’sar, I will leave you with more dummies to practice on! After that, we have real work to do..." - [/message])} - # wmllint: display off -#wmlindent: stop ignoring - {VARIABLE quintain_dead 1} + [/message] + )} [scroll_to_unit] id=Delfador [/scroll_to_unit] + [animate_unit] [filter] id=Delfador [/filter] flag=summon_quintain_raise_staff [/animate_unit] + [sound] name=lightning.ogg [/sound] + [color_adjust] red=100 green=100 blue=100 [/color_adjust] + [animate_unit] [filter] id=Delfador [/filter] flag=summon_quintain_lower_staff [/animate_unit] + [color_adjust] red=0 green=0 @@ -1146,6 +1131,7 @@ Now, Li’sar, I will leave you with more dummies to practice on! After that, we x,y=16,10 side=2 [/unit] + [unit] id=Quintain2 type=Quintain @@ -1153,6 +1139,7 @@ Now, Li’sar, I will leave you with more dummies to practice on! After that, we x,y=13,11 side=2 [/unit] + [unit] id=Quintain3 type=Quintain @@ -1170,29 +1157,30 @@ Now, Li’sar, I will leave you with more dummies to practice on! After that, we [kill] id=Delfador [/kill] + [message] speaker=narrator caption= _"Note" - #wmllint: display on message= _"These dummies only attack if you are a single tile away. With care, you should be able to kill them one at a time." - #wmllint: display off [/message] + [set_menu_item] + description= _ "End Scenario" + id=skip_item + [command] + [endlevel] + result=victory + carryover_report=no + carryover_add=yes + carryover_percentage=0 + [/endlevel] + [/command] + [/set_menu_item] + [event] - name=new turn + name=turn $($turn_number+1) first_time_only=yes - [set_menu_item] - description= _ "End Scenario" - id="skip_item" - [command] - [endlevel] - result=victory - carryover_report=no - carryover_add=yes - carryover_percentage=0 - [/endlevel] - [/command] - [/set_menu_item] + [message] speaker=narrator message= _"Do you want to keep practicing? You can end this scenario at any time by using the End Scenario item in the context menu." @@ -1216,23 +1204,23 @@ Now, Li’sar, I will leave you with more dummies to practice on! After that, we [event] name=time over + [if] - [variable] - name=quintain_dead - numerical_equals=1 - [/variable] + [have_unit] + id=quintain + [/have_unit] [then] + [endlevel] + result=defeat + [/endlevel] + [/then] + [else] [endlevel] result=victory carryover_report=no carryover_add=yes carryover_percentage=0 [/endlevel] - [/then] - [else] - [endlevel] - result=defeat - [/endlevel] [/else] [/if] [/event] @@ -1244,27 +1232,17 @@ Now, Li’sar, I will leave you with more dummies to practice on! After that, we caption= _"Victory" message= _"After your victory notice, the map will be grayed out to indicate that the scenario is over, but you will still be able to examine the final positions and state of your troops and any surviving enemies. This is called linger mode. When you’re finished, click the End Scenario button to go on to the next scenario in the campaign." [/message] + [clear_menu_item] - id="skip_item" + id=skip_item [/clear_menu_item] - {CLEAR_VARIABLE next_turn} - {CLEAR_VARIABLE target_hex} + + {CLEAR_VARIABLE next_turn,target_hex} [/event] [event] name=defeat + {CLEAR_PRINT} [/event] - - # Experience tracking needed in Scenario2 code - # Give them roles of 'Veteran' as well or instead? Lets you track 0XP units cleanly. - [event] - name=advance - first_time_only=no - {VARIABLE_OP unit.variables.previous_xp add $unit.max_experience} - [unstore_unit] - variable=unit - advance=false - [/unstore_unit] - [/event] [/tutorial]