diff --git a/changelog.txt b/changelog.txt deleted file mode 100644 index e613ae7..0000000 --- a/changelog.txt +++ /dev/null @@ -1,56 +0,0 @@ -0.9.15 -- Hotfix to sound not stopping when performing an amputation on another player - -0.9.14 -- Optimizations -- New icon for the mod -- Added a dirtyness malus for cicatrization, you'll have to keep your wound clean while it's healing (wash it you animal) -- When trying to equip a prosthesis from the inventory you'll get a message to let you know that you're doing it wrong -- Added explicit support to Left Is Right, making it work a lot better when you've got an amputated right limb - - -0.9.13 -- Some little optimizations -- Fixed a bug that made Fancy Handwork compat not work as intended - -0.9.12 -- Fixed traits icons -- Some cleaning to the code - -0.9.11 -- Hotfix to cicatrization visuals - -0.9.10 -- Modified textures once again - - -0.9.9 -- Modified textures for amputations -- Fixed a bug that caused some problems when amputating an already amputated limb - -0.9.8 -- New textures for amputations -- When cicatrized, an amputation will not be bloody anymore (visual thing only) - -0.9.7 -- Now amputations should spawn in every case, damn hairs. Thanks Dev for the tip! - - -0.9.6 -- Fixed a bug when handling zombie hitting amputated limbs -- Fixed sound looping incessantly after amputating a limb -- Changed how phantom pain occurs -- Fixes to new hook models - - - - -0.9.5 -- No more Right Click menu. You'll have to use the TOC Menu from the Medical Check, except for Cheats -- Fixes to how amputations are handled - before and after -- Compatibility fixes with older versions -- Various fixes to Traits -- New heavily WIP models for metal and wooden hooks -- Readded sounds during amputations -- Fixed banages not getting applied after an amputation when they were in the player's inventory diff --git a/media/lua/client/TOC/Controllers/DataController.lua b/media/lua/client/TOC/Controllers/DataController.lua index 9db7f12..e996b7f 100644 --- a/media/lua/client/TOC/Controllers/DataController.lua +++ b/media/lua/client/TOC/Controllers/DataController.lua @@ -97,6 +97,7 @@ function DataController:setup(key) -- self.tocData.isInitializing = false -- ModData.add(key, self.tocData) + triggerEvent("OnSetupTocData") end ---In case of desync between the table on ModData and the table here @@ -417,6 +418,8 @@ function DataController.ReceiveData(key, data) triggerEvent("OnReceivedTocData", handler.username) + -- TODO We need an event to track if initialization has been finalized + -- if username == getPlayer():getUsername() and not handler.isResetForced then diff --git a/media/lua/client/TOC/Controllers/LocalPlayerController.lua b/media/lua/client/TOC/Controllers/LocalPlayerController.lua index 5f66489..2bed9fa 100644 --- a/media/lua/client/TOC/Controllers/LocalPlayerController.lua +++ b/media/lua/client/TOC/Controllers/LocalPlayerController.lua @@ -6,6 +6,8 @@ require("TOC/Events") ----------- + + -- Handle ONLY stuff for the local client ---@class LocalPlayerController @@ -33,9 +35,6 @@ function LocalPlayerController.InitializePlayer(isForced) Events.OnAmputatedLimb.Add(LocalPlayerController.ToggleUpdateAmputations) LocalPlayerController.ToggleUpdateAmputations() - -- Manage their traits - LocalPlayerController.ManageTraits(playerObj) - -- Since isForced is used to reset an existing player data, we're gonna clean their ISHealthPanel table too if isForced then local ItemsController = require("TOC/Controllers/ItemsController") @@ -47,9 +46,14 @@ function LocalPlayerController.InitializePlayer(isForced) SetHealthPanelTOC() end + + ---Handles the traits ----@param playerObj IsoPlayer -function LocalPlayerController.ManageTraits(playerObj) +function LocalPlayerController.ManageTraits() + + -- Local player + local playerObj = getPlayer() + local AmputationHandler = require("TOC/Handlers/AmputationHandler") for k, v in pairs(StaticData.TRAITS_BP) do if playerObj:HasTrait(k) then @@ -65,6 +69,11 @@ function LocalPlayerController.ManageTraits(playerObj) end end +-- We need to manage traits when we're done setupping everything +-- It shouldn't be done every single time we initialize the player, fetching data, etc. +Events.OnSetupTocData.Add(LocalPlayerController.ManageTraits) + + ---------------------------------------------------------- --* Health *-- diff --git a/media/lua/client/TOC/Events.lua b/media/lua/client/TOC/Events.lua index 0d3b4c9..b4e19cf 100644 --- a/media/lua/client/TOC/Events.lua +++ b/media/lua/client/TOC/Events.lua @@ -2,3 +2,4 @@ LuaEventManager.AddEvent("OnAmputatedLimb") --Triggered when a limb has been amputated LuaEventManager.AddEvent("OnProsthesisUnequipped") LuaEventManager.AddEvent("OnReceivedTocData") -- Triggered when TOC data is ready +LuaEventManager.AddEvent("OnSetupTocData") -- Triggered when TOC has been setupped \ No newline at end of file diff --git a/media/lua/client/TOC/Main.lua b/media/lua/client/TOC/Main.lua index a62a028..34bf55a 100644 --- a/media/lua/client/TOC/Main.lua +++ b/media/lua/client/TOC/Main.lua @@ -6,7 +6,7 @@ require("TOC/Events") ---@class Main local Main = { - _version = "2.0.11" + _version = "2.0.12" } function Main.Start() diff --git a/media/lua/shared/TOC/Traits.lua b/media/lua/shared/TOC/Traits.lua index 3567bc6..9958155 100644 --- a/media/lua/shared/TOC/Traits.lua +++ b/media/lua/shared/TOC/Traits.lua @@ -5,7 +5,7 @@ local TRAITS = { Amputee_Hand = "Amputee_Hand", Amputee_ForeArm = "Amputee_ForeArm", Amputee_UpperArm = "Amputee_UpperArm", - Insensitive = "Insensitive" + --Insensitive = "Insensitive" -- TODO Disabled for now, until we reintroduce it } @@ -37,7 +37,7 @@ local function SetupTraits() t:addXPBoost(Perks.Strength, -1) end - TraitFactory.addTrait(TRAITS.Insensitive, GetTraitText(TRAITS.Insensitive), 6, GetTraitDesc(TRAITS.Insensitive), false, false) + --TraitFactory.addTrait(TRAITS.Insensitive, GetTraitText(TRAITS.Insensitive), 6, GetTraitDesc(TRAITS.Insensitive), false, false) TraitFactory.setMutualExclusive(TRAITS.Amputee_Hand, TRAITS.Amputee_ForeArm) TraitFactory.setMutualExclusive(TRAITS.Amputee_Hand, TRAITS.Amputee_UpperArm) diff --git a/mod.info b/mod.info index f1f701f..7f258c0 100644 --- a/mod.info +++ b/mod.info @@ -4,5 +4,5 @@ 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.0.11 +modversion=2.0.12 pzversion=41.65