diff --git a/changelog.txt b/changelog.txt index 890ecb2..493e691 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,7 @@ +0.9.12 +- Fixed traits icons +- Some cleaning to the code + 0.9.11 - Hotfix to cicatrization visuals diff --git a/media/lua/client/TOC_HelperFunctions.lua b/media/lua/client/TOC_HelperFunctions.lua index cf6dae8..1a1c28b 100644 --- a/media/lua/client/TOC_HelperFunctions.lua +++ b/media/lua/client/TOC_HelperFunctions.lua @@ -1,3 +1,26 @@ +-- Init +function TocCutLimbForTrait(player, limbs_data, part_name) + local amputation_clothing_item = player:getInventory():AddItem("TOC.Amputation_" .. part_name) + TocSetCorrectTextureForAmputation(amputation_clothing_item, player, true) + + player:setWornItem(amputation_clothing_item:getBodyLocation(), amputation_clothing_item) + limbs_data[part_name].is_cut = true + limbs_data[part_name].is_operated = true + limbs_data[part_name].is_amputation_shown = true + limbs_data[part_name].is_cicatrized = true + + for _, v in pairs(limbs_data[part_name].depends_on) do + limbs_data[v].is_cut = true + limbs_data[v].is_operated = true + limbs_data[v].is_amputation_shown = false + limbs_data[v].is_cicatrized = true + end +end + + + + + -- CutLimb function TocCheckIfStillInfected(limbs_data) if limbs_data == nil then @@ -177,7 +200,7 @@ function TocFindItemInProstBodyLocation(part_name, patient) end --- Debug cheat +-- Debug cheat and update every minute for cicatrization function TocFindAmputationOrProsthesisName(part_name, player, choice) local worn_items = player:getWornItems() for i = 1, worn_items:size() - 1 do diff --git a/media/lua/client/TOC_main.lua b/media/lua/client/TOC_main.lua index 39f658f..cb5359a 100644 --- a/media/lua/client/TOC_main.lua +++ b/media/lua/client/TOC_main.lua @@ -130,52 +130,13 @@ function TocSetInitData(mod_data, player) -- Setup traits if player:HasTrait("Amputee_Hand") then - - local amputation_clothing_item = player:getInventory():AddItem("TOC.Amputation_Left_Hand") - TocSetCorrectTextureForAmputation(amputation_clothing_item, player, true) - - player:setWornItem(amputation_clothing_item:getBodyLocation(), amputation_clothing_item) - mod_data.TOC.Limbs.Left_Hand.is_cut = true - mod_data.TOC.Limbs.Left_Hand.is_operated = true - mod_data.TOC.Limbs.Left_Hand.is_amputation_shown = true - mod_data.TOC.Limbs.Left_Hand.is_cicatrized = true + TocCutLimbForTrait(player, mod_data.TOC.Limbs, "Left_Hand") elseif player:HasTrait("Amputee_LowerArm") then - local amputation_clothing_item = player:getInventory():AddItem("TOC.Amputation_Left_LowerArm") - TocSetCorrectTextureForAmputation(amputation_clothing_item, player, true) - - player:setWornItem(amputation_clothing_item:getBodyLocation(), amputation_clothing_item) - mod_data.TOC.Limbs.Left_LowerArm.is_cut = true - mod_data.TOC.Limbs.Left_LowerArm.is_operated = true - mod_data.TOC.Limbs.Left_LowerArm.is_amputation_shown = true - mod_data.TOC.Limbs.Left_LowerArm.is_cicatrized = true - - for _, v in pairs(mod_data.TOC.Limbs.Left_LowerArm.depends_on) do - mod_data.TOC.Limbs[v].is_cut = true - mod_data.TOC.Limbs[v].is_operated = true - mod_data.TOC.Limbs[v].is_amputation_shown = false - mod_data.TOC.Limbs[v].is_cicatrized = true - end + TocCutLimbForTrait(player, mod_data.TOC.Limbs, "Left_LowerArm") elseif player:HasTrait("Amputee_UpperArm") then - local amputation_clothing_item = player:getInventory():AddItem("TOC.Amputation_Left_UpperArm") - TocSetCorrectTextureForAmputation(amputation_clothing_item, player, true) - - player:setWornItem(amputation_clothing_item:getBodyLocation(), amputation_clothing_item) - mod_data.TOC.Limbs.Left_UpperArm.is_cut = true - mod_data.TOC.Limbs.Left_UpperArm.is_operated = true - mod_data.TOC.Limbs.Left_UpperArm.is_amputation_shown = true - mod_data.TOC.Limbs.Left_UpperArm.is_cicatrized = true - - for _, v in pairs(mod_data.TOC.Limbs.Left_UpperArm.depends_on) do - mod_data.TOC.Limbs[v].is_cut = true - mod_data.TOC.Limbs[v].is_operated = true - mod_data.TOC.Limbs[v].is_amputation_shown = false - mod_data.TOC.Limbs[v].is_cicatrized = true - end + TocCutLimbForTrait(player, mod_data.TOC.Limbs, "Left_UpperArm") end - - - end function TocUpdateBaseData(mod_data) diff --git a/media/lua/shared/translate/EN/UI_EN.txt b/media/lua/shared/translate/EN/UI_EN.txt index 24800ce..2f51337 100644 --- a/media/lua/shared/translate/EN/UI_EN.txt +++ b/media/lua/shared/translate/EN/UI_EN.txt @@ -6,14 +6,14 @@ UI_EN = { UI_ContextMenu_CutArm = "Cut arm", UI_prof_surgeon = "Surgeon", - UI_profdesc_surgeon = "You are a surgeon! Start with all recipe of the mod the only cure.
You are also better to cut and operate.", + UI_profdesc_surgeon = "You are a surgeon! Start with all recipe of the mod the only cure.
Easier to amputate and operate amputees.", - UI_trait_Amputee_Hand = "Amputee hand", - UI_trait_Amputee_Hand_desc = "Begin the game without a hand but also a metal hook.", - UI_trait_Amputee_LowerArm = "Amputee forearm", - UI_trait_Amputee_LowerArm_desc = "Begin the game without a forearm but also a metal hook.", - UI_trait_Amputee_UpperArm = "Amputee arm", - UI_trait_Amputee_UpperArm_desc = "Begin the game without an arm, good luck.", + UI_trait_Amputee_Hand = "Left Hand Amputated", + UI_trait_Amputee_Hand_desc = "You lost your left hand way before the apocalypse began.", + UI_trait_Amputee_LowerArm = "Left Forearm Amputated", + UI_trait_Amputee_LowerArm_desc = "You lost your left forearm way before the apocalypse began.", + UI_trait_Amputee_UpperArm = "Entire left Arm Amputated", + UI_trait_Amputee_UpperArm_desc = "You lost your entire left arm before the apocalypse, good luck.", UI_trait_Insensitive = "Insensitive to pain", UI_trait_Insensitivedesc = "Reduces maximum pain.", diff --git a/media/ui/Traits/trait_amputee1.png b/media/ui/Traits/trait_Amputee_Hand.png similarity index 100% rename from media/ui/Traits/trait_amputee1.png rename to media/ui/Traits/trait_Amputee_Hand.png diff --git a/media/ui/Traits/trait_amputee2.png b/media/ui/Traits/trait_Amputee_LowerArm.png similarity index 100% rename from media/ui/Traits/trait_amputee2.png rename to media/ui/Traits/trait_Amputee_LowerArm.png diff --git a/media/ui/Traits/trait_amputee3.png b/media/ui/Traits/trait_Amputee_UpperArm.png similarity index 100% rename from media/ui/Traits/trait_amputee3.png rename to media/ui/Traits/trait_Amputee_UpperArm.png diff --git a/mod.info b/mod.info index be1f0e3..ff84baa 100644 --- a/mod.info +++ b/mod.info @@ -5,5 +5,5 @@ description=Bitten? Not a problem! id=Amputation2 icon=icon.png url=https://github.com/ZioPao/The-Only-Cure-But-Better -modversion=0.9.11 +modversion=0.9.12 pzversion=41.65