Fixes, placeholders, and getters\setters
This commit is contained in:
@@ -25,6 +25,7 @@ function ItemsHandler.GetAmputationTexturesIndex(playerObj, isCicatrized)
|
||||
matchedIndex = matchedIndex + 5
|
||||
end
|
||||
|
||||
|
||||
if isCicatrized then
|
||||
if isHairy then
|
||||
matchedIndex = matchedIndex + 5 -- to use the cicatrized texture on hairy bodies
|
||||
|
||||
@@ -51,7 +51,10 @@ function ModDataHandler:setup(key)
|
||||
}
|
||||
|
||||
---@type partData
|
||||
local defaultParams = {isCut = false, isInfected = false, isOperated = false, isCicatrized = false, isCauterized = false, isVisible = false}
|
||||
local defaultParams = {
|
||||
isCut = false, isInfected = false, isOperated = false, isCicatrized = false,
|
||||
isCauterized = false, isVisible = false, isProstEquipped = false, prostFactor = 0
|
||||
}
|
||||
|
||||
-- Initialize limbs
|
||||
for i=1, #StaticData.LIMBS_STRINGS do
|
||||
@@ -76,6 +79,12 @@ function ModDataHandler:setIsAnyLimbCut(isAnyLimbCut)
|
||||
self.tocData.isAnyLimbCut = isAnyLimbCut
|
||||
end
|
||||
|
||||
---Set isIgnoredPartInfected
|
||||
---@param isIgnoredPartInfected boolean
|
||||
function ModDataHandler:setIsIgnoredPartInfected(isIgnoredPartInfected)
|
||||
self.tocData.isIgnoredPartInfected = isIgnoredPartInfected
|
||||
end
|
||||
|
||||
---Set isCut
|
||||
---@param limbName string
|
||||
---@param isCut boolean
|
||||
@@ -90,10 +99,18 @@ function ModDataHandler:setIsInfected(limbName, isInfected)
|
||||
self.tocData[limbName].isInfected = isInfected
|
||||
end
|
||||
|
||||
---Set isIgnoredPartInfected
|
||||
---@param isIgnoredPartInfected boolean
|
||||
function ModDataHandler:setIsIgnoredPartInfected(isIgnoredPartInfected)
|
||||
self.tocData.isIgnoredPartInfected = isIgnoredPartInfected
|
||||
---Set isProstEquipped
|
||||
---@param limbName string
|
||||
---@param isProstEquipped boolean
|
||||
function ModDataHandler:setIsProstEquipped(limbName, isProstEquipped)
|
||||
self.tocData[limbName].isProstEquipped = isProstEquipped
|
||||
end
|
||||
|
||||
---Set prostFactor
|
||||
---@param limbName string
|
||||
---@param prostFactor number
|
||||
function ModDataHandler:setProstFactor(limbName, prostFactor)
|
||||
self.tocData[limbName].prostFactor = prostFactor
|
||||
end
|
||||
|
||||
-----------------
|
||||
@@ -105,6 +122,12 @@ function ModDataHandler:getIsAnyLimbCut()
|
||||
return self.tocData.isAnyLimbCut
|
||||
end
|
||||
|
||||
---Get isIgnoredPartInfected
|
||||
---@return boolean
|
||||
function ModDataHandler:getIsIgnoredPartInfected()
|
||||
return self.tocData.isIgnoredPartInfected
|
||||
end
|
||||
|
||||
---Get isCut
|
||||
---@param limbName string
|
||||
---@return boolean
|
||||
@@ -112,18 +135,27 @@ function ModDataHandler:getIsCut(limbName)
|
||||
return self.tocData[limbName].isCut
|
||||
end
|
||||
|
||||
---Get isIgnoredPartInfected
|
||||
---@return boolean
|
||||
function ModDataHandler:getIsIgnoredPartInfected()
|
||||
return self.tocData.isIgnoredPartInfected
|
||||
end
|
||||
|
||||
---Get isVisible
|
||||
---@param limbName string
|
||||
---@return boolean
|
||||
function ModDataHandler:getIsVisible(limbName)
|
||||
return self.tocData[limbName].isVisible
|
||||
end
|
||||
|
||||
---Get isProstEquipped
|
||||
---@param limbName string
|
||||
---@return boolean
|
||||
function ModDataHandler:getIsProstEquipped(limbName)
|
||||
return self.tocData[limbName].isProstEquipped
|
||||
end
|
||||
|
||||
---Get prostFactor
|
||||
---@param limbName string
|
||||
---@return number
|
||||
function ModDataHandler:getProstFactor(limbName)
|
||||
return self.tocData[limbName].getProstFactor
|
||||
end
|
||||
|
||||
--* Limbs data handling *--
|
||||
|
||||
---Set a limb and its dependend limbs as cut
|
||||
@@ -167,6 +199,8 @@ function ModDataHandler:setLimbParams(limbName, ampStatus, cicatrizationTime)
|
||||
if ampStatus.isCicatrized ~= nil then limbData.isCicatrized = ampStatus.isCicatrized end
|
||||
if ampStatus.isCauterized ~= nil then limbData.isCauterized = ampStatus.isCauterized end
|
||||
if ampStatus.isVisible ~= nil then limbData.isVisible = ampStatus.isVisible end
|
||||
if ampStatus.isProstEquipped ~= nil then limbData.isProstEquipped = ampStatus.isProstEquipped end
|
||||
if ampStatus.prostFactor ~= nil then limbData.prostFactor = ampStatus.prostFactor end
|
||||
|
||||
if cicatrizationTime ~= nil then limbData.cicatrizationTime = cicatrizationTime end
|
||||
end
|
||||
|
||||
@@ -46,13 +46,14 @@ local og_ISClothingExtraAction_isValid = ISClothingExtraAction.isValid
|
||||
---@diagnostic disable-next-line: duplicate-set-field
|
||||
function ISClothingExtraAction:isValid()
|
||||
local bodyLocation = self.item:getBodyLocation()
|
||||
|
||||
local isEquippable = false
|
||||
if og_ISClothingExtraAction_isValid(self) and not string.contains(bodyLocation, "TOC_ArmProst") then
|
||||
return true
|
||||
isEquippable = true
|
||||
else
|
||||
return ProsthesisHandler.CheckIfEquippable(bodyLocation)
|
||||
|
||||
isEquippable = ProsthesisHandler.CheckIfEquippable(bodyLocation)
|
||||
end
|
||||
|
||||
return isEquippable
|
||||
end
|
||||
|
||||
|
||||
|
||||
10
media/lua/client/TOC/Handlers/SurgeryHandler.lua
Normal file
10
media/lua/client/TOC/Handlers/SurgeryHandler.lua
Normal file
@@ -0,0 +1,10 @@
|
||||
local ModDataHandler = require("TOC/Handlers/ModDataHandler")
|
||||
|
||||
local SurgeryHandler = {}
|
||||
|
||||
function SurgeryHandler.InstallProsthesis()
|
||||
-- TODO Set stuff in mod data
|
||||
|
||||
end
|
||||
|
||||
return SurgeryHandler
|
||||
1
media/lua/client/TOC/TimedActions/OperateAction.lua
Normal file
1
media/lua/client/TOC/TimedActions/OperateAction.lua
Normal file
@@ -0,0 +1 @@
|
||||
-- temp
|
||||
@@ -66,7 +66,7 @@ local CutLimbHandler = BaseHandler:derive("CutLimbHandler")
|
||||
function CutLimbHandler:new(panel, bodyPart)
|
||||
local o = BaseHandler.new(self, panel, bodyPart)
|
||||
o.items.ITEMS = {}
|
||||
o.limbName = BodyPartType.ToString(self.bodyPart:getType())
|
||||
o.limbName = BodyPartType.ToString(bodyPart:getType())
|
||||
TOC_DEBUG.print("init CutLimbHandler")
|
||||
return o
|
||||
end
|
||||
|
||||
@@ -24,6 +24,8 @@ end
|
||||
---@param worldObjects any
|
||||
---@param test any
|
||||
local function AddOvenContextMenu(playerNum, context, worldObjects, test)
|
||||
if test then return true end
|
||||
|
||||
local pl = getSpecificPlayer(playerNum)
|
||||
|
||||
if not ModDataHandler.GetInstance():getIsAnyLimbCut() then return end
|
||||
|
||||
@@ -13,9 +13,9 @@ local function AddBodyLocationBefore(newLocation, moveToLocation)
|
||||
end
|
||||
|
||||
|
||||
AddBodyLocationBefore("TOC_ArmRight", "Shoes")
|
||||
AddBodyLocationBefore("TOC_ArmLeft", "Shoes")
|
||||
AddBodyLocationBefore("TOC_Arm_R", "Shoes")
|
||||
AddBodyLocationBefore("TOC_Arm_L", "Shoes")
|
||||
|
||||
AddBodyLocationBefore("TOC_ArmProstRight", "Shoes")
|
||||
AddBodyLocationBefore("TOC_ArmProstLeft", "Shoes")
|
||||
AddBodyLocationBefore("TOC_ArmProst_R", "Shoes")
|
||||
AddBodyLocationBefore("TOC_ArmProst_L", "Shoes")
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
---@alias partData { isCut : boolean?, isInfected : boolean?, isOperated : boolean?, isCicatrized : boolean?, isCauterized : boolean?, isVisible : boolean?, cicatrizationTime : number }
|
||||
---@alias partData { isCut : boolean?, isInfected : boolean?, isOperated : boolean?, isCicatrized : boolean?, isCauterized : boolean?, isVisible : boolean?, cicatrizationTime : number, isProstEquipped : boolean, prostFactor : number}
|
||||
---@alias tocModData {Hand_L : partData, ForeArm_L : partData, UpperArm_L : partData, Hand_R : partData, ForeArm_R : partData, UpperArm_R : partData, isIgnoredPartInfected : boolean, isAnyLimbCut : boolean}
|
||||
---------------------------
|
||||
|
||||
|
||||
Reference in New Issue
Block a user