Equip saw before cutting

This commit is contained in:
ZioPao
2024-04-21 02:20:05 +02:00
parent d73b1a3f43
commit 5c03cea8c4
3 changed files with 26 additions and 1 deletions

View File

@@ -331,4 +331,19 @@ end
Events.OnPuttingTourniquet.Add(LocalPlayerController.HandleTourniquet)
--* Object drop handling when amputation occurs
function LocalPlayerController.DropItemsAfterAmputation(limbName)
-- TODO Check for watches and stuff like that
end
Events.OnAmputatedLimb.Add(LocalPlayerController.DropItemsAfterAmputation)
return LocalPlayerController

View File

@@ -182,7 +182,7 @@ function AmputationHandler:execute(damagePlayer)
self:damageAfterAmputation(surgeonFactor)
-- Trigger this event
triggerEvent("OnAmputatedLimb")
triggerEvent("OnAmputatedLimb", self.limbName)
end
---Deletes the instance

View File

@@ -69,6 +69,16 @@ end
---@param stitchesItem InventoryItem?
---@param bandageItem InventoryItem?
local function PerformAction(surgeon, patient, limbName, sawItem, stitchesItem, bandageItem)
-- get saw in hand
-- todo primary or secondary depending on amputation status of surgeon
ISTimedActionQueue.add(ISEquipWeaponAction:new(surgeon, sawItem, 50, true, false))
local lHandItem = surgeon:getSecondaryHandItem()
if lHandItem then
ISTimedActionQueue.add(ISUnequipAction:new(surgeon, lHandItem, 50))
end
ISTimedActionQueue.add(CutLimbAction:new(surgeon, patient, limbName, sawItem, stitchesItem, bandageItem))
end