Fixed Tests

This commit is contained in:
ZioPao
2023-11-09 10:35:02 +01:00
parent 60a7f1b996
commit 9095d11f41
4 changed files with 19 additions and 17 deletions

View File

@@ -1,6 +1,5 @@
local ModDataHandler = require("Handlers/TOC_ModDataHandler")
local StaticData = require("TOC_StaticData")
local CommonMethods = require("TOC_Common")
local ItemsHandler = require("Handlers/TOC_ItemsHandler")
---------------------------
@@ -54,7 +53,8 @@ end
function AmputationHandler:execute()
-- TODO Calculate surgeonStats
local surgeonFactor = 100
-- TODO Cap it to a certain amount, it shouldn't be more than ...?
local surgeonFactor = 1
local patientStats = self.patient:getStats()

View File

@@ -1,14 +1,13 @@
local StaticData = require("TOC_StaticData")
local CommonMethods = require("TOC_Common")
---------------------------
--- Submodule to handle spawning the correct items after certain actions (ie: cutting a hand)
---@class ItemsHandler
local ItemsHandler = {}
---Returns the correct index for the textures of the amputation
---@param isCicatrized boolean
---@return number
@@ -47,6 +46,7 @@ end
function ItemsHandler.RemoveClothingItem(playerObj, clothingItem)
if clothingItem and instanceof(clothingItem, "InventoryItem") then
playerObj:removeWornItem(clothingItem)
playerObj:getInventory():Remove(clothingItem) -- Can be a InventoryItem too.. I guess? todo check it
print("TOC: found and deleted " .. tostring(clothingItem))
return true

View File

@@ -49,8 +49,6 @@ end
---Check if the player has an infected (as in, zombie infection) body part
---@param character IsoGameCharacter
---@param damageType string
---@param damage number
function PlayerHandler.CheckInfection(character)
-- This fucking event barely works. Bleeding seems to be the only thing that triggers it
@@ -79,7 +77,7 @@ function PlayerHandler.CheckInfection(character)
for i=1, #StaticData.IGNORED_PARTS_STRINGS do
local bodyPartType = BodyPartType[StaticData.IGNORED_PARTS_STRINGS[i]]
local bodyPart = bd:getBodyPart(bodyPartType)
if bodyPart:bitten() or bodyPart:IsInfected() then
if bodyPart and bodyPart:bitten() or bodyPart:IsInfected() then
PlayerHandler.modDataHandler:setIsIgnoredPartInfected(true)
end
end