Fixed wrist thing
This commit is contained in:
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
@@ -55,6 +55,7 @@
|
|||||||
"SandboxVars",
|
"SandboxVars",
|
||||||
"getClassField",
|
"getClassField",
|
||||||
"ISWearClothing",
|
"ISWearClothing",
|
||||||
"SyncXp"
|
"SyncXp",
|
||||||
|
"ISClothingExtraAction"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -175,7 +175,7 @@ JCIO.CutLimb = function(partName, surgeonFactor, bandageTable, painkillerTable)
|
|||||||
if tourniquetItem ~= nil then
|
if tourniquetItem ~= nil then
|
||||||
baseDamageValue = 50 -- TODO Decrease mostly blood and damage, add pain, not everything else
|
baseDamageValue = 50 -- TODO Decrease mostly blood and damage, add pain, not everything else
|
||||||
|
|
||||||
if partName == "Left_UpperArm" or partName == "Right_UpperArm" then
|
if partName == side .. "_UpperArm" then
|
||||||
player:removeWornItem(tourniquetItem)
|
player:removeWornItem(tourniquetItem)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -185,7 +185,9 @@ JCIO.CutLimb = function(partName, surgeonFactor, bandageTable, painkillerTable)
|
|||||||
local wristWatchItem = FindWristWatchInWornItems(player, side)
|
local wristWatchItem = FindWristWatchInWornItems(player, side)
|
||||||
|
|
||||||
if wristWatchItem ~= nil then
|
if wristWatchItem ~= nil then
|
||||||
player:removeWornItem(wristWatchItem)
|
if partName == side .. "_LowerArm" or partName == side .. "_UpperArm" then
|
||||||
|
player:removeWornItem(wristWatchItem)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -190,30 +190,46 @@ end
|
|||||||
-- Make the player unable to equip a tourniquet or watches on an already fully amputated limb
|
-- Make the player unable to equip a tourniquet or watches on an already fully amputated limb
|
||||||
local og_ISWearClothingIsValid = ISWearClothing.isValid
|
local og_ISWearClothingIsValid = ISWearClothing.isValid
|
||||||
function ISWearClothing:isValid()
|
function ISWearClothing:isValid()
|
||||||
|
|
||||||
local baseCheck = og_ISWearClothingIsValid(self)
|
local baseCheck = og_ISWearClothingIsValid(self)
|
||||||
local itemFullType = self.item:getFullType()
|
local itemFullType = self.item:getFullType()
|
||||||
local limbsData = self.character:getModData().JCIO.limbs
|
local limbsData = self.character:getModData().JCIO.limbs
|
||||||
local itemsToBeChecked = {
|
|
||||||
"Surgery_%1_Tourniquet", -- 1
|
|
||||||
"Watch_%1" -- 2
|
|
||||||
}
|
|
||||||
|
|
||||||
|
local itemToCheck = "Surgery_%s_Tourniquet"
|
||||||
for _, side in pairs(JCIO.sideNames) do
|
for _, side in pairs(JCIO.sideNames) do
|
||||||
for indexItem, itemName in pairs(itemsToBeChecked) do
|
|
||||||
local formattedItemName = string.format(itemName, side)
|
|
||||||
|
|
||||||
if string.find(itemFullType, formattedItemName) then
|
local formattedItemName = string.format(itemToCheck, side)
|
||||||
if indexItem == 1 and limbsData[side .. "_UpperArm"].isCut then
|
|
||||||
return false
|
if string.find(itemFullType, formattedItemName) then
|
||||||
elseif indexItem == 2 and limbsData[side .. "_Hand"].isCut then
|
if limbsData[side .. "_UpperArm"].isCut then
|
||||||
return false
|
return false
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
return baseCheck
|
return baseCheck
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local og_ISWearClothingExtraAction = ISClothingExtraAction.isValid
|
||||||
|
|
||||||
|
function ISClothingExtraAction:isValid()
|
||||||
|
local baseCheck = og_ISWearClothingExtraAction(self)
|
||||||
|
local itemToCheck = "Watch_%s"
|
||||||
|
local itemFullType = self.item:getFullType()
|
||||||
|
local limbsData = self.character:getModData().JCIO.limbs
|
||||||
|
|
||||||
|
|
||||||
|
for _, side in pairs(JCIO.sideNames) do
|
||||||
|
|
||||||
|
local formattedItemName = string.format(itemToCheck, side)
|
||||||
|
|
||||||
|
if string.find(itemFullType, formattedItemName) then
|
||||||
|
if limbsData[side .. "_LowerArm"].isCut then
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return baseCheck
|
||||||
|
end
|
||||||
Reference in New Issue
Block a user