Reorganizing
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
local ModDataHandler = require("Handlers/TOC_ModDataHandler")
|
||||
local StaticData = require("TOC_StaticData")
|
||||
local ItemsHandler = require("Handlers/TOC_ItemsHandler")
|
||||
local PlayerHandler = require("Handlers/TOC_PlayerHandler")
|
||||
|
||||
local ModDataHandler = require("TOC/Handlers/ModDataHandler")
|
||||
local ItemsHandler = require("TOC/Handlers/ItemsHandler")
|
||||
local PlayerHandler = require("TOC/Handlers/PlayerHandler")
|
||||
local StaticData = require("TOC/StaticData")
|
||||
---------------------------
|
||||
|
||||
-- TODO Add Bandages, Torniquet, etc.
|
||||
@@ -1,5 +1,5 @@
|
||||
local StaticData = require("TOC_StaticData")
|
||||
local CommonMethods = require("TOC_Common")
|
||||
local StaticData = require("TOC/StaticData")
|
||||
local CommonMethods = require("TOC/CommonMethods")
|
||||
|
||||
---------------------------
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
local StaticData = require("TOC_StaticData")
|
||||
local StaticData = require("TOC/StaticData")
|
||||
|
||||
----------------
|
||||
---@alias partData { isCut : boolean?, isInfected : boolean?, isOperated : boolean?, isCicatrized : boolean?, isCauterized : boolean?, isVisible : boolean?, cicatrizationTime : number }
|
||||
@@ -1,6 +1,6 @@
|
||||
local ModDataHandler = require("Handlers/TOC_ModDataHandler")
|
||||
local CommonMethods = require("TOC_Common")
|
||||
local StaticData = require("TOC_StaticData")
|
||||
local ModDataHandler = require("TOC/Handlers/ModDataHandler")
|
||||
local CommonMethods = require("TOC/CommonMethods")
|
||||
local StaticData = require("TOC/StaticData")
|
||||
-----------
|
||||
|
||||
-- TODO We should instantiate this anyway if we want to keep track of cut limbs here. Doing so, we would be able to handle other players too
|
||||
@@ -20,7 +20,7 @@ local PlayerHandler = {}
|
||||
---@param playerObj IsoPlayer
|
||||
---@param isForced boolean?
|
||||
function PlayerHandler.InitializePlayer(_, playerObj, isForced)
|
||||
PlayerHandler.modDataHandler = ModDataHandler:new(playerObj)
|
||||
PlayerHandler.modDataHandler = ModDataHandler:new(playerObj) -- TODO This isn't gonna work for MP purposes
|
||||
PlayerHandler.modDataHandler:setup(isForced)
|
||||
PlayerHandler.playerObj = playerObj
|
||||
|
||||
@@ -37,7 +37,7 @@ function PlayerHandler.InitializePlayer(_, playerObj, isForced)
|
||||
-- Since isForced is used to reset an existing player data, we're gonna clean their ISHealthPanel table too
|
||||
if isForced then
|
||||
ISHealthPanel.highestAmputations = {}
|
||||
local ItemsHandler = require("Handlers/TOC_ItemsHandler")
|
||||
local ItemsHandler = require("TOC/Handlers/ItemsHandler")
|
||||
ItemsHandler.DeleteAllOldAmputationItems(playerObj)
|
||||
end
|
||||
end
|
||||
@@ -62,12 +62,12 @@ end
|
||||
---@param limbName string
|
||||
function PlayerHandler.AddLocalAmputatedLimb(limbName)
|
||||
print("TOC: added " .. limbName .. " to known amputated limbs")
|
||||
table.insert(PlayerHandler.amputatedLimbs, limbName)
|
||||
table.insert(PlayerHandler.amputatedLimbs, limbName) -- TODO This should be player specific, not generic
|
||||
end
|
||||
|
||||
--* Getters *--
|
||||
|
||||
---Get a table with the strings of the amputated limbs
|
||||
---Get a table with the strings of the cached amputated limbs
|
||||
---@return table
|
||||
function PlayerHandler.GetAmputatedLimbs()
|
||||
return PlayerHandler.amputatedLimbs or {}
|
||||
@@ -1,5 +1,5 @@
|
||||
local CommonMethods = require("TOC_Common")
|
||||
local PlayerHandler = require("Handlers/TOC_PlayerHandler")
|
||||
local CommonMethods = require("TOC/CommonMethods")
|
||||
local PlayerHandler = require("TOC/Handlers/PlayerHandler")
|
||||
|
||||
-------------------------
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
local PlayerHandler = require("Handlers/TOC_PlayerHandler")
|
||||
local PlayerHandler = require("TOC/Handlers/PlayerHandler")
|
||||
|
||||
|
||||
------------------
|
||||
@@ -2,7 +2,7 @@ if not getActivatedMods():contains("TEST_FRAMEWORK") or not isDebugEnabled() the
|
||||
local TestFramework = require("TestFramework/TestFramework")
|
||||
local TestUtils = require("TestFramework/TestUtils")
|
||||
|
||||
local PlayerHandler = require("Handlers/TOC_PlayerHandler")
|
||||
local PlayerHandler = require("TOC/Handlers/PlayerHandler")
|
||||
local AmputationHandler = require("Handlers/TOC_AmputationHandler")
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
local BaseHandler = require("UI/TOC_HealthPanelBaseHandler")
|
||||
local CutLimbAction = require("TimedActions/TOC_CutLimbAction")
|
||||
local StaticData = require("TOC_StaticData")
|
||||
local ModDataHandler = require("Handlers/TOC_ModDataHandler")
|
||||
local StaticData = require("TOC/StaticData")
|
||||
local ModDataHandler = require("TOC/Handlers/ModDataHandler")
|
||||
|
||||
---------------------
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
local PlayerHandler = require("Handlers/TOC_PlayerHandler")
|
||||
local StaticData = require("TOC_StaticData")
|
||||
local CommonMethods = require("TOC_Common")
|
||||
local PlayerHandler = require("TOC/Handlers/PlayerHandler")
|
||||
local StaticData = require("TOC/StaticData")
|
||||
local CommonMethods = require("TOC/CommonMethods")
|
||||
|
||||
---@diagnostic disable: duplicate-set-field
|
||||
local CutLimbHandler = require("UI/TOC_CutLimbInteractions")
|
||||
@@ -1,6 +1,5 @@
|
||||
local PlayerHandler = require("Handlers/TOC_PlayerHandler")
|
||||
local StaticData = require("TOC_StaticData")
|
||||
local ModDataHandler = require("Handlers/TOC_ModDataHandler")
|
||||
local PlayerHandler = require("TOC/Handlers/PlayerHandler")
|
||||
local ModDataHandler = require("TOC/Handlers/ModDataHandler")
|
||||
|
||||
---------------
|
||||
|
||||
@@ -1,101 +0,0 @@
|
||||
local StaticData = {}
|
||||
|
||||
StaticData.MOD_NAME = "TOC"
|
||||
|
||||
|
||||
StaticData.PARTS_STRINGS = {
|
||||
Hand = "Hand",
|
||||
ForeArm = "ForeArm",
|
||||
UpperArm = "UpperArm"
|
||||
}
|
||||
|
||||
-- No "MAX" here.
|
||||
StaticData.IGNORED_PARTS_STRINGS = { "Foot_L", "Foot_R", "Groin", "Head", "LowerLeg_L", "LowerLeg_R", "Neck", "Torso_Lower", "Torso_Upper", "UpperLeg_L", "UpperLeg_R" }
|
||||
|
||||
StaticData.SIDES_STRINGS = {
|
||||
R = "R",
|
||||
L = "L"
|
||||
}
|
||||
-- Assembled BodyParts string
|
||||
---@enum
|
||||
StaticData.LIMBS_STRINGS = {}
|
||||
StaticData.BODYPARTSTYPES_ENUM = {}
|
||||
StaticData.LIMBS_DEPENDENCIES = {}
|
||||
StaticData.LIMBS_CICATRIZATION_TIME = {}
|
||||
StaticData.LIMBS_BASE_DAMAGE = {}
|
||||
StaticData.LIMBS_TIME_MULTIPLIER = {}
|
||||
|
||||
|
||||
-- Link a trait to a specific body part
|
||||
StaticData.TRAITS_BP = {
|
||||
AmputeeHand = "Hand_L",
|
||||
AmputeeLowerArm = "ForeArm_L",
|
||||
AmputeeUpeerArm = "UpperArm_L"
|
||||
}
|
||||
|
||||
|
||||
local function AssembleHandData(assembledName)
|
||||
StaticData.LIMBS_BASE_DAMAGE[assembledName] = 60
|
||||
StaticData.LIMBS_CICATRIZATION_TIME[assembledName] = 1700
|
||||
StaticData.LIMBS_TIME_MULTIPLIER[assembledName] = 2
|
||||
StaticData.LIMBS_DEPENDENCIES[assembledName] = {}
|
||||
end
|
||||
|
||||
local function AssembleForearmData(assembledName, side)
|
||||
StaticData.LIMBS_BASE_DAMAGE[assembledName] = 80
|
||||
StaticData.LIMBS_CICATRIZATION_TIME[assembledName] = 1800
|
||||
StaticData.LIMBS_TIME_MULTIPLIER[assembledName] = 3
|
||||
StaticData.LIMBS_DEPENDENCIES[assembledName] = { StaticData.PARTS_STRINGS.Hand .. "_" .. side }
|
||||
end
|
||||
|
||||
local function AssembleUpperarmData(assembledName, side)
|
||||
StaticData.LIMBS_BASE_DAMAGE[assembledName] = 100
|
||||
StaticData.LIMBS_CICATRIZATION_TIME[assembledName] = 2000
|
||||
StaticData.LIMBS_TIME_MULTIPLIER[assembledName] = 4
|
||||
StaticData.LIMBS_DEPENDENCIES[assembledName] = { StaticData.PARTS_STRINGS.Hand .. "_" .. side,
|
||||
StaticData.PARTS_STRINGS.ForeArm .. "_" .. side }
|
||||
end
|
||||
|
||||
|
||||
for side, _ in pairs(StaticData.SIDES_STRINGS) do
|
||||
for part, _ in pairs(StaticData.PARTS_STRINGS) do
|
||||
local assembledName = part .. "_" .. side
|
||||
|
||||
-- Assembled strings
|
||||
table.insert(StaticData.LIMBS_STRINGS, assembledName) -- We need a table like this to cycle through it easily
|
||||
StaticData.BODYPARTSTYPES_ENUM[assembledName] = BodyPartType[assembledName]
|
||||
|
||||
-- Dependencies and cicatrization time
|
||||
if part == StaticData.PARTS_STRINGS.Hand then
|
||||
AssembleHandData(assembledName)
|
||||
elseif part == StaticData.PARTS_STRINGS.ForeArm then
|
||||
AssembleForearmData(assembledName, side)
|
||||
elseif part == StaticData.PARTS_STRINGS.UpperArm then
|
||||
AssembleUpperarmData(assembledName, side)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-----------------
|
||||
-- Visuals and clothing
|
||||
|
||||
--- Textures
|
||||
-- TODO We need male variations
|
||||
StaticData.HEALTH_PANEL_TEXTURES = {
|
||||
|
||||
Female = {
|
||||
Hand_L = getTexture("media/ui/Hand_L.png"),
|
||||
ForeArm_L = getTexture("media/ui/ForeArm_L.png"),
|
||||
UpperArm_L = getTexture("media/ui/UpperArm_L.png"),
|
||||
|
||||
Hand_R = getTexture("media/ui/Hand_R.png"),
|
||||
ForeArm_R = getTexture("media/ui/ForeArm_R.png"),
|
||||
UpperArm_R = getTexture("media/ui/UpperArm_R.png")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
StaticData.AMPUTATION_CLOTHING_ITEM_BASE = "TOC.Amputation_"
|
||||
|
||||
|
||||
return StaticData
|
||||
Reference in New Issue
Block a user