- Fixed some MP checks

- New prost for lower arm males
This commit is contained in:
Pao
2023-01-26 21:46:50 +01:00
parent e29bb1c9df
commit 79fd46a808
8 changed files with 13 additions and 17 deletions

View File

@@ -30,22 +30,17 @@ function CheckIfCanBeOperated(part_name, limbs_data)
end end
function CheckIfProsthesisCanBeEquipped(part_name, item) function CheckIfProsthesisCanBeEquipped(part_name)
local part_data = getPlayer():getModData().TOC.Limbs local limbs_data = getPlayer():getModData().TOC.Limbs
return limbs_data[part_name].is_cauterized or limbs_data[part_name].is_cicatrized
if item ~= nil then
if part_data[part_name].is_operated then
return true
end
else
return false
end
-- check if prosthesis is in the surgeon inventory... we need to get it before -- 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 end

View File

@@ -79,7 +79,7 @@ function AskCanEquipProsthesis(player, part_name)
arg["From"] = getPlayer():getOnlineID() arg["From"] = getPlayer():getOnlineID()
arg["To"] = player:getOnlineID() arg["To"] = player:getOnlineID()
arg["command"] = "CanEquipProsthesis" arg["command"] = "CanEquipProsthesis"
arg["toSend"] = part_name arg["toSend"] = part_name -- TODO to be more precise there should be prosthesis item here too to check
sendClientCommand("TOC", "SendServer", arg) sendClientCommand("TOC", "SendServer", arg)
end end
@@ -152,10 +152,12 @@ end
Commands["CanEquipProsthesis"] = function(arg) Commands["CanEquipProsthesis"] = function(arg)
local part_name = arg["toSend"] local part_name = arg["toSend"]
--local item = arg["toSend"][2] -- TODO Add item prosth here
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", true } -- FIXME true just for test arg["toSend"] = {part_name, "Equip", CheckIfProsthesisCanBeEquipped(part_name) }
sendClientCommand("TOC", "SendServer", arg) sendClientCommand("TOC", "SendServer", arg)
end end
@@ -165,7 +167,7 @@ Commands["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", true } -- FIXME true just for test arg["toSend"] = { part_name, "Unequip", CheckIfProsthesisCanBeUnequipped(part_name)}
sendClientCommand("TOC", "SendServer", arg) sendClientCommand("TOC", "SendServer", arg)
end end

View File

@@ -95,7 +95,6 @@ local og_ISInventoryPaneGetActualItems = ISInventoryPane.getActualItems
function ISInventoryPane.getActualItems(items) function ISInventoryPane.getActualItems(items)
-- TODO add an exception for installed prosthesis, make them unequippable automatically from here and get the correct obj -- TODO add an exception for installed prosthesis, make them unequippable automatically from here and get the correct obj
local ret = og_ISInventoryPaneGetActualItems(items) local ret = og_ISInventoryPaneGetActualItems(items)
-- This is gonna be slower than just overriding the function but hey it's more compatible -- This is gonna be slower than just overriding the function but hey it's more compatible

Binary file not shown.

Before

Width:  |  Height:  |  Size: 147 KiB

After

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

Binary file not shown.