ACF2: Replace isHogAlive with IsHogAlive
authorWuzzy <Wuzzy2@mail.ru>
Wed, 29 May 2019 13:21:23 +0200
changeset 15085 cd60866e6efb
parent 15084 424e3b132dd3
child 15086 3a561db2a71c
ACF2: Replace isHogAlive with IsHogAlive
share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/shadow.lua
--- a/share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/shadow.lua	Fri May 31 11:08:54 2019 +0200
+++ b/share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/shadow.lua	Wed May 29 13:21:23 2019 +0200
@@ -757,23 +757,11 @@
   return brainiacDead
 end
 
-function isHogAlive(hog)
-  if GetHealth(hog) == nil or GetHealth(hog) <= 0 then
-    return false
-  else
-    local _,_,_,_,_,_,_,_,_,_,_,damage = GetGearValues(hog)
-    if damage > GetHealth(hog)  then
-      return false
-    end
-  end
-  return true
-end
-
 function DoBrainiacDead()
   if stage == loseStage then
     return
   end
-  if (not isHogAlive(dense)) or (not isHogAlive(leaks)) then
+  if (not IsHogAlive(dense)) or (not IsHogAlive(leaks)) then
     return
   end
 
@@ -797,7 +785,7 @@
   if stage == loseStage then
     return
   end
-  if (not isHogAlive(dense)) or (not isHogAlive(leaks)) then
+  if (not IsHogAlive(dense)) or (not IsHogAlive(leaks)) then
     return
   end
   SetGearMessage(CurrentHedgehog, 0)
@@ -808,7 +796,7 @@
 end
 
 function CheckRefuse()
-  return isHogAlive(dense) and GetX(dense) > 1400 and StoppedGear(dense)
+  return IsHogAlive(dense) and GetX(dense) > 1400 and StoppedGear(dense)
 end
 
 function DoRefuse()
@@ -819,7 +807,7 @@
 end
 
 function CheckAccept()
-  if not isHogAlive(dense) then
+  if not IsHogAlive(dense) then
     return false
   end
   if GetX(dense) < 1300 then
@@ -843,7 +831,7 @@
 end
 
 function CheckConfront()
-  return cyborgAttacked and isHogAlive(dense) and StoppedGear(dense)
+  return cyborgAttacked and IsHogAlive(dense) and StoppedGear(dense)
 end
 
 function DoConfront()
@@ -907,7 +895,7 @@
   if stage == loseStage then
     return false
   end
-  if not isHogAlive(dense) then
+  if not IsHogAlive(dense) then
     return false
   end
   return (shotgunTaken and grenadeTaken) or GetX(dense) > 2700
@@ -945,7 +933,7 @@
   if stage == loseStage then
     return
   end
-  if not isHogAlive(leaks) then
+  if not IsHogAlive(leaks) then
     return
   end
   SetGearMessage(CurrentHedgehog, 0)