Cleaning cleans wounds and visual too
This commit is contained in:
@@ -225,9 +225,7 @@ function PlayerHandler.UpdateCicatrization()
|
|||||||
TOC_DEBUG.print("updating cicatrization for " .. tostring(limbName))
|
TOC_DEBUG.print("updating cicatrization for " .. tostring(limbName))
|
||||||
|
|
||||||
-- TODO Check if bandaged, sutured, whatever
|
-- TODO Check if bandaged, sutured, whatever
|
||||||
|
|
||||||
-- TODO Clean
|
-- TODO Clean
|
||||||
|
|
||||||
-- TODO Check dirtyness of zone and add to it
|
-- TODO Check dirtyness of zone and add to it
|
||||||
|
|
||||||
--local bptEnum = StaticData.BODYLOCS_IND_BPT[limbName]
|
--local bptEnum = StaticData.BODYLOCS_IND_BPT[limbName]
|
||||||
@@ -236,12 +234,16 @@ function PlayerHandler.UpdateCicatrization()
|
|||||||
local bbptEnum = BloodBodyPartType[limbName]
|
local bbptEnum = BloodBodyPartType[limbName]
|
||||||
--local bodyPart = bd:getBodyPart(bptEnum)
|
--local bodyPart = bd:getBodyPart(bptEnum)
|
||||||
|
|
||||||
local dirtyness = visual:getDirt(bbptEnum) + visual:getBlood(bbptEnum) + modDataHandler:getWoundDirtyness(limbName)
|
local dirtyness = visual:getDirt(bbptEnum) + visual:getBlood(bbptEnum) + modDataHandler:getWoundDirtyness(limbName) + 0.01 -- TODO Make it customizable
|
||||||
|
|
||||||
|
if dirtyness > 1 then
|
||||||
|
dirtyness = 1
|
||||||
|
end
|
||||||
|
|
||||||
modDataHandler:setWoundDirtyness(limbName, dirtyness)
|
modDataHandler:setWoundDirtyness(limbName, dirtyness)
|
||||||
|
|
||||||
TOC_DEBUG.print("dirtyness for this zone: " .. tostring(dirtyness))
|
TOC_DEBUG.print("dirtyness for this zone: " .. tostring(dirtyness))
|
||||||
|
|
||||||
|
|
||||||
cicTime = cicTime - SandboxVars.TOC.CicatrizationSpeed
|
cicTime = cicTime - SandboxVars.TOC.CicatrizationSpeed
|
||||||
modDataHandler:setCicatrizationTime(limbName, cicTime)
|
modDataHandler:setCicatrizationTime(limbName, cicTime)
|
||||||
TOC_DEBUG.print("new cicatrization time: " .. tostring(cicTime))
|
TOC_DEBUG.print("new cicatrization time: " .. tostring(cicTime))
|
||||||
@@ -249,7 +251,6 @@ function PlayerHandler.UpdateCicatrization()
|
|||||||
TOC_DEBUG.print(tostring(limbName) .. " is cicatrized")
|
TOC_DEBUG.print(tostring(limbName) .. " is cicatrized")
|
||||||
modDataHandler:setIsCicatrized(limbName, true)
|
modDataHandler:setIsCicatrized(limbName, true)
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -61,16 +61,27 @@ function CleanWoundAction:perform()
|
|||||||
--self.bodyPart:setNeedBurnWash(false)
|
--self.bodyPart:setNeedBurnWash(false)
|
||||||
self.bandage:Use()
|
self.bandage:Use()
|
||||||
|
|
||||||
|
-- TODO Use Water too
|
||||||
|
|
||||||
if isClient() then
|
if isClient() then
|
||||||
local limbName = CommonMethods.GetLimbNameFromBodyPart(self.bodyPart)
|
|
||||||
|
|
||||||
-- TODO CHeck if correct in MP
|
|
||||||
local modDataHandler = ModDataHandler.GetInstance(self.character:getUsername())
|
|
||||||
|
|
||||||
modDataHandler:setWoundDirtyness(limbName, 0)
|
|
||||||
--sendCleanBurn(self.character, self.otherPlayer, self.bodyPart, self.bandage)
|
--sendCleanBurn(self.character, self.otherPlayer, self.bodyPart, self.bandage)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local limbName = CommonMethods.GetLimbNameFromBodyPart(self.bodyPart)
|
||||||
|
|
||||||
|
-- TODO CHeck if correct in MP
|
||||||
|
local modDataHandler = ModDataHandler.GetInstance(self.otherPlayer:getUsername())
|
||||||
|
modDataHandler:setWoundDirtyness(limbName, 0)
|
||||||
|
|
||||||
|
|
||||||
|
-- Clean visual
|
||||||
|
local bbptEnum = BloodBodyPartType[limbName]
|
||||||
|
|
||||||
|
---@type HumanVisual
|
||||||
|
local visual = self.otherPlayer:getHumanVisual()
|
||||||
|
visual:setDirt(bbptEnum, 0)
|
||||||
|
visual:setBlood(bbptEnum, 0)
|
||||||
|
|
||||||
ISHealthPanel.setBodyPartActionForPlayer(self.otherPlayer, self.bodyPart, nil, nil, nil)
|
ISHealthPanel.setBodyPartActionForPlayer(self.otherPlayer, self.bodyPart, nil, nil, nil)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -200,6 +200,10 @@ function ISHealthBodyPartListBox:doDrawItem(y, item, alt)
|
|||||||
local maxCicaTime = StaticData.LIMBS_CICATRIZATION_TIME_IND_NUM[limbName]
|
local maxCicaTime = StaticData.LIMBS_CICATRIZATION_TIME_IND_NUM[limbName]
|
||||||
local percentage = (1 - cicaTime/maxCicaTime) * 100
|
local percentage = (1 - cicaTime/maxCicaTime) * 100
|
||||||
self:drawText("- " .. getText("IGUI_HealthPanel_Cicatrization") .. string.format(" %.2f", percentage) .. "%", x, y, 0.89, 0.28, 0.28, 1, UIFont.Small)
|
self:drawText("- " .. getText("IGUI_HealthPanel_Cicatrization") .. string.format(" %.2f", percentage) .. "%", x, y, 0.89, 0.28, 0.28, 1, UIFont.Small)
|
||||||
|
y = y + fontHgt
|
||||||
|
|
||||||
|
local scaledDirtyness = math.floor(modDataHandler:getWoundDirtyness(limbName) * 100)
|
||||||
|
self:drawText("- " .. getText("IGUI_HealthPanel_WoundDirtyness") .. string.format(" %d", scaledDirtyness) .. "%", x, y, 0.89, 0.28, 0.28, 1, UIFont.Small)
|
||||||
end
|
end
|
||||||
y = y + fontHgt
|
y = y + fontHgt
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ function WoundCleaningHandler:new(panel, bodyPart, username)
|
|||||||
|
|
||||||
o.limbName = CommonMethods.GetLimbNameFromBodyPart(bodyPart)
|
o.limbName = CommonMethods.GetLimbNameFromBodyPart(bodyPart)
|
||||||
|
|
||||||
|
|
||||||
return o
|
return o
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -72,7 +71,7 @@ end
|
|||||||
function WoundCleaningHandler:perform(previousAction, itemType)
|
function WoundCleaningHandler:perform(previousAction, itemType)
|
||||||
local item = self:getItemOfType(self.items.ITEMS, itemType)
|
local item = self:getItemOfType(self.items.ITEMS, itemType)
|
||||||
previousAction = self:toPlayerInventory(item, previousAction)
|
previousAction = self:toPlayerInventory(item, previousAction)
|
||||||
local action = CleanWoundAction :new(self:getDoctor(), self:getPatient(), item, self.bodyPart)
|
local action = CleanWoundAction:new(self:getDoctor(), self:getPatient(), item, self.bodyPart)
|
||||||
ISTimedActionQueue.addAfter(previousAction, action)
|
ISTimedActionQueue.addAfter(previousAction, action)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -11,5 +11,6 @@ IG_UI_EN = {
|
|||||||
IGUI_HealthPanel_Cicatrization = "Cicatrization",
|
IGUI_HealthPanel_Cicatrization = "Cicatrization",
|
||||||
IGUI_HealthPanel_Cicatrized = "Cicatrized",
|
IGUI_HealthPanel_Cicatrized = "Cicatrized",
|
||||||
IGUI_HealthPanel_Cauterized = "Cauterized",
|
IGUI_HealthPanel_Cauterized = "Cauterized",
|
||||||
|
IGUI_HealthPanel_WoundDirtyness = "Wound Dirtyness",
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user