share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/shadow.lua
changeset 12774 eed03e531823
parent 12554 194b00c4ba07
child 12775 2c426663d971
equal deleted inserted replaced
12773:f1b3e33b0a0a 12774:eed03e531823
    82 isHidden = {}
    82 isHidden = {}
    83 
    83 
    84 
    84 
    85 --------------------------Anim skip functions--------------------------
    85 --------------------------Anim skip functions--------------------------
    86 function AfterRefusedAnim()
    86 function AfterRefusedAnim()
       
    87   if stage == loseStage then
       
    88     return
       
    89   end
    87   SpawnUtilityCrate(2045, 1575, amSwitch)
    90   SpawnUtilityCrate(2045, 1575, amSwitch)
    88   SpawnAmmoCrate(2365, 1495, amShotgun)
    91   SpawnAmmoCrate(2365, 1495, amShotgun)
    89   SpawnAmmoCrate(2495, 1519, amGrenade)
    92   SpawnAmmoCrate(2495, 1519, amGrenade)
    90   SpawnUtilityCrate(2620, 1524, amRope)
    93   SpawnUtilityCrate(2620, 1524, amRope)
    91   ShowMission(loc("The Shadow Falls"), loc("The Showdown"), loc("Save Leaks A Lot!|Hint: The switch hedgehog utility might be of help to you."), 1, 6000)
    94   ShowMission(loc("The Shadow Falls"), loc("The Showdown"), loc("Save Leaks A Lot!|Hint: The switch hedgehog utility might be of help to you."), 1, 6000)
   104   AnimWait(ramon, 1)
   107   AnimWait(ramon, 1)
   105   AddFunction({func = HideHog, args = {cyborg}})
   108   AddFunction({func = HideHog, args = {cyborg}})
   106 end
   109 end
   107 
   110 
   108 function SkipRefusedAnim()
   111 function SkipRefusedAnim()
       
   112   if stage == loseStage then
       
   113     return
       
   114   end
   109   RefusedStart()
   115   RefusedStart()
   110   AnimSetGearPosition(dense, 2645, 1146)
   116   AnimSetGearPosition(dense, 2645, 1146)
   111   AnimSetGearPosition(ramon, 2218, 1675)
   117   AnimSetGearPosition(ramon, 2218, 1675)
   112   AnimSetGearPosition(spiky, 2400, 1675)
   118   AnimSetGearPosition(spiky, 2400, 1675)
   113 end
   119 end
   114 
   120 
   115 function AfterStartDialogue()
   121 function AfterStartDialogue()
       
   122   if stage == loseStage then
       
   123     return
       
   124   end
   116   stage = spyStage
   125   stage = spyStage
   117   ShowMission(loc("The Shadow Falls"), loc("Play with me!"), loc("Kill the cannibal!"), 1, 6000)
   126   ShowMission(loc("The Shadow Falls"), loc("Play with me!"), loc("Kill the cannibal!"), 1, 6000)
   118   TurnTimeLeft = TurnTime
   127   TurnTimeLeft = TurnTime
   119 end
   128 end
   120 
   129 
   121 
   130 
   122 function StartSkipFunc()
   131 function StartSkipFunc()
       
   132   if stage == loseStage then
       
   133     return
       
   134   end
   123   SetState(cannibals[1], 0)
   135   SetState(cannibals[1], 0)
   124   AnimTurn(leaks, "Right")
   136   AnimTurn(leaks, "Right")
   125   AnimSwitchHog(leaks)
   137   AnimSwitchHog(leaks)
   126   SetInputMask(0xFFFFFFFF)
   138   SetInputMask(0xFFFFFFFF)
   127 end
   139 end
   128 
   140 
   129 function AfterWeaklingsAnim()
   141 function AfterWeaklingsAnim()
       
   142   if stage == loseStage then
       
   143     return
       
   144   end
   130   AddAmmo(cannibals[2], amShotgun, 1)
   145   AddAmmo(cannibals[2], amShotgun, 1)
   131   AddAmmo(cannibals[2], amGrenade, 1)
   146   AddAmmo(cannibals[2], amGrenade, 1)
   132   AddAmmo(cannibals[3], amShotgun, 1)
   147   AddAmmo(cannibals[3], amShotgun, 1)
   133   AddAmmo(cannibals[3], amGrenade, 1)
   148   AddAmmo(cannibals[3], amGrenade, 1)
   134   AddAmmo(cannibals[4], amShotgun, 1)
   149   AddAmmo(cannibals[4], amShotgun, 1)
   147   TurnTimeLeft = TurnTime
   162   TurnTimeLeft = TurnTime
   148   ShowMission(loc("The Shadow Falls"), loc("Why do you not like me?"), loc("Obliterate them!|Hint: You might want to take cover..."), 1, 6000)
   163   ShowMission(loc("The Shadow Falls"), loc("Why do you not like me?"), loc("Obliterate them!|Hint: You might want to take cover..."), 1, 6000)
   149 end
   164 end
   150 
   165 
   151 function SkipWeaklingsAnim()
   166 function SkipWeaklingsAnim()
       
   167   if stage == loseStage then
       
   168     return
       
   169   end
   152   for i = 2, 5 do
   170   for i = 2, 5 do
   153     if isHidden[cannibals[i]] == true then
   171     if isHidden[cannibals[i]] == true then
   154       RestoreHog(cannibals[i])
   172       RestoreHog(cannibals[i])
   155       isHidden[cannibals[i]] = false
   173       isHidden[cannibals[i]] = false
   156     end
   174     end
   159   end
   177   end
   160   SetInputMask(0xFFFFFFFF)
   178   SetInputMask(0xFFFFFFFF)
   161 end
   179 end
   162 
   180 
   163 function AfterStronglingsAnim()
   181 function AfterStronglingsAnim()
       
   182   if stage == loseStage then
       
   183     return
       
   184   end
   164   stage = cyborgStage
   185   stage = cyborgStage
   165   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)
   186   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)
   166   AddEvent(CheckChoice, {}, DoChoice, {}, 0)
   187   AddEvent(CheckChoice, {}, DoChoice, {}, 0)
   167   AddEvent(CheckRefuse, {}, DoRefuse, {}, 0)
   188   AddEvent(CheckRefuse, {}, DoRefuse, {}, 0)
   168   AddEvent(CheckAccept, {}, DoAccept, {}, 0)
   189   AddEvent(CheckAccept, {}, DoAccept, {}, 0)
   175   SetHealth(SpawnHealthCrate(3599, 1009), 50)
   196   SetHealth(SpawnHealthCrate(3599, 1009), 50)
   176   EndTurn(true)
   197   EndTurn(true)
   177 end
   198 end
   178 
   199 
   179 function SkipStronglingsAnim()
   200 function SkipStronglingsAnim()
       
   201   if stage == loseStage then
       
   202     return
       
   203   end
   180   for i = 6, 9 do
   204   for i = 6, 9 do
   181     if isHidden[cannibals[i]] == true then
   205     if isHidden[cannibals[i]] == true then
   182       RestoreHog(cannibals[i])
   206       RestoreHog(cannibals[i])
   183       isHidden[cannibals[i]] = false
   207       isHidden[cannibals[i]] = false
   184     end
   208     end
   198   SwitchHog(dense)
   222   SwitchHog(dense)
   199   SetInputMask(0xFFFFFFFF)
   223   SetInputMask(0xFFFFFFFF)
   200 end
   224 end
   201 
   225 
   202 function AfterAcceptedAnim()
   226 function AfterAcceptedAnim()
       
   227   if stage == loseStage then
       
   228     return
       
   229   end
   203   stage = acceptedReturnStage
   230   stage = acceptedReturnStage
   204   SpawnUtilityCrate(1370, 810, amGirder)
   231   SpawnUtilityCrate(1370, 810, amGirder)
   205   SpawnUtilityCrate(1300, 810, amParachute)
   232   SpawnUtilityCrate(1300, 810, amParachute)
   206   ShowMission(loc("The Shadow Falls"), loc("The walk of Fame"), loc("Return to Leaks A Lot!"), 1, 6000)
   233   ShowMission(loc("The Shadow Falls"), loc("The walk of Fame"), loc("Return to Leaks A Lot!"), 1, 6000)
   207   AddEvent(CheckReadyForStronglings, {}, DoReadyForStronglings, {}, 0)
   234   AddEvent(CheckReadyForStronglings, {}, DoReadyForStronglings, {}, 0)
   212   AnimWait(dense, 1)
   239   AnimWait(dense, 1)
   213   AddFunction({func = HideHog, args = {cyborg}})
   240   AddFunction({func = HideHog, args = {cyborg}})
   214 end
   241 end
   215 
   242 
   216 function SkipAcceptedAnim()
   243 function SkipAcceptedAnim()
       
   244   if stage == loseStage then
       
   245     return
       
   246   end
   217   AnimSetGearPosition(cyborg, unpack(cyborgPos))
   247   AnimSetGearPosition(cyborg, unpack(cyborgPos))
   218   SetState(cyborg, gstInvisible)
   248   SetState(cyborg, gstInvisible)
   219   AnimSwitchHog(dense)
   249   AnimSwitchHog(dense)
   220   SetInputMask(0xFFFFFFFF)
   250   SetInputMask(0xFFFFFFFF)
   221 end
   251 end
   222 
   252 
   223 function AfterAttackedAnim()
   253 function AfterAttackedAnim()
       
   254   if stage == loseStage then
       
   255     return
       
   256   end
   224   stage = aloneStage
   257   stage = aloneStage
   225   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)
   258   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)
   226   AddAmmo(cannibals[6], amGrenade, 1)
   259   AddAmmo(cannibals[6], amGrenade, 1)
   227   AddAmmo(cannibals[6], amFirePunch, 0)
   260   AddAmmo(cannibals[6], amFirePunch, 0)
   228   AddAmmo(cannibals[6], amBaseballBat, 0)
   261   AddAmmo(cannibals[6], amBaseballBat, 0)
   242   AnimWait(dense, 1)
   275   AnimWait(dense, 1)
   243   AddFunction({func = HideHog, args = {cyborg}})
   276   AddFunction({func = HideHog, args = {cyborg}})
   244 end
   277 end
   245 
   278 
   246 function SkipAttackedAnim()
   279 function SkipAttackedAnim()
       
   280   if stage == loseStage then
       
   281     return
       
   282   end
   247   if denseDead == false then
   283   if denseDead == false then
   248     DeleteGear(dense)
   284     DeleteGear(dense)
   249   end
   285   end
   250   SpawnAmmoCrate(2551, 994, amGrenade)
   286   SpawnAmmoCrate(2551, 994, amGrenade)
   251   SpawnAmmoCrate(3551, 994, amGrenade)
   287   SpawnAmmoCrate(3551, 994, amGrenade)
   267   SpawnAmmoCrate(3192, 1101, amShotgun)
   303   SpawnAmmoCrate(3192, 1101, amShotgun)
   268   return true
   304   return true
   269 end
   305 end
   270 
   306 
   271 function EmitDenseClouds(anim, dir)
   307 function EmitDenseClouds(anim, dir)
       
   308   if stage == loseStage then
       
   309     return
       
   310   end
   272   local dif
   311   local dif
   273   if dir == "Left" then 
   312   if dir == "Left" then 
   274     dif = 10
   313     dif = 10
   275   else
   314   else
   276     dif = -10
   315     dif = -10
   284   AnimInsertStepNext({func = AnimWait, args = {dense, 800}})
   323   AnimInsertStepNext({func = AnimWait, args = {dense, 800}})
   285   AnimInsertStepNext({func = AnimVisualGear, args = {dense, GetX(dense) + dif, GetY(dense) + dif, vgtSteam, 0, true}, swh = false})
   324   AnimInsertStepNext({func = AnimVisualGear, args = {dense, GetX(dense) + dif, GetY(dense) + dif, vgtSteam, 0, true}, swh = false})
   286 end
   325 end
   287 
   326 
   288 function BlowDenseCloud()
   327 function BlowDenseCloud()
       
   328   if stage == loseStage then
       
   329     return
       
   330   end
   289   AnimInsertStepNext({func = DeleteGear, args = {dense}, swh = false}) 
   331   AnimInsertStepNext({func = DeleteGear, args = {dense}, swh = false}) 
   290   AnimInsertStepNext({func = AnimVisualGear, args = {dense, GetX(dense), GetY(dense), vgtBigExplosion, 0, true}, swh = false})
   332   AnimInsertStepNext({func = AnimVisualGear, args = {dense, GetX(dense), GetY(dense), vgtBigExplosion, 0, true}, swh = false})
   291   AnimInsertStepNext({func = AnimWait, args = {dense, 1200}})
   333   AnimInsertStepNext({func = AnimWait, args = {dense, 1200}})
   292   AnimInsertStepNext({func = AnimVisualGear, args = {dense, GetX(dense) + 20, GetY(dense), vgtExplosion, 0, true}, swh = false})
   334   AnimInsertStepNext({func = AnimVisualGear, args = {dense, GetX(dense) + 20, GetY(dense), vgtExplosion, 0, true}, swh = false})
   293   AnimInsertStepNext({func = AnimWait, args = {dense, 100}})
   335   AnimInsertStepNext({func = AnimWait, args = {dense, 100}})
   480 
   522 
   481 -----------------------------Misc--------------------------------------
   523 -----------------------------Misc--------------------------------------
   482 
   524 
   483 
   525 
   484 function RefusedStart()
   526 function RefusedStart()
       
   527   if stage == loseStage then
       
   528     return
       
   529   end
   485   if ramonHidden == true then
   530   if ramonHidden == true then
   486     RestoreHog(ramon)
   531     RestoreHog(ramon)
   487     ramonHidden = false
   532     ramonHidden = false
   488   end
   533   end
   489   if spikyHidden == true then
   534   if spikyHidden == true then
   551   SetState(ramon, gstInvisible)
   596   SetState(ramon, gstInvisible)
   552   SetState(spiky, gstInvisible)
   597   SetState(spiky, gstInvisible)
   553 end
   598 end
   554 
   599 
   555 function CondNeedToTurn(hog1, hog2)
   600 function CondNeedToTurn(hog1, hog2)
       
   601   if stage == loseStage then
       
   602     return
       
   603   end
   556   xl, xd = GetX(hog1), GetX(hog2)
   604   xl, xd = GetX(hog1), GetX(hog2)
   557   if xl > xd then
   605   if xl and xd then
   558     AnimInsertStepNext({func = AnimTurn, args = {hog1, "Left"}})
   606     if xl > xd then
   559     AnimInsertStepNext({func = AnimTurn, args = {hog2, "Right"}})
   607       AnimInsertStepNext({func = AnimTurn, args = {hog1, "Left"}})
   560   elseif xl < xd then
   608       AnimInsertStepNext({func = AnimTurn, args = {hog2, "Right"}})
   561     AnimInsertStepNext({func = AnimTurn, args = {hog2, "Left"}})
   609     elseif xl < xd then
   562     AnimInsertStepNext({func = AnimTurn, args = {hog1, "Right"}})
   610       AnimInsertStepNext({func = AnimTurn, args = {hog2, "Left"}})
       
   611       AnimInsertStepNext({func = AnimTurn, args = {hog1, "Right"}})
       
   612     end
   563   end
   613   end
   564 end
   614 end
   565 
   615 
   566 function HideHogs()
   616 function HideHogs()
   567   for i = 2, 9 do
   617   for i = 2, 9 do
   575   ramonHidden = true
   625   ramonHidden = true
   576   spikyHidden = true
   626   spikyHidden = true
   577 end
   627 end
   578 
   628 
   579 function HideStronglings()
   629 function HideStronglings()
       
   630   if stage == loseStage then
       
   631     return
       
   632   end
   580   for i = 6, 9 do
   633   for i = 6, 9 do
   581     HideHog(cannibals[i])
   634     HideHog(cannibals[i])
   582     isHidden[cannibals[i]] = true
   635     isHidden[cannibals[i]] = true
   583   end
   636   end
   584 end
   637 end
   585 
   638 
   586 function UnHideWeaklings()
   639 function UnHideWeaklings()
       
   640   if stage == loseStage then
       
   641     return
       
   642   end
   587   for i = 2, 5 do
   643   for i = 2, 5 do
   588     RestoreHog(cannibals[i])
   644     RestoreHog(cannibals[i])
   589     isHidden[cannibals[i]] = false
   645     isHidden[cannibals[i]] = false
   590     SetState(cannibals[i], gstInvisible)
   646     SetState(cannibals[i], gstInvisible)
   591   end
   647   end
   592 end
   648 end
   593 
   649 
   594 function UnHideStronglings()
   650 function UnHideStronglings()
       
   651   if stage == loseStage then
       
   652     return
       
   653   end
   595   for i = 6, 9 do
   654   for i = 6, 9 do
   596     RestoreHog(cannibals[i])
   655     RestoreHog(cannibals[i])
   597     isHidden[cannibals[i]] = false
   656     isHidden[cannibals[i]] = false
   598     SetState(cannibals[i], gstInvisible)
   657     SetState(cannibals[i], gstInvisible)
   599   end
   658   end
   601   cyborgHidden = false
   660   cyborgHidden = false
   602   SetState(cyborg, gstInvisible)
   661   SetState(cyborg, gstInvisible)
   603 end
   662 end
   604 
   663 
   605 function ChoiceTaken()
   664 function ChoiceTaken()
       
   665   if stage == loseStage then
       
   666     return
       
   667   end
   606   SetGearMessage(CurrentHedgehog, 0)
   668   SetGearMessage(CurrentHedgehog, 0)
   607   if choice == choiceAccept then
   669   if choice == choiceAccept then
   608     AddAnim(acceptedAnim)
   670     AddAnim(acceptedAnim)
   609     AddFunction({func = AfterAcceptedAnim, args = {}})
   671     AddFunction({func = AfterAcceptedAnim, args = {}})
   610   elseif choice == choiceRefuse then
   672   elseif choice == choiceRefuse then
   615     AddFunction({func = AfterAttackedAnim, args = {}})
   677     AddFunction({func = AfterAttackedAnim, args = {}})
   616   end
   678   end
   617 end
   679 end
   618 
   680 
   619 function KillCyborg()
   681 function KillCyborg()
       
   682   if stage == loseStage then
       
   683     return
       
   684   end
   620   RestoreHog(cyborg)
   685   RestoreHog(cyborg)
   621   DeleteGear(cyborg)
   686   DeleteGear(cyborg)
   622   EndTurn(true)
   687   EndTurn(true)
   623 end
   688 end
   624 -----------------------------Events------------------------------------
   689 -----------------------------Events------------------------------------
   626 function CheckBrainiacDead()
   691 function CheckBrainiacDead()
   627   return brainiacDead
   692   return brainiacDead
   628 end
   693 end
   629 
   694 
   630 function DoBrainiacDead()
   695 function DoBrainiacDead()
       
   696   if stage == loseStage then
       
   697     return
       
   698   end
   631   EndTurn(true)
   699   EndTurn(true)
   632   SetGearMessage(CurrentHedgehog, 0)
   700   SetGearMessage(CurrentHedgehog, 0)
   633   AddAnim(weaklingsAnim)
   701   AddAnim(weaklingsAnim)
   634   AddFunction({func = AfterWeaklingsAnim, args = {}})
   702   AddFunction({func = AfterWeaklingsAnim, args = {}})
   635   stage = interSpyStage
   703   stage = interSpyStage
   643   end
   711   end
   644   return true
   712   return true
   645 end
   713 end
   646 
   714 
   647 function DoWeaklingsKilled()
   715 function DoWeaklingsKilled()
       
   716   if stage == loseStage then
       
   717     return
       
   718   end
   648   SetGearMessage(CurrentHedgehog, 0)
   719   SetGearMessage(CurrentHedgehog, 0)
   649   AddAnim(stronglingsAnim)
   720   AddAnim(stronglingsAnim)
   650   AddFunction({func = AfterStronglingsAnim, args = {}})
   721   AddFunction({func = AfterStronglingsAnim, args = {}})
   651   stage = interWeakStage
   722   stage = interWeakStage
   652   DismissTeam(loc("Weaklings"))
   723   DismissTeam(loc("Weaklings"))
   655 function CheckRefuse()
   726 function CheckRefuse()
   656   return GetX(dense) > 1400 and StoppedGear(dense)
   727   return GetX(dense) > 1400 and StoppedGear(dense)
   657 end
   728 end
   658 
   729 
   659 function DoRefuse()
   730 function DoRefuse()
       
   731   if stage == loseStage then
       
   732     return
       
   733   end
   660   choice = choiceRefuse
   734   choice = choiceRefuse
   661 end
   735 end
   662 
   736 
   663 function CheckAccept()
   737 function CheckAccept()
   664   return GetX(dense) < 1300 and StoppedGear(dense)
   738   return GetX(dense) < 1300 and StoppedGear(dense)
   665 end
   739 end
   666 
   740 
   667 function DoAccept()
   741 function DoAccept()
       
   742   if stage == loseStage then
       
   743     return
       
   744   end
   668   choice = choiceAccept
   745   choice = choiceAccept
   669 end
   746 end
   670 
   747 
   671 function CheckConfront()
   748 function CheckConfront()
   672   return cyborgAttacked and StoppedGear(dense)
   749   return cyborgAttacked and StoppedGear(dense)
   673 end
   750 end
   674 
   751 
   675 function DoConfront()
   752 function DoConfront()
       
   753   if stage == loseStage then
       
   754     return
       
   755   end
   676   choice = choiceAttack
   756   choice = choiceAttack
   677 end
   757 end
   678 
   758 
   679 function CheckChoice()
   759 function CheckChoice()
   680   return choice ~= 0
   760   return choice ~= 0
   681 end
   761 end
   682 
   762 
   683 function DoChoice()
   763 function DoChoice()
       
   764   if stage == loseStage then
       
   765     return
       
   766   end
   684   RemoveEventFunc(CheckConfront)
   767   RemoveEventFunc(CheckConfront)
   685   RemoveEventFunc(CheckAccept)
   768   RemoveEventFunc(CheckAccept)
   686   RemoveEventFunc(CheckRefuse)
   769   RemoveEventFunc(CheckRefuse)
   687   ChoiceTaken()
   770   ChoiceTaken()
   688 end
   771 end
   689 
   772 
   690 function CheckNeedGirder()
   773 function CheckNeedGirder()
       
   774   if stage == loseStage then
       
   775     return false
       
   776   end
   691   return GetX(dense) > 1640 and StoppedGear(dense)
   777   return GetX(dense) > 1640 and StoppedGear(dense)
   692 end
   778 end
   693 
   779 
   694 function DoNeedGirder()
   780 function DoNeedGirder()
       
   781   if stage == loseStage then
       
   782     return
       
   783   end
   695   ShowMission(loc("The Shadow Falls"), loc("Under Construction"), loc("Return to Leaks A Lot!") .. "|" .. loc("To place a girder, select it, use [Left] and [Right] to select angle and length, place with [Left Click]"), 1, 6000)
   784   ShowMission(loc("The Shadow Falls"), loc("Under Construction"), loc("Return to Leaks A Lot!") .. "|" .. loc("To place a girder, select it, use [Left] and [Right] to select angle and length, place with [Left Click]"), 1, 6000)
   696 end
   785 end
   697 
   786 
   698 function CheckNeedWeapons()
   787 function CheckNeedWeapons()
       
   788   if stage == loseStage then
       
   789     return false
       
   790   end
   699   return GetX(dense) > 2522 and StoppedGear(dense)
   791   return GetX(dense) > 2522 and StoppedGear(dense)
   700 end
   792 end
   701 
   793 
   702 function DoNeedWeapons()
   794 function DoNeedWeapons()
       
   795   if stage == loseStage then
       
   796     return
       
   797   end
   703   grenadeCrate = SpawnAmmoCrate(2550, 800, amGrenade)
   798   grenadeCrate = SpawnAmmoCrate(2550, 800, amGrenade)
   704   shotgunCrate = SpawnAmmoCrate(2610, 850, amShotgun)
   799   shotgunCrate = SpawnAmmoCrate(2610, 850, amShotgun)
   705   AddCaption(loc("A little gift from the cyborgs"))
   800   AddCaption(loc("A little gift from the cyborgs"))
   706 end
   801 end
   707 
   802 
   708 function CheckReadyForStronglings()
   803 function CheckReadyForStronglings()
       
   804   if stage == loseStage then
       
   805     return false
       
   806   end
   709   return (shotgunTaken and grenadeTaken) or GetX(dense) > 2700
   807   return (shotgunTaken and grenadeTaken) or GetX(dense) > 2700
   710 end
   808 end
   711 
   809 
   712 function DoReadyForStronglings()
   810 function DoReadyForStronglings()
       
   811   if stage == loseStage then
       
   812     return
       
   813   end
   713   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)
   814   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)
   714   AddAmmo(dense, amSkip, 100)
   815   AddAmmo(dense, amSkip, 100)
   715   AddAmmo(dense, amSwitch, 100)
   816   AddAmmo(dense, amSwitch, 100)
   716   AddAmmo(leaks, amSkip, 100)
   817   AddAmmo(leaks, amSkip, 100)
   717   AddAmmo(leaks, amSwitch, 100)
   818   AddAmmo(leaks, amSwitch, 100)
   731   SetGearMessage(dense, 0)
   832   SetGearMessage(dense, 0)
   732   TurnTimeLeft = TurnTime
   833   TurnTimeLeft = TurnTime
   733 end
   834 end
   734 
   835 
   735 function DoStronglingsDead()
   836 function DoStronglingsDead()
       
   837   if stage == loseStage then
       
   838     return
       
   839   end
   736   SetGearMessage(CurrentHedgehog, 0)
   840   SetGearMessage(CurrentHedgehog, 0)
   737   if denseDead == true then
   841   if denseDead == true then
   738     AddAnim(acceptedDiedFinalAnim)
   842     AddAnim(acceptedDiedFinalAnim)
   739     SaveCampaignVar("M2DenseDead", "1")
   843     SaveCampaignVar("M2DenseDead", "1")
   740   else
   844   else
   750   end
   854   end
   751   SaveCampaignVar("M2Choice", "" .. choice)
   855   SaveCampaignVar("M2Choice", "" .. choice)
   752 end
   856 end
   753 
   857 
   754 function DoStronglingsDeadRefused()
   858 function DoStronglingsDeadRefused()
       
   859   if stage == loseStage then
       
   860     return
       
   861   end
   755   if denseDead == true then
   862   if denseDead == true then
   756     SaveCampaignVar("M2DenseDead", "1")
   863     SaveCampaignVar("M2DenseDead", "1")
   757   else
   864   else
   758     SaveCampaignVar("M2DenseDead", "0")
   865     SaveCampaignVar("M2DenseDead", "0")
   759   end
   866   end
   774   end
   881   end
   775   SaveCampaignVar("M2Choice", "" .. choice)
   882   SaveCampaignVar("M2Choice", "" .. choice)
   776 end
   883 end
   777 
   884 
   778 function DoStronglingsDeadAttacked()
   885 function DoStronglingsDeadAttacked()
       
   886   if stage == loseStage then
       
   887     return
       
   888   end
   779   SaveCampaignVar("M2DenseDead", "1")
   889   SaveCampaignVar("M2DenseDead", "1")
   780   SaveCampaignVar("M2RamonDead", "0")
   890   SaveCampaignVar("M2RamonDead", "0")
   781   SaveCampaignVar("M2SpikyDead", "0")
   891   SaveCampaignVar("M2SpikyDead", "0")
   782   if progress and progress<2 then
   892   if progress and progress<2 then
   783     SaveCampaignVar("Progress", "2")
   893     SaveCampaignVar("Progress", "2")
   802 function CheckLeaksDead()
   912 function CheckLeaksDead()
   803   return leaksDead
   913   return leaksDead
   804 end
   914 end
   805 
   915 
   806 function DoDead()
   916 function DoDead()
       
   917   if stage == loseStage then
       
   918     return
       
   919   end
   807   AddCaption(loc("...and so the cyborgs took over the world..."))
   920   AddCaption(loc("...and so the cyborgs took over the world..."))
   808   stage = loseStage
   921   stage = loseStage
   809   EndTurn(true)
       
   810   DismissTeam(loc("Natives"))
   922   DismissTeam(loc("Natives"))
   811 end
   923 end
   812 
   924 
   813 function CheckDenseDead()
   925 function CheckDenseDead()
   814   return denseDead and choice ~= choiceAttack 
   926   return denseDead and choice ~= choiceAttack