diff --git a/media/clothing/clothingItems/Prost_Hook_L.xml b/media/clothing/clothingItems/Prost_HookArm_L.xml similarity index 100% rename from media/clothing/clothingItems/Prost_Hook_L.xml rename to media/clothing/clothingItems/Prost_HookArm_L.xml diff --git a/media/clothing/clothingItems/Prost_Hook_R.xml b/media/clothing/clothingItems/Prost_HookArm_R.xml similarity index 100% rename from media/clothing/clothingItems/Prost_Hook_R.xml rename to media/clothing/clothingItems/Prost_HookArm_R.xml diff --git a/media/clothing/clothingItems/Prost_Left_LowerArm_LeatherBase_MetalHook.xml b/media/clothing/clothingItems/Prost_Left_LowerArm_LeatherBase_MetalHook.xml deleted file mode 100644 index 2dacf2b..0000000 --- a/media/clothing/clothingItems/Prost_Left_LowerArm_LeatherBase_MetalHook.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - Prost_Left_LowerArm_Base_Hook_Male - Prost_Left_LowerArm_Base_Hook_Female - 129ee688-d4bb-4297-8eb2-f88974001217 - false - false - Prosthesis\metal_hook_male - Prosthesis\metal_hook_female - diff --git a/media/clothing/clothingItems/Prost_NormalArm_L.xml b/media/clothing/clothingItems/Prost_NormalArm_L.xml new file mode 100644 index 0000000..cd8e4c9 --- /dev/null +++ b/media/clothing/clothingItems/Prost_NormalArm_L.xml @@ -0,0 +1,10 @@ + + + Prosthesis\normalArm_L_M + Prosthesis\normalArm_L_F + 689318c7-5045-4876-a7e1-360de4aedf89 + + false + false + Prosthesis\hookArmTest + \ No newline at end of file diff --git a/media/clothing/clothingItems/Prost_NormalArm_R.xml b/media/clothing/clothingItems/Prost_NormalArm_R.xml new file mode 100644 index 0000000..3f35201 --- /dev/null +++ b/media/clothing/clothingItems/Prost_NormalArm_R.xml @@ -0,0 +1,10 @@ + + + Prosthesis\normalArm_R_M + Prosthesis\normalArm_R_F + 0e24eb76-4745-46af-9147-ba21e0ebbb2e + + false + false + Prosthesis\hookArmTest + \ No newline at end of file diff --git a/media/clothing/clothingItems/Prost_Right_LowerArm_LeatherBase_MetalHook.xml b/media/clothing/clothingItems/Prost_Right_LowerArm_LeatherBase_MetalHook.xml deleted file mode 100644 index 6098b92..0000000 --- a/media/clothing/clothingItems/Prost_Right_LowerArm_LeatherBase_MetalHook.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - Prost_Right_LowerArm_Base_Hook_Male - Prost_Right_LowerArm_Base_Hook_Female - 1eb56768-d7ef-46e4-ac07-91d0e43d15fb - false - false - Prosthesis\metal_hook_male - Prosthesis\metal_hook_female - diff --git a/media/clothing/clothingItems/Surgery_Left_Tourniquet.xml b/media/clothing/clothingItems/Surgery_Left_Tourniquet.xml deleted file mode 100644 index 54a61e2..0000000 --- a/media/clothing/clothingItems/Surgery_Left_Tourniquet.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - Surgery\Tourniquet_Left - Surgery\Tourniquet_Left - afbab35d-8bd4-4d61-87c7-054651ead1bd - false - false - false - Surgery\tourniquet - \ No newline at end of file diff --git a/media/clothing/clothingItems/Surgery_Right_Tourniquet.xml b/media/clothing/clothingItems/Surgery_Right_Tourniquet.xml deleted file mode 100644 index f3117b8..0000000 --- a/media/clothing/clothingItems/Surgery_Right_Tourniquet.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - Surgery\Tourniquet_Right - Surgery\Tourniquet_Right - 9a5fe063-63c7-4e6f-81ca-ee77c6678e0d - false - false - false - Surgery\tourniquet - \ No newline at end of file diff --git a/media/fileGuidTable.xml b/media/fileGuidTable.xml index aa6309d..dc49a98 100644 --- a/media/fileGuidTable.xml +++ b/media/fileGuidTable.xml @@ -28,12 +28,20 @@ - media/clothing/clothingItems/Prost_Hook_L.xml + media/clothing/clothingItems/Prost_HookArm_L.xml 05338f5e-e984-49c2-be79-81af9ae8e818 - media/clothing/clothingItems/Prost_Hook_R.xml + media/clothing/clothingItems/Prost_HookArm_R.xml 8ee7e1bc-2c21-428e-a15d-760d98df973d + + media/clothing/clothingItems/Prost_NormalArm_L.xml + 689318c7-5045-4876-a7e1-360de4aedf89 + + + media/clothing/clothingItems/Prost_NormalArm_R.xml + 0e24eb76-4745-46af-9147-ba21e0ebbb2e + \ No newline at end of file diff --git a/media/lua/client/TOC/Handlers/ItemsHandler.lua b/media/lua/client/TOC/Handlers/ItemsHandler.lua index 0a67c24..6cf68da 100644 --- a/media/lua/client/TOC/Handlers/ItemsHandler.lua +++ b/media/lua/client/TOC/Handlers/ItemsHandler.lua @@ -125,7 +125,7 @@ function ItemsHandler.Zombie.SpawnAmputationItem(zombie) -- TODO Check body location of item and deletes potential amputation to apply local clothingName = itemVisual:getClothingItemName() - print(clothingName) + --print(clothingName) if clothingName and luautils.stringStarts(clothingName, StaticData.AMPUTATION_CLOTHING_ITEM_BASE) then TOC_DEBUG.print("added " .. clothingName .. " to ignoredLimbs") diff --git a/media/lua/client/TOC/Handlers/PlayerHandler.lua b/media/lua/client/TOC/Handlers/PlayerHandler.lua index 0b9871c..d409b24 100644 --- a/media/lua/client/TOC/Handlers/PlayerHandler.lua +++ b/media/lua/client/TOC/Handlers/PlayerHandler.lua @@ -58,8 +58,14 @@ end ---Check if the player has an infected (as in, zombie infection) body part ---@param character IsoGameCharacter -function PlayerHandler.CheckInfection(character) - -- This fucking event barely works. Bleeding seems to be the only thing that triggers it +---@param damageType string +---@param damageAmount number +function PlayerHandler.CheckInfection(character, damageType, damageAmount) + + -- TODO This fucking event barely works. Bleeding seems to be the only thing that triggers it. use this to trigger something else and then do not let it keep going + + -- TOC_DEBUG.print("Player got hit!") + -- TOC_DEBUG.print(damageType) if character ~= getPlayer() then return end local bd = character:getBodyDamage() local modDataHandler = ModDataHandler.GetInstance() @@ -171,34 +177,30 @@ function ISEquipWeaponAction:isValid() -- TODO Cache this! local isPrimaryHandValid = not modDataHandler:getIsCut(primaryHand) or modDataHandler:getIsProstEquipped(prostTopR) local isSecondaryHandValid = not modDataHandler:getIsCut(secondaryHand) or modDataHandler:getIsProstEquipped(prostTopL) - -- Check prosthesis before anything else. If we have them, then we're gucci - --if modDataHandler:getIsProstEquipped(StaticData.PROSTHESES_GROUPS.top) - - - TOC_DEBUG.print("isPrimaryHandValid: " .. tostring(isPrimaryHandValid)) - TOC_DEBUG.print("isSecondaryHandValid: " .. tostring(isSecondaryHandValid)) + --TOC_DEBUG.print("isPrimaryHandValid: " .. tostring(isPrimaryHandValid)) + --TOC_DEBUG.print("isSecondaryHandValid: " .. tostring(isSecondaryHandValid)) -- Both hands are cut off if not isPrimaryHandValid and not isSecondaryHandValid then - TOC_DEBUG.print("Both hands invalid") + --TOC_DEBUG.print("Both hands invalid") isValid = false end -- Equip primary and no right hand (with no prost) if self.jobType:contains(equipPrimaryText) and not isPrimaryHandValid then - TOC_DEBUG.print("Equip primary, no right hand, not valid") + --TOC_DEBUG.print("Equip primary, no right hand, not valid") isValid = false end -- Equip secondary and no left hand (with no prost) if self.jobType:contains(equipSecondaryText) and not isSecondaryHandValid then - TOC_DEBUG.print("Equip secondary, no left hand, not valid") + --TOC_DEBUG.print("Equip secondary, no left hand, not valid") isValid = false end end - TOC_DEBUG.print("isValid to return -> " .. tostring(isValid)) + --TOC_DEBUG.print("isValid to return -> " .. tostring(isValid)) --print("_________________________________") return isValid end @@ -274,13 +276,13 @@ function ISEquipWeaponAction:performWithAmputation(modDataHandler) local isFirstValid = not modDataHandler:getIsCut(hand) or modDataHandler:getIsProstEquipped(prostGroup) local isSecondValid = not modDataHandler:getIsCut(otherHand) or modDataHandler:getIsProstEquipped(otherProstGroup) - TOC_DEBUG.print("First Hand: " .. tostring(hand)) - TOC_DEBUG.print("Prost Group: " .. tostring(prostGroup)) - TOC_DEBUG.print("Other Hand: " .. tostring(otherHand)) - TOC_DEBUG.print("Other Prost Group: " .. tostring(otherProstGroup)) + -- TOC_DEBUG.print("First Hand: " .. tostring(hand)) + -- TOC_DEBUG.print("Prost Group: " .. tostring(prostGroup)) + -- TOC_DEBUG.print("Other Hand: " .. tostring(otherHand)) + -- TOC_DEBUG.print("Other Prost Group: " .. tostring(otherProstGroup)) - TOC_DEBUG.print("isPrimaryHandValid: " .. tostring(isFirstValid)) - TOC_DEBUG.print("isSecondaryHandValid: " .. tostring(isSecondValid)) + -- TOC_DEBUG.print("isPrimaryHandValid: " .. tostring(isFirstValid)) + -- TOC_DEBUG.print("isSecondaryHandValid: " .. tostring(isSecondValid)) if isFirstValid then diff --git a/media/lua/client/TOC/Handlers/ProsthesisHandler.lua b/media/lua/client/TOC/Handlers/ProsthesisHandler.lua index 05ac69a..ba9e156 100644 --- a/media/lua/client/TOC/Handlers/ProsthesisHandler.lua +++ b/media/lua/client/TOC/Handlers/ProsthesisHandler.lua @@ -58,7 +58,6 @@ function ProsthesisHandler.CheckIfEquippable(bodyLocation) end -- No acceptable cut limbs - getPlayer():Say("I can't equip this") return false end ------------------------- @@ -70,23 +69,23 @@ end ------------------------- --* Overrides *-- ----@diagnostic disable-next-line: duplicate-set-field -function ISWearClothing:isValid() - TOC_DEBUG.print("ISWearClothing:isValid") - local bodyLocation = self.item:getBodyLocation() - if not string.contains(bodyLocation, bodyLocArmProst) then - return true - else - return ProsthesisHandler.CheckIfEquippable(bodyLocation) - end -end +-- ---@diagnostic disable-next-line: duplicate-set-field +-- function ISWearClothing:isValid() +-- TOC_DEBUG.print("ISWearClothing:isValid") +-- local bodyLocation = self.item:getBodyLocation() +-- if not string.contains(bodyLocation, bodyLocArmProst) then +-- return true +-- else +-- return ProsthesisHandler.CheckIfEquippable(bodyLocation) +-- end +-- end local og_ISClothingExtraAction_isValid = ISClothingExtraAction.isValid ---@diagnostic disable-next-line: duplicate-set-field function ISClothingExtraAction:isValid() --the item that we gets is the OG one, so if we're coming from the left one and wanna switch to the right one we're still gonna get the Left bodylocation - -- TODO Figure out why it runs 2 times + -- TODO isValid can be run multiple times, for some reason. local testItem = InventoryItemFactory.CreateItem(self.extra) local bodyLocation = testItem:getBodyLocation() local isEquippable = og_ISClothingExtraAction_isValid(self) @@ -99,11 +98,17 @@ function ISClothingExtraAction:isValid() return isEquippable end +local og_ISClothingExtraAction_stop = ISClothingExtraAction.stop +function ISClothingExtraAction:stop() + og_ISClothingExtraAction_stop(self) + if ProsthesisHandler.CheckIfProst(self.item) then + getPlayer():Say(getText("UI_Say_CantEquip")) + + end +end local og_ISClothingExtraAction_perform = ISClothingExtraAction.perform function ISClothingExtraAction:perform() - og_ISClothingExtraAction_perform(self) - if ProsthesisHandler.CheckIfProst(self.item) then local group = ProsthesisHandler.GetGroup(self.item) TOC_DEBUG.print("applying prosthesis stuff for " .. group) @@ -111,6 +116,8 @@ function ISClothingExtraAction:perform() modDataHandler:setIsProstEquipped(group, true) modDataHandler:apply() end + + og_ISClothingExtraAction_perform(self) end diff --git a/media/lua/client/TOC/UI/CutLimbInteractions.lua b/media/lua/client/TOC/UI/CutLimbInteractions.lua index be8f997..5d505b5 100644 --- a/media/lua/client/TOC/UI/CutLimbInteractions.lua +++ b/media/lua/client/TOC/UI/CutLimbInteractions.lua @@ -15,7 +15,6 @@ local function CheckIfSaw(itemType) return itemType:contains(StaticData.SAWS_TYPES_IND_STR.saw) or itemType:contains(StaticData.SAWS_TYPES_IND_STR.gardenSaw) end - ---Return a compatible bandage ---@param player IsoPlayer ---@return InventoryItem? @@ -78,13 +77,13 @@ local function AddInvAmputationOptions(player, context, sawItem, stitchesItem, b -- Set the correct text option if stitchesItem and bandageItem then - TOC_DEBUG.print("stitches and bandage") + --TOC_DEBUG.print("stitches and bandage") text = textAmpStitchBandage elseif not bandageItem and stitchesItem then - TOC_DEBUG.print("only stitches") + --TOC_DEBUG.print("only stitches") text = textAmpStitch elseif not stitchesItem and bandageItem then - TOC_DEBUG.print("only bandages") + --TOC_DEBUG.print("only bandages") text = textAmpBandage else text = textAmp @@ -99,7 +98,7 @@ local function AddInvAmputationOptions(player, context, sawItem, stitchesItem, b local limbName = StaticData.LIMBS_STR[i] if not ModDataHandler.GetInstance():getIsCut(limbName) then local limbTranslatedName = getText("ContextMenu_Limb_" .. limbName) - subMenu:addOption(limbTranslatedName, player, PerformAction, player, limbName, sawItem, stitchesItem, bandageItem) -- TODO Should be patient, not surgeon + subMenu:addOption(limbTranslatedName, player, PerformAction, player, limbName, sawItem, stitchesItem, bandageItem) end end end @@ -125,18 +124,13 @@ local function AddInventoryAmputationMenu(playerNum, context, items) if CheckIfSaw(itemType) then local player = getSpecificPlayer(playerNum) local sawItem = item - --AddInvAmputationOptions(player, context, sawItem) - local stitchesItem = GetStitchesItem(player) local bandageItem = GetBandageItem(player) TOC_DEBUG.print("Stitches item: " .. tostring(stitchesItem)) TOC_DEBUG.print("Bandage item: " .. tostring(bandageItem)) - - --if bandageItem then AddInvAmputationOptions(player, context, sawItem, stitchesItem, bandageItem) - --end -- TODO Add stitches option and mixes end diff --git a/media/lua/client/TOC/Zombies/ZombiesAmputation.lua b/media/lua/client/TOC/Zombies/ZombiesAmputation.lua index 8b0dff1..f8e69f2 100644 --- a/media/lua/client/TOC/Zombies/ZombiesAmputation.lua +++ b/media/lua/client/TOC/Zombies/ZombiesAmputation.lua @@ -8,7 +8,17 @@ local ItemsHandler = require("TOC/Handlers/ItemsHandler") ------------------- local function test(zombie, character, bodyPartType, handWeapon) - ItemsHandler.Zombie.SpawnAmputationItem(zombie) + --ItemsHandler.Zombie.SpawnAmputationItem(zombie) end -Events.OnHitZombie.Add(test) \ No newline at end of file +Events.OnHitZombie.Add(test) + + +-- local function test2(zombie, player, handWeapon, damage) +-- if not instanceof(zombie, "IsoZombie") then return end + +-- print(zombie) + +-- end + +-- Events.OnWeaponHitCharacter.Add(test2) \ No newline at end of file diff --git a/media/lua/shared/TOC/BodyLocations.lua b/media/lua/shared/TOC/BodyLocations.lua index a39b797..2ffdaff 100644 --- a/media/lua/shared/TOC/BodyLocations.lua +++ b/media/lua/shared/TOC/BodyLocations.lua @@ -11,8 +11,9 @@ require("TOC/Debug") -- Location IDs must match BodyLocation= and CanBeEquipped= values in items.txt. local group = BodyLocations.getGroup("Human") +-- TODO Breaks if both arms are cut with one prost!!! group:getOrCreateLocation("TOC_Arm_R") -group:getOrCreateLocation("TOC_ArmProst_R") - group:getOrCreateLocation("TOC_Arm_L") + +group:getOrCreateLocation("TOC_ArmProst_R") group:getOrCreateLocation("TOC_ArmProst_L") diff --git a/media/lua/shared/Translate/EN/ItemName_EN.txt b/media/lua/shared/Translate/EN/ItemName_EN.txt new file mode 100644 index 0000000..4900de1 --- /dev/null +++ b/media/lua/shared/Translate/EN/ItemName_EN.txt @@ -0,0 +1,7 @@ +ItemName_EN = { + ItemName_TOC.Prost_NormalArm_L = "Prosthetic Arm", + ItemName_TOC.Prost_NormalArm_R = "Prosthetic Arm", + + ItemName_TOC.Prost_HookArm_L = "Prosthetic Arm - Hook", + ItemName_TOC.Prost_HookArm_R = "Prosthetic Arm - Hook", +} \ No newline at end of file diff --git a/media/lua/shared/Translate/EN/UI_EN.txt b/media/lua/shared/Translate/EN/UI_EN.txt index 5a1edad..9c1ae70 100644 --- a/media/lua/shared/Translate/EN/UI_EN.txt +++ b/media/lua/shared/Translate/EN/UI_EN.txt @@ -9,5 +9,8 @@ UI_EN = { UI_trait_Amputee_UpperArm_desc = "", UI_trait_Insensitive = "Insensitive", - UI_trait_Insensitive_desc = "" + UI_trait_Insensitive_desc = "", + + + UI_Say_CantEquip = "I can't equip it like this..." } \ No newline at end of file diff --git a/media/models_X/Prosthesis/normalArm_L_F.fbx b/media/models_X/Prosthesis/normalArm_L_F.fbx new file mode 100644 index 0000000..43ca9ca Binary files /dev/null and b/media/models_X/Prosthesis/normalArm_L_F.fbx differ diff --git a/media/models_X/Prosthesis/normalArm_R_F.fbx b/media/models_X/Prosthesis/normalArm_R_F.fbx new file mode 100644 index 0000000..7941a68 Binary files /dev/null and b/media/models_X/Prosthesis/normalArm_R_F.fbx differ diff --git a/media/scripts/TOC_items.txt b/media/scripts/TOC_amputation_items.txt similarity index 97% rename from media/scripts/TOC_items.txt rename to media/scripts/TOC_amputation_items.txt index aae3ca3..6085003 100644 --- a/media/scripts/TOC_items.txt +++ b/media/scripts/TOC_amputation_items.txt @@ -124,7 +124,7 @@ module TOC { Type = Clothing, DisplayCategory = Prosthesis, - DisplayName = Hook Arm Test Left, + DisplayName = ProstArmHook, ClothingItem = Prost_Hook_L, ClothingItemExtra = Prost_Hook_R, ClothingItemExtraOption = InstallProstRight, @@ -144,7 +144,7 @@ module TOC { Type = Clothing, DisplayCategory = Prosthesis, - DisplayName = Hook Arm Test Right, + DisplayName = ProstArmHook, ClothingItem = Prost_Hook_R, ClothingItemExtra = Prost_Hook_L, ClothingItemExtraOption = InstallProstLeft, diff --git a/media/scripts/TOC_models.txt b/media/scripts/TOC_models.txt deleted file mode 100644 index 3f69e48..0000000 --- a/media/scripts/TOC_models.txt +++ /dev/null @@ -1,4 +0,0 @@ -module TOC -{ - -} \ No newline at end of file diff --git a/media/scripts/TOC_prosthesis_items.txt b/media/scripts/TOC_prosthesis_items.txt new file mode 100644 index 0000000..8995843 --- /dev/null +++ b/media/scripts/TOC_prosthesis_items.txt @@ -0,0 +1,90 @@ +module TOC +{ + imports + { + Base + } + + /****************** TOP ******************/ + + item Prost_HookArm_L + { + Type = Clothing, + DisplayCategory = Prosthesis, + DisplayName = ProstArmHook, + ClothingItem = Prost_HookArm_L, + ClothingItemExtra = Prost_HookArm_R, + ClothingItemExtraOption = InstallProstRight, + clothingExtraSubmenu = InstallProstLeft, + BodyLocation = TOC_ArmProst_L, + Weight = 0, + CombatSpeedModifier = 0.7, + BloodLocation = UpperArms;UpperBody, + Insulation = 1.0, + WindResistance = 1.0, + WaterResistance = 1.0, + Icon = genericAmputation, + CanHaveHoles = false, + } + item Prost_HookArm_R + { + Type = Clothing, + DisplayCategory = Prosthesis, + DisplayName = ProstArmHook, + ClothingItem = Prost_HookArm_R, + ClothingItemExtra = Prost_HookArm_L, + ClothingItemExtraOption = InstallProstLeft, + clothingExtraSubmenu = InstallProstRight, + BodyLocation = TOC_ArmProst_R, + + Weight = 0, + CombatSpeedModifier = 0.7, + BloodLocation = UpperArms;UpperBody, + Insulation = 1.0, + WindResistance = 1.0, + WaterResistance = 1.0, + Icon = genericAmputation, + CanHaveHoles = false, + } + + item Prost_NormalArm_L + { + Type = Clothing, + DisplayCategory = Prosthesis, + DisplayName = ProstArmHook, + ClothingItem = Prost_NormalArm_L, + ClothingItemExtra = Prost_NormalArm_R, + ClothingItemExtraOption = InstallProstRight, + clothingExtraSubmenu = InstallProstLeft, + BodyLocation = TOC_ArmProst_L, + Weight = 0, + CombatSpeedModifier = 0.7, + BloodLocation = UpperArms;UpperBody, + Insulation = 1.0, + WindResistance = 1.0, + WaterResistance = 1.0, + Icon = genericAmputation, + CanHaveHoles = false, + } + item Prost_NormalArm_R + { + Type = Clothing, + DisplayCategory = Prosthesis, + DisplayName = ProstArmHook, + ClothingItem = Prost_NormalArm_R, + ClothingItemExtra = Prost_NormalArm_L, + ClothingItemExtraOption = InstallProstLeft, + clothingExtraSubmenu = InstallProstRight, + BodyLocation = TOC_ArmProst_R, + + Weight = 0, + CombatSpeedModifier = 0.7, + BloodLocation = UpperArms;UpperBody, + Insulation = 1.0, + WindResistance = 1.0, + WaterResistance = 1.0, + Icon = genericAmputation, + CanHaveHoles = false, + } + +} \ No newline at end of file diff --git a/media/ui/ForeArm_R.png b/media/ui/ForeArm_R.png index 59119bd..3bba378 100644 Binary files a/media/ui/ForeArm_R.png and b/media/ui/ForeArm_R.png differ diff --git a/media/ui/Hand_R.png b/media/ui/Hand_R.png index de4c38d..b2c70c9 100644 Binary files a/media/ui/Hand_R.png and b/media/ui/Hand_R.png differ diff --git a/media/ui/UpperArm_R.png b/media/ui/UpperArm_R.png index d6266ad..2d0386e 100644 Binary files a/media/ui/UpperArm_R.png and b/media/ui/UpperArm_R.png differ