Added sandbox option for the phantom pain

This commit is contained in:
Pao
2023-04-03 00:51:18 +02:00
parent 20883a1c38
commit 0a46fd3ab9
3 changed files with 26 additions and 12 deletions

View File

@@ -45,13 +45,13 @@ local function ManagePhantomPain(player, TOCModData)
for _, partName in pairs(TOC_Common.GetPartNames()) do
if limbsData[partName].isCut and limbsData[partName].isAmputationShown and ZombRand(1, 100) < 10 then
local body_part = body_damage:getBodyPart(TOC_Common.GetBodyPartFromPartName(partName))
local added_pain
if limbsData[partName].isCauterized then added_pain = 60 else added_pain = 30 end
body_part:setAdditionalPain(ZombRand(1, added_pain))
local bodyPart = body_damage:getBodyPart(TOC_Common.GetBodyPartFromPartName(partName))
local addedPain
if limbsData[partName].isCauterized then addedPain = 60 else addedPain = 30 end
bodyPart:setAdditionalPain(ZombRand(1, addedPain))
for _, depended_v in pairs(limbParameters[partName].dependsOn) do
if limbsData[depended_v].isCauterized then added_pain = 60 else added_pain = 30 end
body_part:setAdditionalPain(ZombRand(1, added_pain))
if limbsData[depended_v].isCauterized then addedPain = 60 else addedPain = 30 end
bodyPart:setAdditionalPain(ZombRand(1, addedPain))
end
@@ -231,12 +231,18 @@ TOC.UpdateEveryOneMinute = function()
local TOCModData = player:getModData().TOC
if TOCModData ~= nil then
ManagePhantomPain(player, TOCModData)
if SandboxVars.TOC.EnablePhantomPain then
if TOCModData ~= nil then
ManagePhantomPain(player, TOCModData)
end
end
-- Updates TOC data in a global way, basically player:transmitModData but it works
-- Sends only Limbs since the other stuff is mostly static
if TOCModData ~= nil then

View File

@@ -1,14 +1,14 @@
Sandbox_EN = {
Sandbox_TOC = "The Only Cure",
Sandbox_TOC_RollUpSleeves = "Roll up sleeves",
Sandbox_TOC_RollUpSleeves_tooltip = "Currently broken, will not do anything",
Sandbox_TOC_EnablePhantomPain = "Enable Phantom Pain",
Sandbox_TOC_EnablePhantomPain_tooltip = "Every once in a while, your character will get a pain sensation where the old limb, now amputated, is supposed to be.",
Sandbox_TOC_CicatrizationSpeedMultiplier = "Cicatrization speed multiplier",
Sandbox_TOC_CicatrizationSpeedMultiplier_tooltip = "Customize this to make the cicatrization process faster",
Sandbox_TOC_CicatrizationSpeedMultiplier_tooltip = "Customize this to make the cicatrization process faster.",
Sandbox_TOC_AmputationTimeMultiplier = "Amputation Time Scaler",
Sandbox_TOC_AmputationTimeMultiplier_tooltip = "Scales the amount of time multplying added after amputation",
Sandbox_TOC_AmputationTimeMultiplier_tooltip = "Scales the amount of time multplying added after amputation.",
}

View File

@@ -11,6 +11,14 @@ VERSION = 1,
} */
option TOC.EnablePhantomPain
{
type = boolean,
default = true,
page = TOC,
translation = TOC_EnablePhantomPain,
}
option TOC.CicatrizationSpeedMultiplier
{
type = integer,