fix: wip changes for traits and infection healing
This commit is contained in:
@@ -94,7 +94,8 @@ function LocalPlayerController.HealArea(bodyPart)
|
|||||||
bodyPart:setBleedingTime(0)
|
bodyPart:setBleedingTime(0)
|
||||||
|
|
||||||
bodyPart:SetBitten(false)
|
bodyPart:SetBitten(false)
|
||||||
bodyPart:setBiteTime(0)
|
--bodyPart:setBiteTime(0)
|
||||||
|
bodyPart:SetInfected(false)
|
||||||
|
|
||||||
bodyPart:setCut(false)
|
bodyPart:setCut(false)
|
||||||
bodyPart:setCutTime(0)
|
bodyPart:setCutTime(0)
|
||||||
@@ -111,13 +112,14 @@ end
|
|||||||
---@param bodyPart BodyPart
|
---@param bodyPart BodyPart
|
||||||
---@param limbName string
|
---@param limbName string
|
||||||
---@param dcInst DataController
|
---@param dcInst DataController
|
||||||
function LocalPlayerController.HealZombieInfection(bodyDamage, bodyPart, limbName, dcInst)
|
function LocalPlayerController.HealZombieInfection(bodyDamage, limbName, dcInst)
|
||||||
|
-- FIX Different in B42.13, to be set with stats?
|
||||||
if bodyDamage:isInfected() == false then return end
|
if bodyDamage:isInfected() == false then return end
|
||||||
|
|
||||||
bodyDamage:setInfected(false)
|
bodyDamage:setInfected(false)
|
||||||
bodyDamage:setInfectionMortalityDuration(-1)
|
bodyDamage:setInfectionMortalityDuration(-1)
|
||||||
bodyDamage:setInfectionTime(-1)
|
bodyDamage:setInfectionTime(-1)
|
||||||
bodyPart:SetInfected(false)
|
--bodyPart:SetInfected(false)
|
||||||
|
|
||||||
dcInst:setIsInfected(limbName, false)
|
dcInst:setIsInfected(limbName, false)
|
||||||
dcInst:apply()
|
dcInst:apply()
|
||||||
@@ -183,7 +185,7 @@ function LocalPlayerController.HandleDamage(character)
|
|||||||
-- Special case for bites\zombie infections
|
-- Special case for bites\zombie infections
|
||||||
if bodyPart:IsInfected() then
|
if bodyPart:IsInfected() then
|
||||||
TOC_DEBUG.print("Healed from zombie infection - " .. limbName)
|
TOC_DEBUG.print("Healed from zombie infection - " .. limbName)
|
||||||
LocalPlayerController.HealZombieInfection(bd, bodyPart, limbName, dcInst)
|
LocalPlayerController.HealZombieInfection(bd, limbName, dcInst)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if (bodyPart:bitten() or bodyPart:IsInfected()) and not dcInst:getIsInfected(limbName) then
|
if (bodyPart:bitten() or bodyPart:IsInfected()) and not dcInst:getIsInfected(limbName) then
|
||||||
|
|||||||
@@ -190,8 +190,10 @@ function AmputationHandler:execute(damagePlayer)
|
|||||||
-- Cache highest amputation and hand feasibility
|
-- Cache highest amputation and hand feasibility
|
||||||
CachedDataHandler.CalculateCacheableValues(username)
|
CachedDataHandler.CalculateCacheableValues(username)
|
||||||
|
|
||||||
|
-- TODO Test this again for 42.13
|
||||||
-- If the part was actually infected, heal the player, if they were in time (infectionLevel < 20)
|
-- If the part was actually infected, heal the player, if they were in time (infectionLevel < 20)
|
||||||
if bd:getGeneralWoundInfectionLevel() < 20 and bodyPart:IsInfected() and not dcInst:getIsIgnoredPartInfected() then
|
local infectionLevel = self.patientPl:getStats():get(CharacterStat.ZOMBIE_INFECTION)
|
||||||
|
if infectionLevel < 20 and bodyPart:isInfected() and not dcInst:getIsIgnoredPartInfected() then
|
||||||
LocalPlayerController.HealZombieInfection(bd, bodyPart, self.limbName, dcInst)
|
LocalPlayerController.HealZombieInfection(bd, bodyPart, self.limbName, dcInst)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user