ACF6: (Re-)initialize turn properly after cut scenes
authorWuzzy <Wuzzy2@mail.ru>
Sun, 26 May 2019 20:45:08 +0200
changeset 15083 3fe414620cc6
parent 15082 984c427297bb
child 15084 0c902b30de39
ACF6: (Re-)initialize turn properly after cut scenes
share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/dragon.lua
--- a/share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/dragon.lua	Sun May 26 19:59:54 2019 +0200
+++ b/share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/dragon.lua	Sun May 26 20:45:08 2019 +0200
@@ -212,6 +212,8 @@
 cratesTaken = false
 doneCyborgsDead = false
 
+timeAfterCratesTaken = nil
+
 annoyingGearsForPortalScene = {}
 -----------------------------Animations--------------------------------
 function EmitDenseClouds(dir)
@@ -383,7 +385,8 @@
 function AfterKillAnim()
   if not cyborgsKilledBeforeCrates then
     PutWeaponCrates()
-    SetTurnTimeLeft(TurnTime)
+    SetTurnTimeLeft(timeAfterCratesTaken)
+    SetReadyTimeLeft(Ready)
     AddEvent(CheckCyborgsDead, {}, DoCyborgsDead, {}, 0)
     ShowMission(loc("Dragon's Lair"), loc("The Slaughter"), loc("Kill the aliens!").."|"..loc("Mines time: 5 seconds"), 1, 2000)
   end
@@ -398,7 +401,7 @@
 function AfterKilledAnim()
   -- Final mission segment with the portal gun
   HideHedge(cyborg)
-  SetTurnTimeLeft(TurnTime)
+  EndTurn(true)
   SetGearMessage(native, 0)
   SpawnSupplyCrate(1184, 399, amPortalGun, 100)
   SpawnSupplyCrate(2259, 755, amTeleport, 2)
@@ -460,6 +463,7 @@
 
 function DoCratesTaken()
   cratesTaken = true
+  timeAfterCratesTaken = TurnTimeLeft
   SetupKillAnim()
   SetGearMessage(CurrentHedgehog, 0)
   AddAnim(killAnim)