share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/shadow.lua
changeset 7225 e3f2280d9000
parent 7213 fce7de71742f
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 startStage = 0
     5 startStage = 0
     5 spyStage = 1
     6 spyStage = 1
    26 
    27 
    27 choiceAccept = 1
    28 choiceAccept = 1
    28 choiceRefuse = 2
    29 choiceRefuse = 2
    29 choiceAttack = 3
    30 choiceAttack = 3
    30 
    31 
    31 HogNames = {"Brainiac", "Corpsemonger", "Femur Lover", "Glark", "Bonely", "Rot Molester", "Bloodrocutor", "Muscle Dissolver", "Bloodsucker"}
    32 HogNames = {loc("Brainiac"), loc("Corpsemonger"), loc("Femur Lover"), loc("Glark"), loc("Bonely"), loc("Rot Molester"), loc("Bloodrocutor"), loc("Muscle Dissolver"), loc("Bloodsucker")}
    32 
    33 
    33 ---POSITIONS---
    34 ---POSITIONS---
    34 
    35 
    35 cannibalPos = {{3108, 1127}, 
    36 cannibalPos = {{3108, 1127}, 
    36                {2559, 1080}, {3598, 1270}, {3293, 1177}, {2623, 1336}, 
    37                {2559, 1080}, {3598, 1270}, {3293, 1177}, {2623, 1336}, 
    86 function AfterRefusedAnim()
    87 function AfterRefusedAnim()
    87   SpawnUtilityCrate(2045, 1575, amSwitch)
    88   SpawnUtilityCrate(2045, 1575, amSwitch)
    88   SpawnUtilityCrate(2365, 1495, amShotgun)
    89   SpawnUtilityCrate(2365, 1495, amShotgun)
    89   SpawnUtilityCrate(2495, 1519, amGrenade)
    90   SpawnUtilityCrate(2495, 1519, amGrenade)
    90   SpawnUtilityCrate(2620, 1524, amRope)
    91   SpawnUtilityCrate(2620, 1524, amRope)
    91   ShowMission("The Shadow Falls", "The Showdown", "Save Leaks A Lot!|Hint: The Switch utility might be of help to you.", 1, 6000)
    92   ShowMission(loc("The Shadow Falls"), loc("The Showdown"), loc("Save Leaks A Lot!|Hint: The Switch utility might be of help to you."), 1, 6000)
    92   RemoveEventFunc(CheckDenseDead)
    93   RemoveEventFunc(CheckDenseDead)
    93   AddEvent(CheckStronglingsDead, {}, DoStronglingsDeadRefused, {}, 0)
    94   AddEvent(CheckStronglingsDead, {}, DoStronglingsDeadRefused, {}, 0)
    94   AddAmmo(cannibals[6], amGrenade, 5)
    95   AddAmmo(cannibals[6], amGrenade, 5)
    95   stage = ramonStage
    96   stage = ramonStage
    96   SwitchHog(cannibals[9])
    97   SwitchHog(cannibals[9])
   109   SetGearPosition(spiky, 2400, 1675)
   110   SetGearPosition(spiky, 2400, 1675)
   110 end
   111 end
   111 
   112 
   112 function AfterStartDialogue()
   113 function AfterStartDialogue()
   113   stage = spyStage
   114   stage = spyStage
   114   ShowMission("The Shadow Falls", "Play with me!", "Defend yourself!|Hint: You can get tips on using weapons by moving your mouse over them in the weapon selection menu", 1, 6000)
   115   ShowMission(loc("The Shadow Falls"), loc("Play with me!"), loc("Defend yourself!|Hint: You can get tips on using weapons by moving your mouse over them in the weapon selection menu"), 1, 6000)
   115   TurnTimeLeft = TurnTime
   116   TurnTimeLeft = TurnTime
   116 end
   117 end
   117 
   118 
   118 
   119 
   119 function StartSkipFunc()
   120 function StartSkipFunc()
   133   stage = wave1Stage
   134   stage = wave1Stage
   134   SwitchHog(dense)
   135   SwitchHog(dense)
   135   SetGearMessage(dense, 0)
   136   SetGearMessage(dense, 0)
   136   SetGearMessage(leaks, 0)
   137   SetGearMessage(leaks, 0)
   137   TurnTimeLeft = TurnTime
   138   TurnTimeLeft = TurnTime
   138   ShowMission("The Shadow Falls", "Why do you not like me?", "Obliterate them!|Hint: You might want to take cover...", 1, 6000)
   139   ShowMission(loc("The Shadow Falls"), loc("Why do you not like me?"), loc("Obliterate them!|Hint: You might want to take cover..."), 1, 6000)
   139 end
   140 end
   140 
   141 
   141 function SkipWeaklingsAnim()
   142 function SkipWeaklingsAnim()
   142   for i = 2, 5 do
   143   for i = 2, 5 do
   143     if isHidden[cannibals[i]] == true then
   144     if isHidden[cannibals[i]] == true then
   151 end
   152 end
   152 
   153 
   153 function AfterStronglingsAnim()
   154 function AfterStronglingsAnim()
   154   stage = cyborgStage
   155   stage = cyborgStage
   155   TurnTimeLeft = 0
   156   TurnTimeLeft = 0
   156   ShowMission("The Shadow Falls", "The Dilemma", "Choose your side! If you want to join the strange man, walk up to him.|Otherwise, walk away from him. If you decide to att...nevermind...", 1, 8000)
   157   ShowMission(loc("The Shadow Falls"), loc("The Dilemma"), loc("Choose your side! If you want to join the strange man, walk up to him.|Otherwise, walk away from him. If you decide to att...nevermind..."), 1, 8000)
   157   AddEvent(CheckChoice, {}, DoChoice, {}, 0)
   158   AddEvent(CheckChoice, {}, DoChoice, {}, 0)
   158   AddEvent(CheckRefuse, {}, DoRefuse, {}, 0)
   159   AddEvent(CheckRefuse, {}, DoRefuse, {}, 0)
   159   AddEvent(CheckAccept, {}, DoAccept, {}, 0)
   160   AddEvent(CheckAccept, {}, DoAccept, {}, 0)
   160   AddEvent(CheckConfront, {}, DoConfront, {}, 0)
   161   AddEvent(CheckConfront, {}, DoConfront, {}, 0)
   161   AddAmmo(dense, amSwitch, 0)
   162   AddAmmo(dense, amSwitch, 0)
   190 function RestartReturnAccepted()
   191 function RestartReturnAccepted()
   191   retryReturn = false
   192   retryReturn = false
   192   SetGearPosition(dense, 1350, 1310)
   193   SetGearPosition(dense, 1350, 1310)
   193   AddAmmo(dense, amGirder, 2)
   194   AddAmmo(dense, amGirder, 2)
   194   AddAmmo(dense, amParachute, 2)
   195   AddAmmo(dense, amParachute, 2)
   195   ShowMission("The Shadow Falls", "The walk of Fame", "Return to Leaks A Lot! If you get stuck, press [Precise] to try again!", 1, 6000)
   196   ShowMission(loc("The Shadow Falls"), loc("The walk of Fame"), loc("Return to Leaks A Lot! If you get stuck, press [Precise] to try again!"), 1, 6000)
   196   RemoveEventFunc(CheckNeedGirder)
   197   RemoveEventFunc(CheckNeedGirder)
   197   RemoveEventFunc(CheckNeedWeapons)
   198   RemoveEventFunc(CheckNeedWeapons)
   198   AddEvent(CheckNeedGirder, {}, DoNeedGirder, {}, 0)
   199   AddEvent(CheckNeedGirder, {}, DoNeedGirder, {}, 0)
   199   AddEvent(CheckNeedWeapons, {}, DoNeedWeapons, {}, 0)
   200   AddEvent(CheckNeedWeapons, {}, DoNeedWeapons, {}, 0)
   200 end
   201 end
   202 
   203 
   203 function AfterAcceptedAnim()
   204 function AfterAcceptedAnim()
   204   stage = acceptedReturnStage
   205   stage = acceptedReturnStage
   205   SpawnAmmoCrate(1300, 810, amGirder)
   206   SpawnAmmoCrate(1300, 810, amGirder)
   206   SpawnAmmoCrate(1300, 810 - 60, amParachute)
   207   SpawnAmmoCrate(1300, 810 - 60, amParachute)
   207   ShowMission("The Shadow Falls", "The walk of Fame", "Return to Leaks A Lot! If you get stuck, press [Precise] to try again!", 1, 6000)
   208   ShowMission(loc("The Shadow Falls"), loc("The walk of Fame"), loc("Return to Leaks A Lot! If you get stuck, press [Precise] to try again!"), 1, 6000)
   208   HideHog(cyborg)
   209   HideHog(cyborg)
   209   AddEvent(CheckTookWeapons, {}, DoTookWeapons, {}, 0)
   210   AddEvent(CheckTookWeapons, {}, DoTookWeapons, {}, 0)
   210   AddEvent(CheckNeedGirder, {}, DoNeedGirder, {}, 0)
   211   AddEvent(CheckNeedGirder, {}, DoNeedGirder, {}, 0)
   211   AddEvent(CheckNeedWeapons, {}, DoNeedWeapons, {}, 0)
   212   AddEvent(CheckNeedWeapons, {}, DoNeedWeapons, {}, 0)
   212   AddEvent(CheckRestartReturnAccepted, {}, RestartReturnAccepted, {}, 1)
   213   AddEvent(CheckRestartReturnAccepted, {}, RestartReturnAccepted, {}, 1)
   221 end
   222 end
   222 
   223 
   223 function AfterAttackedAnim()
   224 function AfterAttackedAnim()
   224   stage = aloneStage
   225   stage = aloneStage
   225   HideHog(cyborg)
   226   HideHog(cyborg)
   226   ShowMission("The Shadow Falls", "The Individualist", "Defeat the cannibals!|Grenade hint: set the timer with [1-5], aim with [Up]/[Down] and hold [Space] to set power", 1, 8000)
   227   ShowMission(loc("The Shadow Falls"), loc("The Individualist"), loc("Defeat the cannibals!|Grenade hint: set the timer with [1-5], aim with [Up]/[Down] and hold [Space] to set power"), 1, 8000)
   227   AddAmmo(cannibals[6], amGrenade, 5)
   228   AddAmmo(cannibals[6], amGrenade, 5)
   228   AddAmmo(cannibals[6], amFirePunch, 0)
   229   AddAmmo(cannibals[6], amFirePunch, 0)
   229   AddAmmo(cannibals[6], amBaseballBat, 0)
   230   AddAmmo(cannibals[6], amBaseballBat, 0)
   230   SetGearMessage(leaks, 0)
   231   SetGearMessage(leaks, 0)
   231   TurnTimeLeft = TurnTime
   232   TurnTimeLeft = TurnTime
   287   AnimInsertStepNext({func = AnimVisualGear, args = {dense, GetX(dense) - 20, GetY(dense), vgtExplosion, 0, true}, swh = false})
   288   AnimInsertStepNext({func = AnimVisualGear, args = {dense, GetX(dense) - 20, GetY(dense), vgtExplosion, 0, true}, swh = false})
   288 end
   289 end
   289 
   290 
   290 function SetupAcceptedSurvivedFinalAnim()
   291 function SetupAcceptedSurvivedFinalAnim()
   291   table.insert(acceptedSurvivedFinalAnim, {func = AnimCustomFunction, args = {dense, CondNeedToTurn, {leaks, dense}}})
   292   table.insert(acceptedSurvivedFinalAnim, {func = AnimCustomFunction, args = {dense, CondNeedToTurn, {leaks, dense}}})
   292   table.insert(acceptedSurvivedFinalAnim, {func = AnimSay, args = {leaks, "Pfew! That was close!", SAY_SAY, 3000}})
   293   table.insert(acceptedSurvivedFinalAnim, {func = AnimSay, args = {leaks, loc("Pfew! That was close!"), SAY_SAY, 3000}})
   293   if grenadeUsed and shotgunUsed then
   294   if grenadeUsed and shotgunUsed then
   294     table.insert(acceptedSurvivedFinalAnim, {func = AnimSay, args = {leaks, "Where did you get the exploding apples and the magic bow that shoots many arrows?", SAY_SAY, 9000}})
   295     table.insert(acceptedSurvivedFinalAnim, {func = AnimSay, args = {leaks, loc("Where did you get the exploding apples and the magic bow that shoots many arrows?"), SAY_SAY, 9000}})
   295   elseif grenadeUsed then
   296   elseif grenadeUsed then
   296     table.insert(acceptedSurvivedFinalAnim, {func = AnimSay, args = {leaks, "Where did you get the exploding apples?", SAY_SAY, 6000}})
   297     table.insert(acceptedSurvivedFinalAnim, {func = AnimSay, args = {leaks, loc("Where did you get the exploding apples?"), SAY_SAY, 6000}})
   297   elseif shotgunUsed then
   298   elseif shotgunUsed then
   298     table.insert(acceptedSurvivedFinalAnim, {func = AnimSay, args = {leaks, "Where did you get the magic bow that shoots many arrows?", SAY_SAY, 8000}})
   299     table.insert(acceptedSurvivedFinalAnim, {func = AnimSay, args = {leaks, loc("Where did you get the magic bow that shoots many arrows?"), SAY_SAY, 8000}})
   299   else
   300   else
   300     table.insert(acceptedSurvivedFinalAnim, {func = AnimSay, args = {leaks, "Did you warn the village?", SAY_SAY, 4000}})
   301     table.insert(acceptedSurvivedFinalAnim, {func = AnimSay, args = {leaks, loc("Did you warn the village?"), SAY_SAY, 4000}})
   301     table.insert(acceptedSurvivedFinalAnim, {func = AnimSay, args = {dense, "No, I came back to help you out...", SAY_SAY, 5000}})
   302     table.insert(acceptedSurvivedFinalAnim, {func = AnimSay, args = {dense, loc("No, I came back to help you out..."), SAY_SAY, 5000}})
   302   end
   303   end
   303   if grenadeUsed or shotgunUsed then
   304   if grenadeUsed or shotgunUsed then
   304     table.insert(acceptedSurvivedFinalAnim, {func = AnimSay, args = {dense, "Uhm...I met one of them and took his weapons.", SAY_SAY, 5000}})
   305     table.insert(acceptedSurvivedFinalAnim, {func = AnimSay, args = {dense, loc("Uhm...I met one of them and took his weapons."), SAY_SAY, 5000}})
   305   end
   306   end
   306   table.insert(acceptedSurvivedFinalAnim, {func = AnimSay, args = {dense, "We should head back to the village now.", SAY_SAY, 5000}})
   307   table.insert(acceptedSurvivedFinalAnim, {func = AnimSay, args = {dense, loc("We should head back to the village now."), SAY_SAY, 5000}})
   307 end
   308 end
   308 
   309 
   309 function AnimationSetup()
   310 function AnimationSetup()
   310   table.insert(startDialogue, {func = AnimWait, args = {dense, 4000}})
   311   table.insert(startDialogue, {func = AnimWait, args = {dense, 4000}})
   311   table.insert(startDialogue, {func = AnimCaption, args = {leaks, "After the shock caused by the enemy spy, Leaks A Lot and Dense Cloud went hunting to relax.", 6000}})
   312   table.insert(startDialogue, {func = AnimCaption, args = {leaks, loc("After the shock caused by the enemy spy, Leaks A Lot and Dense Cloud went hunting to relax."), 6000}})
   312   table.insert(startDialogue, {func = AnimCaption, args = {leaks, "Little did they know that this hunt will mark them forever...", 4000}})
   313   table.insert(startDialogue, {func = AnimCaption, args = {leaks, loc("Little did they know that this hunt will mark them forever..."), 4000}})
   313   table.insert(startDialogue, {func = AnimSay, args = {leaks, "I have no idea where that mole disappeared...Can you see it?", SAY_SAY, 9000}})
   314   table.insert(startDialogue, {func = AnimSay, args = {leaks, loc("I have no idea where that mole disappeared...Can you see it?"), SAY_SAY, 9000}})
   314   table.insert(startDialogue, {func = AnimSay, args = {dense, "Nope. It was one fast mole, that's for sure.", SAY_SAY, 5000}}) 
   315   table.insert(startDialogue, {func = AnimSay, args = {dense, loc("Nope. It was one fast mole, that's for sure."), SAY_SAY, 5000}}) 
   315   table.insert(startDialogue, {func = AnimCustomFunction, args = {dense, EmitDenseClouds, {startDialogue, "right"}}})
   316   table.insert(startDialogue, {func = AnimCustomFunction, args = {dense, EmitDenseClouds, {startDialogue, "right"}}})
   316   table.insert(startDialogue, {func = AnimWait, args = {dense, 2000}})
   317   table.insert(startDialogue, {func = AnimWait, args = {dense, 2000}})
   317   table.insert(startDialogue, {func = AnimSay, args = {leaks, "Please, stop releasing your \"smoke signals\"!", SAY_SAY, 5000}})
   318   table.insert(startDialogue, {func = AnimSay, args = {leaks, loc("Please, stop releasing your \"smoke signals\"!"), SAY_SAY, 5000}})
   318   table.insert(startDialogue, {func = AnimSay, args = {leaks, "You're terrorizing the forest...We won't catch anything like this!", SAY_SAY, 6000}})
   319   table.insert(startDialogue, {func = AnimSay, args = {leaks, loc("You're terrorizing the forest...We won't catch anything like this!"), SAY_SAY, 6000}})
   319   table.insert(startDialogue, {func = AnimSay, args = {leaks, "...", SAY_THINK, 1000}})
   320   table.insert(startDialogue, {func = AnimSay, args = {leaks, loc("..."), SAY_THINK, 1000}})
   320   table.insert(startDialogue, {func = AnimGiveState, args = {cannibals[1], 0}, swh = false})
   321   table.insert(startDialogue, {func = AnimGiveState, args = {cannibals[1], 0}, swh = false})
   321   table.insert(startDialogue, {func = AnimOutOfNowhere, args = {cannibals[1], unpack(cannibalPos[1])}, swh = false})
   322   table.insert(startDialogue, {func = AnimOutOfNowhere, args = {cannibals[1], unpack(cannibalPos[1])}, swh = false})
   322   table.insert(startDialogue, {func = AnimTurn, args = {leaks, "Right"}})
   323   table.insert(startDialogue, {func = AnimTurn, args = {leaks, "Right"}})
   323   table.insert(startDialogue, {func = AnimTurn, args = {cannibals[1], "Right"}})
   324   table.insert(startDialogue, {func = AnimTurn, args = {cannibals[1], "Right"}})
   324   table.insert(startDialogue, {func = AnimWait, args = {cannibals[1], 1000}})
   325   table.insert(startDialogue, {func = AnimWait, args = {cannibals[1], 1000}})
   325   table.insert(startDialogue, {func = AnimTurn, args = {cannibals[1], "Left"}})
   326   table.insert(startDialogue, {func = AnimTurn, args = {cannibals[1], "Left"}})
   326   table.insert(startDialogue, {func = AnimWait, args = {cannibals[1], 1000}})
   327   table.insert(startDialogue, {func = AnimWait, args = {cannibals[1], 1000}})
   327   table.insert(startDialogue, {func = AnimTurn, args = {cannibals[1], "Right"}})
   328   table.insert(startDialogue, {func = AnimTurn, args = {cannibals[1], "Right"}})
   328   table.insert(startDialogue, {func = AnimSay, args = {cannibals[1], "I can't believe it worked!", SAY_THINK, 3500}})
   329   table.insert(startDialogue, {func = AnimSay, args = {cannibals[1], loc("I can't believe it worked!"), SAY_THINK, 3500}})
   329   table.insert(startDialogue, {func = AnimSay, args = {cannibals[1], "That shaman sure knows what he/she's doing!", SAY_THINK, 6000}})
   330   table.insert(startDialogue, {func = AnimSay, args = {cannibals[1], loc("That shaman sure knows what he/she's doing!"), SAY_THINK, 6000}})
   330   table.insert(startDialogue, {func = AnimSay, args = {leaks, "It wants our brains!", SAY_SHOUT, 3000}})
   331   table.insert(startDialogue, {func = AnimSay, args = {leaks, loc("It wants our brains!"), SAY_SHOUT, 3000}})
   331   table.insert(startDialogue, {func = AnimTurn, args = {cannibals[1], "Left"}})
   332   table.insert(startDialogue, {func = AnimTurn, args = {cannibals[1], "Left"}})
   332   table.insert(startDialogue, {func = AnimSay, args = {cannibals[1], "Not you again! My head still hurts from last time!", SAY_SHOUT, 6000}})
   333   table.insert(startDialogue, {func = AnimSay, args = {cannibals[1], loc("Not you again! My head still hurts from last time!"), SAY_SHOUT, 6000}})
   333   table.insert(startDialogue, {func = AnimSwitchHog, args = {leaks}})
   334   table.insert(startDialogue, {func = AnimSwitchHog, args = {leaks}})
   334   AddSkipFunction(startDialogue, StartSkipFunc, {})
   335   AddSkipFunction(startDialogue, StartSkipFunc, {})
   335 
   336 
   336   table.insert(weaklingsAnim, {func = AnimGearWait, args = {leaks, 1000}})
   337   table.insert(weaklingsAnim, {func = AnimGearWait, args = {leaks, 1000}})
   337   table.insert(weaklingsAnim, {func = AnimCustomFunction, args = {leaks, CondNeedToTurn, {leaks, dense}}})
   338   table.insert(weaklingsAnim, {func = AnimCustomFunction, args = {leaks, CondNeedToTurn, {leaks, dense}}})
   338   table.insert(weaklingsAnim, {func = AnimSay, args = {leaks, "Did you see him coming?", SAY_SAY, 3500}})
   339   table.insert(weaklingsAnim, {func = AnimSay, args = {leaks, loc("Did you see him coming?"), SAY_SAY, 3500}})
   339   table.insert(weaklingsAnim, {func = AnimSay, args = {dense, "No. Where did he come from?", SAY_SAY, 3500}})
   340   table.insert(weaklingsAnim, {func = AnimSay, args = {dense, loc("No. Where did he come from?"), SAY_SAY, 3500}})
   340   table.insert(weaklingsAnim, {func = AnimCustomFunction, args = {leaks, UnHideWeaklings, {}}})
   341   table.insert(weaklingsAnim, {func = AnimCustomFunction, args = {leaks, UnHideWeaklings, {}}})
   341   table.insert(weaklingsAnim, {func = AnimOutOfNowhere, args = {cannibals[2], unpack(cannibalPos[2])}})
   342   table.insert(weaklingsAnim, {func = AnimOutOfNowhere, args = {cannibals[2], unpack(cannibalPos[2])}})
   342   table.insert(weaklingsAnim, {func = AnimGiveState, args = {cannibals[2], 0}})
   343   table.insert(weaklingsAnim, {func = AnimGiveState, args = {cannibals[2], 0}})
   343   table.insert(weaklingsAnim, {func = AnimWait, args = {leaks, 400}})
   344   table.insert(weaklingsAnim, {func = AnimWait, args = {leaks, 400}})
   344   table.insert(weaklingsAnim, {func = AnimGiveState, args = {cannibals[3], 0}})
   345   table.insert(weaklingsAnim, {func = AnimGiveState, args = {cannibals[3], 0}})
   348   table.insert(weaklingsAnim, {func = AnimOutOfNowhere, args = {cannibals[4], unpack(cannibalPos[4])}})
   349   table.insert(weaklingsAnim, {func = AnimOutOfNowhere, args = {cannibals[4], unpack(cannibalPos[4])}})
   349   table.insert(weaklingsAnim, {func = AnimWait, args = {leaks, 400}})
   350   table.insert(weaklingsAnim, {func = AnimWait, args = {leaks, 400}})
   350   table.insert(weaklingsAnim, {func = AnimGiveState, args = {cannibals[5], 0}})
   351   table.insert(weaklingsAnim, {func = AnimGiveState, args = {cannibals[5], 0}})
   351   table.insert(weaklingsAnim, {func = AnimOutOfNowhere, args = {cannibals[5], unpack(cannibalPos[5])}})
   352   table.insert(weaklingsAnim, {func = AnimOutOfNowhere, args = {cannibals[5], unpack(cannibalPos[5])}})
   352   table.insert(weaklingsAnim, {func = AnimWait, args = {leaks, 400}})
   353   table.insert(weaklingsAnim, {func = AnimWait, args = {leaks, 400}})
   353   table.insert(weaklingsAnim, {func = AnimSay, args = {cannibals[3], "Are we there yet?", SAY_SAY, 4000}}) 
   354   table.insert(weaklingsAnim, {func = AnimSay, args = {cannibals[3], loc("Are we there yet?"), SAY_SAY, 4000}}) 
   354   table.insert(weaklingsAnim, {func = AnimSay, args = {dense, "This must be some kind of sorcery!", SAY_SHOUT, 3500}})
   355   table.insert(weaklingsAnim, {func = AnimSay, args = {dense, loc("This must be some kind of sorcery!"), SAY_SHOUT, 3500}})
   355   table.insert(weaklingsAnim, {func = AnimSwitchHog, args = {leaks}})
   356   table.insert(weaklingsAnim, {func = AnimSwitchHog, args = {leaks}})
   356   AddSkipFunction(weaklingsAnim, SkipWeaklingsAnim, {})
   357   AddSkipFunction(weaklingsAnim, SkipWeaklingsAnim, {})
   357 
   358 
   358   table.insert(stronglingsAnim, {func = AnimGearWait, args = {leaks, 1000}})
   359   table.insert(stronglingsAnim, {func = AnimGearWait, args = {leaks, 1000}})
   359   table.insert(stronglingsAnim, {func = AnimCustomFunction, args = {leaks, UnHideStronglings, {}}})
   360   table.insert(stronglingsAnim, {func = AnimCustomFunction, args = {leaks, UnHideStronglings, {}}})
   360   table.insert(stronglingsAnim, {func = AnimCustomFunction, args = {leaks, CondNeedToTurn, {leaks, dense}}})
   361   table.insert(stronglingsAnim, {func = AnimCustomFunction, args = {leaks, CondNeedToTurn, {leaks, dense}}})
   361   table.insert(stronglingsAnim, {func = AnimGiveState, args = {leaks, 0}})
   362   table.insert(stronglingsAnim, {func = AnimGiveState, args = {leaks, 0}})
   362   table.insert(stronglingsAnim, {func = AnimGiveState, args = {dense, 0}})
   363   table.insert(stronglingsAnim, {func = AnimGiveState, args = {dense, 0}})
   363   table.insert(stronglingsAnim, {func = AnimSay, args = {leaks, "I thought their shaman died when he tried our medicine!", SAY_SAY, 7000}})
   364   table.insert(stronglingsAnim, {func = AnimSay, args = {leaks, loc("I thought their shaman died when he tried our medicine!"), SAY_SAY, 7000}})
   364   table.insert(stronglingsAnim, {func = AnimSay, args = {dense, "I saw it with my own eyes!", SAY_SAY, 4000}})
   365   table.insert(stronglingsAnim, {func = AnimSay, args = {dense, loc("I saw it with my own eyes!"), SAY_SAY, 4000}})
   365   table.insert(stronglingsAnim, {func = AnimSay, args = {leaks, "Then how do they keep appearing?", SAY_SAY, 4000}})
   366   table.insert(stronglingsAnim, {func = AnimSay, args = {leaks, loc("Then how do they keep appearing?"), SAY_SAY, 4000}})
   366   table.insert(stronglingsAnim, {func = AnimSay, args = {leaks, "It's impossible to communicate with the spirits without a shaman.", SAY_SAY, 7000}})
   367   table.insert(stronglingsAnim, {func = AnimSay, args = {leaks, loc("It's impossible to communicate with the spirits without a shaman."), SAY_SAY, 7000}})
   367   table.insert(stronglingsAnim, {func = AnimSay, args = {dense, "We need to warn the village.", SAY_SAY, 3500}})
   368   table.insert(stronglingsAnim, {func = AnimSay, args = {dense, loc("We need to warn the village."), SAY_SAY, 3500}})
   368   table.insert(stronglingsAnim, {func = AnimGiveState, args = {cannibals[6], 0}})
   369   table.insert(stronglingsAnim, {func = AnimGiveState, args = {cannibals[6], 0}})
   369   table.insert(stronglingsAnim, {func = AnimOutOfNowhere, args = {cannibals[6], unpack(cannibalPos[6])}})
   370   table.insert(stronglingsAnim, {func = AnimOutOfNowhere, args = {cannibals[6], unpack(cannibalPos[6])}})
   370   table.insert(stronglingsAnim, {func = AnimWait, args = {leaks, 400}})
   371   table.insert(stronglingsAnim, {func = AnimWait, args = {leaks, 400}})
   371   table.insert(stronglingsAnim, {func = AnimGiveState, args = {cannibals[7], 0}})
   372   table.insert(stronglingsAnim, {func = AnimGiveState, args = {cannibals[7], 0}})
   372   table.insert(stronglingsAnim, {func = AnimOutOfNowhere, args = {cannibals[7], unpack(cannibalPos[7])}})
   373   table.insert(stronglingsAnim, {func = AnimOutOfNowhere, args = {cannibals[7], unpack(cannibalPos[7])}})
   375   table.insert(stronglingsAnim, {func = AnimOutOfNowhere, args = {cannibals[8], unpack(cannibalPos[8])}})
   376   table.insert(stronglingsAnim, {func = AnimOutOfNowhere, args = {cannibals[8], unpack(cannibalPos[8])}})
   376   table.insert(stronglingsAnim, {func = AnimWait, args = {leaks, 400}})
   377   table.insert(stronglingsAnim, {func = AnimWait, args = {leaks, 400}})
   377   table.insert(stronglingsAnim, {func = AnimGiveState, args = {cannibals[9], 0}})
   378   table.insert(stronglingsAnim, {func = AnimGiveState, args = {cannibals[9], 0}})
   378   table.insert(stronglingsAnim, {func = AnimOutOfNowhere, args = {cannibals[9], unpack(cannibalPos[9])}})
   379   table.insert(stronglingsAnim, {func = AnimOutOfNowhere, args = {cannibals[9], unpack(cannibalPos[9])}})
   379   table.insert(stronglingsAnim, {func = AnimWait, args = {leaks, 400}})
   380   table.insert(stronglingsAnim, {func = AnimWait, args = {leaks, 400}})
   380   table.insert(stronglingsAnim, {func = AnimSay, args = {cannibals[7], "What a ride!", SAY_SHOUT, 2000}})
   381   table.insert(stronglingsAnim, {func = AnimSay, args = {cannibals[7], loc("What a ride!"), SAY_SHOUT, 2000}})
   381   table.insert(stronglingsAnim, {func = AnimTurn, args = {leaks, "Right"}})
   382   table.insert(stronglingsAnim, {func = AnimTurn, args = {leaks, "Right"}})
   382   table.insert(stronglingsAnim, {func = AnimWait, args = {leaks, 700}})
   383   table.insert(stronglingsAnim, {func = AnimWait, args = {leaks, 700}})
   383   table.insert(stronglingsAnim, {func = AnimTurn, args = {leaks, "Left"}})
   384   table.insert(stronglingsAnim, {func = AnimTurn, args = {leaks, "Left"}})
   384   table.insert(stronglingsAnim, {func = AnimSay, args = {leaks, "We can't defeat them!", SAY_THINK, 3000}})
   385   table.insert(stronglingsAnim, {func = AnimSay, args = {leaks, loc("We can't defeat them!"), SAY_THINK, 3000}})
   385   table.insert(stronglingsAnim, {func = AnimSay, args = {leaks, "I'll hold them up while you return to the village!", SAY_SAY, 6000}})
   386   table.insert(stronglingsAnim, {func = AnimSay, args = {leaks, loc("I'll hold them up while you return to the village!"), SAY_SAY, 6000}})
   386   table.insert(stronglingsAnim, {func = AnimFollowGear, args = {cyborg}, swh = false})
   387   table.insert(stronglingsAnim, {func = AnimFollowGear, args = {cyborg}, swh = false})
   387   table.insert(stronglingsAnim, {func = AnimCaption, args = {cyborg, "30 minutes later..."}, swh = false})
   388   table.insert(stronglingsAnim, {func = AnimCaption, args = {cyborg, loc("30 minutes later...")}, swh = false})
   388   table.insert(stronglingsAnim, {func = AnimWait, args = {cyborg, 2000}})
   389   table.insert(stronglingsAnim, {func = AnimWait, args = {cyborg, 2000}})
   389   table.insert(stronglingsAnim, {func = AnimSetGearPosition, args = {dense, 1420, 1315}})
   390   table.insert(stronglingsAnim, {func = AnimSetGearPosition, args = {dense, 1420, 1315}})
   390   table.insert(stronglingsAnim, {func = AnimMove, args = {dense, "left", 1400, 0}})
   391   table.insert(stronglingsAnim, {func = AnimMove, args = {dense, "left", 1400, 0}})
   391   table.insert(stronglingsAnim, {func = AnimCustomFunction, args = {dense, EmitDenseClouds, {stronglingsAnim, "left"}}})
   392   table.insert(stronglingsAnim, {func = AnimCustomFunction, args = {dense, EmitDenseClouds, {stronglingsAnim, "left"}}})
   392   table.insert(stronglingsAnim, {func = AnimMove, args = {dense, "left", 1350, 0}})
   393   table.insert(stronglingsAnim, {func = AnimMove, args = {dense, "left", 1350, 0}})
   393   table.insert(stronglingsAnim, {func = AnimOutOfNowhere, args = {cyborg, 1250, 1320}})
   394   table.insert(stronglingsAnim, {func = AnimOutOfNowhere, args = {cyborg, 1250, 1320}})
   394   table.insert(stronglingsAnim, {func = AnimRemoveState, args = {cyborg, gstInvisible}})
   395   table.insert(stronglingsAnim, {func = AnimRemoveState, args = {cyborg, gstInvisible}})
   395   table.insert(stronglingsAnim, {func = AnimGearWait, args = {cyborg, 2000}})
   396   table.insert(stronglingsAnim, {func = AnimGearWait, args = {cyborg, 2000}})
   396   table.insert(stronglingsAnim, {func = AnimSay, args = {cyborg, "Greetings, cloudy one!", SAY_SAY, 3000}})
   397   table.insert(stronglingsAnim, {func = AnimSay, args = {cyborg, loc("Greetings, cloudy one!"), SAY_SAY, 3000}})
   397   table.insert(stronglingsAnim, {func = AnimSay, args = {cyborg, "I have come to make you an offering...", SAY_SAY, 6000}})
   398   table.insert(stronglingsAnim, {func = AnimSay, args = {cyborg, loc("I have come to make you an offering..."), SAY_SAY, 6000}})
   398   table.insert(stronglingsAnim, {func = AnimSay, args = {cyborg, "You are given the chance to turn your life around...", SAY_SAY, 6000}})
   399   table.insert(stronglingsAnim, {func = AnimSay, args = {cyborg, loc("You are given the chance to turn your life around..."), SAY_SAY, 6000}})
   399   table.insert(stronglingsAnim, {func = AnimSay, args = {cyborg, "If you agree to provide the information we need, you will be spared!", SAY_SAY, 7000}})
   400   table.insert(stronglingsAnim, {func = AnimSay, args = {cyborg, loc("If you agree to provide the information we need, you will be spared!"), SAY_SAY, 7000}})
   400   table.insert(stronglingsAnim, {func = AnimSay, args = {cyborg, "Have no illusions, your tribe is dead, indifferent of your choice.", SAY_SAY, 7000}})
   401   table.insert(stronglingsAnim, {func = AnimSay, args = {cyborg, loc("Have no illusions, your tribe is dead, indifferent of your choice."), SAY_SAY, 7000}})
   401   table.insert(stronglingsAnim, {func = AnimSay, args = {cyborg, "If you decide to help us, though, we will no longer need to find a new governor for the island.", SAY_SAY, 8000}})
   402   table.insert(stronglingsAnim, {func = AnimSay, args = {cyborg, loc("If you decide to help us, though, we will no longer need to find a new governor for the island."), SAY_SAY, 8000}})
   402   table.insert(stronglingsAnim, {func = AnimSay, args = {cyborg, "If you know what I mean...", SAY_SAY, 3000}})
   403   table.insert(stronglingsAnim, {func = AnimSay, args = {cyborg, loc("If you know what I mean..."), SAY_SAY, 3000}})
   403   table.insert(stronglingsAnim, {func = AnimSay, args = {cyborg, "So? What will it be?", SAY_SAY, 3000}})
   404   table.insert(stronglingsAnim, {func = AnimSay, args = {cyborg, loc("So? What will it be?"), SAY_SAY, 3000}})
   404   table.insert(stronglingsAnim, {func = AnimSwitchHog, args = {dense}})
   405   table.insert(stronglingsAnim, {func = AnimSwitchHog, args = {dense}})
   405   AddSkipFunction(stronglingsAnim, SkipStronglingsAnim, {})
   406   AddSkipFunction(stronglingsAnim, SkipStronglingsAnim, {})
   406 
   407 
   407   table.insert(acceptedAnim, {func = AnimSay, args = {cyborg, "Great choice, Steve! Mind if I call you that?", SAY_SAY, 7000}})
   408   table.insert(acceptedAnim, {func = AnimSay, args = {cyborg, loc("Great choice, Steve! Mind if I call you that?"), SAY_SAY, 7000}})
   408   table.insert(acceptedAnim, {func = AnimSay, args = {dense, "Whatever floats your boat...", SAY_SAY, 4500}})
   409   table.insert(acceptedAnim, {func = AnimSay, args = {dense, loc("Whatever floats your boat..."), SAY_SAY, 4500}})
   409   table.insert(acceptedAnim, {func = AnimSay, args = {cyborg, "Great! You will be contacted soon for assistance.", SAY_SAY, 6000}})
   410   table.insert(acceptedAnim, {func = AnimSay, args = {cyborg, loc("Great! You will be contacted soon for assistance."), SAY_SAY, 6000}})
   410   table.insert(acceptedAnim, {func = AnimSay, args = {cyborg, "In the meantime, take these and return to your \"friend\"!", SAY_SAY, 6000}})
   411   table.insert(acceptedAnim, {func = AnimSay, args = {cyborg, loc("In the meantime, take these and return to your \"friend\"!"), SAY_SAY, 6000}})
   411   table.insert(acceptedAnim, {func = AnimGiveState, args = {cyborg, gstInvisible}})
   412   table.insert(acceptedAnim, {func = AnimGiveState, args = {cyborg, gstInvisible}})
   412   table.insert(acceptedAnim, {func = AnimDisappear, args = {cyborg, unpack(cyborgPos)}})
   413   table.insert(acceptedAnim, {func = AnimDisappear, args = {cyborg, unpack(cyborgPos)}})
   413   table.insert(acceptedAnim, {func = AnimSwitchHog, args = {dense}})
   414   table.insert(acceptedAnim, {func = AnimSwitchHog, args = {dense}})
   414   AddSkipFunction(acceptedAnim, SkipAcceptedAnim, {}) 
   415   AddSkipFunction(acceptedAnim, SkipAcceptedAnim, {}) 
   415 
   416 
   416   table.insert(acceptedDiedFinalAnim, {func = AnimSay, args = {leaks, "Pfew! That was close!", SAY_THINK, 3000}})
   417   table.insert(acceptedDiedFinalAnim, {func = AnimSay, args = {leaks, loc("Pfew! That was close!"), SAY_THINK, 3000}})
   417   table.insert(acceptedDiedFinalAnim, {func = AnimSay, args = {leaks, "Your death will not be in vain, Dense Cloud!", SAY_THINK, 5000}})
   418   table.insert(acceptedDiedFinalAnim, {func = AnimSay, args = {leaks, loc("Your death will not be in vain, Dense Cloud!"), SAY_THINK, 5000}})
   418   table.insert(acceptedDiedFinalAnim, {func = AnimSay, args = {dense, "You will be avenged!", SAY_SAY, 3000}})
   419   table.insert(acceptedDiedFinalAnim, {func = AnimSay, args = {dense, loc("You will be avenged!"), SAY_SAY, 3000}})
   419 
   420 
   420   table.insert(refusedAnim, {func = AnimSay, args = {cyborg, "I see...", SAY_SAY, 2000}})
   421   table.insert(refusedAnim, {func = AnimSay, args = {cyborg, loc("I see..."), SAY_SAY, 2000}})
   421   table.insert(refusedAnim, {func = AnimSay, args = {cyborg, "Remember this, pathetic animal: when the day comes, you will regret your blind loyalty!", SAY_SAY, 8000}})
   422   table.insert(refusedAnim, {func = AnimSay, args = {cyborg, loc("Remember this, pathetic animal: when the day comes, you will regret your blind loyalty!"), SAY_SAY, 8000}})
   422   table.insert(refusedAnim, {func = AnimSay, args = {cyborg, "You just committed suicide...", SAY_SAY, 5000}})
   423   table.insert(refusedAnim, {func = AnimSay, args = {cyborg, loc("You just committed suicide..."), SAY_SAY, 5000}})
   423   table.insert(refusedAnim, {func = AnimDisappear, args = {cyborg, unpack(cyborgPos)}})
   424   table.insert(refusedAnim, {func = AnimDisappear, args = {cyborg, unpack(cyborgPos)}})
   424   table.insert(refusedAnim, {func = AnimGiveState, args = {cyborg, gstInvisible}})
   425   table.insert(refusedAnim, {func = AnimGiveState, args = {cyborg, gstInvisible}})
   425   table.insert(refusedAnim, {func = AnimSay, args = {dense, "If you say so...", SAY_THINK, 3000}})
   426   table.insert(refusedAnim, {func = AnimSay, args = {dense, loc("If you say so..."), SAY_THINK, 3000}})
   426   table.insert(refusedAnim, {func = AnimFollowGear, args = {cyborg}, swh = false})
   427   table.insert(refusedAnim, {func = AnimFollowGear, args = {cyborg}, swh = false})
   427   table.insert(refusedAnim, {func = AnimWait, args = {cyborg, 700}})
   428   table.insert(refusedAnim, {func = AnimWait, args = {cyborg, 700}})
   428   table.insert(refusedAnim, {func = AnimCustomFunction, args = {dense, RefusedStart, {}}})
   429   table.insert(refusedAnim, {func = AnimCustomFunction, args = {dense, RefusedStart, {}}})
   429   table.insert(refusedAnim, {func = AnimOutOfNowhere, args = {dense, 2645, 1146}})
   430   table.insert(refusedAnim, {func = AnimOutOfNowhere, args = {dense, 2645, 1146}})
   430   table.insert(refusedAnim, {func = AnimOutOfNowhere, args = {ramon, 2218, 1675}})
   431   table.insert(refusedAnim, {func = AnimOutOfNowhere, args = {ramon, 2218, 1675}})
   432   table.insert(refusedAnim, {func = AnimTurn, args = {spiky, "left"}})
   433   table.insert(refusedAnim, {func = AnimTurn, args = {spiky, "left"}})
   433   table.insert(refusedAnim, {func = AnimWait, args = {cyborg, 1700}})
   434   table.insert(refusedAnim, {func = AnimWait, args = {cyborg, 1700}})
   434   table.insert(refusedAnim, {func = AnimTurn, args = {spiky, "right"}})
   435   table.insert(refusedAnim, {func = AnimTurn, args = {spiky, "right"}})
   435   table.insert(refusedAnim, {func = AnimWait, args = {cyborg, 1700}})
   436   table.insert(refusedAnim, {func = AnimWait, args = {cyborg, 1700}})
   436   table.insert(refusedAnim, {func = AnimTurn, args = {spiky, "left"}})
   437   table.insert(refusedAnim, {func = AnimTurn, args = {spiky, "left"}})
   437   table.insert(refusedAnim, {func = AnimSay, args = {spiky, "Dude, we really need a new shaman...", SAY_SAY, 4000}})
   438   table.insert(refusedAnim, {func = AnimSay, args = {spiky, loc("Dude, we really need a new shaman..."), SAY_SAY, 4000}})
   438   AddSkipFunction(refusedAnim, SkipRefusedAnim, {})
   439   AddSkipFunction(refusedAnim, SkipRefusedAnim, {})
   439 
   440 
   440   table.insert(refusedFinalAnim, {func = AnimSay, args = {leaks, "It's over...", SAY_SAY, 2000}})
   441   table.insert(refusedFinalAnim, {func = AnimSay, args = {leaks, loc("It's over..."), SAY_SAY, 2000}})
   441   table.insert(refusedFinalAnim, {func = AnimSay, args = {leaks, "Let's head back to the village!", SAY_SAY, 4000}})
   442   table.insert(refusedFinalAnim, {func = AnimSay, args = {leaks, loc("Let's head back to the village!"), SAY_SAY, 4000}})
   442 
   443 
   443   table.insert(attackedAnim, {func = AnimCustomFunction, args = {dense, CondNeedToTurn, {cyborg, dense}}})
   444   table.insert(attackedAnim, {func = AnimCustomFunction, args = {dense, CondNeedToTurn, {cyborg, dense}}})
   444   table.insert(attackedAnim, {func = AnimCustomFunction, args = {cyborg, SetHealth, {cyborg, 200}}})
   445   table.insert(attackedAnim, {func = AnimCustomFunction, args = {cyborg, SetHealth, {cyborg, 200}}})
   445   table.insert(attackedAnim, {func = AnimWait, args = {cyborg, 2000}})
   446   table.insert(attackedAnim, {func = AnimWait, args = {cyborg, 2000}})
   446   table.insert(attackedAnim, {func = AnimSay, args = {cyborg, "Really?! You thought you could harm me with your little toys?", SAY_SAY, 7000}})
   447   table.insert(attackedAnim, {func = AnimSay, args = {cyborg, loc("Really?! You thought you could harm me with your little toys?"), SAY_SAY, 7000}})
   447   table.insert(attackedAnim, {func = AnimSay, args = {cyborg, "You're pathetic! You are not worthy of my attention...", SAY_SAY, 6000}})
   448   table.insert(attackedAnim, {func = AnimSay, args = {cyborg, loc("You're pathetic! You are not worthy of my attention..."), SAY_SAY, 6000}})
   448   table.insert(attackedAnim, {func = AnimSay, args = {cyborg, "Actually, you aren't worthy of life! Take this...", SAY_SAY, 5000}})
   449   table.insert(attackedAnim, {func = AnimSay, args = {cyborg, loc("Actually, you aren't worthy of life! Take this..."), SAY_SAY, 5000}})
   449   table.insert(attackedAnim, {func = AnimCustomFunction, args = {dense, BlowDenseCloud, {}}, swh = false})
   450   table.insert(attackedAnim, {func = AnimCustomFunction, args = {dense, BlowDenseCloud, {}}, swh = false})
   450   table.insert(attackedAnim, {func = AnimWait, args = {cyborg, 2000}})
   451   table.insert(attackedAnim, {func = AnimWait, args = {cyborg, 2000}})
   451   table.insert(attackedAnim, {func = AnimSay, args = {cyborg, "Incredible...", SAY_SAY, 3000}})
   452   table.insert(attackedAnim, {func = AnimSay, args = {cyborg, loc("Incredible..."), SAY_SAY, 3000}})
   452   table.insert(attackedAnim, {func = AnimDisappear, args = {cyborg, unpack(cyborgPos)}})
   453   table.insert(attackedAnim, {func = AnimDisappear, args = {cyborg, unpack(cyborgPos)}})
   453   table.insert(attackedAnim, {func = AnimGiveState, args = {cyborg, gstInvisible}})
   454   table.insert(attackedAnim, {func = AnimGiveState, args = {cyborg, gstInvisible}})
   454   table.insert(attackedAnim, {func = AnimSwitchHog, args = {leaks}})
   455   table.insert(attackedAnim, {func = AnimSwitchHog, args = {leaks}})
   455   table.insert(attackedAnim, {func = AnimSay, args = {leaks, "I wonder where Dense Cloud is...", SAY_THINK, 4000}})
   456   table.insert(attackedAnim, {func = AnimSay, args = {leaks, loc("I wonder where Dense Cloud is..."), SAY_THINK, 4000}})
   456   table.insert(attackedAnim, {func = AnimSay, args = {leaks, "I can't wait any more, I have to save myself!", SAY_THINK, 5000}})
   457   table.insert(attackedAnim, {func = AnimSay, args = {leaks, loc("I can't wait any more, I have to save myself!"), SAY_THINK, 5000}})
   457   table.insert(attackedAnim, {func = AnimCustomFunction, args = {leaks, SpawnCrates, {}}})
   458   table.insert(attackedAnim, {func = AnimCustomFunction, args = {leaks, SpawnCrates, {}}})
   458   table.insert(attackedAnim, {func = AnimWait, args = {leaks, 1500}})
   459   table.insert(attackedAnim, {func = AnimWait, args = {leaks, 1500}})
   459   table.insert(attackedAnim, {func = AnimSay, args = {leaks, "Where are all these crates coming from?!", SAY_THINK, 5500}})
   460   table.insert(attackedAnim, {func = AnimSay, args = {leaks, loc("Where are all these crates coming from?!"), SAY_THINK, 5500}})
   460   AddSkipFunction(attackedAnim, SkipAttackedAnim, {})
   461   AddSkipFunction(attackedAnim, SkipAttackedAnim, {})
   461   
   462   
   462   table.insert(attackedFinalAnim, {func = AnimWait, args = {leaks, 2000}})
   463   table.insert(attackedFinalAnim, {func = AnimWait, args = {leaks, 2000}})
   463   table.insert(attackedFinalAnim, {func = AnimSay, args = {leaks, "I have to get back to the village!", SAY_THINK, 5000}})
   464   table.insert(attackedFinalAnim, {func = AnimSay, args = {leaks, loc("I have to get back to the village!"), SAY_THINK, 5000}})
   464   table.insert(attackedFinalAnim, {func = AnimSay, args = {leaks, "Dense Cloud must have already told them everything...", SAY_THINK, 7000}})
   465   table.insert(attackedFinalAnim, {func = AnimSay, args = {leaks, loc("Dense Cloud must have already told them everything..."), SAY_THINK, 7000}})
   465 
   466 
   466 end
   467 end
   467 
   468 
   468 
   469 
   469 -----------------------------Misc--------------------------------------
   470 -----------------------------Misc--------------------------------------
   484   SetGearMessage(ramon, 0)
   485   SetGearMessage(ramon, 0)
   485   SetGearMessage(spiky, 0)
   486   SetGearMessage(spiky, 0)
   486 end
   487 end
   487 
   488 
   488 function AddHogs()
   489 function AddHogs()
   489 	AddTeam("Natives", 2567585, "Bone", "Island", "HillBilly", "cm_birdy")
   490 	AddTeam(loc("Natives"), 29439, "Bone", "Island", "HillBilly", "cm_birdy")
   490   ramon = AddHog("Ramon", 0, 100, "rasta")
   491   ramon = AddHog(loc("Ramon"), 0, 100, "rasta")
   491 	leaks = AddHog("Leaks A Lot", 0, 100, "Rambo")
   492 	leaks = AddHog(loc("Leaks A Lot"), 0, 100, "Rambo")
   492   dense = AddHog("Dense Cloud", 0, 100, "RobinHood")
   493   dense = AddHog(loc("Dense Cloud"), 0, 100, "RobinHood")
   493   spiky = AddHog("Spiky Cheese", 0, 100, "hair_yellow")
   494   spiky = AddHog(loc("Spiky Cheese"), 0, 100, "hair_yellow")
   494 
   495 
   495   AddTeam("Weaklings", 14483456, "Skull", "Island", "Pirate","cm_vampire")
   496   AddTeam(loc("Weaklings"), 14483456, "Skull", "Island", "Pirate","cm_vampire")
   496   cannibals = {}
   497   cannibals = {}
   497   cannibals[1] = AddHog("Brainiac", 5, 20, "Zombi")
   498   cannibals[1] = AddHog(loc("Brainiac"), 5, 20, "Zombi")
   498 
   499 
   499   for i = 2, 5 do
   500   for i = 2, 5 do
   500     cannibals[i] = AddHog(HogNames[i], 1, 20, "Zombi")
   501     cannibals[i] = AddHog(HogNames[i], 1, 20, "Zombi")
   501     hogNr[cannibals[i]] = i - 2
   502     hogNr[cannibals[i]] = i - 2
   502   end
   503   end
   503 
   504 
   504   AddTeam("Stronglings", 14483456, "Skull", "Island", "Pirate","cm_vampire")
   505   AddTeam(loc("Stronglings"), 14483456, "Skull", "Island", "Pirate","cm_vampire")
   505 
   506 
   506   for i = 6, 9 do
   507   for i = 6, 9 do
   507     cannibals[i] = AddHog(HogNames[i], 2, 30, "vampirichog")
   508     cannibals[i] = AddHog(HogNames[i], 2, 30, "vampirichog")
   508     hogNr[cannibals[i]] = i - 2
   509     hogNr[cannibals[i]] = i - 2
   509   end
   510   end
   510 
   511 
   511   AddTeam("011101001", 14483456, "ring", "UFO", "Robot", "cm_star")
   512   AddTeam(loc("011101001"), 14483456, "ring", "UFO", "Robot", "cm_star")
   512   cyborg = AddHog("Y3K1337", 0, 200, "cyborg1")
   513   cyborg = AddHog(loc("Y3K1337"), 0, 200, "cyborg1")
   513 end
   514 end
   514 
   515 
   515 function PlaceHogs()
   516 function PlaceHogs()
   516   HogTurnLeft(leaks, true)
   517   HogTurnLeft(leaks, true)
   517 
   518 
   633 function DoWeaklingsKilled()
   634 function DoWeaklingsKilled()
   634   TurnTimeLeft = 0
   635   TurnTimeLeft = 0
   635   AddAnim(stronglingsAnim)
   636   AddAnim(stronglingsAnim)
   636   AddFunction({func = AfterStronglingsAnim, args = {}})
   637   AddFunction({func = AfterStronglingsAnim, args = {}})
   637   stage = interWeakStage
   638   stage = interWeakStage
   638   ParseCommand("teamgone Weaklings")
   639   ParseCommand("teamgone " .. loc("Weaklings"))
   639 end
   640 end
   640 
   641 
   641 function CheckRefuse()
   642 function CheckRefuse()
   642   return GetX(dense) > 1400 and StoppedGear(dense)
   643   return GetX(dense) > 1400 and StoppedGear(dense)
   643 end
   644 end
   676 function CheckNeedGirder()
   677 function CheckNeedGirder()
   677   return GetX(dense) > 1640 and StoppedGear(dense)
   678   return GetX(dense) > 1640 and StoppedGear(dense)
   678 end
   679 end
   679 
   680 
   680 function DoNeedGirder()
   681 function DoNeedGirder()
   681   ShowMission("The Shadow Falls", "Under Construction", "To place a girder, select it, use [Left] and [Right] to select angle and length, place with [Left Click]", 1, 6000)
   682   ShowMission(loc("The Shadow Falls"), loc("Under Construction"), loc("To place a girder, select it, use [Left] and [Right] to select angle and length, place with [Left Click]"), 1, 6000)
   682 end
   683 end
   683 
   684 
   684 function CheckNeedWeapons()
   685 function CheckNeedWeapons()
   685   return GetX(dense) > 2522 and StoppedGear(dense)
   686   return GetX(dense) > 2522 and StoppedGear(dense)
   686 end
   687 end
   687 
   688 
   688 function DoNeedWeapons()
   689 function DoNeedWeapons()
   689   grenadeCrate = SpawnAmmoCrate(2550, 600, amGrenade)
   690   grenadeCrate = SpawnAmmoCrate(2550, 600, amGrenade)
   690   shotgunCrate = SpawnAmmoCrate(2550, 550, amShotgun)
   691   shotgunCrate = SpawnAmmoCrate(2550, 550, amShotgun)
   691   AddCaption("A little gift from the cyborgs")
   692   AddCaption(loc("A little gift from the cyborgs"))
   692 end
   693 end
   693 
   694 
   694 function CheckTookWeapons()
   695 function CheckTookWeapons()
   695   return shotgunTaken and grenadeTaken
   696   return shotgunTaken and grenadeTaken
   696 end
   697 end
   697 
   698 
   698 function DoTookWeapons()
   699 function DoTookWeapons()
   699   ShowMission("The Shadow Falls", "The guardian", "Protect yourselves!|Grenade hint: set the timer with [1-5], aim with [Up]/[Down] and hold [Space] to set power", 1, 8000)
   700   ShowMission(loc("The Shadow Falls"), loc("The guardian"), loc("Protect yourselves!|Grenade hint: set the timer with [1-5], aim with [Up]/[Down] and hold [Space] to set power"), 1, 8000)
   700   AddAmmo(dense, amSkip, 100)
   701   AddAmmo(dense, amSkip, 100)
   701   AddAmmo(dense, amSwitch, 100)
   702   AddAmmo(dense, amSwitch, 100)
   702   stage = duoStage
   703   stage = duoStage
   703   RemoveEventFunc(CheckNeedGirder)
   704   RemoveEventFunc(CheckNeedGirder)
   704   RemoveEventFunc(CheckNeedWeapons)
   705   RemoveEventFunc(CheckNeedWeapons)
   774 function CheckLeaksDead()
   775 function CheckLeaksDead()
   775   return leaksDead
   776   return leaksDead
   776 end
   777 end
   777 
   778 
   778 function DoDead()
   779 function DoDead()
   779   AddCaption("...and so the cyborgs took over the world...")
   780   AddCaption(loc("...and so the cyborgs took over the world..."))
   780   stage = loseStage
   781   stage = loseStage
   781   TurnTimeLeft = 0
   782   TurnTimeLeft = 0
   782   ParseCommand('teamgone Natives')
   783   ParseCommand("teamgone " .. loc("Natives"))
   783 end
   784 end
   784 
   785 
   785 function CheckDenseDead()
   786 function CheckDenseDead()
   786   return denseDead and choice ~= choiceAttack 
   787   return denseDead and choice ~= choiceAttack 
   787 end
   788 end
   820   AddEvent(CheckLeaksDead, {}, DoDead, {}, 0)
   821   AddEvent(CheckLeaksDead, {}, DoDead, {}, 0)
   821   AddEvent(CheckDenseDead, {}, DoDead, {}, 0)
   822   AddEvent(CheckDenseDead, {}, DoDead, {}, 0)
   822   AddAnim(startDialogue)
   823   AddAnim(startDialogue)
   823   AddFunction({func = AfterStartDialogue, args = {}})
   824   AddFunction({func = AfterStartDialogue, args = {}})
   824   AddEvent(CheckBrainiacDead, {}, DoBrainiacDead, {}, 0)
   825   AddEvent(CheckBrainiacDead, {}, DoBrainiacDead, {}, 0)
   825   ShowMission("The Shadow Falls", "The First Encounter", "Survive!|Hint: Cinematics can be skipped with the [Precise] key.", 1, 0)
   826   ShowMission(loc("The Shadow Falls"), loc("The First Encounter"), loc("Survive!|Hint: Cinematics can be skipped with the [Precise] key."), 1, 0)
   826 end
   827 end
   827 
   828 
   828 function onGameTick()
   829 function onGameTick()
   829   AnimUnWait()
   830   AnimUnWait()
   830   if ShowAnimation() == false then
   831   if ShowAnimation() == false then
   857     end
   858     end
   858   end
   859   end
   859 end
   860 end
   860 
   861 
   861 function onGearAdd(gear)
   862 function onGearAdd(gear)
   862   if GetGearType(gear) == gtGrenade and GetHogTeamName(CurrentHedgehog) == "Natives" then
   863   if GetGearType(gear) == gtGrenade and GetHogTeamName(CurrentHedgehog) == loc("Natives") then
   863     grenadeUsed = true
   864     grenadeUsed = true
   864   elseif GetGearType(gear) == gtShotgunShot and GetHogTeamName(CurrentHedgehog) == "Natives" then
   865   elseif GetGearType(gear) == gtShotgunShot and GetHogTeamName(CurrentHedgehog) == loc("Natives") then
   865     shotgunUsed = true
   866     shotgunUsed = true
   866   end
   867   end
   867 end
   868 end
   868 
   869 
   869 function onAmmoStoreInit()
   870 function onAmmoStoreInit()
   884 end
   885 end
   885 
   886 
   886 function onNewTurn()
   887 function onNewTurn()
   887   if AnimInProgress() then
   888   if AnimInProgress() then
   888     TurnTimeLeft = -1
   889     TurnTimeLeft = -1
   889 --  elseif stage == interSpyStage and GetHogTeamName(CurrentHedgehog) ~= "Natives" then
   890 --  elseif stage == interSpyStage and GetHogTeamName(CurrentHedgehog) ~= loc("Natives") then
   890 --    TurnTimeLeft = 0
   891 --    TurnTimeLeft = 0
   891 --    SetState(CurrentHedgehog, gstInvisible)
   892 --    SetState(CurrentHedgehog, gstInvisible)
   892   elseif stage == cyborgStage then
   893   elseif stage == cyborgStage then
   893     if CurrentHedgehog ~= dense then
   894     if CurrentHedgehog ~= dense then
   894       TurnTimeLeft = 0
   895       TurnTimeLeft = 0