share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/journey.lua
changeset 7225 e3f2280d9000
parent 7219 6c7739c6446f
child 7228 1b29b8cfb17a
equal deleted inserted replaced
7222:4a17a921ec93 7225:e3f2280d9000
       
     1 loadfile(GetDataPath() .. "Scripts/Locale.lua")()
     1 loadfile(GetDataPath() .. "Scripts/Animate.lua")()
     2 loadfile(GetDataPath() .. "Scripts/Animate.lua")()
     2 
     3 
     3 --///////////////////////////////CONSTANTS///////////////////////////
     4 --///////////////////////////////CONSTANTS///////////////////////////
     4 
     5 
     5 choiceAccepted = 1
     6 choiceAccepted = 1
     7 choiceAttacked = 3
     8 choiceAttacked = 3
     8 
     9 
     9 endStage = 1
    10 endStage = 1
    10 
    11 
    11 cannibalNum = 8
    12 cannibalNum = 8
    12 cannibalNames = {"John", "Flesh for Brainz", "Eye Chewer", "Torn Muscle",
    13 cannibalNames = {loc("John"), loc("Flesh for Brainz"), loc("Eye Chewer"), loc("Torn Muscle"),
    13                  "Nom-Nom", "Vedgies", "Brain Blower", "Gorkij"}
    14                  loc("Nom-Nom"), loc("Vedgies"), loc("Brain Blower"), loc("Gorkij")}
    14 cannibalPos = {{2471, 1174}, {939, 1019}, {1953, 902}, {3055, 1041},
    15 cannibalPos = {{2471, 1174}, {939, 1019}, {1953, 902}, {3055, 1041},
    15                {1121, 729}, {1150, 718}, {1149, 680}, {1161, 773}}
    16                {1121, 729}, {1150, 718}, {1149, 680}, {1161, 773}}
    16 
    17 
    17 startLeaksPosDuo = {3572, 1426}
    18 startLeaksPosDuo = {3572, 1426}
    18 startEventXDuo = 3300
    19 startEventXDuo = 3300
    76 winAnim = {}
    77 winAnim = {}
    77 winAnimAD = {}
    78 winAnimAD = {}
    78 
    79 
    79 --/////////////////////////Animation Functions///////////////////////
    80 --/////////////////////////Animation Functions///////////////////////
    80 function AfterMidFailAnim()
    81 function AfterMidFailAnim()
    81   ParseCommand("teamgone Natives")
    82   ParseCommand("teamgone " .. loc("Natives"))
    82   TurnTimeLeft = 0
    83   TurnTimeLeft = 0
    83 end
    84 end
    84 
    85 
    85 function AfterMidAnimAlone()
    86 function AfterMidAnimAlone()
    86   SetupCourse()
    87   SetupCourse()
    96   AddEvent(CheckTookSniper, {}, DoTookSniper, {}, 0)
    97   AddEvent(CheckTookSniper, {}, DoTookSniper, {}, 0)
    97   AddEvent(CheckFailedCourse, {}, DoFailedCourse, {}, 0)
    98   AddEvent(CheckFailedCourse, {}, DoFailedCourse, {}, 0)
    98   SetGearMessage(leaks, 0)
    99   SetGearMessage(leaks, 0)
    99   TurnsLeft = 12
   100   TurnsLeft = 12
   100   TurnTimeLeft = TurnTime
   101   TurnTimeLeft = TurnTime
   101   ShowMission("The Journey Back", "Collateral Damage", "Save the princess by collecting the crate in under 12 turns!", 0, 6000)
   102   ShowMission(loc("The Journey Back"), loc("Collateral Damage"), loc("Save the princess by collecting the crate in under 12 turns!"), 0, 6000)
   102   -----------------------///////////////------------
   103   -----------------------///////////////------------
   103   --SetGearPosition(leaks, 417, 1800)
   104   --SetGearPosition(leaks, 417, 1800)
   104 end
   105 end
   105 
   106 
   106 function SkipEndAnimAlone()
   107 function SkipEndAnimAlone()
   136 function AfterEndAnimAlone()
   137 function AfterEndAnimAlone()
   137   stage = endStage
   138   stage = endStage
   138   SwitchHog(leaks)
   139   SwitchHog(leaks)
   139   SetGearMessage(leaks, 0)
   140   SetGearMessage(leaks, 0)
   140   TurnTimeLeft = -1
   141   TurnTimeLeft = -1
   141   ShowMission("The Journey Back", "Collateral Damage II", "Save Fell From Heaven!", 1, 4000)
   142   ShowMission(loc("The Journey Back"), loc("Collateral Damage II"), loc("Save Fell From Heaven!"), 1, 4000)
   142   AddEvent(CheckLost, {}, DoLost, {}, 0)
   143   AddEvent(CheckLost, {}, DoLost, {}, 0)
   143   AddEvent(CheckWon, {}, DoWon, 0)
   144   AddEvent(CheckWon, {}, DoWon, 0)
   144   RemoveEventFunc(CheckFailedCourse)
   145   RemoveEventFunc(CheckFailedCourse)
   145 end
   146 end
   146 
   147 
   147 function AfterEndAnimDuo()
   148 function AfterEndAnimDuo()
   148   stage = endStage
   149   stage = endStage
   149   SwitchHog(leaks)
   150   SwitchHog(leaks)
   150   SetGearMessage(leaks, 0)
   151   SetGearMessage(leaks, 0)
   151   TurnTimeLeft = -1
   152   TurnTimeLeft = -1
   152   ShowMission("The Journey Back", "Collateral Damage II", "Save Fell From Heaven!", 1, 4000)
   153   ShowMission(loc("The Journey Back"), loc("Collateral Damage II"), loc("Save Fell From Heaven!"), 1, 4000)
   153   AddEvent(CheckLost, {}, DoLost, {}, 0)
   154   AddEvent(CheckLost, {}, DoLost, {}, 0)
   154   AddEvent(CheckWon, {}, DoWon, {}, 0)
   155   AddEvent(CheckWon, {}, DoWon, {}, 0)
   155 end
   156 end
   156 
   157 
   157 function SkipMidAnimAlone()
   158 function SkipMidAnimAlone()
   169 end
   170 end
   170 
   171 
   171 function AfterStartAnim()
   172 function AfterStartAnim()
   172   SetGearMessage(leaks, 0)
   173   SetGearMessage(leaks, 0)
   173   TurnTimeLeft = TurnTime
   174   TurnTimeLeft = TurnTime
   174   local goal = "Get the crate on the other side of the island!|"
   175   local goal = loc("Get the crate on the other side of the island!|")
   175   local hint = "Hint: you might want to stay out of sight and take all the crates...|"
   176   local hint = loc("Hint: you might want to stay out of sight and take all the crates...|")
   176   local stuck = "If you get stuck, use your Desert Eagle or restart the mission!|"
   177   local stuck = loc("If you get stuck, use your Desert Eagle or restart the mission!|")
   177   local conds = "Leaks A Lot must survive!"
   178   local conds = loc("Leaks A Lot must survive!")
   178   if m2DenseDead == 0 then
   179   if m2DenseDead == 0 then
   179     conds = "Your hogs must survive!"
   180     conds = loc("Your hogs must survive!")
   180   end
   181   end
   181   ShowMission("The Journey Back", "Adventurous", goal .. hint .. stuck .. conds, 0, 7000)
   182   ShowMission(loc("The Journey Back"), loc("Adventurous"), goal .. hint .. stuck .. conds, 0, 7000)
   182 end
   183 end
   183 
   184 
   184 function SkipStartAnim()
   185 function SkipStartAnim()
   185   AnimSwitchHog(leaks)
   186   AnimSwitchHog(leaks)
   186 end
   187 end
   230   AddEvent(CheckTookGirder1, {}, DoTookGirder1, {}, 0)
   231   AddEvent(CheckTookGirder1, {}, DoTookGirder1, {}, 0)
   231   AddEvent(CheckTookGirder2, {}, DoTookGirder2, {}, 0)
   232   AddEvent(CheckTookGirder2, {}, DoTookGirder2, {}, 0)
   232   SetGearMessage(leaks, 0)
   233   SetGearMessage(leaks, 0)
   233   SetGearMessage(dense, 0)
   234   SetGearMessage(dense, 0)
   234   TurnTimeLeft = 0
   235   TurnTimeLeft = 0
   235   ShowMission("The Journey Back", "The Savior", "Get Dense Cloud out of the pit!", 1, 5000)
   236   ShowMission(loc("The Journey Back"), loc("The Savior"), loc("Get Dense Cloud out of the pit!"), 1, 5000)
   236 end
   237 end
   237 
   238 
   238 function SkipPastFlowerAnim()
   239 function SkipPastFlowerAnim()
   239   SetGearPosition(dense, 2656, 1842)
   240   SetGearPosition(dense, 2656, 1842)
   240   AnimSwitchHog(dense)
   241   AnimSwitchHog(dense)
   251   HideHog(cannibals[5])
   252   HideHog(cannibals[5])
   252   AddEvent(CheckTookFire, {}, DoTookFire, {}, 0)
   253   AddEvent(CheckTookFire, {}, DoTookFire, {}, 0)
   253   SetGearMessage(leaks, 0)
   254   SetGearMessage(leaks, 0)
   254   SetGearMessage(dense, 0)
   255   SetGearMessage(dense, 0)
   255   TurnTimeLeft = 0
   256   TurnTimeLeft = 0
   256   ShowMission("The Journey Back", "They never learn", "Free Dense Cloud and continue the mission!", 1, 5000)
   257   ShowMission(loc("The Journey Back"), loc("They never learn"), loc("Free Dense Cloud and continue the mission!"), 1, 5000)
   257 end
   258 end
   258 
   259 
   259 function SkipOutPitAnim()
   260 function SkipOutPitAnim()
   260   SetGearPosition(dense, unpack(midDensePosDuo))
   261   SetGearPosition(dense, unpack(midDensePosDuo))
   261   AnimSwitchHog(dense)
   262   AnimSwitchHog(dense)
   374   SetTimer(AddGear(2314, 1818, gtMine, 0, 0, 0, 0), 5000)
   375   SetTimer(AddGear(2314, 1818, gtMine, 0, 0, 0, 0), 5000)
   375 end
   376 end
   376 
   377 
   377 function SetupAnimRefusedDied()
   378 function SetupAnimRefusedDied()
   378   SetupAnimAcceptedDied()
   379   SetupAnimAcceptedDied()
   379   table.insert(startAnim, {func = AnimSay, args = {leaks, "I just wonder where Ramon and Spiky disappeared...", SAY_THINK, 6000}})
   380   table.insert(startAnim, {func = AnimSay, args = {leaks, loc("I just wonder where Ramon and Spiky disappeared..."), SAY_THINK, 6000}})
   380 end
   381 end
   381 
   382 
   382 function SetupAnimAttacked()
   383 function SetupAnimAttacked()
   383   SetupAnimAcceptedDied()
   384   SetupAnimAcceptedDied()
   384   startAnim = {}
   385   startAnim = {}
   385   table.insert(startAnim, {func = AnimWait, args = {leaks, 3000}})
   386   table.insert(startAnim, {func = AnimWait, args = {leaks, 3000}})
   386   table.insert(startAnim, {func = AnimTurn, args = {leaks, "Left"}})
   387   table.insert(startAnim, {func = AnimTurn, args = {leaks, "Left"}})
   387   table.insert(startAnim, {func = AnimSay, args = {leaks, "I wonder where Dense Cloud is...", SAY_THINK, 4000}})
   388   table.insert(startAnim, {func = AnimSay, args = {leaks, loc("I wonder where Dense Cloud is..."), SAY_THINK, 4000}})
   388   table.insert(startAnim, {func = AnimSay, args = {leaks, "He must be in the village already.", SAY_THINK, 4000}})
   389   table.insert(startAnim, {func = AnimSay, args = {leaks, loc("He must be in the village already."), SAY_THINK, 4000}})
   389   table.insert(startAnim, {func = AnimSay, args = {leaks, "I'd better get going myself.", SAY_THINK, 4000}})
   390   table.insert(startAnim, {func = AnimSay, args = {leaks, loc("I'd better get going myself."), SAY_THINK, 4000}})
   390 
   391 
   391   midAnim = {}
   392   midAnim = {}
   392   table.insert(midAnim, {func = AnimWait, args = {leaks, 500}})
   393   table.insert(midAnim, {func = AnimWait, args = {leaks, 500}})
   393   table.insert(midAnim, {func = AnimCustomFunction, swh = false, args = {leaks, RestoreCyborg, {1300, 1200, 1390, 1200}}})
   394   table.insert(midAnim, {func = AnimCustomFunction, swh = false, args = {leaks, RestoreCyborg, {1300, 1200, 1390, 1200}}})
   394   table.insert(midAnim, {func = AnimSwitchHog, args = {cyborg}})
   395   table.insert(midAnim, {func = AnimSwitchHog, args = {cyborg}})
   395   table.insert(midAnim, {func = AnimCustomFunction, args = {cyborg, TargetPrincess, {}}})
   396   table.insert(midAnim, {func = AnimCustomFunction, args = {cyborg, TargetPrincess, {}}})
   396   table.insert(midAnim, {func = AnimSay, args = {cyborg, "Welcome, Leaks A Lot!", SAY_SAY, 3000}})
   397   table.insert(midAnim, {func = AnimSay, args = {cyborg, loc("Welcome, Leaks A Lot!"), SAY_SAY, 3000}})
   397   table.insert(midAnim, {func = AnimSay, args = {cyborg, "I want to play a game...", SAY_SAY, 3000}})
   398   table.insert(midAnim, {func = AnimSay, args = {cyborg, loc("I want to play a game..."), SAY_SAY, 3000}})
   398   table.insert(midAnim, {func = AnimSay, args = {princess, "Help me, please!!!", SAY_SHOUT, 3000}})
   399   table.insert(midAnim, {func = AnimSay, args = {princess, loc("Help me, please!!!"), SAY_SHOUT, 3000}})
   399   table.insert(midAnim, {func = AnimSay, args = {cyborg, "If you can get that crate fast enough, your beloved \"princess\" may go free.", SAY_SAY, 7000}})
   400   table.insert(midAnim, {func = AnimSay, args = {cyborg, loc("If you can get that crate fast enough, your beloved \"princess\" may go free."), SAY_SAY, 7000}})
   400   table.insert(midAnim, {func = AnimSay, args = {cyborg, "However, if you fail to do so, she dies a most violent death! Muahahaha!", SAY_SAY, 8000}})
   401   table.insert(midAnim, {func = AnimSay, args = {cyborg, loc("However, if you fail to do so, she dies a most violent death! Muahahaha!"), SAY_SAY, 8000}})
   401   table.insert(midAnim, {func = AnimSay, args = {cyborg, "Good luck...or else!", SAY_SAY, 4000}})
   402   table.insert(midAnim, {func = AnimSay, args = {cyborg, loc("Good luck...or else!"), SAY_SAY, 4000}})
   402   table.insert(midAnim, {func = AnimTeleportGear, args = {leaks, 2656, 1842}})
   403   table.insert(midAnim, {func = AnimTeleportGear, args = {leaks, 2656, 1842}})
   403   table.insert(midAnim, {func = AnimCustomFunction, args = {cyborg, HideCyborg, {}}, swh = false})
   404   table.insert(midAnim, {func = AnimCustomFunction, args = {cyborg, HideCyborg, {}}, swh = false})
   404   table.insert(midAnim, {func = AnimSay, args = {leaks, "Hey! This is cheating!", SAY_SHOUT, 4000}})
   405   table.insert(midAnim, {func = AnimSay, args = {leaks, loc("Hey! This is cheating!"), SAY_SHOUT, 4000}})
   405   AddSkipFunction(midAnim, SkipMidAnimAlone, {})
   406   AddSkipFunction(midAnim, SkipMidAnimAlone, {})
   406 end
   407 end
   407 
   408 
   408 function SetupAnimAcceptedDied()
   409 function SetupAnimAcceptedDied()
   409   table.insert(startAnimAD, {func = AnimWait, args = {leaks, 3000}})
   410   table.insert(startAnimAD, {func = AnimWait, args = {leaks, 3000}})
   410   table.insert(startAnimAD, {func = AnimTurn, args = {leaks, "left"}})
   411   table.insert(startAnimAD, {func = AnimTurn, args = {leaks, "left"}})
   411   table.insert(startAnimAD, {func = AnimSay, args = {leaks, "I need to get to the other side of this island, fast!", SAY_THINK, 5000}})
   412   table.insert(startAnimAD, {func = AnimSay, args = {leaks, loc("I need to get to the other side of this island, fast!"), SAY_THINK, 5000}})
   412   table.insert(startAnimAD, {func = AnimSay, args = {leaks, "With Dense Cloud on the land of shadows, I'm the village's only hope...", SAY_THINK, 7000}})
   413   table.insert(startAnimAD, {func = AnimSay, args = {leaks, loc("With Dense Cloud on the land of shadows, I'm the village's only hope..."), SAY_THINK, 7000}})
   413 
   414 
   414   table.insert(midAnimAD, {func = AnimWait, args = {leaks, 500}})
   415   table.insert(midAnimAD, {func = AnimWait, args = {leaks, 500}})
   415   table.insert(midAnimAD, {func = AnimCustomFunction, swh = false, args = {leaks, RestoreCyborg, {1300, 1200, 1390, 1200}}})
   416   table.insert(midAnimAD, {func = AnimCustomFunction, swh = false, args = {leaks, RestoreCyborg, {1300, 1200, 1390, 1200}}})
   416   table.insert(midAnimAD, {func = AnimSwitchHog, args = {cyborg}})
   417   table.insert(midAnimAD, {func = AnimSwitchHog, args = {cyborg}})
   417   table.insert(midAnimAD, {func = AnimCustomFunction, args = {cyborg, TargetPrincess, {}}})
   418   table.insert(midAnimAD, {func = AnimCustomFunction, args = {cyborg, TargetPrincess, {}}})
   418   table.insert(midAnimAD, {func = AnimSay, args = {cyborg, "Welcome, Leaks A Lot!", SAY_SAY, 3000}})
   419   table.insert(midAnimAD, {func = AnimSay, args = {cyborg, loc("Welcome, Leaks A Lot!"), SAY_SAY, 3000}})
   419   table.insert(midAnimAD, {func = AnimSay, args = {cyborg, "I want to play a game...", SAY_SAY, 3000}})
   420   table.insert(midAnimAD, {func = AnimSay, args = {cyborg, loc("I want to play a game..."), SAY_SAY, 3000}})
   420   table.insert(midAnimAD, {func = AnimSay, args = {princess, "Help me, please!!!", SAY_SHOUT, 3000}})
   421   table.insert(midAnimAD, {func = AnimSay, args = {princess, loc("Help me, please!!!"), SAY_SHOUT, 3000}})
   421   table.insert(midAnimAD, {func = AnimSay, args = {cyborg, "If you can get that crate fast enough, your beloved \"princess\" may go free.", SAY_SAY, 7000}})
   422   table.insert(midAnimAD, {func = AnimSay, args = {cyborg, loc("If you can get that crate fast enough, your beloved \"princess\" may go free."), SAY_SAY, 7000}})
   422   table.insert(midAnimAD, {func = AnimSay, args = {cyborg, "However, if you fail to do so, she dies a most violent death, just like your friend! Muahahaha!", SAY_SAY, 8000}})
   423   table.insert(midAnimAD, {func = AnimSay, args = {cyborg, loc("However, if you fail to do so, she dies a most violent death, just like your friend! Muahahaha!"), SAY_SAY, 8000}})
   423   table.insert(midAnimAD, {func = AnimSay, args = {cyborg, "Good luck...or else!", SAY_SAY, 4000}})
   424   table.insert(midAnimAD, {func = AnimSay, args = {cyborg, loc("Good luck...or else!"), SAY_SAY, 4000}})
   424   table.insert(midAnimAD, {func = AnimTeleportGear, args = {leaks, 2656, 1842}})
   425   table.insert(midAnimAD, {func = AnimTeleportGear, args = {leaks, 2656, 1842}})
   425   table.insert(midAnimAD, {func = AnimCustomFunction, args = {cyborg, HideCyborg, {}}, swh = false})
   426   table.insert(midAnimAD, {func = AnimCustomFunction, args = {cyborg, HideCyborg, {}}, swh = false})
   426   table.insert(midAnimAD, {func = AnimSay, args = {leaks, "Hey! This is cheating!", SAY_SHOUT, 4000}})
   427   table.insert(midAnimAD, {func = AnimSay, args = {leaks, loc("Hey! This is cheating!"), SAY_SHOUT, 4000}})
   427   AddSkipFunction(midAnimAD, SkipMidAnimAlone, {})
   428   AddSkipFunction(midAnimAD, SkipMidAnimAlone, {})
   428 
   429 
   429   table.insert(failAnimAD, {func = AnimCustomFunction, swh = false, args = {leaks, RestoreCyborg, {2299, 1687, 2294, 1841}}})
   430   table.insert(failAnimAD, {func = AnimCustomFunction, swh = false, args = {leaks, RestoreCyborg, {2299, 1687, 2294, 1841}}})
   430   table.insert(failAnimAD, {func = AnimTeleportGear, args = {leaks, 2090, 1841}})
   431   table.insert(failAnimAD, {func = AnimTeleportGear, args = {leaks, 2090, 1841}})
   431   table.insert(failAnimAD, {func = AnimCustomFunction, swh = false, args = {cyborg, SetupKillRoom, {}}})
   432   table.insert(failAnimAD, {func = AnimCustomFunction, swh = false, args = {cyborg, SetupKillRoom, {}}})
   432   table.insert(failAnimAD, {func = AnimTurn, swh = false, args = {cyborg, "Left"}})
   433   table.insert(failAnimAD, {func = AnimTurn, swh = false, args = {cyborg, "Left"}})
   433   table.insert(failAnimAD, {func = AnimTurn, swh = false, args = {princess, "Left"}})
   434   table.insert(failAnimAD, {func = AnimTurn, swh = false, args = {princess, "Left"}})
   434   table.insert(failAnimAD, {func = AnimTurn, swh = false, args = {leaks, "Right"}})
   435   table.insert(failAnimAD, {func = AnimTurn, swh = false, args = {leaks, "Right"}})
   435   table.insert(failAnimAD, {func = AnimWait, args = {cyborg, 1000}})
   436   table.insert(failAnimAD, {func = AnimWait, args = {cyborg, 1000}})
   436   table.insert(failAnimAD, {func = AnimSay, args = {cyborg, "You have failed to complete your task, young one!", SAY_SAY, 6000}})
   437   table.insert(failAnimAD, {func = AnimSay, args = {cyborg, loc("You have failed to complete your task, young one!"), SAY_SAY, 6000}})
   437   table.insert(failAnimAD, {func = AnimSay, args = {cyborg, "It's time you learned that your actions have consequences!", SAY_SAY, 7000}})
   438   table.insert(failAnimAD, {func = AnimSay, args = {cyborg, loc("It's time you learned that your actions have consequences!"), SAY_SAY, 7000}})
   438   table.insert(failAnimAD, {func = AnimSay, args = {princess, "No! Please, help me!", SAY_SAY, 4000}})
   439   table.insert(failAnimAD, {func = AnimSay, args = {princess, loc("No! Please, help me!"), SAY_SAY, 4000}})
   439   table.insert(failAnimAD, {func = AnimSwitchHog, args = {cyborg}})
   440   table.insert(failAnimAD, {func = AnimSwitchHog, args = {cyborg}})
   440   table.insert(failAnimAD, {func = AnimCustomFunction, args = {cyborg, DumpMines, {}}})
   441   table.insert(failAnimAD, {func = AnimCustomFunction, args = {cyborg, DumpMines, {}}})
   441   table.insert(failAnimAD, {func = AnimCustomFunction, args = {cyborg, KillPrincess, {}}})
   442   table.insert(failAnimAD, {func = AnimCustomFunction, args = {cyborg, KillPrincess, {}}})
   442   table.insert(failAnimAD, {func = AnimWait, args = {cyborg, 12000}})
   443   table.insert(failAnimAD, {func = AnimWait, args = {cyborg, 12000}})
   443   table.insert(failAnimAD, {func = AnimSay, args = {leaks, "No! What have I done?! What have YOU done?!", SAY_SHOUT, 6000}})
   444   table.insert(failAnimAD, {func = AnimSay, args = {leaks, loc("No! What have I done?! What have YOU done?!"), SAY_SHOUT, 6000}})
   444 
   445 
   445   table.insert(endAnimAD, {func = AnimCustomFunction, swh = false, args = {leaks, RestoreCyborg, {437, 1700, 519, 1722}}})
   446   table.insert(endAnimAD, {func = AnimCustomFunction, swh = false, args = {leaks, RestoreCyborg, {437, 1700, 519, 1722}}})
   446   table.insert(endAnimAD, {func = AnimTurn, swh = false, args = {cyborg, "Right"}})
   447   table.insert(endAnimAD, {func = AnimTurn, swh = false, args = {cyborg, "Right"}})
   447   table.insert(endAnimAD, {func = AnimTurn, swh = false, args = {princess, "Right"}})
   448   table.insert(endAnimAD, {func = AnimTurn, swh = false, args = {princess, "Right"}})
   448   table.insert(endAnimAD, {func = AnimSay, args = {princess, "Help me, Leaks!", SAY_SHOUT, 3000}})
   449   table.insert(endAnimAD, {func = AnimSay, args = {princess, loc("Help me, Leaks!"), SAY_SHOUT, 3000}})
   449   table.insert(endAnimAD, {func = AnimSay, args = {leaks, "But you said you'd let her go!", SAY_SHOUT, 5000}})
   450   table.insert(endAnimAD, {func = AnimSay, args = {leaks, loc("But you said you'd let her go!"), SAY_SHOUT, 5000}})
   450   table.insert(endAnimAD, {func = AnimSay, args = {cyborg, "And you believed me? Oh, god, that's cute!", SAY_SHOUT, 7000}})
   451   table.insert(endAnimAD, {func = AnimSay, args = {cyborg, loc("And you believed me? Oh, god, that's cute!"), SAY_SHOUT, 7000}})
   451   table.insert(endAnimAD, {func = AnimSay, args = {leaks, "I won't let you kill her!", SAY_SHOUT, 4000}})
   452   table.insert(endAnimAD, {func = AnimSay, args = {leaks, loc("I won't let you kill her!"), SAY_SHOUT, 4000}})
   452   AddSkipFunction(endAnimAD, SkipEndAnimAlone, {})
   453   AddSkipFunction(endAnimAD, SkipEndAnimAlone, {})
   453   
   454   
   454   table.insert(endFailAnim, {func = AnimCaption, args = {leaks, "Leaks A Lot, depressed for killing his loved one, failed to save the village...", 3000}})
   455   table.insert(endFailAnim, {func = AnimCaption, args = {leaks, loc("Leaks A Lot, depressed for killing his loved one, failed to save the village..."), 3000}})
   455 
   456 
   456   table.insert(winAnimAD, {func = AnimSay, args = {princess, "Thank you, oh, thank you, Leaks A Lot!", SAY_SAY, 5000}})
   457   table.insert(winAnimAD, {func = AnimSay, args = {princess, loc("Thank you, oh, thank you, Leaks A Lot!"), SAY_SAY, 5000}})
   457   table.insert(winAnimAD, {func = AnimSay, args = {princess, "How can I ever repay you for saving my life?", SAY_SAY, 6000}})
   458   table.insert(winAnimAD, {func = AnimSay, args = {princess, loc("How can I ever repay you for saving my life?"), SAY_SAY, 6000}})
   458   table.insert(winAnimAD, {func = AnimSay, args = {leaks, "There's nothing more satisfying for me than seeing you share your beauty with the world every morning, my princess!", SAY_SAY, 10000}})
   459   table.insert(winAnimAD, {func = AnimSay, args = {leaks, loc("There's nothing more satisfying for me than seeing you share your beauty with the world every morning, my princess!"), SAY_SAY, 10000}})
   459   table.insert(winAnimAD, {func = AnimSay, args = {leaks, "Let's go home!", SAY_SAY, 3000}})
   460   table.insert(winAnimAD, {func = AnimSay, args = {leaks, loc("Let's go home!"), SAY_SAY, 3000}})
   460   table.insert(winAnimAD, {func = AnimCaption, args = {leaks, "And so they discovered that cyborgs weren't invulnerable...", 2000}})
   461   table.insert(winAnimAD, {func = AnimCaption, args = {leaks, loc("And so they discovered that cyborgs weren't invulnerable..."), 2000}})
   461 
   462 
   462   startAnim = startAnimAD
   463   startAnim = startAnimAD
   463   midAnim = midAnimAD
   464   midAnim = midAnimAD
   464   failAnim = failAnimAD
   465   failAnim = failAnimAD
   465   endAnim = endAnimAD
   466   endAnim = endAnimAD
   468 end
   469 end
   469 
   470 
   470 function SetupAnimAcceptedLived()
   471 function SetupAnimAcceptedLived()
   471   table.insert(startAnimAL, {func = AnimWait, args = {leaks, 3000}})
   472   table.insert(startAnimAL, {func = AnimWait, args = {leaks, 3000}})
   472   table.insert(startAnimAL, {func = AnimCustomFunction, args = {dense, CondNeedToTurn, {leaks, dense}}})
   473   table.insert(startAnimAL, {func = AnimCustomFunction, args = {dense, CondNeedToTurn, {leaks, dense}}})
   473   table.insert(startAnimAL, {func = AnimSay, args = {leaks, "All right, we just need to get to the other side of the island!", SAY_SAY, 8000}})
   474   table.insert(startAnimAL, {func = AnimSay, args = {leaks, loc("All right, we just need to get to the other side of the island!"), SAY_SAY, 8000}})
   474   table.insert(startAnimAL, {func = AnimSay, args = {dense, "We have no time to waste...", SAY_SAY, 4000}})
   475   table.insert(startAnimAL, {func = AnimSay, args = {dense, loc("We have no time to waste..."), SAY_SAY, 4000}})
   475   table.insert(startAnimAL, {func = AnimSwitchHog, args = {leaks}})
   476   table.insert(startAnimAL, {func = AnimSwitchHog, args = {leaks}})
   476   AddSkipFunction(startAnimAL, SkipStartAnim, {})
   477   AddSkipFunction(startAnimAL, SkipStartAnim, {})
   477 
   478 
   478   table.insert(pastFlowerAnimAL, {func = AnimCustomFunction, args = {dense, RestoreCyborgOnly, {unpack(startCyborgPosDuo)}}, swh = false})
   479   table.insert(pastFlowerAnimAL, {func = AnimCustomFunction, args = {dense, RestoreCyborgOnly, {unpack(startCyborgPosDuo)}}, swh = false})
   479   table.insert(pastFlowerAnimAL, {func = AnimTurn, args = {cyborg, "Right"}})
   480   table.insert(pastFlowerAnimAL, {func = AnimTurn, args = {cyborg, "Right"}})
   480   table.insert(pastFlowerAnimAL, {func = AnimSay, args = {cyborg, "Well, well! Isn't that the cutest thing you've ever seen?", SAY_SAY, 7000}})
   481   table.insert(pastFlowerAnimAL, {func = AnimSay, args = {cyborg, loc("Well, well! Isn't that the cutest thing you've ever seen?"), SAY_SAY, 7000}})
   481   table.insert(pastFlowerAnimAL, {func = AnimSay, args = {cyborg, "Two little hogs cooperating, getting past obstacles...", SAY_SAY, 7000}})
   482   table.insert(pastFlowerAnimAL, {func = AnimSay, args = {cyborg, loc("Two little hogs cooperating, getting past obstacles..."), SAY_SAY, 7000}})
   482   table.insert(pastFlowerAnimAL, {func = AnimSay, args = {cyborg, "Let me test your skills a little, will you?", SAY_SAY, 6000}})
   483   table.insert(pastFlowerAnimAL, {func = AnimSay, args = {cyborg, loc("Let me test your skills a little, will you?"), SAY_SAY, 6000}})
   483   table.insert(pastFlowerAnimAL, {func = AnimTeleportGear, args = {cyborg, 2456, 1842}})
   484   table.insert(pastFlowerAnimAL, {func = AnimTeleportGear, args = {cyborg, 2456, 1842}})
   484   table.insert(pastFlowerAnimAL, {func = AnimTeleportGear, args = {dense, 2656, 1842}})
   485   table.insert(pastFlowerAnimAL, {func = AnimTeleportGear, args = {dense, 2656, 1842}})
   485   table.insert(pastFlowerAnimAL, {func = AnimCustomFunction, args = {dense, CondNeedToTurn, {cyborg, dense}}})
   486   table.insert(pastFlowerAnimAL, {func = AnimCustomFunction, args = {dense, CondNeedToTurn, {cyborg, dense}}})
   486   table.insert(pastFlowerAnimAL, {func = AnimSay, args = {dense, "Why are you doing this?", SAY_SAY, 4000}})
   487   table.insert(pastFlowerAnimAL, {func = AnimSay, args = {dense, loc("Why are you doing this?"), SAY_SAY, 4000}})
   487   table.insert(pastFlowerAnimAL, {func = AnimSay, args = {cyborg, "To help you, of course!", SAY_SAY, 4000}})
   488   table.insert(pastFlowerAnimAL, {func = AnimSay, args = {cyborg, loc("To help you, of course!"), SAY_SAY, 4000}})
   488   table.insert(pastFlowerAnimAL, {func = AnimSwitchHog, args = {dense}})
   489   table.insert(pastFlowerAnimAL, {func = AnimSwitchHog, args = {dense}})
   489   table.insert(pastFlowerAnimAL, {func = AnimDisappear, swh = false, args = {cyborg, 3781, 1583}})
   490   table.insert(pastFlowerAnimAL, {func = AnimDisappear, swh = false, args = {cyborg, 3781, 1583}})
   490   table.insert(pastFlowerAnimAL, {func = AnimCustomFunction, swh = false, args = {cyborg, HideCyborgOnly, {}}})
   491   table.insert(pastFlowerAnimAL, {func = AnimCustomFunction, swh = false, args = {cyborg, HideCyborgOnly, {}}})
   491   AddSkipFunction(pastFlowerAnimAL, SkipPastFlowerAnim, {})
   492   AddSkipFunction(pastFlowerAnimAL, SkipPastFlowerAnim, {})
   492 
   493 
   493   table.insert(outPitAnimAL, {func = AnimCustomFunction, args = {dense, RestoreCyborgOnly, {unpack(midCyborgPosDuo)}}, swh = false})
   494   table.insert(outPitAnimAL, {func = AnimCustomFunction, args = {dense, RestoreCyborgOnly, {unpack(midCyborgPosDuo)}}, swh = false})
   494   table.insert(outPitAnimAL, {func = AnimTurn, args = {cyborg, "Right"}})
   495   table.insert(outPitAnimAL, {func = AnimTurn, args = {cyborg, "Right"}})
   495   table.insert(outPitAnimAL, {func = AnimTeleportGear, args = {dense, unpack(midDensePosDuo)}})
   496   table.insert(outPitAnimAL, {func = AnimTeleportGear, args = {dense, unpack(midDensePosDuo)}})
   496   table.insert(outPitAnimAL, {func = AnimSay, args = {dense, "OH, COME ON!", SAY_SHOUT, 3000}})
   497   table.insert(outPitAnimAL, {func = AnimSay, args = {dense, loc("OH, COME ON!"), SAY_SHOUT, 3000}})
   497   table.insert(outPitAnimAL, {func = AnimSay, args = {cyborg, "Let's see what your comrade does now!", SAY_SAY, 5000}})
   498   table.insert(outPitAnimAL, {func = AnimSay, args = {cyborg, loc("Let's see what your comrade does now!"), SAY_SAY, 5000}})
   498   table.insert(outPitAnimAL, {func = AnimSwitchHog, args = {dense}})
   499   table.insert(outPitAnimAL, {func = AnimSwitchHog, args = {dense}})
   499   table.insert(outPitAnimAL, {func = AnimDisappear, swh = false, args = {cyborg, 3781, 1583}})
   500   table.insert(outPitAnimAL, {func = AnimDisappear, swh = false, args = {cyborg, 3781, 1583}})
   500   table.insert(outPitAnimAL, {func = AnimCustomFunction, swh = false, args = {cyborg, HideCyborgOnly, {}}})
   501   table.insert(outPitAnimAL, {func = AnimCustomFunction, swh = false, args = {cyborg, HideCyborgOnly, {}}})
   501   AddSkipFunction(outPitAnimAL, SkipOutPitAnim, {})
   502   AddSkipFunction(outPitAnimAL, SkipOutPitAnim, {})
   502 
   503 
   505   table.insert(endAnim, {func = AnimTeleportGear, args = {dense, 835, 1519}})
   506   table.insert(endAnim, {func = AnimTeleportGear, args = {dense, 835, 1519}})
   506   table.insert(endAnim, {func = AnimTurn, swh = false, args = {leaks, "Left"}})
   507   table.insert(endAnim, {func = AnimTurn, swh = false, args = {leaks, "Left"}})
   507   table.insert(endAnim, {func = AnimTurn, swh = false, args = {dense, "Left"}})
   508   table.insert(endAnim, {func = AnimTurn, swh = false, args = {dense, "Left"}})
   508   table.insert(endAnim, {func = AnimTurn, swh = false, args = {cyborg, "Right"}})
   509   table.insert(endAnim, {func = AnimTurn, swh = false, args = {cyborg, "Right"}})
   509   table.insert(endAnim, {func = AnimTurn, swh = false, args = {princess, "Right"}})
   510   table.insert(endAnim, {func = AnimTurn, swh = false, args = {princess, "Right"}})
   510   table.insert(endAnim, {func = AnimSay, args = {princess, "Help me, please!", SAY_SHOUT, 3000}})
   511   table.insert(endAnim, {func = AnimSay, args = {princess, loc("Help me, please!"), SAY_SHOUT, 3000}})
   511   table.insert(endAnim, {func = AnimSay, args = {leaks, "What are you doing? Let her go!", SAY_SHOUT, 5000}})
   512   table.insert(endAnim, {func = AnimSay, args = {leaks, loc("What are you doing? Let her go!"), SAY_SHOUT, 5000}})
   512   table.insert(endAnim, {func = AnimSay, args = {cyborg, "Yeah? Watcha gonna do? Cry?", SAY_SHOUT, 5000}})
   513   table.insert(endAnim, {func = AnimSay, args = {cyborg, loc("Yeah? Watcha gonna do? Cry?"), SAY_SHOUT, 5000}})
   513   table.insert(endAnim, {func = AnimSay, args = {leaks, "We won't let you hurt her!", SAY_SHOUT, 4000}})
   514   table.insert(endAnim, {func = AnimSay, args = {leaks, loc("We won't let you hurt her!"), SAY_SHOUT, 4000}})
   514   AddSkipFunction(endAnim, SkipEndAnimDuo, {})
   515   AddSkipFunction(endAnim, SkipEndAnimDuo, {})
   515   
   516   
   516   table.insert(endFailAnim, {func = AnimCaption, args = {leaks, "Leaks A Lot, depressed for killing his loved one, failed to save the village...", 3000}})
   517   table.insert(endFailAnim, {func = AnimCaption, args = {leaks, loc("Leaks A Lot, depressed for killing his loved one, failed to save the village..."), 3000}})
   517 
   518 
   518   table.insert(winAnim, {func = AnimSay, args = {princess, "Thank you, oh, thank you, my heroes!", SAY_SAY, 5000}})
   519   table.insert(winAnim, {func = AnimSay, args = {princess, loc("Thank you, oh, thank you, my heroes!"), SAY_SAY, 5000}})
   519   table.insert(winAnim, {func = AnimSay, args = {princess, "How can I ever repay you for saving my life?", SAY_SAY, 6000}})
   520   table.insert(winAnim, {func = AnimSay, args = {princess, loc("How can I ever repay you for saving my life?"), SAY_SAY, 6000}})
   520   table.insert(winAnim, {func = AnimSay, args = {leaks, "There's nothing more satisfying to us than seeing you share your beauty with the world every morning, my princess!", SAY_SAY, 10000}})
   521   table.insert(winAnim, {func = AnimSay, args = {leaks, loc("There's nothing more satisfying to us than seeing you share your beauty with the world every morning, my princess!"), SAY_SAY, 10000}})
   521   table.insert(winAnim, {func = AnimSay, args = {leaks, "Let's go home!", SAY_SAY, 3000}})
   522   table.insert(winAnim, {func = AnimSay, args = {leaks, loc("Let's go home!"), SAY_SAY, 3000}})
   522   table.insert(winAnim, {func = AnimCaption, args = {leaks, "And so they discovered that cyborgs weren't invulnerable...", 2000}})
   523   table.insert(winAnim, {func = AnimCaption, args = {leaks, loc("And so they discovered that cyborgs weren't invulnerable..."), 2000}})
   523 
   524 
   524   startAnim = startAnimAL
   525   startAnim = startAnimAL
   525   pastFlowerAnim = pastFlowerAnimAL
   526   pastFlowerAnim = pastFlowerAnimAL
   526   outPitAnim = outPitAnimAL
   527   outPitAnim = outPitAnimAL
   527 end
   528 end
   528 
   529 
   529 function SetupAnimRefusedLived()
   530 function SetupAnimRefusedLived()
   530   table.insert(startAnimRL, {func = AnimWait, args = {leaks, 3000}})
   531   table.insert(startAnimRL, {func = AnimWait, args = {leaks, 3000}})
   531   table.insert(startAnimRL, {func = AnimCustomFunction, args = {dense, CondNeedToTurn, {leaks, dense}}})
   532   table.insert(startAnimRL, {func = AnimCustomFunction, args = {dense, CondNeedToTurn, {leaks, dense}}})
   532   table.insert(startAnimRL, {func = AnimSay, args = {leaks, "All right, we just need to get to the other side of the island!", SAY_SAY, 7000}})
   533   table.insert(startAnimRL, {func = AnimSay, args = {leaks, loc("All right, we just need to get to the other side of the island!"), SAY_SAY, 7000}})
   533   table.insert(startAnimRL, {func = AnimSay, args = {dense, "Dude, can you see Ramon and Spiky?", SAY_SAY, 5000}})
   534   table.insert(startAnimRL, {func = AnimSay, args = {dense, loc("Dude, can you see Ramon and Spiky?"), SAY_SAY, 5000}})
   534   table.insert(startAnimRL, {func = AnimSay, args = {leaks, "No...I wonder where they disappeared?!", SAY_SAY, 5000}})
   535   table.insert(startAnimRL, {func = AnimSay, args = {leaks, loc("No...I wonder where they disappeared?!"), SAY_SAY, 5000}})
   535   AddSkipFunction(startAnimRL, SkipStartAnim, {})
   536   AddSkipFunction(startAnimRL, SkipStartAnim, {})
   536 
   537 
   537   table.insert(pastFlowerAnimRL, {func = AnimCustomFunction, args = {dense, RestoreCyborgOnly, {unpack(startCyborgPosDuo)}}, swh = false})
   538   table.insert(pastFlowerAnimRL, {func = AnimCustomFunction, args = {dense, RestoreCyborgOnly, {unpack(startCyborgPosDuo)}}, swh = false})
   538   table.insert(pastFlowerAnimRL, {func = AnimTurn, args = {cyborg, "Right"}})
   539   table.insert(pastFlowerAnimRL, {func = AnimTurn, args = {cyborg, "Right"}})
   539   table.insert(pastFlowerAnimRL, {func = AnimSay, args = {cyborg, "Well, well! Isn't that the cutest thing you've ever seen?", SAY_SAY, 7000}})
   540   table.insert(pastFlowerAnimRL, {func = AnimSay, args = {cyborg, loc("Well, well! Isn't that the cutest thing you've ever seen?"), SAY_SAY, 7000}})
   540   table.insert(pastFlowerAnimRL, {func = AnimSay, args = {cyborg, "Two little hogs cooperating, getting past obstacles...", SAY_SAY, 7000}})
   541   table.insert(pastFlowerAnimRL, {func = AnimSay, args = {cyborg, loc("Two little hogs cooperating, getting past obstacles..."), SAY_SAY, 7000}})
   541   table.insert(pastFlowerAnimRL, {func = AnimSay, args = {cyborg, "Let me test your skills a little, will you?", SAY_SAY, 6000}})
   542   table.insert(pastFlowerAnimRL, {func = AnimSay, args = {cyborg, loc("Let me test your skills a little, will you?"), SAY_SAY, 6000}})
   542   table.insert(pastFlowerAnimRL, {func = AnimTeleportGear, args = {cyborg, 2456, 1842}})
   543   table.insert(pastFlowerAnimRL, {func = AnimTeleportGear, args = {cyborg, 2456, 1842}})
   543   table.insert(pastFlowerAnimRL, {func = AnimTeleportGear, args = {dense, 2656, 1842}})
   544   table.insert(pastFlowerAnimRL, {func = AnimTeleportGear, args = {dense, 2656, 1842}})
   544   table.insert(pastFlowerAnimRL, {func = AnimCustomFunction, args = {dense, CondNeedToTurn, {cyborg, dense}}})
   545   table.insert(pastFlowerAnimRL, {func = AnimCustomFunction, args = {dense, CondNeedToTurn, {cyborg, dense}}})
   545   table.insert(pastFlowerAnimRL, {func = AnimSay, args = {dense, "Why are you doing this?", SAY_SAY, 4000}})
   546   table.insert(pastFlowerAnimRL, {func = AnimSay, args = {dense, loc("Why are you doing this?"), SAY_SAY, 4000}})
   546   table.insert(pastFlowerAnimRL, {func = AnimSay, args = {cyborg, "You couldn't possibly believe that after refusing my offer I'd just let you go!", SAY_SAY, 9000}})
   547   table.insert(pastFlowerAnimRL, {func = AnimSay, args = {cyborg, loc("You couldn't possibly believe that after refusing my offer I'd just let you go!"), SAY_SAY, 9000}})
   547   table.insert(pastFlowerAnimRL, {func = AnimSay, args = {cyborg, "You're funny!", SAY_SAY, 4000}})
   548   table.insert(pastFlowerAnimRL, {func = AnimSay, args = {cyborg, loc("You're funny!"), SAY_SAY, 4000}})
   548   table.insert(pastFlowerAnimRL, {func = AnimSwitchHog, args = {dense}})
   549   table.insert(pastFlowerAnimRL, {func = AnimSwitchHog, args = {dense}})
   549   table.insert(pastFlowerAnimRL, {func = AnimDisappear, swh = false, args = {cyborg, 3781, 1583}})
   550   table.insert(pastFlowerAnimRL, {func = AnimDisappear, swh = false, args = {cyborg, 3781, 1583}})
   550   table.insert(pastFlowerAnimRL, {func = AnimCustomFunction, swh = false, args = {cyborg, HideCyborgOnly, {}}})
   551   table.insert(pastFlowerAnimRL, {func = AnimCustomFunction, swh = false, args = {cyborg, HideCyborgOnly, {}}})
   551   AddSkipFunction(pastFlowerAnimRL, SkipPastFlowerAnim, {})
   552   AddSkipFunction(pastFlowerAnimRL, SkipPastFlowerAnim, {})
   552 
   553 
   553   table.insert(outPitAnimRL, {func = AnimCustomFunction, args = {dense, RestoreCyborgOnly, {unpack(midCyborgPosDuo)}}, swh = false})
   554   table.insert(outPitAnimRL, {func = AnimCustomFunction, args = {dense, RestoreCyborgOnly, {unpack(midCyborgPosDuo)}}, swh = false})
   554   table.insert(outPitAnimRL, {func = AnimTurn, args = {cyborg, "Right"}})
   555   table.insert(outPitAnimRL, {func = AnimTurn, args = {cyborg, "Right"}})
   555   table.insert(outPitAnimRL, {func = AnimTeleportGear, args = {dense, unpack(midDensePosDuo)}})
   556   table.insert(outPitAnimRL, {func = AnimTeleportGear, args = {dense, unpack(midDensePosDuo)}})
   556   table.insert(outPitAnimRL, {func = AnimSay, args = {dense, "OH, COME ON!", SAY_SHOUT, 3000}})
   557   table.insert(outPitAnimRL, {func = AnimSay, args = {dense, loc("OH, COME ON!"), SAY_SHOUT, 3000}})
   557   table.insert(outPitAnimRL, {func = AnimSay, args = {cyborg, "Let's see what your comrade does now!", SAY_SAY, 5000}})
   558   table.insert(outPitAnimRL, {func = AnimSay, args = {cyborg, loc("Let's see what your comrade does now!"), SAY_SAY, 5000}})
   558   table.insert(outPitAnimRL, {func = AnimSwitchHog, args = {dense}})
   559   table.insert(outPitAnimRL, {func = AnimSwitchHog, args = {dense}})
   559   table.insert(outPitAnimRL, {func = AnimDisappear, swh = false, args = {cyborg, 3781, 1583}})
   560   table.insert(outPitAnimRL, {func = AnimDisappear, swh = false, args = {cyborg, 3781, 1583}})
   560   table.insert(outPitAnimRL, {func = AnimCustomFunction, swh = false, args = {cyborg, HideCyborgOnly, {}}})
   561   table.insert(outPitAnimRL, {func = AnimCustomFunction, swh = false, args = {cyborg, HideCyborgOnly, {}}})
   561   AddSkipFunction(outPitAnimRL, SkipOutPitAnim, {})
   562   AddSkipFunction(outPitAnimRL, SkipOutPitAnim, {})
   562 
   563 
   565   table.insert(endAnim, {func = AnimTeleportGear, args = {dense, 835, 1519}})
   566   table.insert(endAnim, {func = AnimTeleportGear, args = {dense, 835, 1519}})
   566   table.insert(endAnim, {func = AnimTurn, swh = false, args = {leaks, "Left"}})
   567   table.insert(endAnim, {func = AnimTurn, swh = false, args = {leaks, "Left"}})
   567   table.insert(endAnim, {func = AnimTurn, swh = false, args = {dense, "Left"}})
   568   table.insert(endAnim, {func = AnimTurn, swh = false, args = {dense, "Left"}})
   568   table.insert(endAnim, {func = AnimTurn, swh = false, args = {cyborg, "Right"}})
   569   table.insert(endAnim, {func = AnimTurn, swh = false, args = {cyborg, "Right"}})
   569   table.insert(endAnim, {func = AnimTurn, swh = false, args = {princess, "Right"}})
   570   table.insert(endAnim, {func = AnimTurn, swh = false, args = {princess, "Right"}})
   570   table.insert(endAnim, {func = AnimSay, args = {princess, "Help me, please!", SAY_SHOUT, 3000}})
   571   table.insert(endAnim, {func = AnimSay, args = {princess, loc("Help me, please!"), SAY_SHOUT, 3000}})
   571   table.insert(endAnim, {func = AnimSay, args = {leaks, "What are you doing? Let her go!", SAY_SHOUT, 5000}})
   572   table.insert(endAnim, {func = AnimSay, args = {leaks, loc("What are you doing? Let her go!"), SAY_SHOUT, 5000}})
   572   table.insert(endAnim, {func = AnimSay, args = {cyborg, "Yeah? Watcha gonna do? Cry?", SAY_SHOUT, 5000}})
   573   table.insert(endAnim, {func = AnimSay, args = {cyborg, loc("Yeah? Watcha gonna do? Cry?"), SAY_SHOUT, 5000}})
   573   table.insert(endAnim, {func = AnimSay, args = {leaks, "We won't let you hurt her!", SAY_SHOUT, 4000}})
   574   table.insert(endAnim, {func = AnimSay, args = {leaks, loc("We won't let you hurt her!"), SAY_SHOUT, 4000}})
   574   AddSkipFunction(endAnim, SkipEndAnimDuo, {})
   575   AddSkipFunction(endAnim, SkipEndAnimDuo, {})
   575   
   576   
   576   table.insert(endFailAnim, {func = AnimCaption, args = {leaks, "Leaks A Lot, depressed for killing his loved one, failed to save the village...", 3000}})
   577   table.insert(endFailAnim, {func = AnimCaption, args = {leaks, loc("Leaks A Lot, depressed for killing his loved one, failed to save the village..."), 3000}})
   577 
   578 
   578   table.insert(winAnim, {func = AnimSay, args = {princess, "Thank you, oh, thank you, my heroes!", SAY_SAY, 5000}})
   579   table.insert(winAnim, {func = AnimSay, args = {princess, loc("Thank you, oh, thank you, my heroes!"), SAY_SAY, 5000}})
   579   table.insert(winAnim, {func = AnimSay, args = {princess, "How can I ever repay you for saving my life?", SAY_SAY, 6000}})
   580   table.insert(winAnim, {func = AnimSay, args = {princess, loc("How can I ever repay you for saving my life?"), SAY_SAY, 6000}})
   580   table.insert(winAnim, {func = AnimSay, args = {leaks, "There's nothing more satisfying to us than seeing you share your beauty with the world every morning, my princess!", SAY_SAY, 10000}})
   581   table.insert(winAnim, {func = AnimSay, args = {leaks, loc("There's nothing more satisfying to us than seeing you share your beauty with the world every morning, my princess!"), SAY_SAY, 10000}})
   581   table.insert(winAnim, {func = AnimSay, args = {leaks, "Let's go home!", SAY_SAY, 3000}})
   582   table.insert(winAnim, {func = AnimSay, args = {leaks, loc("Let's go home!"), SAY_SAY, 3000}})
   582   table.insert(winAnim, {func = AnimCaption, args = {leaks, "And so they discovered that cyborgs weren't invulnerable...", 2000}})
   583   table.insert(winAnim, {func = AnimCaption, args = {leaks, loc("And so they discovered that cyborgs weren't invulnerable..."), 2000}})
   583 
   584 
   584   startAnim = startAnimRL
   585   startAnim = startAnimRL
   585   pastFlowerAnim = pastFlowerAnimRL
   586   pastFlowerAnim = pastFlowerAnimRL
   586   outPitAnim = outPitAnimRL
   587   outPitAnim = outPitAnimRL
   587 end
   588 end
   588 
   589 
   589 function KillPrincess()
   590 function KillPrincess()
   590   ParseCommand("teamgone Cannibal Sentry")
   591   ParseCommand("teamgone " .. loc("Cannibal Sentry"))
   591   TurnTimeLeft = 0
   592   TurnTimeLeft = 0
   592 end
   593 end
   593 --/////////////////////////////Misc Functions////////////////////////
   594 --/////////////////////////////Misc Functions////////////////////////
   594 
   595 
   595 function CondNeedToTurn(hog1, hog2)
   596 function CondNeedToTurn(hog1, hog2)
   801 function CheckLeaksDead()
   802 function CheckLeaksDead()
   802   return leaksDead
   803   return leaksDead
   803 end
   804 end
   804 
   805 
   805 function DoLeaksDead()
   806 function DoLeaksDead()
   806   AddCaption("The village, unprepared, was destroyed by the cyborgs...")
   807   AddCaption(loc("The village, unprepared, was destroyed by the cyborgs..."))
   807   ParseCommand("teamgone Natives")
   808   ParseCommand("teamgone ", .. loc("Natives"))
   808 end
   809 end
   809 
   810 
   810 function CheckDenseDead()
   811 function CheckDenseDead()
   811   return denseDead
   812   return denseDead
   812 end
   813 end
   813 
   814 
   814 function DoDenseDead()
   815 function DoDenseDead()
   815   AddCaption("The village, unprepared, was destroyed by the cyborgs...")
   816   AddCaption(loc("The village, unprepared, was destroyed by the cyborgs..."))
   816   ParseCommand("teamgone Natives")
   817   ParseCommand("teamgone ", .. loc("Natives"))
   817 end
   818 end
   818 
   819 
   819 function CheckTookBlowTorch()
   820 function CheckTookBlowTorch()
   820   return blowTaken
   821   return blowTaken
   821 end
   822 end
   822 
   823 
   823 function DoTookBlowTorch()
   824 function DoTookBlowTorch()
   824   ShowMission("The Journey Back", "The Tunnel Maker", "Hint: Select the BlowTorch, aim and press [Fire]. Press [Fire] again to stop.|Don't blow up the crate.", 0, 6000)
   825   ShowMission(loc("The Journey Back"), loc("The Tunnel Maker"), loc("Hint: Select the BlowTorch, aim and press [Fire]. Press [Fire] again to stop.|Don't blow up the crate."), 0, 6000)
   825 end
   826 end
   826 
   827 
   827 function CheckTookLowGravity()
   828 function CheckTookLowGravity()
   828   return gravityTaken
   829   return gravityTaken
   829 end
   830 end
   830 
   831 
   831 function DoTookLowGravity()
   832 function DoTookLowGravity()
   832   ShowMission("The Journey Back", "The Moonwalk", "Hint: Select the LowGravity and press [Fire].", 0, 6000)
   833   ShowMission(loc("The Journey Back"), loc("The Moonwalk"), loc("Hint: Select the LowGravity and press [Fire]."), 0, 6000)
   833 end
   834 end
   834 
   835 
   835 function CheckOnBridge()
   836 function CheckOnBridge()
   836   return leaksDead == false and GetX(leaks) < 1651 and StoppedGear(leaks)
   837   return leaksDead == false and GetX(leaks) < 1651 and StoppedGear(leaks)
   837 end
   838 end
   854   return leaksDead == false and GetX(leaks) < 1160 and StoppedGear(leaks)
   855   return leaksDead == false and GetX(leaks) < 1160 and StoppedGear(leaks)
   855 end
   856 end
   856 
   857 
   857 function DoOnFirstGirder()
   858 function DoOnFirstGirder()
   858   PlaceCourseMines()
   859   PlaceCourseMines()
   859   ShowMission("The Journey Back", "Slippery", "You'd better watch your steps...", 0, 4000)
   860   ShowMission(loc("The Journey Back"), loc("Slippery"), loc("You'd better watch your steps..."), 0, 4000)
   860 end
   861 end
   861 
   862 
   862 function CheckTookSniper()
   863 function CheckTookSniper()
   863   return sniperTaken and StoppedGear(leaks)
   864   return sniperTaken and StoppedGear(leaks)
   864 end
   865 end
   881   return princessDead
   882   return princessDead
   882 end
   883 end
   883 
   884 
   884 function DoLost()
   885 function DoLost()
   885   AddAnim(endFailAnim)
   886   AddAnim(endFailAnim)
   886   AddFunction({func = ParseCommand, args = {'teamgone Natives'}})
   887   AddFunction({func = ParseCommand, args = {'teamgone ' .. loc('Natives')}})
   887 end
   888 end
   888 
   889 
   889 function CheckWon()
   890 function CheckWon()
   890   return cyborgDead and not princessDead
   891   return cyborgDead and not princessDead
   891 end
   892 end
   896   AddFunction({func = FinishWon, args = {}})
   897   AddFunction({func = FinishWon, args = {}})
   897 end
   898 end
   898 
   899 
   899 function FinishWon()
   900 function FinishWon()
   900   SwitchHog(leaks)
   901   SwitchHog(leaks)
   901   ParseCommand("teamgone Cannibal Sentry")
   902   ParseCommand("teamgone " .. loc("Cannibal Sentry"))
   902   ParseCommand("teamgone 011101001")
   903   ParseCommand("teamgone " .. loc("011101001"))
   903   TurnTimeLeft = 0
   904   TurnTimeLeft = 0
   904 end
   905 end
   905 
   906 
   906 function CheckFailedCourse()
   907 function CheckFailedCourse()
   907   return TurnsLeft == 0
   908   return TurnsLeft == 0
   926 	Delay = 5
   927 	Delay = 5
   927 	MapGen = 0
   928 	MapGen = 0
   928 	Theme = "Nature"
   929 	Theme = "Nature"
   929   SuddenDeathTurns = 3000
   930   SuddenDeathTurns = 3000
   930 
   931 
   931 	AddTeam("Natives", 2567585, "Bone", "Island", "HillBilly", "cm_birdy")
   932 	AddTeam(loc("Natives"), 29439, "Bone", "Island", "HillBilly", "cm_birdy")
   932 	leaks = AddHog("Leaks A Lot", 0, 100, "Rambo")
   933 	leaks = AddHog(loc("Leaks A Lot"), 0, 100, "Rambo")
   933   dense = AddHog("Dense Cloud", 0, 100, "RobinHood")
   934   dense = AddHog(loc("Dense Cloud"), 0, 100, "RobinHood")
   934 
   935 
   935   AddTeam("Cannibal Sentry", 14483456, "Skull", "Island", "Pirate","cm_vampire")
   936   AddTeam(loc("Cannibal Sentry"), 14483456, "Skull", "Island", "Pirate","cm_vampire")
   936   cannibals = {}
   937   cannibals = {}
   937   for i = 1, 4 do
   938   for i = 1, 4 do
   938     cannibals[i] = AddHog(cannibalNames[i], 3, 40, "Zombi")
   939     cannibals[i] = AddHog(cannibalNames[i], 3, 40, "Zombi")
   939     SetGearPosition(cannibals[i], unpack(cannibalPos[i]))
   940     SetGearPosition(cannibals[i], unpack(cannibalPos[i]))
   940   end
   941   end
   942   for i = 5, 8 do
   943   for i = 5, 8 do
   943     cannibals[i] = AddHog(cannibalNames[i], 3, 40, "Zombi")
   944     cannibals[i] = AddHog(cannibalNames[i], 3, 40, "Zombi")
   944     SetGearPosition(cannibals[i], 0, 0)
   945     SetGearPosition(cannibals[i], 0, 0)
   945   end
   946   end
   946 
   947 
   947   AddTeam("011101001", 14483456, "ring", "UFO", "Robot", "cm_star")
   948   AddTeam(loc("011101001"), 14483456, "ring", "UFO", "Robot", "cm_star")
   948   cyborg = AddHog("Y3K1337", 0, 200, "cyborg1")
   949   cyborg = AddHog(loc("Y3K1337"), 0, 200, "cyborg1")
   949   princess = AddHog("Fell From Heaven", 0, 200, "tiara")
   950   princess = AddHog(loc("Fell From Heaven"), 0, 200, "tiara")
   950 
   951 
   951   SetGearPosition(dense, 0, 0)
   952   SetGearPosition(dense, 0, 0)
   952   SetGearPosition(leaks, 0, 0)
   953   SetGearPosition(leaks, 0, 0)
   953   SetGearPosition(cyborg, 0, 0)
   954   SetGearPosition(cyborg, 0, 0)
   954   SetGearPosition(princess, 0, 0)
   955   SetGearPosition(princess, 0, 0)
  1029     TurnTimeLeft = -1
  1030     TurnTimeLeft = -1
  1030   elseif stage == endStage and CurrentHedgehog ~= leaks then
  1031   elseif stage == endStage and CurrentHedgehog ~= leaks then
  1031     AnimSwitchHog(leaks)
  1032     AnimSwitchHog(leaks)
  1032     SetGearMessage(leaks, 0)
  1033     SetGearMessage(leaks, 0)
  1033     TurnTimeLeft = -1
  1034     TurnTimeLeft = -1
  1034   elseif GetHogTeamName(CurrentHedgehog) ~= "Natives" then
  1035   elseif GetHogTeamName(CurrentHedgehog) ~= loc("Natives") then
  1035     for i = 1, 4 do
  1036     for i = 1, 4 do
  1036       if cannibalDead[i] ~= true then
  1037       if cannibalDead[i] ~= true then
  1037         if GetX(cannibals[i]) < GetX(leaks) then
  1038         if GetX(cannibals[i]) < GetX(leaks) then
  1038           HogTurnLeft(cannibals[i], false)
  1039           HogTurnLeft(cannibals[i], false)
  1039         else
  1040         else