ACF5: Fix number of turns before 3rd wave appears not always being 7
authorWuzzy <Wuzzy2@mail.ru>
Sun, 26 May 2019 15:37:49 +0200
changeset 15054 c59bdec25012
parent 15053 e3b3fa42a93b
child 15055 3e79818e21b1
ACF5: Fix number of turns before 3rd wave appears not always being 7
share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/backstab.lua
--- a/share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/backstab.lua	Sun May 26 14:27:55 2019 +0200
+++ b/share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/backstab.lua	Sun May 26 15:37:49 2019 +0200
@@ -141,7 +141,7 @@
 stage = 0
 choice = 0
 highJumped = false
-TurnsLeft = 0
+wave3TurnsLeft = nil
 startNativesNum = 0
 nativesTeamName = nil
 tribeTeamName = nil
@@ -646,7 +646,6 @@
 end
 
 function AfterWave2DeadAnim()
-  TurnsLeft = 7
   stage = platformStage
   SpawnPlatformCrates()
   SetGearMessage(CurrentHedgehog, 0)
@@ -697,7 +696,7 @@
 
 -----------------------------Events------------------------------------
 function CheckTurnsOver()
-  return TurnsLeft == 0
+  return wave3TurnsLeft == 0
 end
 
 function CheckDeployedDead()
@@ -1177,10 +1176,15 @@
     return
   end
 
-  TurnsLeft = TurnsLeft - 1
-  
   if stage == platformStage then
-    AddCaption(string.format(loc("Turns until arrival: %d"), TurnsLeft))
+    if wave3TurnsLeft == nil then
+      wave3TurnsLeft = 7
+    else
+      wave3TurnsLeft = wave3TurnsLeft - 1
+    end
+    if wave3TurnsLeft > 0 then
+      AddCaption(string.format(loc("Turns until arrival: %d"), wave3TurnsLeft))
+    end
   end
   if deployedHog then
     if GetHogTeamName(CurrentHedgehog) == nativesTeamName then