ACF3: Fix cannibals sometimes doing nothing for a full turn
authorWuzzy <Wuzzy2@mail.ru>
Fri, 09 Mar 2018 14:27:37 +0100
changeset 13142 39aa98d01e80
parent 13141 8f2260eeb726
child 13143 2c867c7d939f
ACF3: Fix cannibals sometimes doing nothing for a full turn This was because hogs got confused because walking was forbidden by SetInputMask. Now we use a proper hedgehog effect heArtillery.
ChangeLog.txt
share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/journey.lua
share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/shadow.lua
--- a/ChangeLog.txt	Fri Mar 09 12:55:54 2018 +0100
+++ b/ChangeLog.txt	Fri Mar 09 14:27:37 2018 +0100
@@ -73,6 +73,7 @@
  + Mission 2, Mission 5: Reduce computer hog levels
  * Fix incorrect storytelling in mission descriptions
  * Mission 1: Fix error message spam when Leaks a Lot drowns
+ * Mission 3: Fix cannibals sometimes doing nothing for a full turn
  * Mission 6: Fix cyborgs sometimes doing nothing for a full turn
 
 Missions:
--- a/share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/journey.lua	Fri Mar 09 12:55:54 2018 +0100
+++ b/share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/journey.lua	Fri Mar 09 14:27:37 2018 +0100
@@ -250,7 +250,6 @@
 function SkipMidAnimAlone()
   AnimSetGearPosition(leaks, 2656, 1842)
   AnimSwitchHog(leaks)
-  SetInputMask(0xFFFFFFFF)
   AnimWait(dense, 1)
   AddFunction({func = HideHedge, args = {princess}})
   AddFunction({func = HideHedge, args = {cyborg}})
@@ -1092,11 +1091,13 @@
   for i = 1, 4 do
     cannibals[i] = AddHog(cannibalNames[i], 3, 40, "Zombi")
     AnimSetGearPosition(cannibals[i], unpack(cannibalPos[i]))
+    SetEffect(cannibals[i], heArtillery, 1)
   end
 
   for i = 5, 8 do
     cannibals[i] = AddHog(cannibalNames[i], 3, 40, "Zombi")
     AnimSetGearPosition(cannibals[i], 0, 0)
+    SetEffect(cannibals[i], heArtillery, 1)
   end
 
   AddTeam(loc("011101001"), 14483456, "ring", "UFO", "Robot", "cm_binary")
@@ -1187,19 +1188,8 @@
     SetGearMessage(leaks, 0)
     TurnTimeLeft = -1
   elseif GetHogTeamName(CurrentHedgehog) ~= loc("Natives") then
-    for i = 1, 4 do
-      if cannibalDead[i] ~= true and leaksDead ~= true then
-        if GetX(cannibals[i]) < GetX(leaks) then
-          HogTurnLeft(cannibals[i], false)
-        else
-          HogTurnLeft(cannibals[i], true)
-        end
-      end
-    end
-    SetInputMask(band(0xFFFFFFFF, bnot(gmLeft + gmRight + gmLJump + gmHJump)))
     TurnTimeLeft = 20000
   else
-    SetInputMask(0xFFFFFFFF)
     TurnsLeft = TurnsLeft - 1
     if TurnsLeft >= 1 then
       AddCaption(string.format(loc("Turns left: %d"), TurnsLeft), 0xFFFFFFFF, capgrpGameState)
--- a/share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/shadow.lua	Fri Mar 09 12:55:54 2018 +0100
+++ b/share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/shadow.lua	Fri Mar 09 14:27:37 2018 +0100
@@ -200,7 +200,6 @@
   SetState(cannibals[1], 0)
   AnimTurn(leaks, "Right")
   AnimSwitchHog(leaks)
-  SetInputMask(0xFFFFFFFF)
 end
 
 function AfterWeaklingsAnim()
@@ -240,7 +239,6 @@
     AnimSetGearPosition(cannibals[i], unpack(cannibalPos[i]))
     SetState(cannibals[i], 0)
   end
-  SetInputMask(0xFFFFFFFF)
 end
 
 function AfterStronglingsAnim()
@@ -285,7 +283,6 @@
   HogTurnLeft(dense, true)
   AnimSetGearPosition(cyborg, 1250, 1315)
   SwitchHog(dense)
-  SetInputMask(0xFFFFFFFF)
 end
 
 function AfterAcceptedAnim()
@@ -312,7 +309,6 @@
   AnimSetGearPosition(cyborg, unpack(cyborgPos))
   SetState(cyborg, gstInvisible)
   AnimSwitchHog(dense)
-  SetInputMask(0xFFFFFFFF)
 end
 
 function AfterAttackedAnim()
@@ -355,7 +351,6 @@
   AnimSetGearPosition(cyborg, unpack(cyborgPos))
   SetState(cyborg, gstInvisible)
   AnimSwitchHog(leaks)
-  SetInputMask(0xFFFFFFFF)
 end