Fixed wrist thing
This commit is contained in:
@@ -175,7 +175,7 @@ JCIO.CutLimb = function(partName, surgeonFactor, bandageTable, painkillerTable)
|
||||
if tourniquetItem ~= nil then
|
||||
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)
|
||||
end
|
||||
end
|
||||
@@ -185,7 +185,9 @@ JCIO.CutLimb = function(partName, surgeonFactor, bandageTable, painkillerTable)
|
||||
local wristWatchItem = FindWristWatchInWornItems(player, side)
|
||||
|
||||
if wristWatchItem ~= nil then
|
||||
player:removeWornItem(wristWatchItem)
|
||||
if partName == side .. "_LowerArm" or partName == side .. "_UpperArm" then
|
||||
player:removeWornItem(wristWatchItem)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
@@ -190,30 +190,46 @@ end
|
||||
-- Make the player unable to equip a tourniquet or watches on an already fully amputated limb
|
||||
local og_ISWearClothingIsValid = ISWearClothing.isValid
|
||||
function ISWearClothing:isValid()
|
||||
|
||||
|
||||
local baseCheck = og_ISWearClothingIsValid(self)
|
||||
local itemFullType = self.item:getFullType()
|
||||
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 indexItem, itemName in pairs(itemsToBeChecked) do
|
||||
local formattedItemName = string.format(itemName, side)
|
||||
|
||||
if string.find(itemFullType, formattedItemName) then
|
||||
if indexItem == 1 and limbsData[side .. "_UpperArm"].isCut then
|
||||
return false
|
||||
elseif indexItem == 2 and limbsData[side .. "_Hand"].isCut then
|
||||
return false
|
||||
end
|
||||
local formattedItemName = string.format(itemToCheck, side)
|
||||
|
||||
if string.find(itemFullType, formattedItemName) then
|
||||
if limbsData[side .. "_UpperArm"].isCut then
|
||||
return false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return baseCheck
|
||||
|
||||
|
||||
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