share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/backstab.lua
changeset 7425 3495e70c6d14
parent 7417 2520705b857f
child 7448 d0521a3a4358
equal deleted inserted replaced
7422:aa8a4dfe78e3 7425:3495e70c6d14
    42                  loc("Hedgibal Letter"), loc("Bloodpie"), loc("Scalp Muncher"),
    42                  loc("Hedgibal Letter"), loc("Bloodpie"), loc("Scalp Muncher"),
    43                  loc("Back Breaker"), loc("Dahmer"), loc("Meiwes"),
    43                  loc("Back Breaker"), loc("Dahmer"), loc("Meiwes"),
    44                  loc("Ear Sniffer"), loc("Regurgitator"), loc("Muriel")}
    44                  loc("Ear Sniffer"), loc("Regurgitator"), loc("Muriel")}
    45 
    45 
    46 cannibalPos = {{3607, 1472}, {3612, 1487}, {3646, 1502}, 
    46 cannibalPos = {{3607, 1472}, {3612, 1487}, {3646, 1502}, 
    47                {3694, 1509}, {3746, 1525}, {3704, 1513},
    47                {3507, 195},  {3612, 1487}, {840, 1757}, 
    48                {3607, 1472}, {3612, 1487}, {3646, 1502}, 
    48                {3056, 1231}, {2981, 1222}, {2785, 1258}}
    49                {3694, 1509}, {3746, 1525}, {3704, 1513}}
       
    50 
    49 
    51 cannibalDir = {"Left", "Left", "Left",
    50 cannibalDir = {"Left", "Left", "Left",
    52                "Left", "Left", "Left",
    51                "Left", "Right", "Right",
    53                "Left", "Left", "Left",
       
    54                "Left", "Left", "Left"}
    52                "Left", "Left", "Left"}
    55 
    53 
    56 cyborgPos = {1369, 574}
    54 cyborgPos = {1369, 574}
    57 cyborgPos2 = {1308, 148}
    55 cyborgPos2 = {1308, 148}
    58 
    56 
   230 function SpyDebate()
   228 function SpyDebate()
   231   if m2Choice == choiceAccepted then
   229   if m2Choice == choiceAccepted then
   232     spyHog = natives[denseNum]
   230     spyHog = natives[denseNum]
   233     AnimInsertStepNext({func = AnimSay, args = {natives[wiseNum], loc("What shall we do with the traitor?"), SAY_SAY, 6000}})
   231     AnimInsertStepNext({func = AnimSay, args = {natives[wiseNum], loc("What shall we do with the traitor?"), SAY_SAY, 6000}})
   234     AnimInsertStepNext({func = SetHealth, swh = false, args = {natives[denseNum], 26}})
   232     AnimInsertStepNext({func = SetHealth, swh = false, args = {natives[denseNum], 26}})
   235     AnimInsertStepNext({func = AnimVisualGear, args = {GetGearPosition(natives[denseNum]), vgtExplosion, 0, true}})
   233     AnimInsertStepNext({func = AnimVisualGear, args = {natives[wiseNum], GetGearPosition(natives[denseNum]), vgtExplosion, 0, true}})
   236     AnimInsertStepNext({func = AnimSay, args = {natives[wiseNum], loc("Here, let me help you!"), SAY_SAY, 3000}})
   234     AnimInsertStepNext({func = AnimSay, args = {natives[wiseNum], loc("Here, let me help you!"), SAY_SAY, 3000}})
   237     if nativeDead[chiefNum] == true then
   235     if nativeDead[chiefNum] == true then
   238       AnimInsertStepNext({func = AnimSay, args = {natives[leaksNum], loc("I forgot that she's the daughter of the chief, too..."), SAY_THINK, 7000}})
   236       AnimInsertStepNext({func = AnimSay, args = {natives[leaksNum], loc("I forgot that she's the daughter of the chief, too..."), SAY_THINK, 7000}})
   239       AnimInsertStepNext({func = AnimSay, args = {natives[girlNum], loc("You killed my father, you monster!"), SAY_SAY, 5000}})
   237       AnimInsertStepNext({func = AnimSay, args = {natives[girlNum], loc("You killed my father, you monster!"), SAY_SAY, 5000}})
   240     end
   238     end
   248     AnimInsertStepNext({func = AnimSay, args = {natives[leaksNum], loc("Not now, Fiery Water!"), SAY_SAY, 3000}})
   246     AnimInsertStepNext({func = AnimSay, args = {natives[leaksNum], loc("Not now, Fiery Water!"), SAY_SAY, 3000}})
   249   else
   247   else
   250     spyHog = natives[waterNum]
   248     spyHog = natives[waterNum]
   251     AnimInsertStepNext({func = AnimSay, args = {natives[wiseNum], loc("What shall we do with the traitor?"), SAY_SAY, 5000}})
   249     AnimInsertStepNext({func = AnimSay, args = {natives[wiseNum], loc("What shall we do with the traitor?"), SAY_SAY, 5000}})
   252     AnimInsertStepNext({func = SetHealth, swh = false, args = {natives[waterNum], 26}})
   250     AnimInsertStepNext({func = SetHealth, swh = false, args = {natives[waterNum], 26}})
   253     AnimInsertStepNext({func = AnimVisualGear, args = {nativePos[denseNum][1] + 50, nativePos[denseNum][2], vgtExplosion, 0, true}})
   251     AnimInsertStepNext({func = AnimVisualGear, args = {natives[wiseNum], nativePos[denseNum][1] + 50, nativePos[denseNum][2], vgtExplosion, 0, true}})
   254     AnimInsertStepNext({func = AnimSay, args = {natives[girlNum], loc("I can't believe what I'm hearing!"), SAY_SAY, 5500}})
   252     AnimInsertStepNext({func = AnimSay, args = {natives[girlNum], loc("I can't believe what I'm hearing!"), SAY_SAY, 5500}})
   255     AnimInsertStepNext({func = AnimSay, args = {natives[waterNum], loc("You know what? I don't even regret anything!"), SAY_SAY, 7000}})
   253     AnimInsertStepNext({func = AnimSay, args = {natives[waterNum], loc("You know what? I don't even regret anything!"), SAY_SAY, 7000}})
   256     AnimInsertStepNext({func = AnimSay, args = {natives[girlNum], loc("In fact, you are the only one that's been acting strangely."), SAY_SAY, 8000}})
   254     AnimInsertStepNext({func = AnimSay, args = {natives[girlNum], loc("In fact, you are the only one that's been acting strangely."), SAY_SAY, 8000}})
   257     AnimInsertStepNext({func = AnimSay, args = {natives[waterNum], loc("Are you accusing me of something?"), SAY_SAY, 3500}})
   255     AnimInsertStepNext({func = AnimSay, args = {natives[waterNum], loc("Are you accusing me of something?"), SAY_SAY, 3500}})
   258     AnimInsertStepNext({func = AnimSay, args = {natives[leaksNum], loc("Seems like every time you take a \"walk\", the enemy find us!"), SAY_SAY, 8000}})
   256     AnimInsertStepNext({func = AnimSay, args = {natives[leaksNum], loc("Seems like every time you take a \"walk\", the enemy find us!"), SAY_SAY, 8000}})
   321       table.insert(wave2DeadAnim, {func = AnimSay, args = {natives[wiseNum], loc("Oh, silly me! I forgot that I'm the shaman."), SAY_THINK, 6000}})
   319       table.insert(wave2DeadAnim, {func = AnimSay, args = {natives[wiseNum], loc("Oh, silly me! I forgot that I'm the shaman."), SAY_THINK, 6000}})
   322       table.insert(wave2DeadAnim, {func = AnimCustomFunction, args = {natives[wiseNum], TeleportNatives, {}}})
   320       table.insert(wave2DeadAnim, {func = AnimCustomFunction, args = {natives[wiseNum], TeleportNatives, {}}})
   323       table.insert(wave2DeadAnim, {func = AnimCustomFunction, args = {natives[wiseNum], TurnNatives, {natives[wiseNum]}}})
   321       table.insert(wave2DeadAnim, {func = AnimCustomFunction, args = {natives[wiseNum], TurnNatives, {natives[wiseNum]}}})
   324       table.insert(wave2DeadAnim, {func = AnimCustomFunction, args = {natives[wiseNum], CondNeedToTurn, {natives[wiseNum], deployedHog}}})
   322       table.insert(wave2DeadAnim, {func = AnimCustomFunction, args = {natives[wiseNum], CondNeedToTurn, {natives[wiseNum], deployedHog}}})
   325       table.insert(wave2DeadAnim, {func = AnimSay, args = {natives[wiseNum], loc("I sense another wave of cannibals heading our way!"), SAY_SAY, 6500}})
   323       table.insert(wave2DeadAnim, {func = AnimSay, args = {natives[wiseNum], loc("I sense another wave of cannibals heading our way!"), SAY_SAY, 6500}})
       
   324       table.insert(wave2DeadAnim, {func = AnimSay, args = {natives[wiseNum], loc("I feel something...a place! They will arrive near the graves!"), SAY_SAY, 7500}})
       
   325       table.insert(wave2DeadAnim, {func = AddGear, swh = false, args = {cannibalPos[7][1], cannibalPos[7][2], gtGrave, 0, 0, 0, 0}})
       
   326       table.insert(wave2DeadAnim, {func = AddGear, swh = false, args = {cannibalPos[8][1], cannibalPos[8][2], gtGrave, 0, 0, 0, 0}})
       
   327       table.insert(wave2DeadAnim, {func = AddGear, swh = false, args = {cannibalPos[9][1], cannibalPos[9][2], gtGrave, 0, 0, 0, 0}})
   326       table.insert(wave2DeadAnim, {func = AnimSay, args = {natives[wiseNum], loc("We need to prevent their arrival!"), SAY_SAY, 4500}})
   328       table.insert(wave2DeadAnim, {func = AnimSay, args = {natives[wiseNum], loc("We need to prevent their arrival!"), SAY_SAY, 4500}})
   327       table.insert(wave2DeadAnim, {func = AnimSay, args = {natives[wiseNum], loc("Go, quick!"), SAY_SAY, 2500}})
   329       table.insert(wave2DeadAnim, {func = AnimSay, args = {natives[wiseNum], loc("Go, quick!"), SAY_SAY, 2500}})
   328       table.insert(wave2DeadAnim, {func = AnimCustomFunction, args = {natives[wiseNum], DeployHog, {}}})
   330       table.insert(wave2DeadAnim, {func = AnimCustomFunction, args = {natives[wiseNum], DeployHog, {}}})
   329       table.insert(wave2DeadAnim, {func = AnimCustomFunction, args = {natives[wiseNum], RestoreCyborg, {}}})
   331       table.insert(wave2DeadAnim, {func = AnimCustomFunction, args = {natives[wiseNum], RestoreCyborg, {}}})
   330       table.insert(wave2DeadAnim, {func = AnimOutOfNowhere, swh = false, args = {cyborg, cyborgPos2[1], cyborgPos2[2]}})
   332       table.insert(wave2DeadAnim, {func = AnimOutOfNowhere, swh = false, args = {cyborg, cyborgPos2[1], cyborgPos2[2]}})
   332       table.insert(wave2DeadAnim, {func = AnimCustomFunction, args = {cyborg, IsolateNatives, {}}})
   334       table.insert(wave2DeadAnim, {func = AnimCustomFunction, args = {cyborg, IsolateNatives, {}}})
   333       table.insert(wave2DeadAnim, {func = AnimCustomFunction, args = {cyborg, PutCGI, {}}})
   335       table.insert(wave2DeadAnim, {func = AnimCustomFunction, args = {cyborg, PutCGI, {}}})
   334       table.insert(wave2DeadAnim, {func = AnimSay, args = {cyborg, loc("I want to see how it handles this!"), SAY_SAY, 6000}})
   336       table.insert(wave2DeadAnim, {func = AnimSay, args = {cyborg, loc("I want to see how it handles this!"), SAY_SAY, 6000}})
   335       table.insert(wave2DeadAnim, {func = AnimSwitchHog, args = {deployedHog}})
   337       table.insert(wave2DeadAnim, {func = AnimSwitchHog, args = {deployedHog}})
   336       table.insert(wave2DeadAnim, {func = AnimDisappear, args = {cyborg, 0, 0}})
   338       table.insert(wave2DeadAnim, {func = AnimDisappear, args = {cyborg, 0, 0}})
   337       table.insert(wave2DeadAnim, {func = AnimCustomFunction, args = {cyborg, DeployHog, {}}})
   339 --      table.insert(wave2DeadAnim, {func = AnimCustomFunction, args = {cyborg, DeployHog, {}}})
   338       table.insert(wave2DeadAnim, {func = AnimCustomFunction, swh = false, args = {cyborg, HideCyborg, {}}})
   340       table.insert(wave2DeadAnim, {func = AnimCustomFunction, swh = false, args = {cyborg, HideCyborg, {}}})
   339     else
   341     else
   340       table.insert(wave2DeadAnim, {func = AnimWait, args = {natives[wiseNum], 1500}})
   342       table.insert(wave2DeadAnim, {func = AnimWait, args = {natives[wiseNum], 1500}})
   341       table.insert(wave2DeadAnim, {func = AnimSay, args = {natives[wiseNum], loc("What a strange feeling!"), SAY_THINK, 3000}})
   343       table.insert(wave2DeadAnim, {func = AnimSay, args = {natives[wiseNum], loc("What a strange feeling!"), SAY_THINK, 3000}})
   342       table.insert(wave2DeadAnim, {func = AnimSay, args = {natives[wiseNum], loc("I sense another wave of cannibals heading my way!"), SAY_THINK, 6500}})
   344       table.insert(wave2DeadAnim, {func = AnimSay, args = {natives[wiseNum], loc("I sense another wave of cannibals heading my way!"), SAY_THINK, 6500}})
       
   345       table.insert(wave2DeadAnim, {func = AnimSay, args = {natives[wiseNum], loc("I feel something...a place! They will arrive near the graves!"), SAY_SAY, 7500}})
       
   346       table.insert(wave2DeadAnim, {func = AddGear, swh = false, args = {cannibalPos[7][1], cannibalPos[7][2], gtGrave, 0, 0, 0, 0}})
       
   347       table.insert(wave2DeadAnim, {func = AddGear, swh = false, args = {cannibalPos[8][1], cannibalPos[8][2], gtGrave, 0, 0, 0, 0}})
       
   348       table.insert(wave2DeadAnim, {func = AddGear, swh = false, args = {cannibalPos[9][1], cannibalPos[9][2], gtGrave, 0, 0, 0, 0}})
   343       table.insert(wave2DeadAnim, {func = AnimSay, args = {natives[wiseNum], loc("I need to prevent their arrival!"), SAY_THINK, 4500}})
   349       table.insert(wave2DeadAnim, {func = AnimSay, args = {natives[wiseNum], loc("I need to prevent their arrival!"), SAY_THINK, 4500}})
   344       table.insert(wave2DeadAnim, {func = AnimSay, args = {natives[wiseNum], loc("If only I had a way..."), SAY_THINK, 3000}})
   350       table.insert(wave2DeadAnim, {func = AnimSay, args = {natives[wiseNum], loc("If only I had a way..."), SAY_THINK, 3000}})
   345       table.insert(wave2DeadAnim, {func = AnimSay, args = {natives[wiseNum], loc("Oh, silly me! I forgot that I'm the shaman."), SAY_THINK, 6000}})
   351       table.insert(wave2DeadAnim, {func = AnimSay, args = {natives[wiseNum], loc("Oh, silly me! I forgot that I'm the shaman."), SAY_THINK, 6000}})
   346     end
   352     end
   347   else
   353   else
   351     table.insert(wave2DeadAnim, {func = AnimCustomFunction, args = {cyborg, TeleportNatives, {}}})
   357     table.insert(wave2DeadAnim, {func = AnimCustomFunction, args = {cyborg, TeleportNatives, {}}})
   352     table.insert(wave2DeadAnim, {func = AnimCustomFunction, args = {cyborg, TurnNatives, {cyborg}}})
   358     table.insert(wave2DeadAnim, {func = AnimCustomFunction, args = {cyborg, TurnNatives, {cyborg}}})
   353     table.insert(wave2DeadAnim, {func = AnimSay, args = {cyborg, loc("Oh, my! This is even more entertaining than I've expected!"), SAY_SAY, 7500}})
   359     table.insert(wave2DeadAnim, {func = AnimSay, args = {cyborg, loc("Oh, my! This is even more entertaining than I've expected!"), SAY_SAY, 7500}})
   354     table.insert(wave2DeadAnim, {func = AnimSay, args = {cyborg, loc("You might want to find a way to instantly kill arriving cannibals!"), SAY_SAY, 8000}})
   360     table.insert(wave2DeadAnim, {func = AnimSay, args = {cyborg, loc("You might want to find a way to instantly kill arriving cannibals!"), SAY_SAY, 8000}})
   355     table.insert(wave2DeadAnim, {func = AnimSay, args = {cyborg, loc("I believe there's more of them."), SAY_SAY, 4000}})
   361     table.insert(wave2DeadAnim, {func = AnimSay, args = {cyborg, loc("I believe there's more of them."), SAY_SAY, 4000}})
       
   362     table.insert(wave2DeadAnim, {func = AnimSay, args = {cyborg, loc("I marked the place of their arrival. You're welcome!"), SAY_SAY, 6000}})
       
   363     table.insert(wave2DeadAnim, {func = AddGear, swh = false, args = {cannibalPos[7][1], cannibalPos[7][2], gtGrave, 0, 0, 0, 0}})
       
   364     table.insert(wave2DeadAnim, {func = AddGear, swh = false, args = {cannibalPos[8][1], cannibalPos[8][2], gtGrave, 0, 0, 0, 0}})
       
   365     table.insert(wave2DeadAnim, {func = AddGear, swh = false, args = {cannibalPos[9][1], cannibalPos[9][2], gtGrave, 0, 0, 0, 0}})
       
   366     table.insert(wave2DeadAnim, {func = AnimCustomFunction, args = {deployedHog, DeployHog, {}}})
   356     if nativesNum > 1 then
   367     if nativesNum > 1 then
   357       table.insert(wave2DeadAnim, {func = AnimCustomFunction, args = {natives[wiseNum], RestoreCyborg, {}}})
   368 --      table.insert(wave2DeadAnim, {func = AnimCustomFunction, args = {natives[wiseNum], RestoreCyborg, {}}})
   358       table.insert(wave2DeadAnim, {func = AnimOutOfNowhere, swh = false, args = {cyborg, cyborgPos2[1], cyborgPos2[2]}})
   369 --      table.insert(wave2DeadAnim, {func = AnimOutOfNowhere, swh = false, args = {cyborg, cyborgPos2[1], cyborgPos2[2]}})
   359       table.insert(wave2DeadAnim, {func = AnimTurn, args = {cyborg, "Left"}})
   370 --      table.insert(wave2DeadAnim, {func = AnimTurn, args = {cyborg, "Left"}})
   360       table.insert(wave2DeadAnim, {func = AnimCustomFunction, args = {cyborg, IsolateNatives, {}}})
   371       table.insert(wave2DeadAnim, {func = AnimCustomFunction, args = {cyborg, IsolateNatives, {}}})
   361       table.insert(wave2DeadAnim, {func = AnimCustomFunction, args = {cyborg, PutCGI, {}}})
   372       table.insert(wave2DeadAnim, {func = AnimCustomFunction, args = {cyborg, PutCGI, {}}})
   362       table.insert(wave2DeadAnim, {func = AnimSay, args = {cyborg, loc("I want to see how it handles this!"), SAY_SAY, 6000}})
   373       table.insert(wave2DeadAnim, {func = AnimSay, args = {cyborg, loc("I want to see how it handles this!"), SAY_SAY, 6000}})
   363     end
   374     end
   364     table.insert(wave2DeadAnim, {func = AnimSwitchHog, args = {deployedHog}})
   375     table.insert(wave2DeadAnim, {func = AnimSwitchHog, args = {deployedHog}})
   365     table.insert(wave2DeadAnim, {func = AnimDisappear, swh = false, args = {cyborg, 0, 0}})
   376     table.insert(wave2DeadAnim, {func = AnimDisappear, swh = false, args = {cyborg, 0, 0}})
   366     table.insert(wave2DeadAnim, {func = AnimCustomFunction, args = {deployedHog, DeployHog, {}}})
       
   367     table.insert(wave2DeadAnim, {func = AnimCustomFunction, swh = false, args = {cyborg, HideCyborg, {}}})
   377     table.insert(wave2DeadAnim, {func = AnimCustomFunction, swh = false, args = {cyborg, HideCyborg, {}}})
   368   end
   378   end
   369   AddSkipFunction(wave2DeadAnim, SkipWave2DeadAnim, {})
   379   AddSkipFunction(wave2DeadAnim, SkipWave2DeadAnim, {})
   370 end
   380 end
   371 
   381 
   519   TurnTimeLeft = TurnTime
   529   TurnTimeLeft = TurnTime
   520 end
   530 end
   521 
   531 
   522 function SkipWave2DeadAnim()
   532 function SkipWave2DeadAnim()
   523   TeleportNatives()
   533   TeleportNatives()
       
   534   IsolateNatives()
   524   DeployHog()
   535   DeployHog()
   525   HideCyborg()
   536   HideCyborg()
       
   537   AddGear(cannibalPos[7][1], cannibalPos[7][2], gtGrave, 0, 0, 0, 0)
       
   538   AddGear(cannibalPos[8][1], cannibalPos[8][2], gtGrave, 0, 0, 0, 0)
       
   539   AddGear(cannibalPos[9][1], cannibalPos[9][2], gtGrave, 0, 0, 0, 0)
   526 end
   540 end
   527 
   541 
   528 function SpawnPlatformCrates()
   542 function SpawnPlatformCrates()
   529   SpawnAmmoCrate(2494, 1262, amMine)
   543   SpawnAmmoCrate(2494, 1262, amMine)
   530   SpawnAmmoCrate(2574, 1279, amSMine)
   544   SpawnAmmoCrate(2574, 1279, amSMine)
   533   SpawnUtilityCrate(2579, 1254, amMine)
   547   SpawnUtilityCrate(2579, 1254, amMine)
   534   SpawnUtilityCrate(2478, 1243, amMine)
   548   SpawnUtilityCrate(2478, 1243, amMine)
   535 end
   549 end
   536 
   550 
   537 function AfterWave2DeadAnim()
   551 function AfterWave2DeadAnim()
   538   TurnsLeft = 13
   552   TurnsLeft = 7
   539   stage = platformStage
   553   stage = platformStage
   540   SpawnPlatformCrates()
   554   SpawnPlatformCrates()
   541   AddEvent(CheckTurnsOver, {}, DoTurnsOver, {3}, 0)
   555   AddEvent(CheckTurnsOver, {}, DoTurnsOver, {3}, 0)
   542   AddEvent(CheckWaveDead, {3}, DoWaveDead, {3}, 0)
   556   AddEvent(CheckWaveDead, {3}, DoWaveDead, {3}, 0)
   543   AddEvent(CheckDeployedDead, {}, DoDeployedDead, {}, 0)
   557   AddEvent(CheckDeployedDead, {}, DoDeployedDead, {}, 0)
   544   TurnTimeLeft = 0
   558   TurnTimeLeft = 0
   545   ShowMission(loc("Backstab"), loc("Drills"), loc("You have 12 turns until the next wave arrives.|Make sure the arriving cannibals are greeted appropriately!|If the hog dies, the cause is lost.|Hint: you might want to use some mines..."), 1, 12000)
   559   ShowMission(loc("Backstab"), loc("Drills"), loc("You have 7 turns until the next wave arrives.|Make sure the arriving cannibals are greeted appropriately!|If the hog dies, the cause is lost.|Hint: you might want to use some mines..."), 1, 12000)
   546 end
   560 end
   547 
   561 
   548 function DoTurnsOver()
   562 function DoTurnsOver()
   549   stage = wave3Stage
   563   stage = wave3Stage
   550   RestoreWave(3)
   564   RestoreWave(3)
   574   stage = spyKillStage
   588   stage = spyKillStage
   575   AddEvent(CheckChoice, {}, DoChoice, {}, 0)
   589   AddEvent(CheckChoice, {}, DoChoice, {}, 0)
   576   AddEvent(CheckKilledOther, {}, DoKilledOther, {}, 0)
   590   AddEvent(CheckKilledOther, {}, DoKilledOther, {}, 0)
   577   AddEvent(CheckChoiceRefuse, {}, DoChoiceRefuse, {}, 0)
   591   AddEvent(CheckChoiceRefuse, {}, DoChoiceRefuse, {}, 0)
   578   ShowMission(loc("Backstab"), loc("Judas"), loc("Kill the traitor...or spare his life!|Kill him or press [Precise]!"), 1, 8000)
   592   ShowMission(loc("Backstab"), loc("Judas"), loc("Kill the traitor...or spare his life!|Kill him or press [Precise]!"), 1, 8000)
   579   ----------------------
       
   580   SetHealth(natives[leaksNum], 1)
       
   581 end
   593 end
   582 
   594 
   583 -----------------------------Events------------------------------------
   595 -----------------------------Events------------------------------------
   584 function CheckTurnsOver()
   596 function CheckTurnsOver()
   585   return TurnsLeft == 0
   597   return TurnsLeft == 0
   658   elseif index == 2 then
   670   elseif index == 2 then
   659     SetupWave2DeadAnim()
   671     SetupWave2DeadAnim()
   660     AddAnim(wave2DeadAnim)
   672     AddAnim(wave2DeadAnim)
   661     AddFunction({func = AfterWave2DeadAnim, args = {}})
   673     AddFunction({func = AfterWave2DeadAnim, args = {}})
   662   elseif index == 3 then
   674   elseif index == 3 then
   663     HideNatives()
   675     AnimSwitchHog(deployedHog)
   664     SetupWave3DeadAnim()
   676     AddFunction({func = AddWave3DeadAnim, args = {}})
   665     AddAnim(wave3DeadAnim)
   677   end
   666     AddFunction({func = AfterWave3DeadAnim, args = {}})
   678 end
   667   end
   679 
       
   680 function AddWave3DeadAnim()
       
   681   HideNatives()
       
   682   SetupWave3DeadAnim()
       
   683   AddAnim(wave3DeadAnim)
       
   684   AddFunction({func = AfterWave3DeadAnim, args = {}})
   668 end
   685 end
   669 
   686 
   670 function HideNatives()
   687 function HideNatives()
   671   for i = 1, 9 do
   688   for i = 1, 9 do
   672     if nativeDead[i] ~= true and natives[i] ~= deployedHog then
   689     if nativeDead[i] ~= true and natives[i] ~= deployedHog then
   687   table.insert(wave3DeadAnim, {func = AnimSay, args = {deployedHog, loc("Where are they?!"), SAY_THINK, 3000}})
   704   table.insert(wave3DeadAnim, {func = AnimSay, args = {deployedHog, loc("Where are they?!"), SAY_THINK, 3000}})
   688   table.insert(wave3DeadAnim, {func = AnimCustomFunction, args = {deployedHog, RestoreCyborg, {}}})
   705   table.insert(wave3DeadAnim, {func = AnimCustomFunction, args = {deployedHog, RestoreCyborg, {}}})
   689   table.insert(wave3DeadAnim, {func = AnimOutOfNowhere, args = {cyborg, 4040, 782}})
   706   table.insert(wave3DeadAnim, {func = AnimOutOfNowhere, args = {cyborg, 4040, 782}})
   690   table.insert(wave3DeadAnim, {func = AnimSay, args = {cyborg, loc("These primitive people are so funny!"), SAY_THINK, 6500}})
   707   table.insert(wave3DeadAnim, {func = AnimSay, args = {cyborg, loc("These primitive people are so funny!"), SAY_THINK, 6500}})
   691   table.insert(wave3DeadAnim, {func = AnimMove, args = {cyborg, "Right", 4060, 0}})
   708   table.insert(wave3DeadAnim, {func = AnimMove, args = {cyborg, "Right", 4060, 0}})
       
   709   table.insert(wave3DeadAnim, {func = AnimSwitchHog, args = {deployedHog}})
       
   710   table.insert(wave3DeadAnim, {func = AnimWait, args = {deployedHog, 1}})
   692   table.insert(wave3DeadAnim, {func = AnimCustomFunction, args = {deployedHog, HideCyborg, {}}})
   711   table.insert(wave3DeadAnim, {func = AnimCustomFunction, args = {deployedHog, HideCyborg, {}}})
   693   table.insert(wave3DeadAnim, {func = AnimSay, args = {deployedHog, loc("I need to find the others!"), SAY_THINK, 4500}})
   712   table.insert(wave3DeadAnim, {func = AnimSay, args = {deployedHog, loc("I need to find the others!"), SAY_THINK, 4500}})
   694   table.insert(wave3DeadAnim, {func = AnimSay, args = {deployedHog, loc("I have to follow that alien."), SAY_THINK, 4500}})
   713   table.insert(wave3DeadAnim, {func = AnimSay, args = {deployedHog, loc("I have to follow that alien."), SAY_THINK, 4500}})
   695 end
   714 end
   696 
   715 
   918 function onGameInit()
   937 function onGameInit()
   919 	Seed = 2
   938 	Seed = 2
   920 	GameFlags = gfSolidLand
   939 	GameFlags = gfSolidLand
   921 	TurnTime = 60000 
   940 	TurnTime = 60000 
   922 	CaseFreq = 0
   941 	CaseFreq = 0
   923 	MinesNum = 6
   942 	MinesNum = 0
   924 	MinesTime = 3000
   943 	MinesTime = 3000
   925 	Explosives = 6
   944 	Explosives = 0
   926 	Delay = 10 
   945 	Delay = 10 
   927   Map = "Cave"
   946   Map = "Cave"
   928 	Theme = "Nature"
   947 	Theme = "Nature"
   929   SuddenDeathTurns = 3000
   948   SuddenDeathTurns = 3000
   930 
   949 
  1020   if GetHogTeamName(CurrentHedgehog) == loc("Tribe") then
  1039   if GetHogTeamName(CurrentHedgehog) == loc("Tribe") then
  1021     TurnTimeLeft = 0
  1040     TurnTimeLeft = 0
  1022     return
  1041     return
  1023   end
  1042   end
  1024   TurnsLeft = TurnsLeft - 1
  1043   TurnsLeft = TurnsLeft - 1
       
  1044   
       
  1045   if stage == platformStage then
       
  1046     AddCaption(TurnsLeft .. " turns until arrival!")
       
  1047   end
  1025 
  1048 
  1026   if stage == spyKillStage then
  1049   if stage == spyKillStage then
  1027     if CurrentHedgehog == spyHog or GetHogTeamName(CurrentHedgehog) ~= loc("Natives") then
  1050     if CurrentHedgehog == spyHog or GetHogTeamName(CurrentHedgehog) ~= loc("Natives") then
  1028       TurnTimeLeft = 0
  1051       TurnTimeLeft = 0
  1029     else
  1052     else
  1041 
  1064 
  1042 function onGearDamage(gear, damage)
  1065 function onGearDamage(gear, damage)
  1043 end
  1066 end
  1044 
  1067 
  1045 function onPrecise()
  1068 function onPrecise()
  1046   if GameTime > 2500 then
  1069   if GameTime > 2500 and AnimInProgress() then
  1047     SetAnimSkip(true)
  1070     SetAnimSkip(true)
       
  1071     return
  1048   end
  1072   end
  1049   if stage == spyKillStage then
  1073   if stage == spyKillStage then
  1050     highJumped = true
  1074     highJumped = true
  1051   end
  1075   end
  1052 end
  1076 end