# Solace Tutorial Script File
# ===========================
#
# Commands:
# play_wave_file <sound file path>			Start playing the sound asynchonously
# play_sound_effect <event name>			Play a sound effect defined in the sound index file
# wait <number of seconds>					Hold execution of script for x seconds (float input)
# display_title <message>					Display a drop down title dialog (Halts execution for 2 seconds)
# display_message <message>					Display a message in a dialog box (Halts execution until user clicks done)
# display_arrow <x> <y> <message>			Display an arrow at x, y with message (note coordinate are in map coordinate, bottom left is 0,0 and top right is 1024,768, decimal input)
# display_chat wait_time <message>			Adds the message to the chat interface
# display_flipped_arrow <x> <y> <message>	Same as above, but the arrow points to the left instead of to the right
# clear_gameboard							Removes all units and combat moves
# clear_arrows								Removes all helper arrows
# advance_tutorial_stage					Advances the phase of the current tutorial
#											Phases
#											-1 = Pre-new turn dialog (Script initialization)
#											0 = New turn dialog (Halts execution until user clicks "Done")
#											1 = Purchase units dialog (Halts execution until user clicks "Done")
#											2 = Perform combat movements (Does not halt execution, see watch_for_combat and watch_for_end_of_stage below)
#											3 = Resolve combat movements (Halts script execution until all battles are done and ready to advance to non-combat phase)
#											4 = Perform non combat movements (Does not halt execution, see watch_for_combat and watch_for_end_of_stage below)
#											5 = Unload troops from transports (Note:  The tutorial will never ask to user to skip this phase, it is _always_ performed)
#											6 = Place purchased units (Halts until all units are place on the map)
#
#
# add_unit <type> <number> <county ID> <controller>
#											Adds a unit on the gameboard
#											Types
#											0 = Infantry
#											1 = Archer
#											2 = Cavalry
#											3 = Balista
#											4 = Catapult
#											5 = Sloop
#											6 = Frigate
#											7 = Galleon
#											8 = Transport
#
#											Controller ID
#											1 = People of Tarth
#											2 = Minx Cartel
#											3 = Free Cities
#											4 = Kilary Stronghold
#											5 = Clan Lords
#											6 = Jinda Empire
#
#											Refer to county numbers.psd for county ID numbers
#
# set_current_controller <controller>		Forces a change in the current controller (not pretty, doesn't restart phases).  Only use this at the beginning of the script if you want the user to be someone besides the Clan Lords!
#
# watch_for_combat <from> <to> <type> <number>
#											Halts execution until the user performs the requested
#											combat movement
#
# watch_for_unit_load <type> <number>		Halts execution until the user performs the requested transport troop load
#
# watch_for_end_of_stage					Halts execution until the user presses the "End Phase" button (user will not be able to press the "End Phase" button until the script reaches this state)
#
#
# Note: script syntax is white space sensitive, separate all arguments with a single space
#
# Note: you may only play a single wave file at a time for voice overs
#
# Note: Last line of this file must be a blank line
#

# Display tutorial welcome title
total_chapters 3
chapter_marker
display_chat 0 (This tutorial will give you a basic understanding of Solace.  Please refer to the manual for complete rules and documentation.)
display_chat 0   
display_title Chapter One: History
wait 2.5
group_chat_marker
display_chat 0 "Ah, welcome my lord!  Are you ready for a lesson on how to play Solace?"
display_chat 0   
display_chat 0 "Good! Now, give me your undivided attention and I shall endeavor to enlighten that darkened and musty head of yours!"
display_chat 0   
play_wave_file tut1.wav
wait 12.5
display_chat 0   
display_chat 0 "What you see before you is a map of the world of Solace, a world recently being crushed under the unbearable weight of war.  And as in any war, various countries of differing persuasions are involved."
display_chat 0   
display_chat 0 "Draw your attention to the map and I will begin describing the various participants in this epic battle!"
display_chat 0   
play_wave_file tut2.wav
wait 19.5
display_chat 0   
display_chat 0 "The purple area is currently claimed by the Ligionire Clan Lords, a volatile group of shepherds and warriors. History will later note them as the instigators of this war, since they rose up in rebellion against the peaceful rule of the monks of the Brotherhood of Sorrows.  Personally I think they just got bored with the sheep and decided to have a little fun!  No matter the reason, they didn't begin the war alone."
display_chat 0   
play_wave_file tut3.wav
display_arrow 924 300 Clan Lords
wait 23.5

display_chat 0   
display_chat 0 "The pirates of the Minx Cartel and their allies the simple tradesmen of the Free Cities joined the Clan Lords, hoping for a little conquest and plunder.  The brown counties belong to the Minx Cartel, which just a few short years ago was not even a formal kingdom!  What began as a loose confederacy of pirates and smugglers blossomed into a semi-coordinated federation of buccaneers."
display_chat 0   

play_wave_file tut4.wav
display_flipped_arrow 457 669 Minx Cartel
wait 23.5

display_chat 0   
display_chat 0 "Their longtime allies inhabit the blue counties.  The Free Cities is a sparsely populated country of hunters, fishermen, and other simple tradesmen.  They rely on the Minx Cartel for protection, but in turn provide the Cartel with furs, food, and wine!"
display_chat 0   

display_arrow 539 570 Free Cities
wait 17.0

display_arrow 825 523 Kilary Stronghold
display_chat 0  
display_chat 0 "Opposing this rising tide of bloodthirsty warriors are the monks of the Brotherhood of Sorrow, who inhabit the yellow counties around the Kilary Stronghold.  Although the monks don't believe in violence, they have no problem with politically manipulating others to achieve their goals.  I guess the Clan Lords had enough of that!"
display_chat 0 

play_wave_file tut5.wav
wait 16.5

display_flipped_arrow 105 495 People Of Tarth
display_chat 0   
display_chat 0 "The monks have many political connections, and the remaining two countries rose in defense of the Stronghold.  The wild horsemen of the green colored counties are the People of Tarth.  They answered the swift call for help and now mount a campaign against the Minx Cartel."
display_chat 0  
wait 15.5

display_arrow 446 105 Jinda Empire
display_chat 0  
display_chat 0 "Meanwhile in the south, the Jinda Empire also joined the Stronghold in their struggle.  Normally content with their extensive merchant network and dealings in exotic herbs, the Jinda Empire refitted many of their vessels and now command a sizeable fleet!"
display_chat 0  
wait 16.0

clear_arrows

chapter_marker
display_title Chapter Two: Geography

display_chat 0  
display_chat 0 "Well, enough of the history, time for a lesson in geography.  The map of Solace is split into many separate areas, with each one representing a sea zone or a land county.  Each land county under your country's possession earns you income at the end of your turn, and that income is determined by its credit value."
display_chat 0  

play_wave_file tut6.wav
wait 9.0
display_flipped_arrow 817 343 A Sea Zone
wait 1.5
display_arrow 762 229 A Land County
wait 9.0
display_arrow 583 186 Credit Value
wait 1.5

display_chat 0  
display_chat 0 "Credit values are displayed in the white circles on land territories.  Note that sea zones do not earn credits for your country, nor are they considered part of your country's territory."
display_chat 0  
play_wave_file tut6.5.wav
wait 11.5

clear_arrows

display_chat 0  
display_chat 0 "Each country has a capital where your treasury is kept and newly purchased units can be placed.  Sea zones directly adjacent to a capital are considered sea ports and newly purchased ships may be placed there."
display_chat 0  

play_wave_file tut7.wav
wait 1.5
display_arrow 927 237 Country Capital
wait 7.5
display_arrow 1000 398   
display_flipped_arrow 866 398 Sea Ports
wait 3.0

clear_arrows

add_unit 2 3 33 5
wait 0.25
add_unit 0 7 42 6
wait 0.25
add_unit 1 1 35 5
wait 0.25
display_arrow 848 140 Stack of 3 Cavalry
wait 0.25
display_arrow 560 174 Stack of 7 Infantry
wait 0.25
display_arrow 885 291 Stack of 1 Archer
wait 0.25

display_chat 0  
display_chat 0 "The foolhardy souls who actually joined the various armies are represented on the map by stacks of units.  These stacks are made up of a series of red and white chips, topped by a game piece representing the type of unit they are.  Each red chip in a stack represents 5 units, and each white chip represents a single additional unit.  Remember when counting the units in a stack to include the actual game piece as a unit."
display_chat 0  

play_wave_file tut8.wav
group_chat_marker
wait 26.0

clear_arrows
clear_gameboard

chapter_marker
display_title Chapter Three: Military Arts

add_unit 1 3 32 5
wait 0.25
add_unit 0 2 34 5
wait 0.25
add_unit 7 1 73 5
wait 0.25
add_unit 6 1 73 5
wait 0.25
add_unit 8 3 72 5
wait 0.25
add_unit 0 2 35 5
wait 0.25
add_unit 2 1 35 5
wait 0.25
add_unit 4 1 35 5
wait 0.25
add_unit 2 3 37 5
wait 0.25
add_unit 3 3 36 5
wait 0.25
add_unit 4 1 33 5

wait 0.25
add_unit 5 1 74 4
wait 0.25
add_unit 0 1 31 4
wait 0.25
add_unit 1 2 31 4
wait 0.25

display_chat 0  
display_chat 0 "Time to begin your instruction in the military arts.  Your turn begins with a summary report of the various countries, the current number of credits in their treasury, and an overview of their military might.  Go ahead and review the information in this dialog, and then click Done when you're ready to continue the lesson."
display_chat 0  

play_wave_file tut9.wav
wait 3.0
# Display the begin new turn dialog, halting until the user presses Done
advance_tutorial_stage
group_chat_marker

display_chat 0.0  
display_chat 0.0 "Your first task is to decide which units you're going to purchase.  You only have a limited number of credits in your treasury, so spend them wisely!  Any units you purchase in the beginning will not be ready to place until the end of your turn, so take into account future casualties as well.  If you need to review the gameboard while pondering your decision, click on the open/close icon in the upper-right corner of the window."
display_chat 0.0  

play_wave_file tut10.wav

display_chat 23.0  
display_chat 23.0 "To purchase a unit, simply click on it.  To undo the purchasing of a unit, option click on the unit.  If you would like a detailed description of each unit and their statistics, control-click on the unit.  Go ahead and purchase some units, and when you're ready to continue click Done"
display_chat 23.0  

# Halt execution until the user presses the Done button
advance_tutorial_stage

display_chat 0  
display_chat 0 "Congratulations, you're now ready to begin making your combat movements.  During this phase you'll decide which of your units attack where.  This is done by dragging a stack of units to the territory you wish to invade.  If you would like to move a single unit from the stack, hold shift and drag the unit.  Remember that you can control-click on any unit to get information about it."
display_chat 0  

play_wave_file tut11.wav
wait 24.0

advance_tutorial_stage
group_chat_marker

display_chat 0  
display_chat 0 "Lets try a simple maneuver.  Drag the stack of three archers to the territory controlled by the Jinda Empire."
display_chat 0  

play_wave_file tut12.wav
wait 3.0
display_flipped_arrow 816 237 Drag these archers
wait 2.0
display_arrow 728 269 To this county
wait 1.0

watch_for_combat 32 45 1 3
group_chat_marker

clear_arrows
display_chat 0  
display_chat 0 "Good!  Now, lets try something different.  Its normally a good idea to capture as much territory on your turn as possible, since this increases the amount of credits you get at the end of your turn.  Lets split up this stack of two infantry and send a single one to the designated county.  To send a single unit from a stack of units, hold down the shift key as you click and drag the stack."
display_chat 0  

play_wave_file tut13.wav
wait 12.0
display_flipped_arrow 785 44 Shift-drag these infantry
wait 3.0
display_arrow 676 173 To this county
wait 7.0

watch_for_combat 34 44 0 1
group_chat_marker

clear_arrows
display_chat 0  
display_chat 0 "Now lets complete the maneuver by dragging this infantry to the other county."
display_chat 0  

play_wave_file tut14.wav
wait 2.0
display_flipped_arrow 785 44 Drag this infantry
wait 1.0
display_arrow 640 41 To this county
wait 1.0

watch_for_combat 34 43 0 1
group_chat_marker

clear_arrows
display_chat 0  
display_chat 0 "Not only can your land troops harass the enemy, but your navy can as well.  Drag the Galleon and the Frigate to attack the enemy's Sloop"
display_chat 0  

play_wave_file tut15.wav
wait 4.0
display_arrow 972 374 Drag these ships
wait 3.0
display_arrow 929 516 To this county
wait 1.0

watch_for_combats 73 74 7 1 73 74 6 1
group_chat_marker

clear_arrows
display_chat 0  
display_chat 0 "Next we're going to perform an amphibious assault.  This is done by loading land troops onto transport ships and have them invade an enemy land territory.  Go ahead and load the designated land troops onto your transports by dragging the units onto the transports themselves."
display_chat 0  

play_wave_file tut16.wav
wait 10.0
display_arrow 868 271 Load these units
wait 2.0
display_arrow 890 406 Onto these transports
wait 3.5

watch_for_unit_load 2 1
watch_for_unit_load 0 2
watch_for_unit_load 4 1
group_chat_marker

clear_arrows
display_chat 0  
display_chat 0 "We'd really like these troops to assault the enemy capital, and the presence of the enemy Sloop would normally prevent this.  However, we can try a risky maneuver by trying to run their blockade.  We do this by attacking the Sloop with our Galleon and Frigate."
display_chat 0  

display_chat 14  
display_chat 14 "If they're successful the assault will proceed as planned.  If not, the transports will retreat and be unable to do anything else this turn.  Go ahead and drag your transports to the enemy capital".
display_chat 14  


play_wave_file tut17.wav
wait 22.0
display_arrow 890 406 Drag these transports
wait 3.0
display_flipped_arrow 859 553 To This Capital
wait 1.0

watch_for_combat 72 31 8 3
group_chat_marker

clear_arrows
display_chat 0  
display_chat 0 "We're now ready to end this phase and begin resolving our combat moves.  Before we do this lets take a moment and review the order of play indicator.  This little device shows the various country shields in the correct order of play, highlighting the current player." 
display_chat 0  

display_chat 14  
display_chat 14 "Clicking on any of these shields will provide background information about that country and a summary of their military might.  When you're all set, go ahead and click the End Phase button to resolve your combat moves." 
display_chat 14  

play_wave_file tut18.wav
display_flipped_arrow 119 35 Order of Play Indicator
wait 27.0

watch_for_end_of_stage

clear_arrows

forbid_chapter_skip

display_chat 0  
display_chat 0 "Your generals will now execute your combat movements.  When a combat movement results in a battle, you'll be taken to the battle board where all combat is fought.  Combat proceeds along very simple rules.  First, each of the attacker's units fire upon the defenders."
display_char 0  

display_chat 17  
display_chat 17 "They do this by casting a die and if they roll the number of the column that unit is in or less, then that unit hits one of the defenders.  A defender which gets hit is placed onto the casualties area.  Here they'll have a single chance to return fire before they are removed from battle."
display_chat 17  


display_chat 34  
display_chat 34 "After the attacker finishes, the defenders will then counter-attack, removing any attacking units they hit in the process."
display_chat 34  

play_wave_file tut19a.wav

wait 17
# Start resolving the combat moves
advance_tutorial_stage
group_chat_marker

wait 5.0

display_chat 0  
display_chat 0 "There are five units which have special abilities in combat.  Cavalry are good shock troops, and as such on their very first attack any defender they hit is removed from the battle board without getting a change to counter-attack.  Catapults are massive siege engines which kill two enemy units for every successful hit.  Balistae are the ultimate defensive weapon which can take two hits before being removed."
display_chat 0  

display_chat 25  
display_chat 25 "Catapults and Balistae are also able to protect your sea ports from enemy ships.  Galleons are very large ships which can take two hits before they are removed from battle.  Sloops have the ability to perform a hit and fade, which allows them to take a single shot at the enemy before retreating.  The advantage of this is that the enemy must roll a one during their counter-attack in order to hit the retreating sloops."
display_chat 25  

play_wave_file tut19b.wav

wait 9.0

watch_for_end_of_combat_resolution

allow_chapter_skip

# Perform the non-combat movements
advance_tutorial_stage

wait 2.0

display_chat 0  
display_chat 0 "Did you notice the message saying "You captured 32 credits"?  You gain the enemy's treasury whenever you capture their capital county, a very good thing!  Not only can this looted treasure go towards purchasing more units, but it also denies the enemy the chance to purchase new troops with it."
display_chat 0  

play_wave_file tut20.wav

wait 17.5

group_chat_marker

display_chat 0  
display_chat 0 "After all of your combat movements are completed, you are allowed to move whatever units have not yet moved in non-combative ways.  Think of this turn as moving reinforcements to the front line, or repositioning units back to defend your capital.  Go ahead and move the rest of your land units west towards the Jinda Empire."
display_chat 0  

display_chat 20  
display_chat 20 "Note that Cavalry units can move a total of two spaces so use them well!  Click the End Phase button to continue."
display_chat 20  

play_wave_file tut21.wav

watch_for_end_of_stage

# Unload troops from transports
advance_tutorial_stage
group_chat_marker

display_chat 0  
display_chat 0 "We're almost done!  We now have the option to unload troops from any of our loaded transports.  This is useful for ferrying troops across the sea to friendly land territories.  Since we have no loaded transports to unload, go ahead and click the End Phase button"
display_chat 0  

play_wave_file tut22.wav

watch_for_end_of_stage

# Place purchased units

display_arrow 866 398 Place any purchased ships here

display_chat 0  
display_chat 0 "This is the final phase of our turn, when we get the chance to place any units we purchased in the beginning of our turn.  New troops may only be placed in a capital under your control, or in a sea zone adjacent to that capital.  If you only have a single capital, any land troops you purchased will be placed automatically."
display_chat 0  

display_chat 16  
display_chat 16 "Any ships you may have bought or if you control more than one capital will require you to place the units yourself."
display_chat 16  

play_wave_file tut23.wav

advance_tutorial_stage
group_chat_marker

wait 27.0

forbid_chapter_skip

clear_arrows

display_chat 0  
display_chat 0 "You're now ready to play the game of Solace, and I need a beer (and to get out of this dress)!"
display_chat 0  

play_wave_file tut24.wav
wait 10.0



