From c3e977a10afd569716c29997030df5e992512dba Mon Sep 17 00:00:00 2001 From: Pao Date: Fri, 3 Feb 2023 15:02:43 +0100 Subject: [PATCH] Cleanliness malus --- media/lua/client/TOC_ProsthesisMethods.lua | 7 +------ media/lua/client/TOC_Update.lua | 21 ++++++++++++++------- media/scripts/TOC_items.txt | 4 ++-- 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/media/lua/client/TOC_ProsthesisMethods.lua b/media/lua/client/TOC_ProsthesisMethods.lua index f5be959..e693744 100644 --- a/media/lua/client/TOC_ProsthesisMethods.lua +++ b/media/lua/client/TOC_ProsthesisMethods.lua @@ -1,4 +1,3 @@ - ------------------------------------------ -------- THE ONLY CURE BUT BETTER -------- ------------------------------------------ @@ -33,13 +32,9 @@ function TocEquipProsthesis(part_name, prosthesis_base_name) end end - - - - - end + ---Unequip a prosthesis clothing item and returns it to the inventory as a normal item ---@param part_name string function TheOnlyCure.UnequipProsthesis(patient, part_name, equipped_prosthesis) diff --git a/media/lua/client/TOC_Update.lua b/media/lua/client/TOC_Update.lua index 2cd2a37..c31e0fc 100644 --- a/media/lua/client/TOC_Update.lua +++ b/media/lua/client/TOC_Update.lua @@ -117,15 +117,9 @@ local function SetHealthStatusForBodyPart(part_data, part_name, player) end - --Wound cleanliness - -- TODO we need to check the upper body part since that's what getting wounded eheh - - - local amputated_limb_item = TocGetAmputationItemInInventory(player, part_name) - --getDirtyness -- Cicatrization check if not part_data[part_name].is_cicatrized then @@ -217,8 +211,21 @@ local function TocUpdateEveryTenMinutes() -- Updates the cicatrization time for _, part_name in pairs(GetBodyParts()) do if part_data[part_name].is_cut and not part_data[part_name].is_cicatrized then - part_data[part_name].cicatrization_time = part_data[part_name].cicatrization_time - SandboxVars.TOC.CicatrizationSpeedMultiplier + --Wound cleanliness contributes to cicatrization + -- TODO we reset this stuff every time we restart the game for compat reason, this is an issue + local amputated_limb_item = TocGetAmputationItemInInventory(player, part_name) + local item_dirtyness = amputated_limb_item:getDirtyness()/100 + local item_bloodyness = amputated_limb_item:getBloodLevel()/100 + + local modifier = SandboxVars.TOC.CicatrizationSpeedMultiplier - item_bloodyness - item_dirtyness + + print("TOC: Type " .. amputated_limb_item:getFullType()) + print("TOC: Dirtyness " .. item_dirtyness) + print("TOC: Bloodyness " .. item_bloodyness) + + + part_data[part_name].cicatrization_time = part_data[part_name].cicatrization_time - modifier end diff --git a/media/scripts/TOC_items.txt b/media/scripts/TOC_items.txt index 45b11f5..31b6b0f 100644 --- a/media/scripts/TOC_items.txt +++ b/media/scripts/TOC_items.txt @@ -15,7 +15,7 @@ imports Weight = 0, CombatSpeedModifier = 0.9, - /*BloodLocation = UpperArms;LowerArms,*/ + BloodLocation = Hands;LowerArms, Insulation = 1.0, WindResistance = 1.0, @@ -69,7 +69,7 @@ imports Weight = 0, CombatSpeedModifier = 0.9, - /*BloodLocation = UpperArms;LowerArms,*/ + BloodLocation = Hands;LowerArms, Insulation = 1.0, WindResistance = 1.0,