Added prost notification in health panel

This commit is contained in:
ZioPao
2024-01-10 01:38:29 +01:00
parent 74adac6f9d
commit 81f9bbf6ea
4 changed files with 18 additions and 8 deletions

View File

@@ -251,10 +251,11 @@ function DataController:getCicatrizationTime(limbName)
end end
---Get isProstEquipped ---Get isProstEquipped
---@param group string ---@param limbName string
---@return boolean ---@return boolean
function DataController:getIsProstEquipped(group) function DataController:getIsProstEquipped(limbName)
return self.tocData.prostheses[group].isProstEquipped local prostGroup = StaticData.LIMBS_TO_PROST_GROUP_MATCH_IND_STR[limbName]
return self.tocData.prostheses[prostGroup].isProstEquipped
end end
---Get prostFactor ---Get prostFactor

View File

@@ -16,7 +16,7 @@ local StaticData = require("TOC/StaticData")
local function CheckHandFeasibility(limbName) local function CheckHandFeasibility(limbName)
local dcInst = DataController.GetInstance() local dcInst = DataController.GetInstance()
return not dcInst:getIsCut(limbName) or dcInst:getIsProstEquipped(StaticData.LIMBS_TO_PROST_GROUP_MATCH_IND_STR[limbName]) return not dcInst:getIsCut(limbName) or dcInst:getIsProstEquipped(limbName)
end end
@@ -71,8 +71,7 @@ function ISBaseTimedAction:perform()
if dcInst:getIsCut(limbName) and dcInst:getIsVisible(limbName) then if dcInst:getIsCut(limbName) and dcInst:getIsVisible(limbName) then
local side = CommonMethods.GetSide(limbName) local side = CommonMethods.GetSide(limbName)
LocalPlayerController.playerObj:getXp():AddXP(Perks["Side_" .. side], 1) -- TODO Make it dynamic LocalPlayerController.playerObj:getXp():AddXP(Perks["Side_" .. side], 1) -- TODO Make it dynamic
local prostGroup = StaticData.LIMBS_TO_PROST_GROUP_MATCH_IND_STR[limbName] if not dcInst:getIsCicatrized(limbName) and dcInst:getIsProstEquipped(limbName) then
if not dcInst:getIsCicatrized(limbName) and dcInst:getIsProstEquipped(prostGroup) then
TOC_DEBUG.print("Trying for bleed, player met the criteria") TOC_DEBUG.print("Trying for bleed, player met the criteria")
LocalPlayerController.TryRandomBleed(self.character, limbName) LocalPlayerController.TryRandomBleed(self.character, limbName)
end end

View File

@@ -183,8 +183,10 @@ function ISHealthBodyPartListBox:doDrawItem(y, item, alt)
if dcInst:getIsCauterized(limbName) then if dcInst:getIsCauterized(limbName) then
self:drawText("- " .. getText("IGUI_HealthPanel_Cauterized"), x, y, 0.58, 0.75, 0.28, 1, UIFont.Small) self:drawText("- " .. getText("IGUI_HealthPanel_Cauterized"), x, y, 0.58, 0.75, 0.28, 1, UIFont.Small)
else else
self:drawText("- " .. getText("IGUI_HealthPanel_Cicatrized"), x, y, 0.28, 0.89, 0.28, 1, UIFont.Small) self:drawText("- " .. getText("IGUI_HealthPanel_Cicatrized"), x, y, 0.28, 0.89, 0.28, 1, UIFont.Small)
end end
y = y + fontHgt
else else
local cicaTime = dcInst:getCicatrizationTime(limbName) local cicaTime = dcInst:getCicatrizationTime(limbName)
@@ -196,8 +198,15 @@ function ISHealthBodyPartListBox:doDrawItem(y, item, alt)
local scaledDirtyness = math.floor(dcInst:getWoundDirtyness(limbName) * 100) local scaledDirtyness = math.floor(dcInst:getWoundDirtyness(limbName) * 100)
self:drawText("- " .. getText("IGUI_HealthPanel_WoundDirtyness") .. string.format(" %d", scaledDirtyness) .. "%", x, y, 0.89, 0.28, 0.28, 1, UIFont.Small) self:drawText("- " .. getText("IGUI_HealthPanel_WoundDirtyness") .. string.format(" %d", scaledDirtyness) .. "%", x, y, 0.89, 0.28, 0.28, 1, UIFont.Small)
y = y + fontHgt
end end
y = y + fontHgt
if dcInst:getIsProstEquipped(limbName) then
self:drawText("- " .. getText("IGUI_HealthPanel_ProstEquipped"), x, y, 0.28, 0.89, 0.28, 1, UIFont.Small)
y = y + fontHgt
end
end end

View File

@@ -13,5 +13,6 @@ IG_UI_EN = {
IGUI_HealthPanel_Cicatrized = "Cicatrized", IGUI_HealthPanel_Cicatrized = "Cicatrized",
IGUI_HealthPanel_Cauterized = "Cauterized", IGUI_HealthPanel_Cauterized = "Cauterized",
IGUI_HealthPanel_WoundDirtyness = "Wound Dirtyness", IGUI_HealthPanel_WoundDirtyness = "Wound Dirtyness",
IGUI_HealthPanel_ProstEquipped = "Prosthesis Equipped",
} }