That's a lot of stuff, fixed X on online UI, prosthesis unequipping, prosthesis equipping for MP, ecc.
This commit is contained in:
@@ -3,6 +3,9 @@
|
||||
local Commands = {}
|
||||
|
||||
Commands["ResponseCanAct"] = function(arg)
|
||||
|
||||
|
||||
print("TOC: ResponseCanAct")
|
||||
local ui = GetConfirmUIMP()
|
||||
ui.responseReceive = true
|
||||
ui.responseAction = arg["toSend"][2]
|
||||
@@ -32,6 +35,24 @@ function SendOperateLimb(player, part_name, surgeon_factor, use_oven)
|
||||
sendClientCommand("TOC", "SendServer", arg)
|
||||
end
|
||||
|
||||
function SendEquipProsthesis(player, part_name, prosthesis_base_name)
|
||||
local arg = {}
|
||||
arg["From"] = getPlayer():getOnlineID()
|
||||
arg["To"] = player:getOnlineID()
|
||||
arg["command"] = "EquipProsthesis"
|
||||
arg["toSend"] = { part_name, prosthesis_base_name}
|
||||
sendClientCommand("TOC", "SendServer", arg)
|
||||
end
|
||||
|
||||
function SendUnequipProsthesis(player, part_name, equipped_prosthesis)
|
||||
local arg = {}
|
||||
arg["From"] = getPlayer():getOnlineID()
|
||||
arg["To"] = player:getOnlineID()
|
||||
arg["command"] = "UnequipProsthesis"
|
||||
arg["toSend"] = { part_name, equipped_prosthesis}
|
||||
sendClientCommand("TOC", "SendServer", arg)
|
||||
end
|
||||
|
||||
function AskCanCutLimb(player, part_name)
|
||||
GetConfirmUIMP().responseReceive = false
|
||||
local arg = {}
|
||||
@@ -59,9 +80,23 @@ function AskCanEquipProsthesis(player, part_name)
|
||||
arg["To"] = player:getOnlineID()
|
||||
arg["command"] = "CanEquipProsthesis"
|
||||
arg["toSend"] = part_name
|
||||
|
||||
sendClientCommand("TOC", "SendServer", arg)
|
||||
end
|
||||
|
||||
|
||||
function AskCanUnequipProsthesis(player, part_name)
|
||||
GetConfirmUIMP().responseReceive = false
|
||||
local arg = {}
|
||||
arg["From"] = getPlayer():getOnlineID()
|
||||
arg["To"] = player:getOnlineID()
|
||||
arg["command"] = "CanUnequipProsthesis"
|
||||
arg["toSend"] = part_name
|
||||
|
||||
sendClientCommand("TOC", "SendServer", arg)
|
||||
end
|
||||
|
||||
|
||||
-- Patient (receive)
|
||||
Commands["CutLimb"] = function(arg)
|
||||
local arg = arg["toSend"]
|
||||
@@ -73,6 +108,28 @@ Commands["OperateLimb"] = function(arg)
|
||||
TheOnlyCure.OperateLimb(arg[1], arg[2], arg[3])
|
||||
end
|
||||
|
||||
|
||||
Commands["EquipProsthesis"] = function(arg)
|
||||
|
||||
-- part_name = arg[1]
|
||||
-- prosthesis = arg[2]
|
||||
|
||||
local arg = arg["toSend"]
|
||||
|
||||
TheOnlyCure.EquipProsthesis(arg[1], arg[2])
|
||||
|
||||
end
|
||||
|
||||
Commands["UnequipProsthesis"] = function(arg)
|
||||
|
||||
-- part_name = arg[1]
|
||||
|
||||
local arg = arg["toSend"]
|
||||
|
||||
TheOnlyCure.UnequipProsthesis(arg[1])
|
||||
|
||||
end
|
||||
|
||||
Commands["CanCutLimb"] = function(arg)
|
||||
local part_name = arg["toSend"]
|
||||
|
||||
@@ -95,14 +152,23 @@ end
|
||||
|
||||
Commands["CanEquipProsthesis"] = function(arg)
|
||||
local part_name = arg["toSend"]
|
||||
|
||||
arg["To"] = arg["From"]
|
||||
arg["From"] = getPlayer():getOnlineID()
|
||||
arg["command"] = "ResponseCanAct"
|
||||
arg["toSend"] = { part_name, "Equip", CheckIfProsthesisCanBeEquipped(part_name) }
|
||||
arg["toSend"] = { part_name, "Equip", true } -- FIXME true just for test
|
||||
sendClientCommand("TOC", "SendServer", arg)
|
||||
|
||||
end
|
||||
|
||||
Commands["CanUnequipProsthesis"] = function(arg)
|
||||
local part_name = arg["toSend"]
|
||||
arg["To"] = arg["From"]
|
||||
arg["From"] = getPlayer():getOnlineID()
|
||||
arg["command"] = "ResponseCanAct"
|
||||
arg["toSend"] = { part_name, "Unequip", true } -- FIXME true just for test
|
||||
sendClientCommand("TOC", "SendServer", arg)
|
||||
|
||||
end
|
||||
|
||||
Commands["CanResetEverything"] = function(arg)
|
||||
local part_name = "RightHand" --useless
|
||||
@@ -112,7 +178,6 @@ Commands["CanResetEverything"] = function(arg)
|
||||
arg["command"] = "ResponseCanAct"
|
||||
arg["toSend"] = { part_name, "Cut", true }
|
||||
sendClientCommand("TOC", "SendServer", arg)
|
||||
--TocResetEverything()
|
||||
end
|
||||
|
||||
Commands["ResetEverything"] = function(arg)
|
||||
@@ -155,6 +220,7 @@ local function OnTocServerCommand(module, command, args)
|
||||
if module == 'TOC' then
|
||||
print("OnTocServerCommand " .. command)
|
||||
if Commands[command] then
|
||||
print("Found command, executing it now")
|
||||
args = args or {}
|
||||
Commands[command](args)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user