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
---Get isProstEquipped
---@param group string
---@param limbName string
---@return boolean
function DataController:getIsProstEquipped(group)
return self.tocData.prostheses[group].isProstEquipped
function DataController:getIsProstEquipped(limbName)
local prostGroup = StaticData.LIMBS_TO_PROST_GROUP_MATCH_IND_STR[limbName]
return self.tocData.prostheses[prostGroup].isProstEquipped
end
---Get prostFactor

View File

@@ -16,7 +16,7 @@ local StaticData = require("TOC/StaticData")
local function CheckHandFeasibility(limbName)
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
@@ -71,8 +71,7 @@ function ISBaseTimedAction:perform()
if dcInst:getIsCut(limbName) and dcInst:getIsVisible(limbName) then
local side = CommonMethods.GetSide(limbName)
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(prostGroup) then
if not dcInst:getIsCicatrized(limbName) and dcInst:getIsProstEquipped(limbName) then
TOC_DEBUG.print("Trying for bleed, player met the criteria")
LocalPlayerController.TryRandomBleed(self.character, limbName)
end