More bug fixes
This commit is contained in:
@@ -43,7 +43,7 @@ function ModDataHandler:createData()
|
||||
---@type amputationTable
|
||||
local defaultParams = {isCut = false, isInfected = false, isOperated = false, isCicatrized = false, isCauterized = false, isDependant = false}
|
||||
|
||||
local test = StaticData.LIMBS_STRINGS
|
||||
|
||||
-- Initialize limbs
|
||||
for i=1, #StaticData.LIMBS_STRINGS do
|
||||
local limbName = StaticData.LIMBS_STRINGS[i]
|
||||
@@ -101,7 +101,8 @@ function ModDataHandler:setCutLimb(limbName, isOperated, isCicatrized, isCauteri
|
||||
local params = {isCut = true, isInfected = false, isOperated = isOperated, isCicatrized = isCicatrized, isCauterized = isCauterized, isDependant = false}
|
||||
self:setLimbParams(limbName, params, cicatrizationTime)
|
||||
|
||||
|
||||
local t = StaticData.LIMBS_DEPENDENCIES
|
||||
print(t)
|
||||
for i=1, #StaticData.LIMBS_DEPENDENCIES[limbName] do
|
||||
local dependedLimbName = StaticData.LIMBS_DEPENDENCIES[limbName][i]
|
||||
|
||||
|
||||
@@ -46,12 +46,12 @@ for side, _ in pairs(StaticData.SIDES_STRINGS) do
|
||||
elseif part == StaticData.PARTS_STRINGS.ForeArm then
|
||||
StaticData.LIMBS_BASE_DAMAGE[assembledName] = 80
|
||||
StaticData.LIMBS_CICATRIZATION_TIME[assembledName] = 1800
|
||||
StaticData.LIMBS_DEPENDENCIES[assembledName] = { side .. StaticData.PARTS_STRINGS.Hand }
|
||||
StaticData.LIMBS_DEPENDENCIES[assembledName] = { StaticData.PARTS_STRINGS.Hand .. "_" .. side, }
|
||||
elseif part == StaticData.PARTS_STRINGS.UpperArm then
|
||||
StaticData.LIMBS_BASE_DAMAGE[assembledName] = 100
|
||||
StaticData.LIMBS_CICATRIZATION_TIME[assembledName] = 2000
|
||||
StaticData.LIMBS_DEPENDENCIES[assembledName] = { side .. "_" .. StaticData.PARTS_STRINGS.Hand,
|
||||
side .. "_" .. StaticData.PARTS_STRINGS.ForeArm }
|
||||
StaticData.LIMBS_DEPENDENCIES[assembledName] = { StaticData.PARTS_STRINGS.Hand .. "_" .. side,
|
||||
StaticData.PARTS_STRINGS.ForeArm .. "_" .. side }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -4,14 +4,31 @@ if not getActivatedMods():contains("TEST_FRAMEWORK") or not isDebugEnabled() the
|
||||
local TestFramework = require("TestFramework/TestFramework")
|
||||
local TestUtils = require("TestFramework/TestUtils")
|
||||
|
||||
TestFramework.registerTestModule("Functionality", "Cut Left Hand", function()
|
||||
local Tests = {}
|
||||
local PlayerHandler = require("TOC_PlayerHandler")
|
||||
local PlayerHandler = require("TOC_PlayerHandler")
|
||||
|
||||
function Tests.CutLeftHand()
|
||||
TestFramework.registerTestModule("Functionality", "Setup", function()
|
||||
|
||||
local Tests = {}
|
||||
function Tests.InitializePlayer()
|
||||
local pl = getPlayer()
|
||||
PlayerHandler.InitializePlayer(nil, pl)
|
||||
return true
|
||||
end
|
||||
|
||||
return Tests
|
||||
end)
|
||||
|
||||
TestFramework.registerTestModule("Functionality", "Amputation", function()
|
||||
local Tests = {}
|
||||
|
||||
function Tests.CutLeftHand()
|
||||
PlayerHandler.ForceCutLimb("Hand_L")
|
||||
return PlayerHandler.modDataHandler:getIsCut("Hand_L")
|
||||
end
|
||||
|
||||
function Tests.CutLeftForearm()
|
||||
PlayerHandler.ForceCutLimb("ForeArm_L")
|
||||
return PlayerHandler.modDataHandler:getIsCut("ForeArm_L") and PlayerHandler.modDataHandler:getIsCut("Hand_L")
|
||||
end
|
||||
|
||||
return Tests
|
||||
|
||||
Reference in New Issue
Block a user