Implemented Forced Amputation and some additional safety checks
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
local CommandsData = require("TOC/CommandsData")
|
||||
local AmputationHandler = require("TOC/Handlers/AmputationHandler")
|
||||
local DataController = require("TOC/Controllers/DataController")
|
||||
--------------------------------------------
|
||||
|
||||
local ClientRelayCommands = {}
|
||||
@@ -25,8 +26,14 @@ end
|
||||
---Creates a new handler and execute the amputation function on this client
|
||||
---@param args receiveExecuteAmputationActionParams
|
||||
function ClientRelayCommands.ReceiveExecuteAmputationAction(args)
|
||||
|
||||
-- Check if player already doesn't have that limb or it's a dependant limb.
|
||||
-- Mostly a check for admin forced amputations more than anything else, since this case is handled in the GUI already.
|
||||
local dcInst = DataController.GetInstance()
|
||||
if dcInst:getIsCut(args.limbName) then return end
|
||||
|
||||
local handler = InitAmputationHandler(args.limbName, args.surgeonNum)
|
||||
handler:execute(true)
|
||||
handler:execute(args.damagePlayer)
|
||||
end
|
||||
|
||||
|
||||
@@ -46,6 +53,15 @@ function ClientRelayCommands.ReceiveExecuteInitialization()
|
||||
LocalPlayerController.InitializePlayer(true)
|
||||
end
|
||||
|
||||
---Creates a new handler and execute the amputation function on this client
|
||||
---@param args receiveForcedCicatrizationParams
|
||||
function ClientRelayCommands.ReceiveForcedCicatrization(args)
|
||||
local dcInst = DataController.GetInstance()
|
||||
--dcInst:setCicatrizationTime(args.limbName, 1)
|
||||
dcInst:setIsCicatrized(args.limbName, true)
|
||||
dcInst:apply()
|
||||
end
|
||||
|
||||
-------------------------
|
||||
|
||||
local function OnServerRelayCommand(module, command, args)
|
||||
|
||||
Reference in New Issue
Block a user