diff --git a/.gitignore b/.gitignore index 5a869cf..0c81fb7 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -/media \ No newline at end of file +dev_stuff/gen_amp_textures/.venv +dev_stuff/gen_amp_textures/output \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index a2e2a17..39267db 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -19,5 +19,9 @@ ".vscode", "dev_stuff", "workshop_files" + ], + "Lua.diagnostics.globals": [ + "FHSwapHandsAction", + "timer" ] } \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 533f4fe..063b956 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -6,14 +6,14 @@ { "label": "Create Workshop folder", "type": "shell", - "options": {"statusbar": {"label": "$(combine) Assemble Mod"}}, - "command": "python ${config:zomboid_user_folder}/PaosCrap/make_workshop_pack.py \"picch\" \"${workspaceFolderBasename}\" \"\"", + "options": {"statusbar": {"label": "$(combine) Assemble Mod - B42"}}, + "command": "python ${config:zomboid_user_folder}/PaosCrap/make_workshop_pack.py \"42\" \"picch\" \"${workspaceFolderBasename}\" \"\"", }, { "label": "Create Workshop folder", "type": "shell", - "options": {"statusbar": {"label": "$(combine) Assemble Mod (B41 ONLY)"}}, - "command": "python ${config:zomboid_user_folder}/PaosCrap/make_workshop_pack_b41.py \"picch\" \"${workspaceFolderBasename}\"", + "options": {"statusbar": {"label": "$(combine) Assemble Mod - B41"}}, + "command": "python ${config:zomboid_user_folder}/PaosCrap/make_workshop_pack.py \"41\" \"picch\" \"${workspaceFolderBasename}\" \"\"", }, { "label": "Create Workshop folder", @@ -25,7 +25,7 @@ "label": "Bump Mod Version", "type": "shell", "options": {"statusbar": {"label": "$(arrow-up) Bump Mod Version"}}, - "command": "python ${config:zomboid_user_folder}/PaosCrap/bump_version.py 42/media/lua/client/TOC/Main.lua", + "command": "python ${config:zomboid_user_folder}/PaosCrap/bump_version.py common/media/lua/client/TOC/Main.lua", }, { "label": "Run Zomboid Debug No Steam (42)", diff --git a/42/media/lua/client/TOC-42/Controllers/LimitActionsController.lua b/42/media/lua/client/TOC-42/Controllers/LimitActionsController.lua index bad1481..0e57d8a 100644 --- a/42/media/lua/client/TOC-42/Controllers/LimitActionsController.lua +++ b/42/media/lua/client/TOC-42/Controllers/LimitActionsController.lua @@ -4,7 +4,7 @@ local OverridenMethodsArchive = require("TOC/OverridenMethodsArchive") local og_ISClothingExtraAction_isValid = OverridenMethodsArchive.Get("ISClothingExtraAction_isValid") ---@diagnostic disable-next-line: duplicate-set-field function ISClothingExtraAction:isValid() - TOC_DEBUG.print("Inside ISClothingExtraAction:isValid 42") - TOC_DEBUG.print(OverridenMethodsArchive.Get("ISClothingExtraAction_isValid")) + -- TOC_DEBUG.print("Inside ISClothingExtraAction:isValid 42") + -- TOC_DEBUG.print(OverridenMethodsArchive.Get("ISClothingExtraAction_isValid")) return LimitActionsController.WrapClothingAction(self, og_ISClothingExtraAction_isValid, instanceItem(self.extra)) end \ No newline at end of file diff --git a/42/media/lua/client/TOC-42/Handlers/ProsthesisHandler.lua b/42/media/lua/client/TOC-42/Handlers/ProsthesisHandler.lua index 7d90b73..1a5dc66 100644 --- a/42/media/lua/client/TOC-42/Handlers/ProsthesisHandler.lua +++ b/42/media/lua/client/TOC-42/Handlers/ProsthesisHandler.lua @@ -25,16 +25,16 @@ local og_ISUnequipAction_complete = ISUnequipAction.complete function ISUnequipAction:complete() -- Horrendous workaround. For B42, as of now, it will basically happen two times, once with :perform and once with :complete. Shouldn't -- matter for performance but it's really ugly. - local isProst = ProsthesisHandler.SearchAndSetupProsthesis(self.item, false) - local group - if isProst then - group = BodyLocations.getGroup("Human") - group:setMultiItem("TOC_ArmProst", false) - end + -- local isProst = ProsthesisHandler.SearchAndSetupProsthesis(self.item, false) + -- local group + -- if isProst then + -- group = BodyLocations.getGroup("Human") + -- group:setMultiItem("TOC_ArmProst", false) + -- end og_ISUnequipAction_complete(self) - if isProst then - group:setMultiItem("TOC_ArmProst", true) - end + -- if isProst then + -- group:setMultiItem("TOC_ArmProst", true) + -- end end \ No newline at end of file diff --git a/42/media/scripts/TOC_recipes.txt b/42/media/scripts/TOC_recipes.txt new file mode 100644 index 0000000..56db634 --- /dev/null +++ b/42/media/scripts/TOC_recipes.txt @@ -0,0 +1,53 @@ +module TOC +{ + imports + { + Base + } + /*************Craft Prosthetics*******************/ + craftRecipe Craft Prosthetic Arm + { + timedAction = BuildMetalStructureSmall, + Time = 150, + Tags = InHandCraft, + category = Welding, + NeedToBeLearn = false, + SkillRequired = MetalWelding:4, + xpAward = MetalWelding:50, + inputs + { + item 4 [MetalPipe], + item 2 [Plank], + item 4 [Base.BlowTorch] flags[DontRecordInput], + item 4 [Base.WeldingRods] flags[DontRecordInput], + + } + outputs + { + item 1 TOC.Prost_NormalArm_L, + } + } + + craftRecipe Craft Prosthetic Hook + { + timedAction = BuildMetalStructureSmall, + Time = 100, + Tags = InHandCraft, + category = Welding, + NeedToBeLearn = false, + SkillRequired = MetalWelding:2, + xpAward = MetalWelding:30, + inputs + { + item 2 [MetalPipe], + item 1 [Plank], + item 4 [Base.BlowTorch] flags[DontRecordInput], + item 2 [Base.WeldingRods] flags[DontRecordInput], + + } + outputs + { + item 1 TOC.Prost_HookArm_L, + } + } +} \ No newline at end of file diff --git a/42/mod.info b/42/mod.info index 6452b21..c7729e9 100644 --- a/42/mod.info +++ b/42/mod.info @@ -4,7 +4,7 @@ description=You've been bitten. You have only two choices. id=TheOnlyCure icon=icon.png url=https://github.com/ZioPao/The-Only-Cure -modversion=2.2 +modversion=2.2.2 versionMin=42.6 loadModAfter=\FancyHandwork,\BrutalHandwork,\TwoWeaponsOnBackRework diff --git a/common/media/clothing/clothingItems/Amputation_ForeArm_L.xml b/common/media/clothing/clothingItems/Amputation_ForeArm_L.xml index 9850855..e63e9bb 100644 --- a/common/media/clothing/clothingItems/Amputation_ForeArm_L.xml +++ b/common/media/clothing/clothingItems/Amputation_ForeArm_L.xml @@ -7,9 +7,10 @@ false false - 3 4 + 3 + diff --git a/common/media/clothing/clothingItems/Amputation_ForeArm_R.xml b/common/media/clothing/clothingItems/Amputation_ForeArm_R.xml index e8e4f88..b11585f 100644 --- a/common/media/clothing/clothingItems/Amputation_ForeArm_R.xml +++ b/common/media/clothing/clothingItems/Amputation_ForeArm_R.xml @@ -9,6 +9,8 @@ 5 6 + + Amputations\Human\Forearm\skin01_b diff --git a/common/media/clothing/clothingItems/Amputation_Hand_L.xml b/common/media/clothing/clothingItems/Amputation_Hand_L.xml index 72adc09..212f3d9 100644 --- a/common/media/clothing/clothingItems/Amputation_Hand_L.xml +++ b/common/media/clothing/clothingItems/Amputation_Hand_L.xml @@ -7,18 +7,33 @@ false false 4 - none + - Amputations\Human\Forearm\skin01_b - Amputations\Human\Forearm\skin02_b - Amputations\Human\Forearm\skin03_b - Amputations\Human\Forearm\skin04_b - Amputations\Human\Forearm\skin05_b + Amputations\Human\Hand\skin01_b + Amputations\Human\Hand\skin02_b + Amputations\Human\Hand\skin03_b + Amputations\Human\Hand\skin04_b + Amputations\Human\Hand\skin05_b - Amputations\Human\Forearm\skin01_hairy_b - Amputations\Human\Forearm\skin02_hairy_b - Amputations\Human\Forearm\skin03_hairy_b - Amputations\Human\Forearm\skin04_hairy_b - Amputations\Human\Forearm\skin05_hairy_b + Amputations\Human\Hand\skin01_hairy_b + Amputations\Human\Hand\skin02_hairy_b + Amputations\Human\Hand\skin03_hairy_b + Amputations\Human\Hand\skin04_hairy_b + Amputations\Human\Hand\skin05_hairy_b + + + + Body\MaleBody01 + Body\MaleBody02 + Body\MaleBody03 + Body\MaleBody04 + Body\MaleBody05 + + Body\MaleBody01a + Body\MaleBody02a + Body\MaleBody03a + Body\MaleBody04 + Body\MaleBody05a + \ No newline at end of file diff --git a/common/media/clothing/clothingItems/Amputation_Hand_R.xml b/common/media/clothing/clothingItems/Amputation_Hand_R.xml index 3d1fb11..d361adf 100644 --- a/common/media/clothing/clothingItems/Amputation_Hand_R.xml +++ b/common/media/clothing/clothingItems/Amputation_Hand_R.xml @@ -6,18 +6,32 @@ false false 6 - none + - Amputations\Human\Forearm\skin01_b - Amputations\Human\Forearm\skin02_b - Amputations\Human\Forearm\skin03_b - Amputations\Human\Forearm\skin04_b - Amputations\Human\Forearm\skin05_b + Amputations\Human\Hand\skin01_b + Amputations\Human\Hand\skin02_b + Amputations\Human\Hand\skin03_b + Amputations\Human\Hand\skin04_b + Amputations\Human\Hand\skin05_b - Amputations\Human\Forearm\skin01_hairy_b - Amputations\Human\Forearm\skin02_hairy_b - Amputations\Human\Forearm\skin03_hairy_b - Amputations\Human\Forearm\skin04_hairy_b - Amputations\Human\Forearm\skin05_hairy_b + Amputations\Human\Hand\skin01_hairy_b + Amputations\Human\Hand\skin02_hairy_b + Amputations\Human\Hand\skin03_hairy_b + Amputations\Human\Hand\skin04_hairy_b + Amputations\Human\Hand\skin05_hairy_b + + + + Body\MaleBody01 + Body\MaleBody02 + Body\MaleBody03 + Body\MaleBody04 + Body\MaleBody05 + + Body\MaleBody01a + Body\MaleBody02a + Body\MaleBody03a + Body\MaleBody04 + Body\MaleBody05a \ No newline at end of file diff --git a/common/media/clothing/clothingItems/Amputation_UpperArm_L.xml b/common/media/clothing/clothingItems/Amputation_UpperArm_L.xml index 82a42ed..6437d9d 100644 --- a/common/media/clothing/clothingItems/Amputation_UpperArm_L.xml +++ b/common/media/clothing/clothingItems/Amputation_UpperArm_L.xml @@ -9,6 +9,8 @@ 3 4 + + Amputations\Human\Upperarm\skin01_b Amputations\Human\Upperarm\skin02_b diff --git a/common/media/clothing/clothingItems/Amputation_UpperArm_R.xml b/common/media/clothing/clothingItems/Amputation_UpperArm_R.xml index 4e85bc0..e09ee6a 100644 --- a/common/media/clothing/clothingItems/Amputation_UpperArm_R.xml +++ b/common/media/clothing/clothingItems/Amputation_UpperArm_R.xml @@ -8,7 +8,8 @@ false 5 6 - + + Amputations\Human\Upperarm\skin01_b Amputations\Human\Upperarm\skin02_b diff --git a/common/media/lua/client/TOC/Controllers/DataController.lua b/common/media/lua/client/TOC/Controllers/DataController.lua index fba40cd..eb1314d 100644 --- a/common/media/lua/client/TOC/Controllers/DataController.lua +++ b/common/media/lua/client/TOC/Controllers/DataController.lua @@ -57,7 +57,6 @@ function DataController:setup(key) ---@type tocModDataType self.tocData = { -- Generic stuff that does not belong anywhere else - isInitializing = true, isIgnoredPartInfected = false, isAnyLimbCut = false, limbs = {}, @@ -93,10 +92,6 @@ function DataController:setup(key) -- Sync with the server self:apply() - -- -- Disable lock - -- self.tocData.isInitializing = false - -- ModData.add(key, self.tocData) - triggerEvent("OnSetupTocData") end @@ -339,14 +334,11 @@ end ---@param cicatrizationTime integer? function DataController:setLimbParams(limbName, ampStatus, cicatrizationTime) local limbData = self.tocData.limbs[limbName] - if ampStatus.isCut ~= nil then limbData.isCut = ampStatus.isCut end - if ampStatus.isInfected ~= nil then limbData.isInfected = ampStatus.isInfected end - if ampStatus.isOperated ~= nil then limbData.isOperated = ampStatus.isOperated end - if ampStatus.isCicatrized ~= nil then limbData.isCicatrized = ampStatus.isCicatrized end - if ampStatus.isCauterized ~= nil then limbData.isCauterized = ampStatus.isCauterized end - if ampStatus.woundDirtyness ~= nil then limbData.woundDirtyness = ampStatus.woundDirtyness end - if ampStatus.isVisible ~= nil then limbData.isVisible = ampStatus.isVisible end - + for k, v in pairs(ampStatus) do + if v ~= nil then + limbData[k] = v + end + end if cicatrizationTime ~= nil then limbData.cicatrizationTime = cicatrizationTime end end @@ -485,4 +477,4 @@ function DataController.DestroyInstance(username) end -return DataController \ No newline at end of file +return DataController diff --git a/common/media/lua/client/TOC/Controllers/ItemsController.lua b/common/media/lua/client/TOC/Controllers/ItemsController.lua index a4fbf35..e76d2d3 100644 --- a/common/media/lua/client/TOC/Controllers/ItemsController.lua +++ b/common/media/lua/client/TOC/Controllers/ItemsController.lua @@ -17,7 +17,6 @@ ItemsController.Player = {} ---@return number ---@private function ItemsController.Player.GetAmputationTexturesIndex(playerObj, isCicatrized) - -- FIX Broken local textureString = playerObj:getHumanVisual():getSkinTexture() local isHairy = textureString:sub(-1) == "a" @@ -79,13 +78,16 @@ end ---Deletes all the old amputation items, used for resets ---@param playerObj IsoPlayer function ItemsController.Player.DeleteAllOldAmputationItems(playerObj) + -- TODO Fix visual bug -- This part is a workaround for a pretty shitty implementation on the java side. Check ProsthesisHandler for more infos - local group = BodyLocations.getGroup("Human") - group:setMultiItem("TOC_Arm", false) - group:setMultiItem("TOC_ArmProst", false) + -- local group = BodyLocations.getGroup("Human") + -- group:setMultiItem("TOC_Arm", false) + -- group:setMultiItem("TOC_ArmProst", false) for i = 1, #StaticData.LIMBS_STR do local limbName = StaticData.LIMBS_STR[i] + + -- TODO Won't work with dedicated clothingItems for multi amps local clothItemName = StaticData.AMPUTATION_CLOTHING_ITEM_BASE .. limbName local clothItem = playerObj:getInventory():FindAndReturn(clothItemName) ---@cast clothItem InventoryItem @@ -94,8 +96,8 @@ function ItemsController.Player.DeleteAllOldAmputationItems(playerObj) -- Reset model just in case playerObj:resetModel() - group:setMultiItem("TOC_Arm", true) - group:setMultiItem("TOC_ArmProst", true) + -- group:setMultiItem("TOC_Arm", true) + -- group:setMultiItem("TOC_ArmProst", true) end ---Spawns and equips the correct amputation item to the player. diff --git a/common/media/lua/client/TOC/Controllers/LimitActionsController.lua b/common/media/lua/client/TOC/Controllers/LimitActionsController.lua index df1b8e2..5583217 100644 --- a/common/media/lua/client/TOC/Controllers/LimitActionsController.lua +++ b/common/media/lua/client/TOC/Controllers/LimitActionsController.lua @@ -36,11 +36,12 @@ end - - - - - +-- We need to override when the player changes key binds manually to be sure that TOC changes are re-applied +local og_MainOptions_apply = MainOptions.apply +function MainOptions:apply(closeAfter) + og_MainOptions_apply(self, closeAfter) + CachedDataHandler.OverrideBothHandsFeasibility() +end -------------------------------------------- diff --git a/common/media/lua/client/TOC/Controllers/TourniquetController.lua b/common/media/lua/client/TOC/Controllers/TourniquetController.lua index f66cc9c..0031870 100644 --- a/common/media/lua/client/TOC/Controllers/TourniquetController.lua +++ b/common/media/lua/client/TOC/Controllers/TourniquetController.lua @@ -64,18 +64,18 @@ end ---@param obj any self ---@param wrappedFunc function function TourniquetController.WrapClothingAction(obj, wrappedFunc) - local isTourniquet = TourniquetController.IsItemTourniquet(obj.item:getFullType()) - local group - if isTourniquet then - group = BodyLocations.getGroup("Human") - group:setMultiItem(TourniquetController.bodyLoc, false) - end + -- local isTourniquet = TourniquetController.IsItemTourniquet(obj.item:getFullType()) + -- local group + -- if isTourniquet then + -- group = BodyLocations.getGroup("Human") + -- group:setMultiItem(TourniquetController.bodyLoc, false) + -- end local ogValue = wrappedFunc(obj) - if isTourniquet then - group:setMultiItem(TourniquetController.bodyLoc, true) - end + -- if isTourniquet then + -- group:setMultiItem(TourniquetController.bodyLoc, true) + -- end return ogValue -- Needed for isValid end @@ -94,16 +94,19 @@ end local og_ISClothingExtraAction_perform = ISClothingExtraAction.perform +---@diagnostic disable-next-line: duplicate-set-field function ISClothingExtraAction:perform() TourniquetController.WrapClothingAction(self, og_ISClothingExtraAction_perform) end local og_ISWearClothing_isValid = ISWearClothing.isValid +---@diagnostic disable-next-line: duplicate-set-field function ISWearClothing:isValid() return TourniquetController.WrapClothingAction(self, og_ISWearClothing_isValid) end local og_ISUnequipAction_perform = ISUnequipAction.perform +---@diagnostic disable-next-line: duplicate-set-field function ISUnequipAction:perform() return TourniquetController.WrapClothingAction(self, og_ISUnequipAction_perform) end diff --git a/common/media/lua/client/TOC/Handlers/CachedDataHandler.lua b/common/media/lua/client/TOC/Handlers/CachedDataHandler.lua index c8a5b0d..60998e0 100644 --- a/common/media/lua/client/TOC/Handlers/CachedDataHandler.lua +++ b/common/media/lua/client/TOC/Handlers/CachedDataHandler.lua @@ -23,7 +23,7 @@ end function CachedDataHandler.CalculateCacheableValues(username) CachedDataHandler.CalculateHighestAmputatedLimbs(username) if getPlayer():getUsername() == username then - CachedDataHandler.CalculateBothHandsFeasibility() + CachedDataHandler.OverrideBothHandsFeasibility() end end @@ -130,14 +130,13 @@ function CachedDataHandler.GetHandFeasibility(side) -- FIX horrendous workaround, but with a forced init we run the caching too early and it breaks this, setting it to nil. if CachedDataHandler.handFeasibility[side] == nil then - CachedDataHandler.CalculateBothHandsFeasibility() + CachedDataHandler.OverrideBothHandsFeasibility() end return CachedDataHandler.handFeasibility[side] end - -function CachedDataHandler.CalculateBothHandsFeasibility() +function CachedDataHandler.OverrideBothHandsFeasibility() CachedDataHandler.CalculateHandFeasibility("Hand_L") CachedDataHandler.CalculateHandFeasibility("Hand_R") local interactStr = "Interact" @@ -151,12 +150,22 @@ function CachedDataHandler.CalculateBothHandsFeasibility() if not CachedDataHandler.GetBothHandsFeasibility() then TOC_DEBUG.print("Disabling interact key") TOC_DEBUG.print("Cached current key for interact: " .. tostring(CachedDataHandler.interactKey)) - getCore():addKeyBinding(interactStr, Keyboard.KEY_NONE) - else - TOC_DEBUG.print("Re-enabling interact key") - TOC_DEBUG.print("Cached current key for interact: " .. tostring(CachedDataHandler.interactKey)) - getCore():addKeyBinding(interactStr, CachedDataHandler.interactKey) + if StaticData.COMPAT_42 then + getCore():addKeyBinding(interactStr, Keyboard.KEY_NONE, 0, false, false, false) + else + getCore():addKeyBinding(interactStr, Keyboard.KEY_NONE) + + end + else + --TOC_DEBUG.print("Re-enabling interact key") + --TOC_DEBUG.print("Cached current key for interact: " .. tostring(CachedDataHandler.interactKey)) + + if StaticData.COMPAT_42 then + getCore():addKeyBinding(interactStr, CachedDataHandler.interactKey, 0, false, false, false) + else + getCore():addKeyBinding(interactStr, CachedDataHandler.interactKey) + end end end @@ -164,4 +173,5 @@ function CachedDataHandler.GetBothHandsFeasibility() return CachedDataHandler.handFeasibility["L"] or CachedDataHandler.handFeasibility["R"] end -return CachedDataHandler \ No newline at end of file +return CachedDataHandler + diff --git a/common/media/lua/client/TOC/Handlers/ProsthesisHandler.lua b/common/media/lua/client/TOC/Handlers/ProsthesisHandler.lua index 1787794..0ba1e3a 100644 --- a/common/media/lua/client/TOC/Handlers/ProsthesisHandler.lua +++ b/common/media/lua/client/TOC/Handlers/ProsthesisHandler.lua @@ -9,8 +9,8 @@ local OverridenMethodsArchive = require("TOC/OverridenMethodsArchive") ---@class ProsthesisHandler local ProsthesisHandler = {} -local bodyLocArmProst = StaticData.MOD_BODYLOCS_BASE_IND_STR.TOC_ArmProst -local bodyLocLegProst = StaticData.MOD_BODYLOCS_BASE_IND_STR.TOC_LegProst +local bodylocArmProstBaseline = "TOC_ArmProst" +--local bodyLocLegProst = "TOC_LegProst" ---Check if the following item is a prosthesis or not ---@param item InventoryItem? @@ -23,7 +23,7 @@ function ProsthesisHandler.CheckIfProst(item) return false end - return item:getBodyLocation():contains(bodyLocArmProst) + return item:getBodyLocation():contains(bodylocArmProstBaseline) end ---Get the grouping for the prosthesis @@ -33,13 +33,10 @@ function ProsthesisHandler.GetGroup(item) local fullType = item:getFullType() local side = CommonMethods.GetSide(fullType) - local bodyLocation = item:getBodyLocation() local position - if bodyLocation == bodyLocArmProst then + if bodyLocation:contains(bodylocArmProstBaseline) then position = "Top_" - elseif bodyLocation == bodyLocLegProst then - position = "Bottom_" else TOC_DEBUG.print("Something is wrong, no position in this item") position = nil @@ -86,7 +83,7 @@ function ProsthesisHandler.SearchAndSetupProsthesis(item, isEquipping) dcInst:apply() -- Calculates hands feasibility once again - CachedDataHandler.CalculateBothHandsFeasibility() + CachedDataHandler.OverrideBothHandsFeasibility() return true end @@ -110,14 +107,15 @@ end --* Overrides *-- ----@diagnostic disable-next-line: duplicate-set-field local og_ISWearClothing_isValid = ISWearClothing.isValid +---@diagnostic disable-next-line: duplicate-set-field function ISWearClothing:isValid() local isEquippable = og_ISWearClothing_isValid(self) return ProsthesisHandler.Validate(self.item, isEquippable) end local og_ISWearClothing_perform = ISWearClothing.perform +---@diagnostic disable-next-line: duplicate-set-field function ISWearClothing:perform() ProsthesisHandler.SearchAndSetupProsthesis(self.item, true) og_ISWearClothing_perform(self) @@ -134,18 +132,26 @@ local og_ISClothingExtraAction_isValid = OverridenMethodsArchive.Save("ISClothin function ISClothingExtraAction:isValid() local isEquippable = og_ISClothingExtraAction_isValid(self) -- self.extra is a string, not the item + + -- B42 Compatibility to add local testItem = InventoryItemFactory.CreateItem(self.extra) return ProsthesisHandler.Validate(testItem, isEquippable) end local og_ISClothingExtraAction_perform = OverridenMethodsArchive.Save("ISClothingExtraAction_perform", ISClothingExtraAction.perform) +---@diagnostic disable-next-line: duplicate-set-field function ISClothingExtraAction:perform() + + + -- B42 Compatibility to add + local extraItem = InventoryItemFactory.CreateItem(self.extra) ProsthesisHandler.SearchAndSetupProsthesis(extraItem, true) og_ISClothingExtraAction_perform(self) end local og_ISUnequipAction_perform = ISUnequipAction.perform +---@diagnostic disable-next-line: duplicate-set-field function ISUnequipAction:perform() --[[ @@ -158,15 +164,15 @@ function ISUnequipAction:perform() ]] local isProst = ProsthesisHandler.SearchAndSetupProsthesis(self.item, false) - local group - if isProst then - group = BodyLocations.getGroup("Human") - group:setMultiItem("TOC_ArmProst", false) - end + -- local group + -- if isProst then + -- group = BodyLocations.getGroup("Human") + -- group:setMultiItem("TOC_ArmProst", false) + -- end og_ISUnequipAction_perform(self) if isProst then - group:setMultiItem("TOC_ArmProst", true) + -- group:setMultiItem("TOC_ArmProst", true) -- we need to fetch the limbname associated to the prosthesis local side = CommonMethods.GetSide(self.item:getFullType()) diff --git a/common/media/lua/client/TOC/Main.lua b/common/media/lua/client/TOC/Main.lua index 07bcac6..c13f4b8 100644 --- a/common/media/lua/client/TOC/Main.lua +++ b/common/media/lua/client/TOC/Main.lua @@ -6,7 +6,7 @@ require("TOC/Events") ---@class Main local Main = { - _version = "2.1.6" + _version = "2.2.2" } function Main.Start() diff --git a/common/media/lua/client/TOC/TimedActions/CleanWoundAction.lua b/common/media/lua/client/TOC/TimedActions/CleanWoundAction.lua index 3d306c9..2ebfbea 100644 --- a/common/media/lua/client/TOC/TimedActions/CleanWoundAction.lua +++ b/common/media/lua/client/TOC/TimedActions/CleanWoundAction.lua @@ -7,6 +7,9 @@ local CommonMethods = require("TOC/CommonMethods") ---@field otherPlayer IsoPlayer ---@field bandage InventoryItem ---@field bodyPart any +---@field doctorLevel number +---@field bandagedPlayerX number +---@field bandagedPlayerY number local CleanWoundAction = ISBaseTimedAction:derive("CleanWoundAction") ---@param doctor IsoPlayer @@ -33,7 +36,7 @@ function CleanWoundAction:new(doctor, otherPlayer, bandage, bodyPart) if doctor:isTimedActionInstant() then o.maxTime = 1 end - if doctor:getAccessLevel() ~= "None" then -- TODO Fix for B42 + if doctor:getAccessLevel() ~= "None" then -- B42 Deprecated o.doctorLevel = 10 end return o diff --git a/common/media/lua/client/TOC/UI/HealthPanel.lua b/common/media/lua/client/TOC/UI/HealthPanel.lua index fea0e21..bd23334 100644 --- a/common/media/lua/client/TOC/UI/HealthPanel.lua +++ b/common/media/lua/client/TOC/UI/HealthPanel.lua @@ -143,26 +143,6 @@ function ISHealthPanel:render() end --- local og_ISHealthPanel_update = ISHealthPanel.update --- function ISHealthPanel:update() --- og_ISHealthPanel_update(self) --- -- TODO Listen for changes on other player side instead of looping this - - --- -- FIX Re-enable it, just for test --- if self.character then --- local locPlUsername = getPlayer():getUsername() --- local remPlUsername = self.character:getUsername() --- if locPlUsername ~= remPlUsername and self:isReallyVisible() then --- -- Request update for TOC DATA --- local key = CommandsData.GetKey(remPlUsername) --- --ModData.request(key) --- end --- end --- end - - - -- We need to override this to force the alpha to 1 local og_ISCharacterInfoWindow_render = ISCharacterInfoWindow.prerender function ISCharacterInfoWindow:prerender() diff --git a/common/media/lua/client/TOC/UI/Interactions/HealthPanelBaseHandler.lua b/common/media/lua/client/TOC/UI/Interactions/HealthPanelBaseHandler.lua index 78ced2a..953c8b2 100644 --- a/common/media/lua/client/TOC/UI/Interactions/HealthPanelBaseHandler.lua +++ b/common/media/lua/client/TOC/UI/Interactions/HealthPanelBaseHandler.lua @@ -33,15 +33,17 @@ function BaseHandler:checkItems() local containers = ISInventoryPaneContextMenu.getContainers(self:getDoctor()) local done = {} local childContainers = {} - for i=1,containers:size() do - local container = containers:get(i-1) - done[container] = true - table.wipe(childContainers) - self:checkContainerItems(container, childContainers) - for _,container2 in ipairs(childContainers) do - if not done[container2] then - done[container2] = true - self:checkContainerItems(container2, nil) + if containers ~= nil then + for i=1, containers:size() do + local container = containers:get(i-1) + done[container] = true + table.wipe(childContainers) + self:checkContainerItems(container, childContainers) + for _,container2 in ipairs(childContainers) do + if not done[container2] then + done[container2] = true + self:checkContainerItems(container2, nil) + end end end end @@ -101,7 +103,7 @@ function BaseHandler:getItemOfTag(items, type) end function BaseHandler:getAllItemsOfType(items, type) - local items = {} + items = {} for _,item in ipairs(items) do if item:getFullType() == type then table.insert(items, item) diff --git a/common/media/lua/shared/TOC/BodyLocations.lua b/common/media/lua/shared/TOC/BodyLocations.lua index aa1fb2e..5c55c13 100644 --- a/common/media/lua/shared/TOC/BodyLocations.lua +++ b/common/media/lua/shared/TOC/BodyLocations.lua @@ -1,5 +1,6 @@ require("TOC/Debug") require("NPCs/BodyLocations") +local StaticData = require("TOC/StaticData") local BodyLocationsAPI = {} local function customGetVal(obj, int) return getClassFieldVal(obj, getClassField(obj, int)) end @@ -8,6 +9,19 @@ local group = BodyLocations.getGroup("Human") ---@type ArrayList local list = customGetVal(group, 1) +---@param bodyLoc string +function BodyLocationsAPI.New(bodyLoc) + local curItem + if StaticData.COMPAT_42 then + curItem = BodyLocation.new(group, bodyLoc) -- create new item + group:getAllLocations():add(curItem) -- add to the list + else + curItem = group:getOrCreateLocation(bodyLoc) -- get current item - or create + end + return curItem +end + +-- TODO Not sure if this method actually works as intende with b42, but for our use case it's fine... ---@param toRelocateOrCreate string ---@param locationElement string ---@param afterBoolean boolean @@ -19,7 +33,8 @@ function BodyLocationsAPI.MoveOrCreateBeforeOrAfter(toRelocateOrCreate, location if itemToMoveTo ~= nil then -- Check type of arg 1 == string - if not, error out. if type(toRelocateOrCreate) ~= "string" then error("Argument 1 is not of type string. Please re-check!", 2) end - local curItem = group:getOrCreateLocation(toRelocateOrCreate) -- get current item - or create + + local curItem = BodyLocationsAPI.New(toRelocateOrCreate) list:remove(curItem) -- remove from the list local index = group:indexOf(locationElement) -- get current index after removal of the location to move to if afterBoolean then index = index + 1 end -- if we want it after it, we increase the index to move to by one @@ -32,27 +47,33 @@ function BodyLocationsAPI.MoveOrCreateBeforeOrAfter(toRelocateOrCreate, location end end -function TestBodyLocations() - local group = BodyLocations.getGroup("Human") - local x = group:getAllLocations() - for i=0, x:size() -1 do - ---@type BodyLocation - local bl = x:get(i) +-- function TestBodyLocations() +-- local group = BodyLocations.getGroup("Human") +-- local x = group:getAllLocations() - print(bl:getId()) - end +-- for i=0, x:size() -1 do -end +-- ---@type BodyLocation +-- local bl = x:get(i) + +-- print(bl:getId()) +-- end +-- end -- MultiItem causes a ton of issues... fucking hell -BodyLocationsAPI.MoveOrCreateBeforeOrAfter("TOC_Arm", "FullTop", true) -group:setMultiItem("TOC_Arm", true) +-- local curItem = BodyLocation.new(group, "TOC_Arm_L") +-- group:getAllLocations():add(curItem) -BodyLocationsAPI.MoveOrCreateBeforeOrAfter("TOC_ArmProst", "TOC_Arm", true) -group:setMultiItem("TOC_ArmProst", true) +-- local curItem = BodyLocation.new(group, "TOC_Arm_R") +-- group:getAllLocations():add(curItem) -BodyLocationsAPI.MoveOrCreateBeforeOrAfter("TOC_ArmAccessory", "TOC_ArmProst", true) -group:setMultiItem("TOC_ArmAccessory", true) \ No newline at end of file + +BodyLocationsAPI.New("TOC_Arm_L") +BodyLocationsAPI.New("TOC_Arm_R") +BodyLocationsAPI.New("TOC_ArmProst_L") +BodyLocationsAPI.New("TOC_ArmProst_R") +BodyLocationsAPI.New("TOC_ArmAccessory_L") +BodyLocationsAPI.New("TOC_ArmAccessory_R") \ No newline at end of file diff --git a/common/media/lua/shared/TOC/Debug.lua b/common/media/lua/shared/TOC/Debug.lua index d559da9..d2c6a8c 100644 --- a/common/media/lua/shared/TOC/Debug.lua +++ b/common/media/lua/shared/TOC/Debug.lua @@ -13,10 +13,12 @@ end ---Print debug ---@param string string function TOC_DEBUG.print(string) - --if isDebugEnabled() then - local runningFile = TOC_DEBUG.getRunningFile() - print("[TOC]" .. "[" .. runningFile .. "] " .. tostring(string)) - --end + if isDebugEnabled() then + local runningFile = TOC_DEBUG.getRunningFile() + print("[TOC]" .. "[" .. runningFile .. "] " .. tostring(string)) + else + print(string) + end end ---Horrendous but I don't really care about performance for this diff --git a/common/media/lua/shared/TOC/StaticData.lua b/common/media/lua/shared/TOC/StaticData.lua index 833095f..fe181bc 100644 --- a/common/media/lua/shared/TOC/StaticData.lua +++ b/common/media/lua/shared/TOC/StaticData.lua @@ -2,7 +2,7 @@ ---@alias limbsTable {Hand_L : partDataType, ForeArm_L : partDataType, UpperArm_L : partDataType, Hand_R : partDataType, ForeArm_R : partDataType, UpperArm_R : partDataType } ---@alias prosthesisData {isProstEquipped : boolean, prostFactor : number } ---@alias prosthesesTable {Top_L : prosthesisData, Top_R : prosthesisData } -- TODO add Bottom_L and Bottom_R ----@alias tocModDataType { limbs : limbsTable, prostheses : prosthesesTable, isIgnoredPartInfected : boolean, isAnyLimbCut : boolean, isInitializing : boolean} +---@alias tocModDataType { limbs : limbsTable, prostheses : prosthesesTable, isIgnoredPartInfected : boolean, isAnyLimbCut : boolean} --------------------------- @@ -49,11 +49,14 @@ StaticData.PARTS_STR = { "UpperArm" } - +-- TODO make it a bit more elegant StaticData.MOD_BODYLOCS_BASE_IND_STR = { - TOC_ArmProst = "TOC_ArmProst", - TOC_LegProst = "TOC_LegProst", - TOC_Arm = "TOC_Arm", + TOC_ArmProst_L = "TOC_ArmProst_L", + TOC_ArmProst_R = "TOC_ArmProst_R", + TOC_Arm_L = "TOC_Arm_L", + TOC_Arm_R = "TOC_Arm_R", + + --TOC_LegProst = "TOC_LegProst", } -- No "MAX" here. @@ -149,6 +152,7 @@ StaticData.AMP_GROUPS_BASE_IND_STR = { Bottom = "Bottom" } +-- FIX This should be aligned with the body locs, no reason anymore to keep it separated StaticData.AMP_GROUPS_IND_STR = {} StaticData.AMP_GROUPS_STR = {} diff --git a/common/media/scripts/TOC_amputation_items.txt b/common/media/scripts/TOC_amputation_items.txt index ff1e494..e34482b 100644 --- a/common/media/scripts/TOC_amputation_items.txt +++ b/common/media/scripts/TOC_amputation_items.txt @@ -9,9 +9,10 @@ module TOC { Type = Clothing, DisplayCategory = Amputation, + hidden = true, ClothingItem = Amputation_Hand_R, - BodyLocation = TOC_Arm, + BodyLocation = TOC_Arm_R, Weight = 0, CombatSpeedModifier = 0.9, @@ -27,9 +28,10 @@ module TOC { Type = Clothing, DisplayCategory = Amputation, + hidden = true, ClothingItem = Amputation_ForeArm_R, - BodyLocation = TOC_Arm, + BodyLocation = TOC_Arm_R, Weight = 0, CombatSpeedModifier = 0.8, @@ -44,9 +46,10 @@ module TOC { Type = Clothing, DisplayCategory = Amputation, + hidden = true, ClothingItem = Amputation_UpperArm_R, - BodyLocation = TOC_Arm, + BodyLocation = TOC_Arm_R, BloodLocation = UpperArms;UpperBody, Weight = 0, CombatSpeedModifier = 0.7, @@ -60,9 +63,10 @@ module TOC { Type = Clothing, DisplayCategory = Amputation, + hidden = true, ClothingItem = Amputation_Hand_L, - BodyLocation = TOC_Arm, + BodyLocation = TOC_Arm_L, Weight = 0, CombatSpeedModifier = 0.9, @@ -78,9 +82,10 @@ module TOC { Type = Clothing, DisplayCategory = Amputation, + hidden = true, ClothingItem = Amputation_ForeArm_L, - BodyLocation = TOC_Arm, + BodyLocation = TOC_Arm_L, Weight = 0, CombatSpeedModifier = 0.8, @@ -96,9 +101,10 @@ module TOC { Type = Clothing, DisplayCategory = Amputation, + hidden = true, ClothingItem = Amputation_UpperArm_L, - BodyLocation = TOC_Arm, + BodyLocation = TOC_Arm_L, Weight = 0, CombatSpeedModifier = 0.7, diff --git a/common/media/scripts/TOC_prosthesis_items.txt b/common/media/scripts/TOC_prosthesis_items.txt index 23eebb4..691dbbc 100644 --- a/common/media/scripts/TOC_prosthesis_items.txt +++ b/common/media/scripts/TOC_prosthesis_items.txt @@ -16,7 +16,7 @@ module TOC ClothingItemExtra = Prost_HookArm_R, ClothingItemExtraOption = InstallProstRight, clothingExtraSubmenu = InstallProstLeft, - BodyLocation = TOC_ArmProst, + BodyLocation = TOC_ArmProst_L, Weight = 1.5, CombatSpeedModifier = 1.05, BloodLocation = UpperArms;UpperBody, @@ -38,7 +38,7 @@ module TOC ClothingItemExtra = Prost_HookArm_L, ClothingItemExtraOption = InstallProstLeft, clothingExtraSubmenu = InstallProstRight, - BodyLocation = TOC_ArmProst, + BodyLocation = TOC_ArmProst_R, Weight = 1.5, CombatSpeedModifier = 1.05, BloodLocation = UpperArms;UpperBody, @@ -60,7 +60,7 @@ module TOC ClothingItemExtra = Prost_NormalArm_R, ClothingItemExtraOption = InstallProstRight, clothingExtraSubmenu = InstallProstLeft, - BodyLocation = TOC_ArmProst, + BodyLocation = TOC_ArmProst_L, Weight = 2, CombatSpeedModifier = 1.1, BloodLocation = UpperArms;UpperBody, @@ -82,7 +82,7 @@ module TOC ClothingItemExtra = Prost_NormalArm_L, ClothingItemExtraOption = InstallProstLeft, clothingExtraSubmenu = InstallProstRight, - BodyLocation = TOC_ArmProst, + BodyLocation = TOC_ArmProst_R, Weight = 2, CombatSpeedModifier = 1.1, BloodLocation = UpperArms;UpperBody, diff --git a/common/media/scripts/TOC_surgery_items.txt b/common/media/scripts/TOC_surgery_items.txt index 02c115c..aa21297 100644 --- a/common/media/scripts/TOC_surgery_items.txt +++ b/common/media/scripts/TOC_surgery_items.txt @@ -15,7 +15,7 @@ module TOC ClothingItemExtra = Surg_Arm_Tourniquet_R, ClothingItemExtraOption = PutTourniquetArmRight, clothingExtraSubmenu = PutTourniquetArmLeft, - BodyLocation = TOC_ArmAccessory, + BodyLocation = TOC_ArmAccessory_L, BloodLocation = UpperArms;UpperBody, Weight = 0.25, @@ -35,7 +35,7 @@ module TOC ClothingItemExtra = Surg_Arm_Tourniquet_L, ClothingItemExtraOption = PutTourniquetArmLeft, clothingExtraSubmenu = PutTourniquetArmRight, - BodyLocation = TOC_ArmAccessory, + BodyLocation = TOC_ArmAccessory_R, BloodLocation = UpperArms;UpperBody, Weight = 0.25, diff --git a/common/media/textures/Amputations/Human/Forearm/skin01_b.png b/common/media/textures/Amputations/Human/Forearm/skin01_b.png index e6bf563..f894b6b 100644 Binary files a/common/media/textures/Amputations/Human/Forearm/skin01_b.png and b/common/media/textures/Amputations/Human/Forearm/skin01_b.png differ diff --git a/common/media/textures/Amputations/Human/Forearm/skin01_hairy_b.png b/common/media/textures/Amputations/Human/Forearm/skin01_hairy_b.png index 3d6236d..1809bb4 100644 Binary files a/common/media/textures/Amputations/Human/Forearm/skin01_hairy_b.png and b/common/media/textures/Amputations/Human/Forearm/skin01_hairy_b.png differ diff --git a/common/media/textures/Amputations/Human/Forearm/skin02_b.png b/common/media/textures/Amputations/Human/Forearm/skin02_b.png index 55326a8..604809f 100644 Binary files a/common/media/textures/Amputations/Human/Forearm/skin02_b.png and b/common/media/textures/Amputations/Human/Forearm/skin02_b.png differ diff --git a/common/media/textures/Amputations/Human/Forearm/skin02_hairy_b.png b/common/media/textures/Amputations/Human/Forearm/skin02_hairy_b.png index de9c4cf..7387621 100644 Binary files a/common/media/textures/Amputations/Human/Forearm/skin02_hairy_b.png and b/common/media/textures/Amputations/Human/Forearm/skin02_hairy_b.png differ diff --git a/common/media/textures/Amputations/Human/Forearm/skin03_b.png b/common/media/textures/Amputations/Human/Forearm/skin03_b.png index f29ee93..216a23a 100644 Binary files a/common/media/textures/Amputations/Human/Forearm/skin03_b.png and b/common/media/textures/Amputations/Human/Forearm/skin03_b.png differ diff --git a/common/media/textures/Amputations/Human/Forearm/skin03_hairy_b.png b/common/media/textures/Amputations/Human/Forearm/skin03_hairy_b.png index 49eb61a..701b151 100644 Binary files a/common/media/textures/Amputations/Human/Forearm/skin03_hairy_b.png and b/common/media/textures/Amputations/Human/Forearm/skin03_hairy_b.png differ diff --git a/common/media/textures/Amputations/Human/Forearm/skin04_b.png b/common/media/textures/Amputations/Human/Forearm/skin04_b.png index 3c8f622..be45ab0 100644 Binary files a/common/media/textures/Amputations/Human/Forearm/skin04_b.png and b/common/media/textures/Amputations/Human/Forearm/skin04_b.png differ diff --git a/common/media/textures/Amputations/Human/Forearm/skin04_hairy_b.png b/common/media/textures/Amputations/Human/Forearm/skin04_hairy_b.png index b0d0d4f..864ca3f 100644 Binary files a/common/media/textures/Amputations/Human/Forearm/skin04_hairy_b.png and b/common/media/textures/Amputations/Human/Forearm/skin04_hairy_b.png differ diff --git a/common/media/textures/Amputations/Human/Forearm/skin05_b.png b/common/media/textures/Amputations/Human/Forearm/skin05_b.png index 668d653..390ba63 100644 Binary files a/common/media/textures/Amputations/Human/Forearm/skin05_b.png and b/common/media/textures/Amputations/Human/Forearm/skin05_b.png differ diff --git a/common/media/textures/Amputations/Human/Forearm/skin05_hairy_b.png b/common/media/textures/Amputations/Human/Forearm/skin05_hairy_b.png index 394c9bb..425305d 100644 Binary files a/common/media/textures/Amputations/Human/Forearm/skin05_hairy_b.png and b/common/media/textures/Amputations/Human/Forearm/skin05_hairy_b.png differ diff --git a/common/media/textures/Amputations/Human/Hand/skin01_b.png b/common/media/textures/Amputations/Human/Hand/skin01_b.png new file mode 100644 index 0000000..6886a79 Binary files /dev/null and b/common/media/textures/Amputations/Human/Hand/skin01_b.png differ diff --git a/common/media/textures/Amputations/Human/Hand/skin01_hairy_b.png b/common/media/textures/Amputations/Human/Hand/skin01_hairy_b.png new file mode 100644 index 0000000..563de15 Binary files /dev/null and b/common/media/textures/Amputations/Human/Hand/skin01_hairy_b.png differ diff --git a/common/media/textures/Amputations/Human/Hand/skin02_b.png b/common/media/textures/Amputations/Human/Hand/skin02_b.png new file mode 100644 index 0000000..88311e7 Binary files /dev/null and b/common/media/textures/Amputations/Human/Hand/skin02_b.png differ diff --git a/common/media/textures/Amputations/Human/Hand/skin02_hairy_b.png b/common/media/textures/Amputations/Human/Hand/skin02_hairy_b.png new file mode 100644 index 0000000..9deaf29 Binary files /dev/null and b/common/media/textures/Amputations/Human/Hand/skin02_hairy_b.png differ diff --git a/common/media/textures/Amputations/Human/Hand/skin03_b.png b/common/media/textures/Amputations/Human/Hand/skin03_b.png new file mode 100644 index 0000000..2c6fba1 Binary files /dev/null and b/common/media/textures/Amputations/Human/Hand/skin03_b.png differ diff --git a/common/media/textures/Amputations/Human/Hand/skin03_hairy_b.png b/common/media/textures/Amputations/Human/Hand/skin03_hairy_b.png new file mode 100644 index 0000000..0de2f5b Binary files /dev/null and b/common/media/textures/Amputations/Human/Hand/skin03_hairy_b.png differ diff --git a/common/media/textures/Amputations/Human/Hand/skin04_b.png b/common/media/textures/Amputations/Human/Hand/skin04_b.png new file mode 100644 index 0000000..14fa7ae Binary files /dev/null and b/common/media/textures/Amputations/Human/Hand/skin04_b.png differ diff --git a/common/media/textures/Amputations/Human/Hand/skin04_hairy_b.png b/common/media/textures/Amputations/Human/Hand/skin04_hairy_b.png new file mode 100644 index 0000000..b9d0050 Binary files /dev/null and b/common/media/textures/Amputations/Human/Hand/skin04_hairy_b.png differ diff --git a/common/media/textures/Amputations/Human/Hand/skin05_b.png b/common/media/textures/Amputations/Human/Hand/skin05_b.png new file mode 100644 index 0000000..4a708a0 Binary files /dev/null and b/common/media/textures/Amputations/Human/Hand/skin05_b.png differ diff --git a/common/media/textures/Amputations/Human/Hand/skin05_hairy_b.png b/common/media/textures/Amputations/Human/Hand/skin05_hairy_b.png new file mode 100644 index 0000000..3a9b075 Binary files /dev/null and b/common/media/textures/Amputations/Human/Hand/skin05_hairy_b.png differ diff --git a/common/media/textures/Amputations/Human/Upperarm/skin01_b.png b/common/media/textures/Amputations/Human/Upperarm/skin01_b.png index ed01382..d842158 100644 Binary files a/common/media/textures/Amputations/Human/Upperarm/skin01_b.png and b/common/media/textures/Amputations/Human/Upperarm/skin01_b.png differ diff --git a/common/media/textures/Amputations/Human/Upperarm/skin01_hairy_b.png b/common/media/textures/Amputations/Human/Upperarm/skin01_hairy_b.png index 05c0972..6f43846 100644 Binary files a/common/media/textures/Amputations/Human/Upperarm/skin01_hairy_b.png and b/common/media/textures/Amputations/Human/Upperarm/skin01_hairy_b.png differ diff --git a/common/media/textures/Amputations/Human/Upperarm/skin02_b.png b/common/media/textures/Amputations/Human/Upperarm/skin02_b.png index f844751..16d4167 100644 Binary files a/common/media/textures/Amputations/Human/Upperarm/skin02_b.png and b/common/media/textures/Amputations/Human/Upperarm/skin02_b.png differ diff --git a/common/media/textures/Amputations/Human/Upperarm/skin02_hairy_b.png b/common/media/textures/Amputations/Human/Upperarm/skin02_hairy_b.png index a796be5..c906fe0 100644 Binary files a/common/media/textures/Amputations/Human/Upperarm/skin02_hairy_b.png and b/common/media/textures/Amputations/Human/Upperarm/skin02_hairy_b.png differ diff --git a/common/media/textures/Amputations/Human/Upperarm/skin03_b.png b/common/media/textures/Amputations/Human/Upperarm/skin03_b.png index f31fef6..bc669ab 100644 Binary files a/common/media/textures/Amputations/Human/Upperarm/skin03_b.png and b/common/media/textures/Amputations/Human/Upperarm/skin03_b.png differ diff --git a/common/media/textures/Amputations/Human/Upperarm/skin03_hairy_b.png b/common/media/textures/Amputations/Human/Upperarm/skin03_hairy_b.png index 650d142..77aeeae 100644 Binary files a/common/media/textures/Amputations/Human/Upperarm/skin03_hairy_b.png and b/common/media/textures/Amputations/Human/Upperarm/skin03_hairy_b.png differ diff --git a/common/media/textures/Amputations/Human/Upperarm/skin04_b.png b/common/media/textures/Amputations/Human/Upperarm/skin04_b.png index 7dce8ac..dada041 100644 Binary files a/common/media/textures/Amputations/Human/Upperarm/skin04_b.png and b/common/media/textures/Amputations/Human/Upperarm/skin04_b.png differ diff --git a/common/media/textures/Amputations/Human/Upperarm/skin04_hairy_b.png b/common/media/textures/Amputations/Human/Upperarm/skin04_hairy_b.png index be3afb2..ec3a25f 100644 Binary files a/common/media/textures/Amputations/Human/Upperarm/skin04_hairy_b.png and b/common/media/textures/Amputations/Human/Upperarm/skin04_hairy_b.png differ diff --git a/common/media/textures/Amputations/Human/Upperarm/skin05_b.png b/common/media/textures/Amputations/Human/Upperarm/skin05_b.png index 0db3df9..35be197 100644 Binary files a/common/media/textures/Amputations/Human/Upperarm/skin05_b.png and b/common/media/textures/Amputations/Human/Upperarm/skin05_b.png differ diff --git a/common/media/textures/Amputations/Human/Upperarm/skin05_hairy_b.png b/common/media/textures/Amputations/Human/Upperarm/skin05_hairy_b.png index 51b9fb5..a5bbdf9 100644 Binary files a/common/media/textures/Amputations/Human/Upperarm/skin05_hairy_b.png and b/common/media/textures/Amputations/Human/Upperarm/skin05_hairy_b.png differ diff --git a/common/media/textures/Amputations/Masks/Belt.png b/common/media/textures/Amputations/Masks/Belt.png new file mode 100644 index 0000000..eb0be59 Binary files /dev/null and b/common/media/textures/Amputations/Masks/Belt.png differ diff --git a/common/media/textures/Amputations/Masks/Chest.png b/common/media/textures/Amputations/Masks/Chest.png new file mode 100644 index 0000000..1209f76 Binary files /dev/null and b/common/media/textures/Amputations/Masks/Chest.png differ diff --git a/common/media/textures/Amputations/Masks/Crotch.png b/common/media/textures/Amputations/Masks/Crotch.png new file mode 100644 index 0000000..fb12868 Binary files /dev/null and b/common/media/textures/Amputations/Masks/Crotch.png differ diff --git a/common/media/textures/Amputations/Masks/Dress.png b/common/media/textures/Amputations/Masks/Dress.png new file mode 100644 index 0000000..5081088 Binary files /dev/null and b/common/media/textures/Amputations/Masks/Dress.png differ diff --git a/common/media/textures/Amputations/Masks/Head.png b/common/media/textures/Amputations/Masks/Head.png new file mode 100644 index 0000000..7a1f656 Binary files /dev/null and b/common/media/textures/Amputations/Masks/Head.png differ diff --git a/common/media/textures/Amputations/Masks/LeftFoot.png b/common/media/textures/Amputations/Masks/LeftFoot.png new file mode 100644 index 0000000..e5ab940 Binary files /dev/null and b/common/media/textures/Amputations/Masks/LeftFoot.png differ diff --git a/common/media/textures/Amputations/Masks/LeftLeg.png b/common/media/textures/Amputations/Masks/LeftLeg.png new file mode 100644 index 0000000..3dcc71e Binary files /dev/null and b/common/media/textures/Amputations/Masks/LeftLeg.png differ diff --git a/common/media/textures/Amputations/Masks/RightFoot.png b/common/media/textures/Amputations/Masks/RightFoot.png new file mode 100644 index 0000000..4dc15e1 Binary files /dev/null and b/common/media/textures/Amputations/Masks/RightFoot.png differ diff --git a/common/media/textures/Amputations/Masks/RightLeg.png b/common/media/textures/Amputations/Masks/RightLeg.png new file mode 100644 index 0000000..a7cbf69 Binary files /dev/null and b/common/media/textures/Amputations/Masks/RightLeg.png differ diff --git a/common/media/textures/Amputations/Masks/Waist.png b/common/media/textures/Amputations/Masks/Waist.png new file mode 100644 index 0000000..cc7e53e Binary files /dev/null and b/common/media/textures/Amputations/Masks/Waist.png differ diff --git a/dev_stuff/FemaleBody_fix.png b/dev_stuff/FemaleBody_fix.png new file mode 100644 index 0000000..dbce0e2 Binary files /dev/null and b/dev_stuff/FemaleBody_fix.png differ diff --git a/dev_stuff/female_mask.png b/dev_stuff/female_mask.png new file mode 100644 index 0000000..0d897c4 Binary files /dev/null and b/dev_stuff/female_mask.png differ diff --git a/dev_stuff/gen_amp_textures/input/body/MaleBody01.png b/dev_stuff/gen_amp_textures/input/body/MaleBody01.png new file mode 100644 index 0000000..0f12fff Binary files /dev/null and b/dev_stuff/gen_amp_textures/input/body/MaleBody01.png differ diff --git a/dev_stuff/gen_amp_textures/input/body/MaleBody01a.png b/dev_stuff/gen_amp_textures/input/body/MaleBody01a.png new file mode 100644 index 0000000..39e85a5 Binary files /dev/null and b/dev_stuff/gen_amp_textures/input/body/MaleBody01a.png differ diff --git a/dev_stuff/gen_amp_textures/input/body/MaleBody02.png b/dev_stuff/gen_amp_textures/input/body/MaleBody02.png new file mode 100644 index 0000000..b66a231 Binary files /dev/null and b/dev_stuff/gen_amp_textures/input/body/MaleBody02.png differ diff --git a/dev_stuff/gen_amp_textures/input/body/MaleBody02a.png b/dev_stuff/gen_amp_textures/input/body/MaleBody02a.png new file mode 100644 index 0000000..9ebcba0 Binary files /dev/null and b/dev_stuff/gen_amp_textures/input/body/MaleBody02a.png differ diff --git a/dev_stuff/gen_amp_textures/input/body/MaleBody03.png b/dev_stuff/gen_amp_textures/input/body/MaleBody03.png new file mode 100644 index 0000000..c3a08fb Binary files /dev/null and b/dev_stuff/gen_amp_textures/input/body/MaleBody03.png differ diff --git a/dev_stuff/gen_amp_textures/input/body/MaleBody03a.png b/dev_stuff/gen_amp_textures/input/body/MaleBody03a.png new file mode 100644 index 0000000..c5d2c13 Binary files /dev/null and b/dev_stuff/gen_amp_textures/input/body/MaleBody03a.png differ diff --git a/dev_stuff/gen_amp_textures/input/body/MaleBody04.png b/dev_stuff/gen_amp_textures/input/body/MaleBody04.png new file mode 100644 index 0000000..5c3f42b Binary files /dev/null and b/dev_stuff/gen_amp_textures/input/body/MaleBody04.png differ diff --git a/dev_stuff/gen_amp_textures/input/body/MaleBody04a.png b/dev_stuff/gen_amp_textures/input/body/MaleBody04a.png new file mode 100644 index 0000000..02e767c Binary files /dev/null and b/dev_stuff/gen_amp_textures/input/body/MaleBody04a.png differ diff --git a/dev_stuff/gen_amp_textures/input/body/MaleBody05.png b/dev_stuff/gen_amp_textures/input/body/MaleBody05.png new file mode 100644 index 0000000..12a7a95 Binary files /dev/null and b/dev_stuff/gen_amp_textures/input/body/MaleBody05.png differ diff --git a/dev_stuff/gen_amp_textures/input/body/MaleBody05a.png b/dev_stuff/gen_amp_textures/input/body/MaleBody05a.png new file mode 100644 index 0000000..fbdbdcb Binary files /dev/null and b/dev_stuff/gen_amp_textures/input/body/MaleBody05a.png differ diff --git a/dev_stuff/gen_amp_textures/input/wound.png b/dev_stuff/gen_amp_textures/input/wound.png new file mode 100644 index 0000000..5c7ce22 Binary files /dev/null and b/dev_stuff/gen_amp_textures/input/wound.png differ diff --git a/dev_stuff/gen_amp_textures/main.py b/dev_stuff/gen_amp_textures/main.py new file mode 100644 index 0000000..076f1d6 --- /dev/null +++ b/dev_stuff/gen_amp_textures/main.py @@ -0,0 +1,65 @@ +from pathlib import Path +from PIL import Image +import os + +input_bodies_path = Path('input/body') +input_wound_texture = Path('input/wound.png') +# 45, 33 TEXTURE + + +# 256,256 + +IMG_WIDTH = 256 + +COORDS_L = { + "H": (2, 100), + "F": (2, 59), + "U": (2,21), +} + +COORDS_R = { + "H": (IMG_WIDTH - 43- COORDS_L['H'][0], COORDS_L['H'][1]), + "F": (IMG_WIDTH - 43 - COORDS_L['F'][0], COORDS_L['F'][1]), + "U": (IMG_WIDTH - 43 - COORDS_L['U'][0], COORDS_L['U'][1]), +} + +FULL_COORDS = {key: (COORDS_L[key], COORDS_R[key]) for key in COORDS_L} + +print(FULL_COORDS) +overlay = Image.open(input_wound_texture) + +for filepath in input_bodies_path.glob('*.png'): # Only PNG files + print(f'Processing {filepath.name}...') + base = Image.open(filepath) + + + body_name = filepath.stem.replace('MaleBody', 'skin') + if body_name.endswith('a'): + body_name = body_name[:-1] + '_hairy_b' + else: + body_name = body_name + '_b' + + for key, (value_L, value_R) in FULL_COORDS.items(): + print(key) + result = base.copy() + + result.paste(overlay, value_L, mask=overlay) + result.paste(overlay, value_R, mask=overlay) + + output_path = 'output/' + + if key == "H": + os.makedirs('output/Hand', exist_ok=True) + output_path = 'output/Hand' + + if key == "F": + os.makedirs('output/Forearm', exist_ok=True) + output_path = 'output/Forearm' + + if key == "U": + os.makedirs('output/UpperArm', exist_ok=True) + output_path = 'output/UpperArm' + + result.save(f'{output_path}/{body_name}.png') + + diff --git a/dev_stuff/logos/TOC_LOGOv2 by Chuck.psd b/dev_stuff/logos/TOC_LOGOv2 by Chuck.psd index 695a996..0ad4acc 100644 Binary files a/dev_stuff/logos/TOC_LOGOv2 by Chuck.psd and b/dev_stuff/logos/TOC_LOGOv2 by Chuck.psd differ diff --git a/dev_stuff/logos/gude-2025-10-04.log b/dev_stuff/logos/gude-2025-10-04.log new file mode 100644 index 0000000..9e980fe --- /dev/null +++ b/dev_stuff/logos/gude-2025-10-04.log @@ -0,0 +1,3 @@ +16:46:38:807 [CRITICAL] SharedConnection - Failed to open WinHTTP Session. The parameter is incorrect. +, last error code = 87 +16:46:38:807 [ERROR] Failed to Configure Secure Protocols. WinHTTP Incorrect Handle Type. last error code = 12018 diff --git a/dev_stuff/steam_desc.txt b/dev_stuff/steam_desc.txt index 6914803..98a63ef 100644 --- a/dev_stuff/steam_desc.txt +++ b/dev_stuff/steam_desc.txt @@ -4,26 +4,21 @@ [h1]You're bitten. You have two choices.[/h1] Wait until you succumb to the virus or take matters into your hands. Cut off that infected part and live to die another day. -This version of [b]The Only Cure[/b] has been rebuilt from scratch to support future additions and to feel as close as possible as a vanilla mechanic. - -[b]If you're using an older version of The Only Cure and want to switch with this, you're gonna need to create a new character\save to prevent issues.[/b] -[b]The older version will be delisted shortly and it will not be supported anymore.[/b] -[h1]Supports [b]Single Player[/b] and [b]Multiplayer[/b]. Host Mode is currently [b]UNSUPPORTED![/b][/h1] - [h1]Setup[/h1] -Use it with the following mods for the intended experience: +[strike]Use it with the following mods for the intended experience: [list] [*] [url=https://steamcommunity.com/sharedfiles/filedetails/?id=2904920097]Fancy Handwork[/url] [*] [url=https://steamcommunity.com/sharedfiles/filedetails/?id=2934621024]Brutal Handwork[/url] [/list] -Place them [b]BEFORE[/b] The Only Cure in your mod list! +Place them [b]BEFORE[/b] The Only Cure in your mod list![/strike] +[b]At the moment, the mods listed here aren't compatible with B42.[/b] [hr][/hr] [h1]Quick guide[/h1] [h2]Amputation[/h2] -Get a [i]Saw[/i] or a [i]Garden Saw[/i], right click on it, and choose which limb to amputate. You can also drag n' drop your Saw item directly into the afflicted area to start cutting it off. +Get a [i]Saw[/i]/[i]Garden Saw[/i], right click on it, and choose which limb to amputate. You can also drag n' drop your Saw item directly into the afflicted area to start cutting it off. If you have some [i]bandages[/i] and\or [i]stitches[/i] in your inventory you will automatically use them, multiplying the chances of your survival. If you have a [i]tourniquet[/i], place it on the correct side to dampen the amount of damage you will take after you're done amputating the limb. @@ -77,8 +72,8 @@ Got any issues or found some pesky bugs? Report them on GitHub! [th]Compatibility API[/th] [/tr] [tr] - [th]JCloudJalix[/th] - [th]German translation[/th] + [th]JCloudJalix, Rinary1, pllq, ttaeo, pgmbru[/th] + [th]Translation[/th] [/tr] [/table] diff --git a/mod.info b/mod.info index 7b8bb47..babeea2 100644 --- a/mod.info +++ b/mod.info @@ -4,4 +4,4 @@ description=You've been bitten. You have only two choices. id=TheOnlyCure icon=icon.png url=https://github.com/ZioPao/The-Only-Cure -modversion=2.1.7 \ No newline at end of file +modversion=2.2.1 \ No newline at end of file diff --git a/mod_41.info b/mod_41.info new file mode 100644 index 0000000..babeea2 --- /dev/null +++ b/mod_41.info @@ -0,0 +1,7 @@ +name=The Only Cure +poster=poster.png +description=You've been bitten. You have only two choices. +id=TheOnlyCure +icon=icon.png +url=https://github.com/ZioPao/The-Only-Cure +modversion=2.2.1 \ No newline at end of file diff --git a/poster.png b/poster.png index 86c8c7e..9aae2d2 100644 Binary files a/poster.png and b/poster.png differ diff --git a/poster_b41.png b/poster_b41.png new file mode 100644 index 0000000..86c8c7e Binary files /dev/null and b/poster_b41.png differ diff --git a/workshop_files/preview.png b/workshop_files/preview.png index 11db975..a3a8bd1 100644 Binary files a/workshop_files/preview.png and b/workshop_files/preview.png differ diff --git a/workshop_files/preview_b41.png b/workshop_files/preview_b41.png new file mode 100644 index 0000000..11db975 Binary files /dev/null and b/workshop_files/preview_b41.png differ diff --git a/workshop_files/workshop.txt b/workshop_files/workshop.txt index f2da156..2a9eda1 100644 --- a/workshop_files/workshop.txt +++ b/workshop_files/workshop.txt @@ -1,6 +1,6 @@ version=1 -id=3236152598 -title=The Only Cure - Rebuilt +id=3580276809 +title=[B42] The Only Cure description=[img]https://raw.githubusercontent.com/ZioPao/The-Only-Cure/551125bb50cb65608ad89ca81ef0daccb3b02c4c/dev_stuff/logos/title.png[/img] description= @@ -27,7 +27,7 @@ description= description=[h1]Setup[/h1] -description=Use it with the following mods for the intended experience: +description=[strike]Use it with the following mods for the intended experience: description=[list] @@ -39,10 +39,12 @@ description=[/list] description= -description=Place them [b]BEFORE[/b] The Only Cure in your mod list! +description=Place them [b]BEFORE[/b] The Only Cure in your mod list![/strike] description= +description=[b]At the moment, the mods listed here aren't compatible with B42. + description=[hr][/hr] description= @@ -181,5 +183,5 @@ description= description=[hr][/hr] -tags=Build 41;Balance;Interface;Items;Misc;Multiplayer;Realistic;Textures +tags=Build 42;Balance;Interface;Items;Misc;Multiplayer;Realistic;Textures visibility=public