@@ -6,12 +6,11 @@ require("TOC/Events")
|
|||||||
|
|
||||||
---@class Main
|
---@class Main
|
||||||
local Main = {
|
local Main = {
|
||||||
_version = "2.0.4"
|
_version = "2.0.5"
|
||||||
}
|
}
|
||||||
|
|
||||||
function Main.Start()
|
function Main.Start()
|
||||||
TOC_DEBUG.print("Starting The Only Cure version " .. tostring(Main._version))
|
TOC_DEBUG.print("Starting The Only Cure version " .. tostring(Main._version))
|
||||||
--Main.SetupTraits()
|
|
||||||
Main.SetupEvents()
|
Main.SetupEvents()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ local StaticData = require("TOC/StaticData")
|
|||||||
TestFramework.registerTestModule("LocalPlayerController", "Setup", function()
|
TestFramework.registerTestModule("LocalPlayerController", "Setup", function()
|
||||||
local Tests = {}
|
local Tests = {}
|
||||||
function Tests.InitializePlayer()
|
function Tests.InitializePlayer()
|
||||||
local pl = getPlayer()
|
|
||||||
LocalPlayerController.InitializePlayer(true)
|
LocalPlayerController.InitializePlayer(true)
|
||||||
end
|
end
|
||||||
return Tests
|
return Tests
|
||||||
@@ -154,6 +153,36 @@ TestFramework.registerTestModule("Various", "Player", function()
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
|
|
||||||
|
TestFramework.registerTestModule("Various", "Visuals", function()
|
||||||
|
local Tests = {}
|
||||||
|
|
||||||
|
function Tests.AddBloodRightForearm()
|
||||||
|
local playerObj = getPlayer()
|
||||||
|
-- local wornItems = playerObj:getWornItems()
|
||||||
|
-- local limbName = "ForeArm_R"
|
||||||
|
-- local fullType = StaticData.AMPUTATION_CLOTHING_ITEM_BASE .. limbName
|
||||||
|
|
||||||
|
-- for i = 1, wornItems:size() do
|
||||||
|
-- local it = wornItems:get(i - 1)
|
||||||
|
-- if it then
|
||||||
|
-- local wornItem = wornItems:get(i - 1):getItem()
|
||||||
|
-- TOC_DEBUG.print(wornItem:getFullType())
|
||||||
|
-- if wornItem:getFullType() == fullType then
|
||||||
|
-- TOC_DEBUG.print("Found amputation item for " .. limbName)
|
||||||
|
|
||||||
|
-- -- change it here
|
||||||
|
-- wornItem:setBloodLevel
|
||||||
|
-- wornItem:getVisual():setTextureChoice(texId)
|
||||||
|
-- playerObj:resetModelNextFrame() -- necessary to update the model
|
||||||
|
-- return
|
||||||
|
-- end
|
||||||
|
-- end
|
||||||
|
-- end
|
||||||
|
end
|
||||||
|
|
||||||
|
return Tests
|
||||||
|
end)
|
||||||
|
|
||||||
|
|
||||||
--------------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------------
|
||||||
if not getActivatedMods():contains("PerfTestFramework") or not isDebugEnabled() then return end
|
if not getActivatedMods():contains("PerfTestFramework") or not isDebugEnabled() then return end
|
||||||
|
|||||||
40
media/lua/client/TOC/TimedActions/WashYourselfOverride.lua
Normal file
40
media/lua/client/TOC/TimedActions/WashYourselfOverride.lua
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
local CachedDataHandler = require("TOC/Handlers/CachedDataHandler")
|
||||||
|
local StaticData = require("TOC/StaticData")
|
||||||
|
|
||||||
|
-- Since amputations are actually clothing items, we need to override ISWashYourself to account for that
|
||||||
|
|
||||||
|
|
||||||
|
local og_ISWashYourself_perform = ISWashYourself.perform
|
||||||
|
function ISWashYourself:perform()
|
||||||
|
|
||||||
|
TOC_DEBUG.print("ISWashYourself override")
|
||||||
|
|
||||||
|
---@type IsoPlayer
|
||||||
|
local pl = self.character
|
||||||
|
local plInv = pl:getInventory()
|
||||||
|
-- Search for amputations and clean them here
|
||||||
|
local amputatedLimbs = CachedDataHandler.GetAmputatedLimbs(pl:getUsername())
|
||||||
|
for limbName, _ in pairs(amputatedLimbs) do
|
||||||
|
|
||||||
|
TOC_DEBUG.print("Checking if " .. limbName .. " is in inventory and washing it")
|
||||||
|
|
||||||
|
-- get clothing item
|
||||||
|
local foundItem = plInv:FindAndReturn(StaticData.AMPUTATION_CLOTHING_ITEM_BASE .. limbName)
|
||||||
|
if foundItem and instanceof(foundItem, "Clothing") then
|
||||||
|
|
||||||
|
TOC_DEBUG.print("Washing " .. limbName)
|
||||||
|
|
||||||
|
---@cast foundItem Clothing
|
||||||
|
foundItem:setWetness(100)
|
||||||
|
foundItem:setBloodLevel(0)
|
||||||
|
foundItem:setDirtyness(0) -- TODO Integrate with other dirtyness
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
og_ISWashYourself_perform(self)
|
||||||
|
|
||||||
|
|
||||||
|
end
|
||||||
2
mod.info
2
mod.info
@@ -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.4
|
modversion=2.0.5
|
||||||
pzversion=41.65
|
pzversion=41.65
|
||||||
|
|||||||
Reference in New Issue
Block a user