Merge pull request #75 from ZioPao/dev

v2.0.12
This commit is contained in:
Pao
2024-05-31 10:53:56 +02:00
committed by GitHub
7 changed files with 22 additions and 65 deletions

View File

@@ -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

View File

@@ -97,6 +97,7 @@ function DataController:setup(key)
-- self.tocData.isInitializing = false -- self.tocData.isInitializing = false
-- ModData.add(key, self.tocData) -- ModData.add(key, self.tocData)
triggerEvent("OnSetupTocData")
end end
---In case of desync between the table on ModData and the table here ---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) 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 -- if username == getPlayer():getUsername() and not handler.isResetForced then

View File

@@ -6,6 +6,8 @@ require("TOC/Events")
----------- -----------
-- Handle ONLY stuff for the local client -- Handle ONLY stuff for the local client
---@class LocalPlayerController ---@class LocalPlayerController
@@ -33,9 +35,6 @@ function LocalPlayerController.InitializePlayer(isForced)
Events.OnAmputatedLimb.Add(LocalPlayerController.ToggleUpdateAmputations) Events.OnAmputatedLimb.Add(LocalPlayerController.ToggleUpdateAmputations)
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 -- Since isForced is used to reset an existing player data, we're gonna clean their ISHealthPanel table too
if isForced then if isForced then
local ItemsController = require("TOC/Controllers/ItemsController") local ItemsController = require("TOC/Controllers/ItemsController")
@@ -47,9 +46,14 @@ function LocalPlayerController.InitializePlayer(isForced)
SetHealthPanelTOC() SetHealthPanelTOC()
end end
---Handles the traits ---Handles the traits
---@param playerObj IsoPlayer function LocalPlayerController.ManageTraits()
function LocalPlayerController.ManageTraits(playerObj)
-- Local player
local playerObj = getPlayer()
local AmputationHandler = require("TOC/Handlers/AmputationHandler") local AmputationHandler = require("TOC/Handlers/AmputationHandler")
for k, v in pairs(StaticData.TRAITS_BP) do for k, v in pairs(StaticData.TRAITS_BP) do
if playerObj:HasTrait(k) then if playerObj:HasTrait(k) then
@@ -65,6 +69,11 @@ function LocalPlayerController.ManageTraits(playerObj)
end end
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 *-- --* Health *--

View File

@@ -2,3 +2,4 @@
LuaEventManager.AddEvent("OnAmputatedLimb") --Triggered when a limb has been amputated LuaEventManager.AddEvent("OnAmputatedLimb") --Triggered when a limb has been amputated
LuaEventManager.AddEvent("OnProsthesisUnequipped") LuaEventManager.AddEvent("OnProsthesisUnequipped")
LuaEventManager.AddEvent("OnReceivedTocData") -- Triggered when TOC data is ready LuaEventManager.AddEvent("OnReceivedTocData") -- Triggered when TOC data is ready
LuaEventManager.AddEvent("OnSetupTocData") -- Triggered when TOC has been setupped

View File

@@ -6,7 +6,7 @@ require("TOC/Events")
---@class Main ---@class Main
local Main = { local Main = {
_version = "2.0.11" _version = "2.0.12"
} }
function Main.Start() function Main.Start()

View File

@@ -5,7 +5,7 @@ local TRAITS = {
Amputee_Hand = "Amputee_Hand", Amputee_Hand = "Amputee_Hand",
Amputee_ForeArm = "Amputee_ForeArm", Amputee_ForeArm = "Amputee_ForeArm",
Amputee_UpperArm = "Amputee_UpperArm", 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) t:addXPBoost(Perks.Strength, -1)
end 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_ForeArm)
TraitFactory.setMutualExclusive(TRAITS.Amputee_Hand, TRAITS.Amputee_UpperArm) TraitFactory.setMutualExclusive(TRAITS.Amputee_Hand, TRAITS.Amputee_UpperArm)

View File

@@ -4,5 +4,5 @@ description=You've been bitten. You have only two choices.
id=TheOnlyCure id=TheOnlyCure
icon=icon.png icon=icon.png
url=https://github.com/ZioPao/The-Only-Cure url=https://github.com/ZioPao/The-Only-Cure
modversion=2.0.11 modversion=2.0.12
pzversion=41.65 pzversion=41.65