From 2a35d4ed29400a06af116ed0505bda3848d7f1b7 Mon Sep 17 00:00:00 2001 From: Pao Date: Sun, 29 Jan 2023 18:14:46 +0100 Subject: [PATCH] first stuff for prosthetic knifes --- .../Prost_Left_LowerArm_ProstheticKnife.xml | 12 ++++ media/lua/client/TOC_Update.lua | 11 +++- media/lua/client/TOC_main.lua | 23 +++++-- media/lua/client/TimedActions/ISCutLimb.lua | 1 - media/lua/shared/translate/EN/ItemName_EN.txt | 1 + media/lua/shared/translate/EN/Tooltip_EN.txt | 6 ++ media/sandbox-options.txt | 6 +- media/scripts/TOC_items.txt | 63 +++++++++++-------- media/scripts/TOC_models_item.txt | 7 +++ mod.info | 2 +- 10 files changed, 94 insertions(+), 38 deletions(-) create mode 100644 media/clothing/clothingItems/Prost_Left_LowerArm_ProstheticKnife.xml diff --git a/media/clothing/clothingItems/Prost_Left_LowerArm_ProstheticKnife.xml b/media/clothing/clothingItems/Prost_Left_LowerArm_ProstheticKnife.xml new file mode 100644 index 0000000..d331934 --- /dev/null +++ b/media/clothing/clothingItems/Prost_Left_LowerArm_ProstheticKnife.xml @@ -0,0 +1,12 @@ + + + Prost_Left_LowerArm_Hook_Male + Prost_Left_LowerArm_Hook_Female + aea8e02a-cba0-48d0-9eb0-7087651306b0 + false + false + false + Clothes\wood_male + Clothes\wood_female + + \ No newline at end of file diff --git a/media/lua/client/TOC_Update.lua b/media/lua/client/TOC_Update.lua index 1d03d8b..081436c 100644 --- a/media/lua/client/TOC_Update.lua +++ b/media/lua/client/TOC_Update.lua @@ -58,6 +58,13 @@ local function SetHealthStatusForBodyPart(part_data, part_name, player) end + + -- Check for stitching + local is_stitched = false + + -- TODO Implement this + + -- Set max health for body part if part_data[part_name].is_cicatrized and body_part:getHealth() > 80 then body_part:SetHealth(80) @@ -158,8 +165,8 @@ local function TocUpdateEveryTenMinutes() if player == nil then return end - local toc_data = player:getModData().TOC - local part_data = toc_data.Limbs + + local part_data = player:getModData().TOC.Limbs --Experience for prosthesis user for _, side in ipairs(TOC_sides) do diff --git a/media/lua/client/TOC_main.lua b/media/lua/client/TOC_main.lua index ab16564..73b378d 100644 --- a/media/lua/client/TOC_main.lua +++ b/media/lua/client/TOC_main.lua @@ -22,6 +22,15 @@ function TocSetInitData(mod_data, player) print("TOC: Creating mod_data.TOC") + + -- TODO this is gonna become a mess really fast, i fucked up. + -- TODO Move prosthesis to something more easily accessible + -- TODO Acceptable prosthesis need to be moved to something more accessible + + + + + mod_data.TOC = { Limbs = { @@ -104,7 +113,7 @@ function TocSetInitData(mod_data, player) mod_data.TOC.Limbs[part_name].is_prosthesis_equipped = false - mod_data.TOC.Limbs[part_name].equipped_prosthesis = {} + mod_data.TOC.Limbs[part_name].equipped_prosthesis = {} -- TODO i'm still not usign this, I should though -- Even if there are some duplicates, this is just easier in the end since we're gonna get fairly easily part_name @@ -154,12 +163,13 @@ end function TocUpdateBaseData(mod_data) - local prosthesis_list = { "WoodenHook", "MetalHook", "MetalHand" } + -- TODO The prosthetic knife needs to be a weapon first and foremost, so other than a + -- clothing item it needs to be a weapon too (an invisible one maybe?) + --local prosthesis_list = { "WoodenHook", "MetalHook", "MetalHand", "ProstheticKnife" } - - local accepted_prosthesis_hand = { "WoodenHook", "MetalHook", "MetalHand" } - local accepted_prosthesis_lowerarm = { "WoodenHook", "MetalHook", "MetalHand" } + local accepted_prosthesis_hand = { "WoodenHook", "MetalHook", "MetalHand", "ProstheticKnife" } + local accepted_prosthesis_lowerarm = { "WoodenHook", "MetalHook", "MetalHand", "ProstheticKnife" } local accepted_prosthesis_upperarm = {} -- For future stuff for _, side in ipairs(TOC_sides) do @@ -176,6 +186,7 @@ function TocUpdateBaseData(mod_data) mod_data.TOC.Prosthesis["WoodenHook"][part_name].prosthesis_factor = 1.3 mod_data.TOC.Prosthesis["MetalHook"][part_name].prosthesis_factor = 1.2 mod_data.TOC.Prosthesis["MetalHand"][part_name].prosthesis_factor = 1.1 + mod_data.TOC.Prosthesis["ProstheticKnife"][part_name].prosthesis_factor = 1.5 elseif limb == "LowerArm" then @@ -186,6 +197,8 @@ function TocUpdateBaseData(mod_data) mod_data.TOC.Prosthesis["WoodenHook"][part_name].prosthesis_factor = 1.35 mod_data.TOC.Prosthesis["MetalHook"][part_name].prosthesis_factor = 1.25 mod_data.TOC.Prosthesis["MetalHand"][part_name].prosthesis_factor = 1.15 + mod_data.TOC.Prosthesis["ProstheticKnife"][part_name].prosthesis_factor = 1.6 + elseif limb == "UpperArm" then mod_data.TOC.Limbs[part_name].cicatrization_base_time = 2000 mod_data.TOC.Limbs[part_name].depends_on = { side .. "_Hand", side .. "_LowerArm", } diff --git a/media/lua/client/TimedActions/ISCutLimb.lua b/media/lua/client/TimedActions/ISCutLimb.lua index 3d2fa8d..d8ca847 100644 --- a/media/lua/client/TimedActions/ISCutLimb.lua +++ b/media/lua/client/TimedActions/ISCutLimb.lua @@ -36,7 +36,6 @@ function ISCutLimb:start() self:setActionAnim("SawLog") local saw_item = TocGetSawInInventory(self.surgeon) - self.sound = self.character:getEmitter():playSound("Amputation_Sound") -- Return whatever object we've got in the inventory diff --git a/media/lua/shared/translate/EN/ItemName_EN.txt b/media/lua/shared/translate/EN/ItemName_EN.txt index 64d9faa..95f84dd 100644 --- a/media/lua/shared/translate/EN/ItemName_EN.txt +++ b/media/lua/shared/translate/EN/ItemName_EN.txt @@ -27,6 +27,7 @@ DisplayName_EN = { ItemName_TOC.WoodenHook = "Wooden Hook", ItemName_TOC.MetalHook = "Metal Hook", ItemName_TOC.MetalHand = "Metal Hand", + ItemName_TOC.ProstheticKnife = "Prosthetic Knife", ItemName_TOC.SurgeonMag1 = "Surgeon magazine for dummies", ItemName_TOC.SurgeonMag2 = "Surgeon magazine for students", diff --git a/media/lua/shared/translate/EN/Tooltip_EN.txt b/media/lua/shared/translate/EN/Tooltip_EN.txt index 67be3ca..4295dbd 100644 --- a/media/lua/shared/translate/EN/Tooltip_EN.txt +++ b/media/lua/shared/translate/EN/Tooltip_EN.txt @@ -7,6 +7,12 @@ Tooltip_EN = { Tooltip_equip_prothesis_fore = "Water Resistance is the time multiplier for actions
Without prosthesis, the multiplier is 2.5" Tooltip_prosthesic_limb = "A prosthetic limb. You'll have to wait until your limb is cicatrized before installing it.
It's done by having a bandage (alcohol is better) when cut, use a surgeon kit and wait." + + Tooltip_ProstheticKnife = "Prost Knife test", + + + + Recipe_Tooltip_Wooden_hook = "Make a prosthesic wooden hook.
Can be used on an amputated hand or forearm.
Can't be equipped if the upper arm is amputated." Recipe_Tooltip_Metal_hook = "Make a prosthesic metal hook.
Can be used on an amputated hand or forearm.
Can't be equipped if the upper arm is amputated." Recipe_Tooltip_Metal_hand = "Make a prosthesic metal hand.
Can be used on an amputated hand or forearm.
Can't be equipped if the upper arm is amputated." diff --git a/media/sandbox-options.txt b/media/sandbox-options.txt index 19ad269..6cb0242 100644 --- a/media/sandbox-options.txt +++ b/media/sandbox-options.txt @@ -1,7 +1,7 @@ VERSION = 1, -option TOC.RollUpSleeves +/* option TOC.RollUpSleeves { type = boolean, default = true, @@ -9,7 +9,7 @@ option TOC.RollUpSleeves page = TOC, translation = TOC_RollUpSleeves, -} +} */ option TOC.CicatrizationSpeedMultiplier { @@ -18,6 +18,6 @@ option TOC.CicatrizationSpeedMultiplier max = 10, default = 1, page = TOC, - translation = TOC_CicatrizationSpeedMultiplier + translation = TOC_CicatrizationSpeedMultiplier, } \ No newline at end of file diff --git a/media/scripts/TOC_items.txt b/media/scripts/TOC_items.txt index b2c236e..1fdd602 100644 --- a/media/scripts/TOC_items.txt +++ b/media/scripts/TOC_items.txt @@ -337,37 +337,48 @@ imports /************************ Prosthesis base items ************************/ item WoodenHook - { - Weight = 1, - Type = Normal, - DisplayCategory = Prosthesis, - DisplayName = DisplayName_woodenHook, - Icon = woodenHook, - Tooltip = Tooltip_prosthesic_limb, - WorldStaticModel = TOC.WoodenHook, - } + { + Weight = 1, + Type = Normal, + DisplayCategory = Prosthesis, + DisplayName = DisplayName_WoodenHook, + Icon = woodenHook, + Tooltip = Tooltip_prosthesic_limb, + WorldStaticModel = TOC.WoodenHook, + } item MetalHook - { - Weight = 0.5, - Type = Normal, - DisplayCategory = Prosthesis, - DisplayName = DisplayName_metalHook, - Icon = metalHook, - Tooltip = Tooltip_prosthesic_limb, - WorldStaticModel = TOC.MetalHook, + { + Weight = 0.5, + Type = Normal, + DisplayCategory = Prosthesis, + DisplayName = DisplayName_MetalHook, + Icon = metalHook, + Tooltip = Tooltip_prosthesic_limb, + WorldStaticModel = TOC.MetalHook, - } + } item MetalHand - { - Weight = 0.3, - Type = Normal, - DisplayCategory = Prosthesis, - DisplayName = DisplayName_metalHand, - Icon = metalHand, - Tooltip = Tooltip_prosthesic_limb, - } + { + Weight = 0.3, + Type = Normal, + DisplayCategory = Prosthesis, + DisplayName = DisplayName_MetalHand, + Icon = metalHand, + Tooltip = Tooltip_prosthesic_limb, + } +item ProstheticKnife +{ + Weight = 0.5, + Type = Normal, + DisplayCategory = Prosthesis, + DisplayName = DisplayName_ProstheticKnife, + Icon = metalHand, + Tooltip = Tooltip_ProstheticKnife, +} + + /**************************** Mags ****************************/ item SurgeonMag1 diff --git a/media/scripts/TOC_models_item.txt b/media/scripts/TOC_models_item.txt index 8c13a58..0563928 100644 --- a/media/scripts/TOC_models_item.txt +++ b/media/scripts/TOC_models_item.txt @@ -13,4 +13,11 @@ module TOC texture = WorldItems/wood, scale = 0.15, } + + model ProstheticKnife + { + mesh = WorldItems/prostKnife, + texture = WorldItems/metal_base, + scale = 0.15 + } } \ No newline at end of file diff --git a/mod.info b/mod.info index fe27aed..930a423 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.2 +modversion=0.9.4 pzversion=41.65