Some more stuff, included body locations
This commit is contained in:
@@ -150,7 +150,7 @@ df_top = read_table(excel_path, "TopTable")
|
|||||||
|
|
||||||
limbs = ["Hand", "LowerArm"]
|
limbs = ["Hand", "LowerArm"]
|
||||||
sides = ["Left", "Right"]
|
sides = ["Left", "Right"]
|
||||||
prost_bodylocations = ["TOC_ArmRightProsthesis", "TOC_ArmLeftProsthesis"]
|
prost_bodylocations = ["JCIO_ArmRightProsthesis", "JCIO_ArmLeftProsthesis"]
|
||||||
texture_types = ["Wooden", "Metal"]
|
texture_types = ["Wooden", "Metal"]
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -238,16 +238,16 @@ JCIO_UI.SetupDescUI = function(surgeon, patient, limbsData, partName)
|
|||||||
descUI["status"]:setText("Nothing here")
|
descUI["status"]:setText("Nothing here")
|
||||||
descUI["status"]:setColor(1, 1, 1, 1)
|
descUI["status"]:setColor(1, 1, 1, 1)
|
||||||
descUI["b1"]:setVisible(false)
|
descUI["b1"]:setVisible(false)
|
||||||
elseif CheckIfCanBeCut(partName, limbsData) then
|
elseif JCIO_Common.CheckIfCanBeCut(partName, limbsData) then
|
||||||
-- Everything else
|
-- Everything else
|
||||||
-- TODO add check for cuts and scratches
|
-- TODO add check for cuts and scratches
|
||||||
descUI["status"]:setText("Not cut")
|
descUI["status"]:setText("Not cut")
|
||||||
descUI["status"]:setColor(1, 1, 1, 1)
|
descUI["status"]:setColor(1, 1, 1, 1)
|
||||||
if JCIO_Common.GetSawInInventory(surgeon) and not CheckIfProsthesisAlreadyInstalled(limbsData, partName) then
|
if JCIO_Common.GetSawInInventory(surgeon) and not JCIO_Common.CheckIfProsthesisAlreadyInstalled(limbsData, partName) then
|
||||||
descUI["b1"]:setVisible(true)
|
descUI["b1"]:setVisible(true)
|
||||||
descUI["b1"]:setText("Cut")
|
descUI["b1"]:setText("Cut")
|
||||||
descUI["b1"]:addArg("option", "Cut")
|
descUI["b1"]:addArg("option", "Cut")
|
||||||
elseif JCIO_Common.GetSawInInventory(surgeon) and CheckIfProsthesisAlreadyInstalled(limbsData, partName) then
|
elseif JCIO_Common.GetSawInInventory(surgeon) and JCIO_Common.CheckIfProsthesisAlreadyInstalled(limbsData, partName) then
|
||||||
descUI["b1"]:setVisible(true)
|
descUI["b1"]:setVisible(true)
|
||||||
descUI["b1"]:setText("Remove prosthesis before")
|
descUI["b1"]:setText("Remove prosthesis before")
|
||||||
descUI["b1"]:addArg("option", "Nothing")
|
descUI["b1"]:addArg("option", "Nothing")
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ JCIO_Anims.SetMissingFootAnimation = function(check)
|
|||||||
print("SP, so it's fine")
|
print("SP, so it's fine")
|
||||||
else
|
else
|
||||||
|
|
||||||
sendClientCommand(player, "TOC", "NotifyNewCrawlAnimation", {id = player:getOnlineID(), check = check})
|
sendClientCommand(player, "JCIO", "NotifyNewCrawlAnimation", {id = player:getOnlineID(), check = check})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -3,8 +3,6 @@
|
|||||||
------------------------------------------
|
------------------------------------------
|
||||||
------------ COMMON FUNCTIONS ------------
|
------------ COMMON FUNCTIONS ------------
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if JCIO_Common == nil then
|
if JCIO_Common == nil then
|
||||||
JCIO_Common = {}
|
JCIO_Common = {}
|
||||||
end
|
end
|
||||||
@@ -26,8 +24,6 @@ JCIO_Common.GeneratePartNames = function()
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
JCIO_Common.GetPartNames = function()
|
JCIO_Common.GetPartNames = function()
|
||||||
if JCIO_Common.partNames.size() == nil then
|
if JCIO_Common.partNames.size() == nil then
|
||||||
JCIO_Common.GeneratePartNames()
|
JCIO_Common.GeneratePartNames()
|
||||||
@@ -36,6 +32,18 @@ JCIO_Common.GetPartNames = function()
|
|||||||
return JCIO_Common.partNames
|
return JCIO_Common.partNames
|
||||||
end
|
end
|
||||||
|
|
||||||
|
JCIO_Common.GetSideFromPartName = function(partName)
|
||||||
|
|
||||||
|
if string.find(partName, "Left") then
|
||||||
|
return "Left"
|
||||||
|
else
|
||||||
|
return "Right"
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
---------------------------------
|
||||||
|
|
||||||
JCIO_Common.GetAcceptableBodyPartTypes = function()
|
JCIO_Common.GetAcceptableBodyPartTypes = function()
|
||||||
|
|
||||||
-- TODO Add Foot_L and Foot_R
|
-- TODO Add Foot_L and Foot_R
|
||||||
@@ -146,13 +154,100 @@ end
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
-----------------------------------
|
||||||
|
-- Online Handling checks
|
||||||
|
|
||||||
function JCIO_Common.GetSideFromPartName(partName)
|
|
||||||
|
|
||||||
if string.find(partName, "Left") then
|
-----------------------------------------
|
||||||
return "Left"
|
-- MP HANDLING CHECKS
|
||||||
|
function JCIO_Common.CheckIfCanBeCut(partName, limbsData)
|
||||||
|
|
||||||
|
if limbsData == nil then
|
||||||
|
limbsData = getPlayer():getModData().JCIO.limbs
|
||||||
|
end
|
||||||
|
|
||||||
|
local check = (not limbsData[partName].isCut) and
|
||||||
|
(not JCIO_Common.CheckIfProsthesisAlreadyInstalled(limbsData, partName))
|
||||||
|
|
||||||
|
return check
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
function JCIO_Common.CheckIfCanBeOperated(partName, limbsData)
|
||||||
|
|
||||||
|
if limbsData == nil then
|
||||||
|
limbsData = getPlayer():getModData().JCIO.limbs
|
||||||
|
end
|
||||||
|
|
||||||
|
return limbsData[partName].isOperated == false and limbsData[partName].isAmputationShown
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
function JCIO_Common.CheckIfProsthesisCanBeEquipped(partName)
|
||||||
|
local limbs_data = getPlayer():getModData().JCIO.limbs
|
||||||
|
return limbs_data[partName].isCauterized or limbs_data[partName].isCicatrized
|
||||||
|
-- check if prosthesis is in the surgeon inventory... we need to get it before
|
||||||
|
end
|
||||||
|
|
||||||
|
function JCIO_Common.CheckIfProsthesisCanBeUnequipped(partName)
|
||||||
|
|
||||||
|
-- TODO we should get item here to be sure that we can do this action instead of relying on some later checks
|
||||||
|
return true
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
-----------------------------------------
|
||||||
|
-- Various checks
|
||||||
|
-----------------------------------------
|
||||||
|
|
||||||
|
function JCIO_Common.CheckIfItemIsAmputatedLimb(item)
|
||||||
|
local itemFullType = item:getFullType()
|
||||||
|
local check
|
||||||
|
|
||||||
|
if string.find(itemFullType, "JCIO.Amputation_") then
|
||||||
|
check = true
|
||||||
else
|
else
|
||||||
return "Right"
|
check = false
|
||||||
|
end
|
||||||
|
|
||||||
|
return check
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
function CheckIfItemIsProsthesis(item)
|
||||||
|
|
||||||
|
local itemFullType = item:getFullType()
|
||||||
|
|
||||||
|
-- TODO This isn't gonna work anymore! Modular prosthetics needs to be handled in a different way
|
||||||
|
local prosthesisList = GetProsthesisList()
|
||||||
|
|
||||||
|
for _, v in pairs(prosthesisList) do
|
||||||
|
if v == itemFullType then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return false
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
function JCIO_Common.CheckIfItemIsInstalledProsthesis(item)
|
||||||
|
local itemFullType = item:getFullType()
|
||||||
|
if string.find(itemFullType, "TOC.Prost_") then
|
||||||
|
return true
|
||||||
|
else
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
function JCIO_Common.CheckIfProsthesisAlreadyInstalled(limbsData, partName)
|
||||||
|
|
||||||
|
for _, side in pairs(JCIO.sideNames) do
|
||||||
|
if string.find(partName, side) then
|
||||||
|
return (limbsData[side .. "_Hand"].isProsthesisEquipped or limbsData[side .. "_LowerArm"].isProsthesisEquipped)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
@@ -27,8 +27,8 @@ ServerCommands.CanCutLimb = function(arg)
|
|||||||
arg["To"] = arg["From"]
|
arg["To"] = arg["From"]
|
||||||
arg["From"] = getPlayer():getOnlineID()
|
arg["From"] = getPlayer():getOnlineID()
|
||||||
arg["command"] = "ResponseCanAct"
|
arg["command"] = "ResponseCanAct"
|
||||||
arg["toSend"] = { part_name, "Cut", CheckIfCanBeCut(part_name) }
|
arg["toSend"] = { part_name, "Cut", JCIO_Common.CheckIfCanBeCut(part_name) }
|
||||||
sendClientCommand("TOC", "SendServer", arg)
|
sendClientCommand("JCIO", "SendServer", arg)
|
||||||
end
|
end
|
||||||
|
|
||||||
ServerCommands.CutLimb = function(arg)
|
ServerCommands.CutLimb = function(arg)
|
||||||
@@ -51,8 +51,8 @@ ServerCommands.CanOperateLimb = function(arg)
|
|||||||
arg["To"] = arg["From"]
|
arg["To"] = arg["From"]
|
||||||
arg["From"] = getPlayer():getOnlineID()
|
arg["From"] = getPlayer():getOnlineID()
|
||||||
arg["command"] = "ResponseCanAct"
|
arg["command"] = "ResponseCanAct"
|
||||||
arg["toSend"] = { part_name, "Operate", CheckIfCanBeOperated(part_name) }
|
arg["toSend"] = { part_name, "Operate", JCIO_Common.CheckIfCanBeOperated(part_name) }
|
||||||
sendClientCommand("TOC", "SendServer", arg)
|
sendClientCommand("JCIO", "SendServer", arg)
|
||||||
end
|
end
|
||||||
ServerCommands.OperateLimb = function(arg)
|
ServerCommands.OperateLimb = function(arg)
|
||||||
|
|
||||||
@@ -68,8 +68,8 @@ ServerCommands.CanEquipProsthesis = function(arg)
|
|||||||
arg["To"] = arg["From"]
|
arg["To"] = arg["From"]
|
||||||
arg["From"] = getPlayer():getOnlineID()
|
arg["From"] = getPlayer():getOnlineID()
|
||||||
arg["command"] = "ResponseCanAct"
|
arg["command"] = "ResponseCanAct"
|
||||||
arg["toSend"] = {part_name, "Equip", CheckIfProsthesisCanBeEquipped(part_name) }
|
arg["toSend"] = {part_name, "Equip", JCIO_Common.CheckIfProsthesisCanBeEquipped(part_name) }
|
||||||
sendClientCommand("TOC", "SendServer", arg)
|
sendClientCommand("JCIO", "SendServer", arg)
|
||||||
|
|
||||||
end
|
end
|
||||||
ServerCommands.EquipProsthesis = function(arg)
|
ServerCommands.EquipProsthesis = function(arg)
|
||||||
@@ -89,8 +89,8 @@ ServerCommands.CanUnequipProsthesis = function(arg)
|
|||||||
arg["To"] = arg["From"]
|
arg["To"] = arg["From"]
|
||||||
arg["From"] = getPlayer():getOnlineID()
|
arg["From"] = getPlayer():getOnlineID()
|
||||||
arg["command"] = "ResponseCanAct"
|
arg["command"] = "ResponseCanAct"
|
||||||
arg["toSend"] = { part_name, "Unequip", CheckIfProsthesisCanBeUnequipped(part_name)}
|
arg["toSend"] = { part_name, "Unequip", JCIO_Common.CheckIfProsthesisCanBeUnequipped(part_name)}
|
||||||
sendClientCommand("TOC", "SendServer", arg)
|
sendClientCommand("JCIO", "SendServer", arg)
|
||||||
end
|
end
|
||||||
ServerCommands.UnequipProsthesis = function(arg)
|
ServerCommands.UnequipProsthesis = function(arg)
|
||||||
|
|
||||||
@@ -110,7 +110,7 @@ ServerCommands.CanResetEverything = function(arg)
|
|||||||
arg["From"] = getPlayer():getOnlineID()
|
arg["From"] = getPlayer():getOnlineID()
|
||||||
arg["command"] = "ResponseCanAct"
|
arg["command"] = "ResponseCanAct"
|
||||||
arg["toSend"] = { part_name, "Cut", true }
|
arg["toSend"] = { part_name, "Cut", true }
|
||||||
sendClientCommand("TOC", "SendServer", arg)
|
sendClientCommand("JCIO", "SendServer", arg)
|
||||||
end
|
end
|
||||||
ServerCommands.ResetEverything = function(_)
|
ServerCommands.ResetEverything = function(_)
|
||||||
JCIO_Cheat.ResetEverything()
|
JCIO_Cheat.ResetEverything()
|
||||||
@@ -144,9 +144,9 @@ end
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
local function OnTocServerCommand(module, command, args)
|
local function OnServerCommand(module, command, args)
|
||||||
if module == 'TOC' then
|
if module == 'JCIO' then
|
||||||
print("JCIO: On Toc Server Command " .. command)
|
print("JCIO: On JCIO Server Command " .. command)
|
||||||
if ServerCommands[command] then
|
if ServerCommands[command] then
|
||||||
print("Found command, executing it now")
|
print("Found command, executing it now")
|
||||||
args = args or {}
|
args = args or {}
|
||||||
@@ -156,13 +156,13 @@ local function OnTocServerCommand(module, command, args)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
Events.OnServerCommand.Add(OnTocServerCommand)
|
Events.OnServerCommand.Add(OnServerCommand)
|
||||||
|
|
||||||
|
|
||||||
---------------------------------- Global Mod Data -----------------------------
|
---------------------------------- Global Mod Data -----------------------------
|
||||||
|
|
||||||
|
|
||||||
function TOC_OnReceiveGlobalModData(key, modData)
|
local function OnReceiveGlobalModData(key, modData)
|
||||||
if modData then
|
if modData then
|
||||||
ModData.remove(key)
|
ModData.remove(key)
|
||||||
ModData.add(key, modData)
|
ModData.add(key, modData)
|
||||||
@@ -170,14 +170,14 @@ function TOC_OnReceiveGlobalModData(key, modData)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
Events.OnReceiveGlobalModData.Add(TOC_OnReceiveGlobalModData)
|
Events.OnReceiveGlobalModData.Add(OnReceiveGlobalModData)
|
||||||
|
|
||||||
function TOC_OnConnected()
|
local function OnConnected()
|
||||||
ModData.request("JCIO_PLAYER_DATA")
|
ModData.request("JCIO_PLAYER_DATA")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
Events.OnConnected.Add(TOC_OnConnected)
|
Events.OnConnected.Add(OnConnected)
|
||||||
|
|
||||||
|
|
||||||
--------------------------------------------------------
|
--------------------------------------------------------
|
||||||
@@ -195,7 +195,7 @@ function SendCutLimb(player, part_name, surgeon_factor, bandage_table, painkille
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
sendClientCommand("TOC", "SendServer", arg)
|
sendClientCommand("JCIO", "SendServer", arg)
|
||||||
end
|
end
|
||||||
|
|
||||||
function SendOperateLimb(player, part_name, surgeon_factor, use_oven)
|
function SendOperateLimb(player, part_name, surgeon_factor, use_oven)
|
||||||
@@ -204,7 +204,7 @@ function SendOperateLimb(player, part_name, surgeon_factor, use_oven)
|
|||||||
arg["To"] = player:getOnlineID()
|
arg["To"] = player:getOnlineID()
|
||||||
arg["command"] = "OperateLimb"
|
arg["command"] = "OperateLimb"
|
||||||
arg["toSend"] = { part_name, surgeon_factor, use_oven }
|
arg["toSend"] = { part_name, surgeon_factor, use_oven }
|
||||||
sendClientCommand("TOC", "SendServer", arg)
|
sendClientCommand("JCIO", "SendServer", arg)
|
||||||
end
|
end
|
||||||
|
|
||||||
function SendEquipProsthesis(player, part_name, item, prosthesis_base_name)
|
function SendEquipProsthesis(player, part_name, item, prosthesis_base_name)
|
||||||
@@ -213,7 +213,7 @@ function SendEquipProsthesis(player, part_name, item, prosthesis_base_name)
|
|||||||
arg["To"] = player:getOnlineID()
|
arg["To"] = player:getOnlineID()
|
||||||
arg["command"] = "EquipProsthesis"
|
arg["command"] = "EquipProsthesis"
|
||||||
arg["toSend"] = { part_name, item, prosthesis_base_name}
|
arg["toSend"] = { part_name, item, prosthesis_base_name}
|
||||||
sendClientCommand("TOC", "SendServer", arg)
|
sendClientCommand("JCIO", "SendServer", arg)
|
||||||
end
|
end
|
||||||
|
|
||||||
function SendUnequipProsthesis(player, part_name, item)
|
function SendUnequipProsthesis(player, part_name, item)
|
||||||
@@ -222,7 +222,7 @@ function SendUnequipProsthesis(player, part_name, item)
|
|||||||
arg["To"] = player:getOnlineID()
|
arg["To"] = player:getOnlineID()
|
||||||
arg["command"] = "UnequipProsthesis"
|
arg["command"] = "UnequipProsthesis"
|
||||||
arg["toSend"] = { player, part_name, item}
|
arg["toSend"] = { player, part_name, item}
|
||||||
sendClientCommand("TOC", "SendServer", arg)
|
sendClientCommand("JCIO", "SendServer", arg)
|
||||||
end
|
end
|
||||||
|
|
||||||
function AskCanCutLimb(player, part_name)
|
function AskCanCutLimb(player, part_name)
|
||||||
@@ -232,7 +232,7 @@ function AskCanCutLimb(player, part_name)
|
|||||||
arg["To"] = player:getOnlineID()
|
arg["To"] = player:getOnlineID()
|
||||||
arg["command"] = "CanCutLimb"
|
arg["command"] = "CanCutLimb"
|
||||||
arg["toSend"] = part_name
|
arg["toSend"] = part_name
|
||||||
sendClientCommand("TOC", "SendServer", arg)
|
sendClientCommand("JCIO", "SendServer", arg)
|
||||||
end
|
end
|
||||||
|
|
||||||
function AskCanOperateLimb(player, part_name)
|
function AskCanOperateLimb(player, part_name)
|
||||||
@@ -242,7 +242,7 @@ function AskCanOperateLimb(player, part_name)
|
|||||||
arg["To"] = player:getOnlineID()
|
arg["To"] = player:getOnlineID()
|
||||||
arg["command"] = "CanOperateLimb"
|
arg["command"] = "CanOperateLimb"
|
||||||
arg["toSend"] = part_name
|
arg["toSend"] = part_name
|
||||||
sendClientCommand("TOC", "SendServer", arg)
|
sendClientCommand("JCIO", "SendServer", arg)
|
||||||
end
|
end
|
||||||
|
|
||||||
function AskCanEquipProsthesis(player, part_name)
|
function AskCanEquipProsthesis(player, part_name)
|
||||||
@@ -253,7 +253,7 @@ function AskCanEquipProsthesis(player, part_name)
|
|||||||
arg["command"] = "CanEquipProsthesis"
|
arg["command"] = "CanEquipProsthesis"
|
||||||
arg["toSend"] = part_name -- TODO to be more precise there should be prosthesis item here too to check
|
arg["toSend"] = part_name -- TODO to be more precise there should be prosthesis item here too to check
|
||||||
|
|
||||||
sendClientCommand("TOC", "SendServer", arg)
|
sendClientCommand("JCIO", "SendServer", arg)
|
||||||
end
|
end
|
||||||
|
|
||||||
function AskCanUnequipProsthesis(player, part_name)
|
function AskCanUnequipProsthesis(player, part_name)
|
||||||
@@ -264,5 +264,5 @@ function AskCanUnequipProsthesis(player, part_name)
|
|||||||
arg["command"] = "CanUnequipProsthesis"
|
arg["command"] = "CanUnequipProsthesis"
|
||||||
arg["toSend"] = part_name
|
arg["toSend"] = part_name
|
||||||
|
|
||||||
sendClientCommand("TOC", "SendServer", arg)
|
sendClientCommand("JCIO", "SendServer", arg)
|
||||||
end
|
end
|
||||||
@@ -1,100 +0,0 @@
|
|||||||
-- VARIOUS CHECKS --
|
|
||||||
|
|
||||||
if TheOnlyCure == nil then
|
|
||||||
TheOnlyCure = {}
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
local pairs = pairs
|
|
||||||
|
|
||||||
|
|
||||||
-----------------------------------------
|
|
||||||
-- MP HANDLING CHECKS
|
|
||||||
function CheckIfCanBeCut(part_name, limbs_data)
|
|
||||||
|
|
||||||
if limbs_data == nil then
|
|
||||||
limbs_data = getPlayer():getModData().JCIO.limbs
|
|
||||||
end
|
|
||||||
|
|
||||||
local check = (not limbs_data[part_name].isCut) and
|
|
||||||
(not CheckIfProsthesisAlreadyInstalled(limbs_data, part_name))
|
|
||||||
|
|
||||||
return check
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
function CheckIfCanBeOperated(part_name, limbs_data)
|
|
||||||
|
|
||||||
if limbs_data == nil then
|
|
||||||
limbs_data = getPlayer():getModData().TOC.Limbs
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
return limbs_data[part_name].is_operated == false and limbs_data[part_name].is_amputation_shown
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
function CheckIfProsthesisCanBeEquipped(part_name)
|
|
||||||
local limbs_data = getPlayer():getModData().TOC.Limbs
|
|
||||||
return limbs_data[part_name].is_cauterized or limbs_data[part_name].is_cicatrized
|
|
||||||
-- check if prosthesis is in the surgeon inventory... we need to get it before
|
|
||||||
end
|
|
||||||
|
|
||||||
function CheckIfProsthesisCanBeUnequipped(part_name)
|
|
||||||
|
|
||||||
-- TODO we should get item here to be sure that we can do this action instead of relying on some later checks
|
|
||||||
return true
|
|
||||||
|
|
||||||
end
|
|
||||||
-----------------------------------------
|
|
||||||
|
|
||||||
function CheckIfItemIsAmputatedLimb(item)
|
|
||||||
local item_full_type = item:getFullType()
|
|
||||||
local check
|
|
||||||
|
|
||||||
if string.find(item_full_type, "TOC.Amputation_") then
|
|
||||||
check = true
|
|
||||||
else
|
|
||||||
check = false
|
|
||||||
end
|
|
||||||
|
|
||||||
return check
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
function CheckIfItemIsProsthesis(item)
|
|
||||||
|
|
||||||
local item_full_type = item:getFullType()
|
|
||||||
local prosthesis_list = GetProsthesisList() -- TODO this isn't gonna work after the modular prost rewrite
|
|
||||||
|
|
||||||
for _, v in pairs(prosthesis_list) do
|
|
||||||
if v == item_full_type then
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
return false
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
function CheckIfItemIsInstalledProsthesis(item)
|
|
||||||
local item_full_type = item:getFullType()
|
|
||||||
if string.find(item_full_type, "TOC.Prost_") then
|
|
||||||
return true
|
|
||||||
else
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function CheckIfProsthesisAlreadyInstalled(limbs_data, part_name)
|
|
||||||
|
|
||||||
for _, side in pairs(JCIO.sideNames) do
|
|
||||||
if string.find(part_name, side) then
|
|
||||||
return (limbs_data[side .. "_Hand"].is_prosthesis_equipped or limbs_data[side .. "_LowerArm"].is_prosthesis_equipped)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
|
||||||
@@ -10,24 +10,24 @@ end
|
|||||||
-- Unequip Prosthesis
|
-- Unequip Prosthesis
|
||||||
|
|
||||||
local function PartNameToBodyLocationProsthesis(name)
|
local function PartNameToBodyLocationProsthesis(name)
|
||||||
if name == "Right_Hand" then return "TOC_ArmRightProsthesis" end
|
if name == "Right_Hand" then return "JCIO_ArmRightProsthesis" end
|
||||||
if name == "Right_LowerArm" then return "TOC_ArmRightProsthesis" end
|
if name == "Right_LowerArm" then return "JCIO_ArmRightProsthesis" end
|
||||||
if name == "Right_UpperArm" then return "TOC_ArmRightProsthesis" end
|
if name == "Right_UpperArm" then return "JCIO_ArmRightProsthesis" end
|
||||||
if name == "Left_Hand" then return "TOC_ArmLeftProsthesis" end
|
if name == "Left_Hand" then return "JCIO_ArmLeftProsthesis" end
|
||||||
if name == "Left_LowerArm" then return "TOC_ArmLeftProsthesis" end
|
if name == "Left_LowerArm" then return "JCIO_ArmLeftProsthesis" end
|
||||||
if name == "Left_UpperArm" then return "TOC_ArmLeftProsthesis" end
|
if name == "Left_UpperArm" then return "JCIO_ArmLeftProsthesis" end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function PartNameToBodyLocationAmputation(name)
|
local function PartNameToBodyLocationAmputation(name)
|
||||||
if name == "Right_Hand" then return "TOC_ArmRight" end
|
if name == "Right_Hand" then return "JCIO_ArmRight" end
|
||||||
if name == "Right_LowerArm" then return "TOC_ArmRight" end
|
if name == "Right_LowerArm" then return "JCIO_ArmRight" end
|
||||||
if name == "Right_UpperArm" then return "TOC_ArmRight" end
|
if name == "Right_UpperArm" then return "JCIO_ArmRight" end
|
||||||
if name == "Left_Hand" then return "TOC_ArmLeft" end
|
if name == "Left_Hand" then return "JCIO_ArmLeft" end
|
||||||
if name == "Left_LowerArm" then return "TOC_ArmLeft" end
|
if name == "Left_LowerArm" then return "JCIO_ArmLeft" end
|
||||||
if name == "Left_UpperArm" then return "TOC_ArmLeft" end
|
if name == "Left_UpperArm" then return "JCIO_ArmLeft" end
|
||||||
|
|
||||||
if name == "Left_Foot" then return "TOC_LegLeft" end
|
if name == "Left_Foot" then return "JCIO_LegLeft" end
|
||||||
if name == "Right_Foot" then return "TOC_LegRight" end
|
if name == "Right_Foot" then return "JCIO_LegRight" end
|
||||||
end
|
end
|
||||||
|
|
||||||
function TocFindItemInProstBodyLocation(part_name, patient)
|
function TocFindItemInProstBodyLocation(part_name, patient)
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ function ISInventoryPane:onMouseDoubleClick(x, y)
|
|||||||
|
|
||||||
if instanceof(item_to_check, "InventoryItem") then
|
if instanceof(item_to_check, "InventoryItem") then
|
||||||
og_ISInventoryPaneOnMouseDoubleClick(self, x, y)
|
og_ISInventoryPaneOnMouseDoubleClick(self, x, y)
|
||||||
elseif CheckIfItemIsAmputatedLimb(item_to_check.items[1]) or CheckIfItemIsInstalledProsthesis(item_to_check.items[1]) then
|
elseif JCIO_Common.CheckIfItemIsAmputatedLimb(item_to_check.items[1]) or JCIO_Common.CheckIfItemIsInstalledProsthesis(item_to_check.items[1]) then
|
||||||
--print("JCIO: Can't double click this item")
|
--print("JCIO: Can't double click this item")
|
||||||
|
|
||||||
end
|
end
|
||||||
@@ -107,7 +107,7 @@ ISInventoryPaneContextMenu.onInspectClothing = function(playerObj, cloth
|
|||||||
|
|
||||||
-- Inspect menu bypasses getActualItems, so we need to add that workaround here too
|
-- Inspect menu bypasses getActualItems, so we need to add that workaround here too
|
||||||
local clothing_full_type = clothing:getFullType()
|
local clothing_full_type = clothing:getFullType()
|
||||||
if CheckIfItemIsAmputatedLimb(clothing) or CheckIfItemIsInstalledProsthesis(clothing) then
|
if JCIO_Common.CheckIfItemIsAmputatedLimb(clothing) or JCIO_Common.CheckIfItemIsInstalledProsthesis(clothing) then
|
||||||
--print("JCIO: Can't inspect this!")
|
--print("JCIO: Can't inspect this!")
|
||||||
else
|
else
|
||||||
og_ISInventoryPaneContextMenuOnInspectClothing(playerObj, clothing)
|
og_ISInventoryPaneContextMenuOnInspectClothing(playerObj, clothing)
|
||||||
@@ -170,7 +170,7 @@ function ISInventoryPaneContextMenu.unequipItem(item, player)
|
|||||||
if item == nil then
|
if item == nil then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if CheckIfItemIsAmputatedLimb(item) == false and CheckIfItemIsInstalledProsthesis(item) == false then
|
if JCIO_Common.CheckIfItemIsAmputatedLimb(item) == false and JCIO_Common.CheckIfItemIsInstalledProsthesis(item) == false then
|
||||||
og_ISInventoryPaneContextMenuUnequipItem(item, player)
|
og_ISInventoryPaneContextMenuUnequipItem(item, player)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -178,7 +178,7 @@ end
|
|||||||
local og_ISInventoryPaneContextMenuDropItem = ISInventoryPaneContextMenu.dropItem
|
local og_ISInventoryPaneContextMenuDropItem = ISInventoryPaneContextMenu.dropItem
|
||||||
function ISInventoryPaneContextMenu.dropItem(item, player)
|
function ISInventoryPaneContextMenu.dropItem(item, player)
|
||||||
|
|
||||||
if CheckIfItemIsAmputatedLimb(item) == false and CheckIfItemIsInstalledProsthesis(item) == false then
|
if JCIO_Common.CheckIfItemIsAmputatedLimb(item) == false and JCIO_Common.CheckIfItemIsInstalledProsthesis(item) == false then
|
||||||
og_ISInventoryPaneContextMenuDropItem(item, player)
|
og_ISInventoryPaneContextMenuDropItem(item, player)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ function JCIO_CutLimbAction:stop()
|
|||||||
|
|
||||||
print("Stopping ISCutLimb")
|
print("Stopping ISCutLimb")
|
||||||
self.surgeon:getEmitter():stopSoundByName("Amputation_Sound")
|
self.surgeon:getEmitter():stopSoundByName("Amputation_Sound")
|
||||||
sendClientCommand(self.surgeon, "TOC", "AskStopAmputationSound", {surgeon_id = self.surgeon:getOnlineID()})
|
sendClientCommand(self.surgeon, "JCIO", "AskStopAmputationSound", {surgeon_id = self.surgeon:getOnlineID()})
|
||||||
|
|
||||||
-- TODO test this with more than 2 players
|
-- TODO test this with more than 2 players
|
||||||
-- TODO this gets bugged when player dies while amputating
|
-- TODO this gets bugged when player dies while amputating
|
||||||
@@ -63,7 +63,7 @@ function JCIO_CutLimbAction:start()
|
|||||||
if self.patient == self.surgeon then
|
if self.patient == self.surgeon then
|
||||||
TocDamagePlayerDuringAmputation(self.patient, self.partName)
|
TocDamagePlayerDuringAmputation(self.patient, self.partName)
|
||||||
else
|
else
|
||||||
sendClientCommand(self.surgeon, "TOC", "AskDamageOtherPlayer", {self.patient:getOnlineID(), self.partName})
|
sendClientCommand(self.surgeon, "JCIO", "AskDamageOtherPlayer", {self.patient:getOnlineID(), self.partName})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@@ -124,7 +124,7 @@ function JCIO_CutLimbAction:perform()
|
|||||||
|
|
||||||
if self.patient ~= self.surgeon and isClient() then
|
if self.patient ~= self.surgeon and isClient() then
|
||||||
SendCutLimb(self.patient, self.partName, surgeon_factor, bandage_table, painkiller_table)
|
SendCutLimb(self.patient, self.partName, surgeon_factor, bandage_table, painkiller_table)
|
||||||
sendClientCommand(self.surgeon, "TOC", "AskStopAmputationSound", {surgeon_id = self.surgeon:getOnlineID()})
|
sendClientCommand(self.surgeon, "JCIO", "AskStopAmputationSound", {surgeon_id = self.surgeon:getOnlineID()})
|
||||||
else
|
else
|
||||||
JCIO.CutLimb(self.partName, surgeon_factor, bandage_table, painkiller_table)
|
JCIO.CutLimb(self.partName, surgeon_factor, bandage_table, painkiller_table)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,67 +1,67 @@
|
|||||||
require 'Items/ProceduralDistributions'
|
require 'Items/ProceduralDistributions'
|
||||||
|
|
||||||
table.insert(ProceduralDistributions.list.MedicalClinicTools.items, "TOC.SurgeonMag1");
|
table.insert(ProceduralDistributions.list.MedicalClinicTools.items, "JCIO.SurgeonMag1")
|
||||||
table.insert(ProceduralDistributions.list.MedicalClinicTools.items, 10);
|
table.insert(ProceduralDistributions.list.MedicalClinicTools.items, 10)
|
||||||
table.insert(ProceduralDistributions.list.MedicalStorageTools.items, "TOC.SurgeonMag1");
|
table.insert(ProceduralDistributions.list.MedicalStorageTools.items, "JCIO.SurgeonMag1")
|
||||||
table.insert(ProceduralDistributions.list.MedicalStorageTools.items, 10);
|
table.insert(ProceduralDistributions.list.MedicalStorageTools.items, 10)
|
||||||
table.insert(ProceduralDistributions.list.ArmyStorageMedical.items, "TOC.SurgeonMag1");
|
table.insert(ProceduralDistributions.list.ArmyStorageMedical.items, "JCIO.SurgeonMag1")
|
||||||
table.insert(ProceduralDistributions.list.ArmyStorageMedical.items, 10);
|
table.insert(ProceduralDistributions.list.ArmyStorageMedical.items, 10)
|
||||||
table.insert(ProceduralDistributions.list.SafehouseMedical.items, "TOC.SurgeonMag1");
|
table.insert(ProceduralDistributions.list.SafehouseMedical.items, "JCIO.SurgeonMag1")
|
||||||
table.insert(ProceduralDistributions.list.SafehouseMedical.items, 10);
|
table.insert(ProceduralDistributions.list.SafehouseMedical.items, 10)
|
||||||
|
|
||||||
table.insert(ProceduralDistributions.list.MedicalClinicTools.items, "TOC.SurgeonMag2");
|
table.insert(ProceduralDistributions.list.MedicalClinicTools.items, "JCIO.SurgeonMag2")
|
||||||
table.insert(ProceduralDistributions.list.MedicalClinicTools.items, 10);
|
table.insert(ProceduralDistributions.list.MedicalClinicTools.items, 10)
|
||||||
table.insert(ProceduralDistributions.list.MedicalStorageTools.items, "TOC.SurgeonMag2");
|
table.insert(ProceduralDistributions.list.MedicalStorageTools.items, "JCIO.SurgeonMag2")
|
||||||
table.insert(ProceduralDistributions.list.MedicalStorageTools.items, 10);
|
table.insert(ProceduralDistributions.list.MedicalStorageTools.items, 10)
|
||||||
table.insert(ProceduralDistributions.list.ArmyStorageMedical.items, "TOC.SurgeonMag2");
|
table.insert(ProceduralDistributions.list.ArmyStorageMedical.items, "JCIO.SurgeonMag2")
|
||||||
table.insert(ProceduralDistributions.list.ArmyStorageMedical.items, 10);
|
table.insert(ProceduralDistributions.list.ArmyStorageMedical.items, 10)
|
||||||
table.insert(ProceduralDistributions.list.SafehouseMedical.items, "TOC.SurgeonMag2");
|
table.insert(ProceduralDistributions.list.SafehouseMedical.items, "JCIO.SurgeonMag2")
|
||||||
table.insert(ProceduralDistributions.list.SafehouseMedical.items, 10);
|
table.insert(ProceduralDistributions.list.SafehouseMedical.items, 10)
|
||||||
|
|
||||||
table.insert(ProceduralDistributions.list.MedicalClinicTools.items, "TOC.SurgeonMag3");
|
table.insert(ProceduralDistributions.list.MedicalClinicTools.items, "JCIO.SurgeonMag3")
|
||||||
table.insert(ProceduralDistributions.list.MedicalClinicTools.items, 10);
|
table.insert(ProceduralDistributions.list.MedicalClinicTools.items, 10)
|
||||||
table.insert(ProceduralDistributions.list.MedicalStorageTools.items, "TOC.SurgeonMag3");
|
table.insert(ProceduralDistributions.list.MedicalStorageTools.items, "JCIO.SurgeonMag3")
|
||||||
table.insert(ProceduralDistributions.list.MedicalStorageTools.items, 10);
|
table.insert(ProceduralDistributions.list.MedicalStorageTools.items, 10)
|
||||||
table.insert(ProceduralDistributions.list.ArmyStorageMedical.items, "TOC.SurgeonMag3");
|
table.insert(ProceduralDistributions.list.ArmyStorageMedical.items, "JCIO.SurgeonMag3")
|
||||||
table.insert(ProceduralDistributions.list.ArmyStorageMedical.items, 10);
|
table.insert(ProceduralDistributions.list.ArmyStorageMedical.items, 10)
|
||||||
table.insert(ProceduralDistributions.list.SafehouseMedical.items, "TOC.SurgeonMag3");
|
table.insert(ProceduralDistributions.list.SafehouseMedical.items, "JCIO.SurgeonMag3")
|
||||||
table.insert(ProceduralDistributions.list.SafehouseMedical.items, 10);
|
table.insert(ProceduralDistributions.list.SafehouseMedical.items, 10)
|
||||||
|
|
||||||
table.insert(ProceduralDistributions.list.MedicalClinicTools.items, "TOC.ProthesisMag1");
|
table.insert(ProceduralDistributions.list.MedicalClinicTools.items, "JCIO.ProthesisMag1")
|
||||||
table.insert(ProceduralDistributions.list.MedicalClinicTools.items, 5);
|
table.insert(ProceduralDistributions.list.MedicalClinicTools.items, 5)
|
||||||
table.insert(ProceduralDistributions.list.MedicalStorageTools.items, "TOC.ProthesisMag1");
|
table.insert(ProceduralDistributions.list.MedicalStorageTools.items, "JCIO.ProthesisMag1")
|
||||||
table.insert(ProceduralDistributions.list.MedicalStorageTools.items, 5);
|
table.insert(ProceduralDistributions.list.MedicalStorageTools.items, 5)
|
||||||
table.insert(ProceduralDistributions.list.ArmyStorageMedical.items, "TOC.ProthesisMag1");
|
table.insert(ProceduralDistributions.list.ArmyStorageMedical.items, "JCIO.ProthesisMag1")
|
||||||
table.insert(ProceduralDistributions.list.ArmyStorageMedical.items, 5);
|
table.insert(ProceduralDistributions.list.ArmyStorageMedical.items, 5)
|
||||||
table.insert(ProceduralDistributions.list.SafehouseMedical.items, "TOC.ProthesisMag1");
|
table.insert(ProceduralDistributions.list.SafehouseMedical.items, "JCIO.ProthesisMag1")
|
||||||
table.insert(ProceduralDistributions.list.SafehouseMedical.items, 5);
|
table.insert(ProceduralDistributions.list.SafehouseMedical.items, 5)
|
||||||
table.insert(ProceduralDistributions.list.StoreShelfMechanics.items, "TOC.ProthesisMag1");
|
table.insert(ProceduralDistributions.list.StoreShelfMechanics.items, "JCIO.ProthesisMag1")
|
||||||
table.insert(ProceduralDistributions.list.StoreShelfMechanics.items, 5);
|
table.insert(ProceduralDistributions.list.StoreShelfMechanics.items, 5)
|
||||||
table.insert(ProceduralDistributions.list.MechanicShelfTools.items, "TOC.ProthesisMag1");
|
table.insert(ProceduralDistributions.list.MechanicShelfTools.items, "JCIO.ProthesisMag1")
|
||||||
table.insert(ProceduralDistributions.list.MechanicShelfTools.items, 5);
|
table.insert(ProceduralDistributions.list.MechanicShelfTools.items, 5)
|
||||||
|
|
||||||
table.insert(ProceduralDistributions.list.MedicalClinicTools.items, "TOC.ProthesisMag2");
|
table.insert(ProceduralDistributions.list.MedicalClinicTools.items, "JCIO.ProthesisMag2")
|
||||||
table.insert(ProceduralDistributions.list.MedicalClinicTools.items, 5);
|
table.insert(ProceduralDistributions.list.MedicalClinicTools.items, 5)
|
||||||
table.insert(ProceduralDistributions.list.MedicalStorageTools.items, "TOC.ProthesisMag2");
|
table.insert(ProceduralDistributions.list.MedicalStorageTools.items, "JCIO.ProthesisMag2")
|
||||||
table.insert(ProceduralDistributions.list.MedicalStorageTools.items, 5);
|
table.insert(ProceduralDistributions.list.MedicalStorageTools.items, 5)
|
||||||
table.insert(ProceduralDistributions.list.ArmyStorageMedical.items, "TOC.ProthesisMag2");
|
table.insert(ProceduralDistributions.list.ArmyStorageMedical.items, "JCIO.ProthesisMag2")
|
||||||
table.insert(ProceduralDistributions.list.ArmyStorageMedical.items, 5);
|
table.insert(ProceduralDistributions.list.ArmyStorageMedical.items, 5)
|
||||||
table.insert(ProceduralDistributions.list.SafehouseMedical.items, "TOC.ProthesisMag2");
|
table.insert(ProceduralDistributions.list.SafehouseMedical.items, "JCIO.ProthesisMag2")
|
||||||
table.insert(ProceduralDistributions.list.SafehouseMedical.items, 5);
|
table.insert(ProceduralDistributions.list.SafehouseMedical.items, 5)
|
||||||
table.insert(ProceduralDistributions.list.StoreShelfMechanics.items, "TOC.ProthesisMag2");
|
table.insert(ProceduralDistributions.list.StoreShelfMechanics.items, "JCIO.ProthesisMag2")
|
||||||
table.insert(ProceduralDistributions.list.StoreShelfMechanics.items, 5);
|
table.insert(ProceduralDistributions.list.StoreShelfMechanics.items, 5)
|
||||||
table.insert(ProceduralDistributions.list.MechanicShelfTools.items, "TOC.ProthesisMag2");
|
table.insert(ProceduralDistributions.list.MechanicShelfTools.items, "JCIO.ProthesisMag2")
|
||||||
table.insert(ProceduralDistributions.list.MechanicShelfTools.items, 5);
|
table.insert(ProceduralDistributions.list.MechanicShelfTools.items, 5)
|
||||||
|
|
||||||
table.insert(ProceduralDistributions.list.MedicalClinicTools.items, "TOC.ProthesisMag3");
|
table.insert(ProceduralDistributions.list.MedicalClinicTools.items, "JCIO.ProthesisMag3")
|
||||||
table.insert(ProceduralDistributions.list.MedicalClinicTools.items, 5);
|
table.insert(ProceduralDistributions.list.MedicalClinicTools.items, 5)
|
||||||
table.insert(ProceduralDistributions.list.MedicalStorageTools.items, "TOC.ProthesisMag3");
|
table.insert(ProceduralDistributions.list.MedicalStorageTools.items, "JCIO.ProthesisMag3")
|
||||||
table.insert(ProceduralDistributions.list.MedicalStorageTools.items, 5);
|
table.insert(ProceduralDistributions.list.MedicalStorageTools.items, 5)
|
||||||
table.insert(ProceduralDistributions.list.ArmyStorageMedical.items, "TOC.ProthesisMag3");
|
table.insert(ProceduralDistributions.list.ArmyStorageMedical.items, "JCIO.ProthesisMag3")
|
||||||
table.insert(ProceduralDistributions.list.ArmyStorageMedical.items, 5);
|
table.insert(ProceduralDistributions.list.ArmyStorageMedical.items, 5)
|
||||||
table.insert(ProceduralDistributions.list.SafehouseMedical.items, "TOC.ProthesisMag3");
|
table.insert(ProceduralDistributions.list.SafehouseMedical.items, "JCIO.ProthesisMag3")
|
||||||
table.insert(ProceduralDistributions.list.SafehouseMedical.items, 5);
|
table.insert(ProceduralDistributions.list.SafehouseMedical.items, 5)
|
||||||
table.insert(ProceduralDistributions.list.StoreShelfMechanics.items, "TOC.ProthesisMag3");
|
table.insert(ProceduralDistributions.list.StoreShelfMechanics.items, "JCIO.ProthesisMag3")
|
||||||
table.insert(ProceduralDistributions.list.StoreShelfMechanics.items, 5);
|
table.insert(ProceduralDistributions.list.StoreShelfMechanics.items, 5)
|
||||||
table.insert(ProceduralDistributions.list.MechanicShelfTools.items, "TOC.ProthesisMag3");
|
table.insert(ProceduralDistributions.list.MechanicShelfTools.items, "JCIO.ProthesisMag3")
|
||||||
table.insert(ProceduralDistributions.list.MechanicShelfTools.items, 5);
|
table.insert(ProceduralDistributions.list.MechanicShelfTools.items, 5)
|
||||||
@@ -6,7 +6,7 @@ local ClientCommands = {}
|
|||||||
-- Main handler of base functions for TOC, not changed till now 'cause it works
|
-- Main handler of base functions for TOC, not changed till now 'cause it works
|
||||||
ClientCommands.SendServer = function(player, arg)
|
ClientCommands.SendServer = function(player, arg)
|
||||||
local otherPlayer = getPlayerByOnlineID(arg["To"])
|
local otherPlayer = getPlayerByOnlineID(arg["To"])
|
||||||
sendServerCommand(otherPlayer, "TOC", arg["command"], arg)
|
sendServerCommand(otherPlayer, "JCIO", arg["command"], arg)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -18,14 +18,14 @@ ClientCommands.AskDamageOtherPlayer = function(_, arg)
|
|||||||
local patient_id = arg[1]
|
local patient_id = arg[1]
|
||||||
local part_name = arg[2]
|
local part_name = arg[2]
|
||||||
|
|
||||||
sendServerCommand(patient, "TOC", "AcceptDamageOtherPlayer", {patient_id, part_name})
|
sendServerCommand(patient, "JCIO", "AcceptDamageOtherPlayer", {patient_id, part_name})
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
ClientCommands.AskStopAmputationSound = function(_, args)
|
ClientCommands.AskStopAmputationSound = function(_, args)
|
||||||
|
|
||||||
print("JCIO: We're in AskStopAmputationSound")
|
print("JCIO: We're in AskStopAmputationSound")
|
||||||
sendServerCommand("TOC", "StopAmputationSound", {surgeon_id = args.surgeon_id})
|
sendServerCommand("JCIO", "StopAmputationSound", {surgeon_id = args.surgeon_id})
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
@@ -33,7 +33,7 @@ end
|
|||||||
-- Animations
|
-- Animations
|
||||||
ClientCommands.NotifyNewCrawlAnimation = function(player, args)
|
ClientCommands.NotifyNewCrawlAnimation = function(player, args)
|
||||||
|
|
||||||
sendServerCommand("TOC", "SetCrawlAnimation", {id = args.id, check = args.check})
|
sendServerCommand("JCIO", "SetCrawlAnimation", {id = args.id, check = args.check})
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -43,7 +43,7 @@ end
|
|||||||
-- Cheats
|
-- Cheats
|
||||||
ClientCommands.AskToResetEverything = function(_, arg)
|
ClientCommands.AskToResetEverything = function(_, arg)
|
||||||
local clicked_player = getPlayerByOnlineID(arg[1])
|
local clicked_player = getPlayerByOnlineID(arg[1])
|
||||||
sendServerCommand(clicked_player, "TOC", "ResetEverything", {})
|
sendServerCommand(clicked_player, "JCIO", "ResetEverything", {})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@@ -10,17 +10,17 @@ local function AddBodyLocationBefore(new_location, move_to_location)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
AddBodyLocationBefore("TOC_ArmRight", "Shoes")
|
AddBodyLocationBefore("JCIO_ArmRight", "Shoes")
|
||||||
AddBodyLocationBefore("TOC_ArmLeft", "Shoes")
|
AddBodyLocationBefore("JCIO_ArmLeft", "Shoes")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
AddBodyLocationBefore("TOC_ArmRightProsthesis", "Shoes")
|
AddBodyLocationBefore("JCIO_ArmRightProsthesis", "Shoes")
|
||||||
AddBodyLocationBefore("TOC_ArmLeftProsthesis", "Shoes")
|
AddBodyLocationBefore("JCIO_ArmLeftProsthesis", "Shoes")
|
||||||
|
|
||||||
AddBodyLocationBefore("TOC_LegRight", "FannyPackFront")
|
AddBodyLocationBefore("JCIO_LegRight", "FannyPackFront")
|
||||||
AddBodyLocationBefore("TOC_LegLeft", "FannyPackFront")
|
AddBodyLocationBefore("JCIO_LegLeft", "FannyPackFront")
|
||||||
|
|
||||||
|
|
||||||
AddBodyLocationBefore("TOC_LegRightProsthesis", "FannyPackFront")
|
AddBodyLocationBefore("JCIO_LegRightProsthesis", "FannyPackFront")
|
||||||
AddBodyLocationBefore("TOC_LegLeftProsthesis", "FannyPackFront")
|
AddBodyLocationBefore("JCIO_LegLeftProsthesis", "FannyPackFront")
|
||||||
@@ -7,14 +7,16 @@ local function AddProfession()
|
|||||||
-6,
|
-6,
|
||||||
getText("UI_profdesc_surgeon")
|
getText("UI_profdesc_surgeon")
|
||||||
);
|
);
|
||||||
surgeon:addXPBoost(Perks.Doctor, 4);
|
surgeon:addXPBoost(Perks.Doctor, 4)
|
||||||
surgeon:addXPBoost(Perks.SmallBlade, 3);
|
surgeon:addXPBoost(Perks.SmallBlade, 3)
|
||||||
surgeon:getFreeRecipes():add("Make metal hand");
|
|
||||||
surgeon:getFreeRecipes():add("Make metal hook");
|
-- TODO Fix this, it doesn't make any sense
|
||||||
surgeon:getFreeRecipes():add("Make wooden hook");
|
surgeon:getFreeRecipes():add("Make metal hand")
|
||||||
surgeon:getFreeRecipes():add("Combine real surgeon kit");
|
surgeon:getFreeRecipes():add("Make metal hook")
|
||||||
surgeon:getFreeRecipes():add("Combine surgeon kit");
|
surgeon:getFreeRecipes():add("Make wooden hook")
|
||||||
surgeon:getFreeRecipes():add("Combine improvised surgeon kit");
|
surgeon:getFreeRecipes():add("Combine real surgeon kit")
|
||||||
|
surgeon:getFreeRecipes():add("Combine surgeon kit")
|
||||||
|
surgeon:getFreeRecipes():add("Combine improvised surgeon kit")
|
||||||
|
|
||||||
local profList = ProfessionFactory.getProfessions()
|
local profList = ProfessionFactory.getProfessions()
|
||||||
for i=1,profList:size() do
|
for i=1,profList:size() do
|
||||||
@@ -11,7 +11,7 @@ imports
|
|||||||
DisplayName = Amputated right hand,
|
DisplayName = Amputated right hand,
|
||||||
|
|
||||||
ClothingItem = Amputation_Right_Hand,
|
ClothingItem = Amputation_Right_Hand,
|
||||||
BodyLocation = TOC_ArmRight,
|
BodyLocation = JCIO_ArmRight,
|
||||||
|
|
||||||
Weight = 0,
|
Weight = 0,
|
||||||
CombatSpeedModifier = 0.9,
|
CombatSpeedModifier = 0.9,
|
||||||
@@ -30,7 +30,7 @@ imports
|
|||||||
DisplayName = Amputated right forearm,
|
DisplayName = Amputated right forearm,
|
||||||
|
|
||||||
ClothingItem = Amputation_Right_LowerArm,
|
ClothingItem = Amputation_Right_LowerArm,
|
||||||
BodyLocation = TOC_ArmRight,
|
BodyLocation = JCIO_ArmRight,
|
||||||
|
|
||||||
Weight = 0,
|
Weight = 0,
|
||||||
CombatSpeedModifier = 0.8,
|
CombatSpeedModifier = 0.8,
|
||||||
@@ -48,7 +48,7 @@ imports
|
|||||||
DisplayName = Amputated entire right arm,
|
DisplayName = Amputated entire right arm,
|
||||||
|
|
||||||
ClothingItem = Amputation_Right_UpperArm,
|
ClothingItem = Amputation_Right_UpperArm,
|
||||||
BodyLocation = TOC_ArmRight,
|
BodyLocation = JCIO_ArmRight,
|
||||||
BloodLocation = UpperArms;UpperBody,
|
BloodLocation = UpperArms;UpperBody,
|
||||||
Weight = 0,
|
Weight = 0,
|
||||||
CombatSpeedModifier = 0.7,
|
CombatSpeedModifier = 0.7,
|
||||||
@@ -65,7 +65,7 @@ imports
|
|||||||
DisplayName = Amputated left hand,
|
DisplayName = Amputated left hand,
|
||||||
|
|
||||||
ClothingItem = Amputation_Left_Hand,
|
ClothingItem = Amputation_Left_Hand,
|
||||||
BodyLocation = TOC_ArmLeft,
|
BodyLocation = JCIO_ArmLeft,
|
||||||
|
|
||||||
Weight = 0,
|
Weight = 0,
|
||||||
CombatSpeedModifier = 0.9,
|
CombatSpeedModifier = 0.9,
|
||||||
@@ -84,7 +84,7 @@ imports
|
|||||||
DisplayCategory = Amputation,
|
DisplayCategory = Amputation,
|
||||||
DisplayName = Amputated left forearm,
|
DisplayName = Amputated left forearm,
|
||||||
ClothingItem = Amputation_Left_LowerArm,
|
ClothingItem = Amputation_Left_LowerArm,
|
||||||
BodyLocation = TOC_ArmLeft,
|
BodyLocation = JCIO_ArmLeft,
|
||||||
|
|
||||||
Weight = 0,
|
Weight = 0,
|
||||||
CombatSpeedModifier = 0.8,
|
CombatSpeedModifier = 0.8,
|
||||||
@@ -102,7 +102,7 @@ imports
|
|||||||
Type = Clothing,
|
Type = Clothing,
|
||||||
DisplayName = Amputated entire left arm,
|
DisplayName = Amputated entire left arm,
|
||||||
ClothingItem = Amputation_Left_UpperArm,
|
ClothingItem = Amputation_Left_UpperArm,
|
||||||
BodyLocation = TOC_ArmLeft,
|
BodyLocation = JCIO_ArmLeft,
|
||||||
|
|
||||||
Weight = 0,
|
Weight = 0,
|
||||||
CombatSpeedModifier = 0.7,
|
CombatSpeedModifier = 0.7,
|
||||||
@@ -162,7 +162,7 @@ imports
|
|||||||
DisplayCategory = Prosthesis,
|
DisplayCategory = Prosthesis,
|
||||||
DisplayName = Right Hand - Wooden Hook,
|
DisplayName = Right Hand - Wooden Hook,
|
||||||
ClothingItem = Prost_Right_Hand_WoodenHook,
|
ClothingItem = Prost_Right_Hand_WoodenHook,
|
||||||
BodyLocation = TOC_ArmRightProsthesis,
|
BodyLocation = JCIO_ArmRightProsthesis,
|
||||||
BloodLocation = Hands,
|
BloodLocation = Hands,
|
||||||
Icon = woodenHook,
|
Icon = woodenHook,
|
||||||
Tooltip = Tooltip_equip_prothesis_hand,
|
Tooltip = Tooltip_equip_prothesis_hand,
|
||||||
@@ -177,7 +177,7 @@ imports
|
|||||||
DisplayCategory = Prosthesis,
|
DisplayCategory = Prosthesis,
|
||||||
DisplayName = Left Hand - Wooden Hook,
|
DisplayName = Left Hand - Wooden Hook,
|
||||||
ClothingItem = Prost_Left_Hand_WoodenHook,
|
ClothingItem = Prost_Left_Hand_WoodenHook,
|
||||||
BodyLocation = TOC_ArmLeftProsthesis,
|
BodyLocation = JCIO_ArmLeftProsthesis,
|
||||||
BloodLocation = Hands,
|
BloodLocation = Hands,
|
||||||
Icon = woodenHook,
|
Icon = woodenHook,
|
||||||
Tooltip = Tooltip_equip_prothesis_hand,
|
Tooltip = Tooltip_equip_prothesis_hand,
|
||||||
@@ -193,7 +193,7 @@ imports
|
|||||||
DisplayCategory = Prosthesis,
|
DisplayCategory = Prosthesis,
|
||||||
DisplayName = Right Hand - Metal Hook,
|
DisplayName = Right Hand - Metal Hook,
|
||||||
ClothingItem = Prost_Right_Hand_MetalHook,
|
ClothingItem = Prost_Right_Hand_MetalHook,
|
||||||
BodyLocation = TOC_ArmRightProsthesis,
|
BodyLocation = JCIO_ArmRightProsthesis,
|
||||||
BloodLocation = Hands,
|
BloodLocation = Hands,
|
||||||
Icon = metalHook,
|
Icon = metalHook,
|
||||||
Tooltip = Tooltip_equip_prothesis_hand,
|
Tooltip = Tooltip_equip_prothesis_hand,
|
||||||
@@ -208,7 +208,7 @@ imports
|
|||||||
DisplayCategory = Prosthesis,
|
DisplayCategory = Prosthesis,
|
||||||
DisplayName = Left Hand - Metal Hook,
|
DisplayName = Left Hand - Metal Hook,
|
||||||
ClothingItem = Prost_Left_Hand_MetalHook,
|
ClothingItem = Prost_Left_Hand_MetalHook,
|
||||||
BodyLocation = TOC_ArmLeftProsthesis,
|
BodyLocation = JCIO_ArmLeftProsthesis,
|
||||||
BloodLocation = Hands,
|
BloodLocation = Hands,
|
||||||
Icon = metalHook,
|
Icon = metalHook,
|
||||||
Tooltip = Tooltip_equip_prothesis_hand,
|
Tooltip = Tooltip_equip_prothesis_hand,
|
||||||
@@ -222,7 +222,7 @@ imports
|
|||||||
DisplayCategory = Prosthesis,
|
DisplayCategory = Prosthesis,
|
||||||
DisplayName = Right Hand - Metal Hand,
|
DisplayName = Right Hand - Metal Hand,
|
||||||
ClothingItem = Prost_Right_Hand_MetalHand,
|
ClothingItem = Prost_Right_Hand_MetalHand,
|
||||||
BodyLocation = TOC_ArmRightProsthesis,
|
BodyLocation = JCIO_ArmRightProsthesis,
|
||||||
BloodLocation = Hands,
|
BloodLocation = Hands,
|
||||||
Icon = metalHand,
|
Icon = metalHand,
|
||||||
Tooltip = Tooltip_equip_prothesis_hand,
|
Tooltip = Tooltip_equip_prothesis_hand,
|
||||||
@@ -236,7 +236,7 @@ imports
|
|||||||
DisplayCategory = Prosthesis,
|
DisplayCategory = Prosthesis,
|
||||||
DisplayName = Left Hand - Metal Hand,
|
DisplayName = Left Hand - Metal Hand,
|
||||||
ClothingItem = Prost_Left_Hand_MetalHand,
|
ClothingItem = Prost_Left_Hand_MetalHand,
|
||||||
BodyLocation = TOC_ArmLeftProsthesis,
|
BodyLocation = JCIO_ArmLeftProsthesis,
|
||||||
BloodLocation = Hands,
|
BloodLocation = Hands,
|
||||||
Icon = metalHand,
|
Icon = metalHand,
|
||||||
Tooltip = Tooltip_equip_prothesis_hand",
|
Tooltip = Tooltip_equip_prothesis_hand",
|
||||||
@@ -250,7 +250,7 @@ imports
|
|||||||
DisplayCategory = Prosthesis,
|
DisplayCategory = Prosthesis,
|
||||||
DisplayName = Right Forearm - Wooden Hook,
|
DisplayName = Right Forearm - Wooden Hook,
|
||||||
ClothingItem = Prost_Right_LowerArm_WoodenHook,
|
ClothingItem = Prost_Right_LowerArm_WoodenHook,
|
||||||
BodyLocation = TOC_ArmRightProsthesis,
|
BodyLocation = JCIO_ArmRightProsthesis,
|
||||||
BloodLocation = LowerArms;Hands,
|
BloodLocation = LowerArms;Hands,
|
||||||
Icon = woodenHook,
|
Icon = woodenHook,
|
||||||
Tooltip = Tooltip_equip_prothesis_fore,
|
Tooltip = Tooltip_equip_prothesis_fore,
|
||||||
@@ -264,7 +264,7 @@ imports
|
|||||||
DisplayCategory = Prosthesis,
|
DisplayCategory = Prosthesis,
|
||||||
DisplayName = Left Forearm - Wooden Hook,
|
DisplayName = Left Forearm - Wooden Hook,
|
||||||
ClothingItem = Prost_Left_LowerArm_WoodenHook,
|
ClothingItem = Prost_Left_LowerArm_WoodenHook,
|
||||||
BodyLocation = TOC_ArmLeftProsthesis,
|
BodyLocation = JCIO_ArmLeftProsthesis,
|
||||||
BloodLocation = LowerArms;Hands,
|
BloodLocation = LowerArms;Hands,
|
||||||
Icon = woodenHook,
|
Icon = woodenHook,
|
||||||
Tooltip = Tooltip_equip_prothesis_fore,
|
Tooltip = Tooltip_equip_prothesis_fore,
|
||||||
@@ -278,7 +278,7 @@ imports
|
|||||||
DisplayCategory = Prosthesis,
|
DisplayCategory = Prosthesis,
|
||||||
DisplayName = Right Forearm - Metal Hook,
|
DisplayName = Right Forearm - Metal Hook,
|
||||||
ClothingItem = Prost_Right_LowerArm_MetalHook,
|
ClothingItem = Prost_Right_LowerArm_MetalHook,
|
||||||
BodyLocation = TOC_ArmRightProsthesis,
|
BodyLocation = JCIO_ArmRightProsthesis,
|
||||||
BloodLocation = LowerArms;Hands,
|
BloodLocation = LowerArms;Hands,
|
||||||
Icon = metalHook,
|
Icon = metalHook,
|
||||||
Tooltip = Tooltip_equip_prothesis_fore,
|
Tooltip = Tooltip_equip_prothesis_fore,
|
||||||
@@ -292,7 +292,7 @@ imports
|
|||||||
DisplayCategory = Prosthesis,
|
DisplayCategory = Prosthesis,
|
||||||
DisplayName = Left Forearm - Metal Hook,
|
DisplayName = Left Forearm - Metal Hook,
|
||||||
ClothingItem = Prost_Left_LowerArm_MetalHook,
|
ClothingItem = Prost_Left_LowerArm_MetalHook,
|
||||||
BodyLocation = TOC_ArmLeftProsthesis,
|
BodyLocation = JCIO_ArmLeftProsthesis,
|
||||||
BloodLocation = LowerArms;Hands,
|
BloodLocation = LowerArms;Hands,
|
||||||
|
|
||||||
Icon = metalHook,
|
Icon = metalHook,
|
||||||
@@ -307,7 +307,7 @@ imports
|
|||||||
DisplayCategory = Prosthesis,
|
DisplayCategory = Prosthesis,
|
||||||
DisplayName = Right Forearm - Metal Hand,
|
DisplayName = Right Forearm - Metal Hand,
|
||||||
ClothingItem = Prost_Right_LowerArm_MetalHand,
|
ClothingItem = Prost_Right_LowerArm_MetalHand,
|
||||||
BodyLocation = TOC_ArmRightProsthesis,
|
BodyLocation = JCIO_ArmRightProsthesis,
|
||||||
BloodLocation = LowerArms;Hands,
|
BloodLocation = LowerArms;Hands,
|
||||||
Icon = metalHand,
|
Icon = metalHand,
|
||||||
Tooltip = Tooltip_equip_prothesis_fore,
|
Tooltip = Tooltip_equip_prothesis_fore,
|
||||||
@@ -321,7 +321,7 @@ imports
|
|||||||
DisplayCategory = Prosthesis,
|
DisplayCategory = Prosthesis,
|
||||||
DisplayName = Left Forearm - Metal Hand,
|
DisplayName = Left Forearm - Metal Hand,
|
||||||
ClothingItem = Prost_Left_LowerArm_MetalHand,
|
ClothingItem = Prost_Left_LowerArm_MetalHand,
|
||||||
BodyLocation = TOC_ArmLeftProsthesis,
|
BodyLocation = JCIO_ArmLeftProsthesis,
|
||||||
BloodLocation = LowerArms;Hands,
|
BloodLocation = LowerArms;Hands,
|
||||||
Icon = metalHand,
|
Icon = metalHand,
|
||||||
Tooltip = Tooltip_equip_prothesis_fore,
|
Tooltip = Tooltip_equip_prothesis_fore,
|
||||||
@@ -485,7 +485,7 @@ item Amputation_Left_Foot
|
|||||||
DisplayName = Amputated Left Foot,
|
DisplayName = Amputated Left Foot,
|
||||||
|
|
||||||
ClothingItem = Amputation_Left_Foot,
|
ClothingItem = Amputation_Left_Foot,
|
||||||
BodyLocation = TOC_LegLeft,
|
BodyLocation = JCIO_LegLeft,
|
||||||
|
|
||||||
Weight = 0,
|
Weight = 0,
|
||||||
CombatSpeedModifier = 0.9,
|
CombatSpeedModifier = 0.9,
|
||||||
@@ -504,7 +504,7 @@ item Amputation_Right_Foot
|
|||||||
DisplayName = Amputated Right Foot,
|
DisplayName = Amputated Right Foot,
|
||||||
|
|
||||||
ClothingItem = Amputation_Right_Foot,
|
ClothingItem = Amputation_Right_Foot,
|
||||||
BodyLocation = TOC_LegRight,
|
BodyLocation = JCIO_LegRight,
|
||||||
|
|
||||||
Weight = 0,
|
Weight = 0,
|
||||||
CombatSpeedModifier = 0.9,
|
CombatSpeedModifier = 0.9,
|
||||||
|
|||||||
Reference in New Issue
Block a user