# HG changeset patch # User Wuzzy # Date 1559128883 -7200 # Node ID cd60866e6efbb5039bee981d7e465dcd51046d57 # Parent 424e3b132dd35bb192b030a31f4ed0bc25e21a9d ACF2: Replace isHogAlive with IsHogAlive diff -r 424e3b132dd3 -r cd60866e6efb 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)