Let's switch back to the OG name
This commit is contained in:
@@ -8,32 +8,32 @@
|
||||
---@param partName string
|
||||
---@param prosthesisItem any the prosthesis item
|
||||
---@param prosthesisBaseName string I don't really remember
|
||||
function JCIO.EquipProsthesis(partName, prosthesisItem, prosthesisBaseName)
|
||||
function TOC.EquipProsthesis(partName, prosthesisItem, prosthesisBaseName)
|
||||
|
||||
-- TODO probably will have to move this from the TOC menu to classic equip to have dynamic durability
|
||||
-- TODO We need to pass the original item so we can get its data!
|
||||
|
||||
local player = getPlayer()
|
||||
local jcioModData = player:getModData().JCIO
|
||||
local TOCModData = player:getModData().TOC
|
||||
|
||||
local equippedProsthesis = GenerateEquippedProsthesis(prosthesisItem, player:getInventory(), "Hand")
|
||||
|
||||
|
||||
--print("JCIO: Test durability new item " .. added_prosthesis_mod_data.TOC.durability)
|
||||
--print("TOC: Test durability new item " .. added_prosthesis_mod_data.TOC.durability)
|
||||
|
||||
-- TODO equippedProsthesis must have something like the ProsthesisFactor from before!!!
|
||||
|
||||
if partName ~= nil then
|
||||
|
||||
if equippedProsthesis ~= nil then
|
||||
jcioModData.limbs[partName].isProsthesisEquipped = true
|
||||
TOCModData.limbs[partName].isProsthesisEquipped = true
|
||||
|
||||
|
||||
-- Fill equippedProsthesis with the correct stuff
|
||||
-- TODO For prosthetics we should fetch the data from a modData INSIDE them!
|
||||
|
||||
-- TODO Change the value passed, it's wrong
|
||||
--jcioModData.limbs[partName].equippedProsthesis = jcioModData.Prosthesis[prosthesisBaseName][partName]
|
||||
--TOCModData.limbs[partName].equippedProsthesis = TOCModData.Prosthesis[prosthesisBaseName][partName]
|
||||
|
||||
if player:isFemale() then
|
||||
equippedProsthesis:getVisual():setTextureChoice(1)
|
||||
@@ -51,13 +51,13 @@ end
|
||||
|
||||
---Unequip a prosthesis clothing item and returns it to the inventory as a normal item
|
||||
---@param partName string
|
||||
function JCIO.UnequipProsthesis(patient, partName, equippedProsthesis)
|
||||
function TOC.UnequipProsthesis(patient, partName, equippedProsthesis)
|
||||
|
||||
|
||||
-- TODO Pass the parameters generated from EquipProsthesis to the re-generated normal item
|
||||
|
||||
local jcioModData = patient:getModData().JCIO
|
||||
jcioModData.limbs[partName].isProsthesisEquipped = false
|
||||
local TOCModData = patient:getModData().TOC
|
||||
TOCModData.limbs[partName].isProsthesisEquipped = false
|
||||
|
||||
|
||||
local equippedProstFullType = equippedProsthesis:getFullType()
|
||||
@@ -70,16 +70,16 @@ function JCIO.UnequipProsthesis(patient, partName, equippedProsthesis)
|
||||
local equippedProstModData = equippedProsthesis:getModData()
|
||||
|
||||
|
||||
local baseProstItem = patient:getInventory():AddItem("JCIO." .. prostName)
|
||||
local baseProstItem = patient:getInventory():AddItem("TOC." .. prostName)
|
||||
local baseProstItemModData = baseProstItem.getModData()
|
||||
baseProstItemModData.JCIO = {
|
||||
durability = equippedProstModData.JCIO.durability,
|
||||
speed = equippedProstModData.JCIO.speed
|
||||
baseProstItemModData.TOC = {
|
||||
durability = equippedProstModData.TOC.durability,
|
||||
speed = equippedProstModData.TOC.speed
|
||||
}
|
||||
|
||||
patient:setWornItem(equippedProsthesis:getBodyLocation(), nil)
|
||||
patient:getInventory():Remove(equippedProsthesis)
|
||||
jcioModData.limbs[partName].equippedProsthesis = nil
|
||||
TOCModData.limbs[partName].equippedProsthesis = nil
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user