This commit is contained in:
ZioPao
2025-04-15 03:07:20 +02:00
parent bbd36f7dc2
commit b0d3520173

View File

@@ -129,13 +129,11 @@ function ISBaseTimedAction:perform()
-- First check level of perks. if already at max, skip -- First check level of perks. if already at max, skip
local amputatedLimbs = CachedDataHandler.GetAmputatedLimbs(LocalPlayerController.username) local amputatedLimbs = CachedDataHandler.GetAmputatedLimbs(LocalPlayerController.username)
local xp = self.maxTime / 100 local xp = self.maxTime / 100
-- Prevent xp from being negative and decreasing perks -- Prevent xp from being negative and decreasing perks
if xp < 0 then xp = 0 end if xp < 0 then xp = 0 end
for k, _ in pairs(amputatedLimbs) do for k, _ in pairs(amputatedLimbs) do
local limbName = k local limbName = k
@@ -143,20 +141,28 @@ 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)
local xpObj = LocalPlayerController.playerObj:getXp() local ampPerk = Perks["Side_" .. side]
if xpObj:getLevel() < 10 then local ampPerkLevel = LocalPlayerController.playerObj:getPerkLevel(ampPerk)
xpObj:AddXP(Perks["Side_" .. side], xp)
end
if not dcInst:getIsCicatrized(limbName) and dcInst:getIsProstEquipped(limbName) then if ampPerkLevel < 10 then
TOC_DEBUG.print("Trying for bleed, player met the criteria") --TOC_DEBUG.print("Levelling")
LocalPlayerController.TryRandomBleed(self.character, limbName) LocalPlayerController.playerObj:getXp():AddXP(ampPerk, xp)
end end
-- Level up prosthesis perk -- Level up prosthesis perk
if dcInst:getIsProstEquipped(limbName) then if dcInst:getIsProstEquipped(limbName) then
LocalPlayerController.playerObj:getXp():AddXP(Perks["ProstFamiliarity"], xp) local prostPerk = Perks["ProstFamiliarity"]
local prostPerkLevel = LocalPlayerController.playerObj:getPerkLevel(prostPerk)
if prostPerkLevel < 10 then
LocalPlayerController.playerObj:getXp():AddXP(prostPerk, xp)
end
end
-- Bleeding when not cicatrized
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 end
end end
end end