chore: cleaning and setting up stuff

This commit is contained in:
ZioPao
2025-04-17 18:23:18 +02:00
parent 8c8aa8351b
commit 522c49b40c
5 changed files with 22 additions and 3 deletions

View File

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

View File

@@ -110,14 +110,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 +135,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()
--[[

View File

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