diff --git a/media/lua/client/TOC_CommonFunctions.lua b/media/lua/client/TOC_CommonFunctions.lua
index c5c95e4..97d5665 100644
--- a/media/lua/client/TOC_CommonFunctions.lua
+++ b/media/lua/client/TOC_CommonFunctions.lua
@@ -45,25 +45,6 @@ function GetAcceptingProsthesisBodyPartTypes()
end
--- TODO This is just convoluted. Do not use this
-function FindTocDataPartNameFromBodyPartType(toc_limbs_data, bodyPartType)
- if bodyPartType == BodyPartType.Hand_R then
- return toc_limbs_data.Right_Hand
- elseif bodyPartType == BodyPartType.ForeArm_R then
- return toc_limbs_data.Right_LowerArm
- elseif bodyPartType == BodyPartType.UpperArm_R then
- return toc_limbs_data.Right_UpperArm
- elseif bodyPartType == BodyPartType.Hand_L then
- return toc_limbs_data.Left_Hand
- elseif bodyPartType == BodyPartType.ForeArm_L then
- return toc_limbs_data.Left_LowerArm
- elseif bodyPartType == BodyPartType.UpperArm_L then
- return toc_limbs_data.Left_UpperArm
- else
- return nil
- end
-end
-
function TocGetPartNameFromBodyPartType(body_part)
if body_part == BodyPartType.Hand_R then
@@ -114,3 +95,28 @@ function TocFindCorrectClothingProsthesis(item_name, part_name)
end
+function TocFindAmputationInInventory(player, side, limb)
+ local player_inventory = player:getInventory()
+ local item_name = "TOC.Amputation_" .. side .. "_" .. limb
+ local found_item = player_inventory:FindAndReturn(item_name)
+ if found_item then
+ return found_item:getFullType()
+
+ end
+
+end
+
+function TocFindEquippedProsthesisInInventory(player, side, limb)
+ local player_inventory = player:getInventory()
+ for _, prost in ipairs(GetProsthesisList()) do
+ local item_name = TocFindCorrectClothingProsthesis(prost, side .."_" .. limb)
+ local found_item = player_inventory:FindAndReturn(item_name)
+
+ if found_item then
+ return found_item:getFullType()
+
+ end
+
+ end
+
+end
\ No newline at end of file
diff --git a/media/lua/client/TOC_Compatibility.lua b/media/lua/client/TOC_Compatibility.lua
index ad5ab46..62ab30b 100644
--- a/media/lua/client/TOC_Compatibility.lua
+++ b/media/lua/client/TOC_Compatibility.lua
@@ -27,18 +27,19 @@ function TocCheckCompatibilityWithOlderVersions(mod_data)
TocSetCorrectTextureForAmputation(amputation_clothing_item, player)
player:setWornItem(amputation_clothing_item:getBodyLocation(), amputation_clothing_item)
-
end
-
end
+ TocResetClothingItemBodyLocation(player, side, limb)
+
+
+
end
end
- TocReapplyBodyLocation()
@@ -156,88 +157,3 @@ function TocMapOldDataToNew(mod_data)
end
-
-
-------------------------------------------------------------------------------------------
-
--- Modified functions for compat reason, used only in one instance
---------------------
-local function TocPartNameToOldBodyLocationProsthesis(name)
- if name == "Right_Hand" then return "ArmRight_Prot" end
- if name == "Right_LowerArm" then return "ArmRight_Prot" end
- if name == "Right_UpperArm" then return "ArmRight_Prot" end
- if name == "Left_Hand" then return "ArmLeft_Prot" end
- if name == "Left_LowerArm" then return "ArmLeft_Prot" end
- if name == "Left_UpperArm" then return "ArmLeft_Prot" end
-end
-
-local function TocPartNameToOldBodyLocationAmputation(name)
- if name == "Right_Hand" then return "ArmRight" end
- if name == "Right_LowerArm" then return "ArmRight" end
- if name == "Right_UpperArm" then return "ArmRight" end
- if name == "Left_Hand" then return "ArmLeft" end
- if name == "Left_LowerArm" then return "ArmLeft" end
- if name == "Left_UpperArm" then return "ArmLeft" end
-end
-
-
-
-function TocFindAmputationInInventory(player, side, limb)
- local player_inventory = player:getInventory()
- local item_name = "TOC.Amputation_" .. side .. "_" .. limb
- local found_item = player_inventory:FindAndReturn(item_name)
- if found_item then
- return found_item:getFullType()
-
- end
-
-end
-
-function TocFindEquippedProsthesisInInventory(player, side, limb)
- local player_inventory = player:getInventory()
- for _, prost in ipairs(GetProsthesisList()) do
- local item_name = "TOC.Prost_" .. side .. "_" .. limb .. "_" .. prost
- local found_item = player_inventory:FindAndReturn(item_name)
-
- if found_item then
- return found_item:getFullType()
-
- end
-
- end
-
-end
-
-
-function TocOldFindAmputationOrProsthesisName(part_name, player, choice)
-
- local player_inventory = player:getInventory()
-
- for _, side in ipairs(TOC_sides) do
- for _, limb in ipairs(TOC_limbs) do
- local item_name
- local found_item
- if choice == "Amputation" then
- item_name = "TOC.Amputation_" .. side .. "_" .. limb
- end
-
- if choice == "Prosthesis" then
- item_name = "TOC.Prost" .. side .. "_" .. limb .. "_MetalHook" -- TODO finish this
-
-
- end
-
-
- found_item = player_inventory:FindAndReturn(item_name)
-
- if found_item then
- return found_item:getFullType()
-
- end
-
-
- end
- end
-
-
-end
\ No newline at end of file
diff --git a/media/lua/client/TOC_ContextMenus.lua b/media/lua/client/TOC_ContextMenus.lua
index 8f73ddf..3b71c55 100644
--- a/media/lua/client/TOC_ContextMenus.lua
+++ b/media/lua/client/TOC_ContextMenus.lua
@@ -30,11 +30,22 @@ TocContextMenus.CreateMenus = function(player, context, worldObjects, test)
-- FIXME this is to prevent context menu spamming. Find a better way
clicked_players_table[clicked_player:getUsername()] = true
- local root_option = context:addOption("The Only Cure on " .. clicked_player:getUsername())
- local root_menu = context:getNew(context)
- local cheat_menu = TocContextMenus.CreateCheatMenu(context, root_menu, local_player,
- clicked_player)
- context:addSubMenu(root_option, root_menu)
+ if local_player:getAccessLevel() == "Admin" or isDebugEnabled() then
+ local root_option = context:addOption("The Only Cure Cheats on " .. clicked_player:getUsername())
+ local root_menu = context:getNew(context)
+
+ if clicked_player == local_player then
+ root_menu:addOption("Reset TOC for me", _, TocResetEverything)
+
+ else
+ root_menu:addOption("Reset TOC for " .. clicked_player:getUsername(), _, TryToToResetEverythingOtherPlayer,
+ clicked_player, local_player)
+
+ end
+ context:addSubMenu(root_option, root_menu)
+ end
+
+
-- TocContextMenus.FillCutAndOperateMenus(local_player, clicked_player, worldObjects,
-- cut_menu, operate_menu)
diff --git a/media/lua/client/TOC_Debug.lua b/media/lua/client/TOC_Debug.lua
index 23d0697..d508048 100644
--- a/media/lua/client/TOC_Debug.lua
+++ b/media/lua/client/TOC_Debug.lua
@@ -37,97 +37,42 @@ function TocResetEverything()
end
-function TocReapplyBodyLocation()
- -- get amputated limbs
- local player = getPlayer()
+-- Set correct body locations for items in inventory
+function TocResetClothingItemBodyLocation(player, side, limb)
local player_inventory = player:getInventory()
- for _, side in ipairs(TOC_sides) do
- for _, limb in ipairs(TOC_limbs) do
- local amputation_item_name = TocFindAmputationInInventory(player, side, limb)
- local equipped_prosthesis_item_name = TocFindEquippedProsthesisInInventory(player, side, limb)
- print(amputation_item_name)
- print(equipped_prosthesis_item_name)
- if amputation_item_name ~= nil then
-
- local amputation_item = player_inventory:FindAndReturn(amputation_item_name)
- if amputation_item ~= nil then
- player:removeWornItem(amputation_item)
- player:getInventory():Remove(amputation_item)
- amputation_item = player_inventory:AddItem(amputation_item_name)
- TocSetCorrectTextureForAmputation(amputation_item, player)
-
- player:setWornItem(amputation_item:getBodyLocation(), amputation_item)
- end
- amputation_item = nil -- reset it
- end
-
- if equipped_prosthesis_item_name ~= nil then
- local prosthesis_item = player_inventory:FindAndReturn(equipped_prosthesis_item_name)
- if prosthesis_item ~= nil then
- print("Resetting " .. prosthesis_item:getName())
- player:removeWornItem(prosthesis_item)
- player:getInventory():Remove(prosthesis_item)
- prosthesis_item = player_inventory:AddItem(equipped_prosthesis_item_name)
- player:setWornItem(prosthesis_item:getBodyLocation(), prosthesis_item)
-
- end
- prosthesis_item = nil -- reset it
- end
+ local amputation_item_name = TocFindAmputationInInventory(player, side, limb)
+ local equipped_prosthesis_item_name = TocFindEquippedProsthesisInInventory(player, side, limb)
+ print(amputation_item_name)
+ print(equipped_prosthesis_item_name)
+ if amputation_item_name ~= nil then
+ local amputation_item = player_inventory:FindAndReturn(amputation_item_name)
+ if amputation_item ~= nil then
+ player:removeWornItem(amputation_item)
+ player:getInventory():Remove(amputation_item)
+ amputation_item = player_inventory:AddItem(amputation_item_name)
+ TocSetCorrectTextureForAmputation(amputation_item, player)
+ player:setWornItem(amputation_item:getBodyLocation(), amputation_item)
end
+ amputation_item = nil -- reset it
end
+ if equipped_prosthesis_item_name ~= nil then
+ local prosthesis_item = player_inventory:FindAndReturn(equipped_prosthesis_item_name)
+ if prosthesis_item ~= nil then
+ print("Resetting " .. prosthesis_item:getName())
+ player:removeWornItem(prosthesis_item)
+ player:getInventory():Remove(prosthesis_item)
+ prosthesis_item = player_inventory:AddItem(equipped_prosthesis_item_name)
+ player:setWornItem(prosthesis_item:getBodyLocation(), prosthesis_item)
-
- -- for _, v in ipairs(GetBodyParts()) do
-
- -- local amputation_item_name = TocOldFindAmputationOrProsthesisName(v, player, "Amputation")
- -- local prosthesis_item_name = TocOldFindAmputationOrProsthesisName(v, player, "Prosthesis")
-
- -- print(amputation_item_name)
- -- print(prosthesis_item_name)
- -- if amputation_item_name ~= nil then
-
- -- local amputation_item = player_inventory:FindAndReturn(amputation_item_name)
- -- if amputation_item ~= nil then
- -- player:removeWornItem(amputation_item)
- -- player:getInventory():Remove(amputation_item)
- -- amputation_item = player_inventory:AddItem(amputation_item_name)
- -- player:setWornItem(amputation_item:getBodyLocation(), amputation_item)
- -- end
- -- amputation_item = nil -- reset it
- -- end
- -- if prosthesis_item_name ~= nil then
- -- local prosthesis_item = player_inventory:FindAndReturn(prosthesis_item_name)
- -- if prosthesis_item ~= nil then
- -- print("Resetting " .. prosthesis_item:getName())
- -- player:removeWornItem(prosthesis_item)
- -- player:getInventory():Remove(prosthesis_item)
- -- prosthesis_item = player_inventory:AddItem(prosthesis_item_name)
- -- player:setWornItem(prosthesis_item:getBodyLocation(), prosthesis_item)
-
- -- end
- -- prosthesis_item = nil -- reset it
- -- end
-
-
- -- end
-
- -- -- get prosthe
-
-
- -- -- fix them
-
-
- -- -- reapply them
-
-
-
+ end
+ prosthesis_item = nil -- reset it
+ end
end
-
-----------------------------------------------------------------------
diff --git a/media/lua/client/TOC_OverridenFunctions.lua b/media/lua/client/TOC_OverridenFunctions.lua
index 94de3f3..8dd7148 100644
--- a/media/lua/client/TOC_OverridenFunctions.lua
+++ b/media/lua/client/TOC_OverridenFunctions.lua
@@ -80,7 +80,7 @@ function ISInventoryPane:onMouseDoubleClick(x, y)
local player_inventory = getPlayerInventory(self.player).inventory
if instanceof(item_to_check, "InventoryItem") then
og_ISInventoryPaneOnMouseDoubleClick(self, x, y)
- elseif CheckIfItemIsAmputatedLimb(item_to_check.items[1]) or CheckIfItemIsProsthesis(item_to_check.items[1]) then
+ elseif CheckIfItemIsAmputatedLimb(item_to_check.items[1]) or CheckIfItemIsInstalledProsthesis(item_to_check.items[1]) then
print("TOC: Can't double click this item")
else
og_ISInventoryPaneOnMouseDoubleClick(self, x, y)
@@ -113,9 +113,11 @@ ISInventoryPaneContextMenu.onInspectClothing = function(playerObj, cloth
-- Inspect menu bypasses getActualItems, so we need to add that workaround here too
local clothing_full_type = clothing:getFullType()
- if not string.find(clothing_full_type, "Amputation_") then
-
+ if CheckIfItemIsAmputatedLimb(clothing) or CheckIfItemIsInstalledProsthesis(clothing) then
+ print("TOC: Can't inspect this!")
+ else
og_ISInventoryPaneContextMenuOnInspectClothing(playerObj, clothing)
+
end
end
diff --git a/media/lua/shared/translate/EN/Tooltip_EN.txt b/media/lua/shared/translate/EN/Tooltip_EN.txt
index 4295dbd..2d9f087 100644
--- a/media/lua/shared/translate/EN/Tooltip_EN.txt
+++ b/media/lua/shared/translate/EN/Tooltip_EN.txt
@@ -3,9 +3,9 @@ Tooltip_EN = {
Tooltip_Surgeon_kit = "Surgeon kit. To be used on an amputated limb
Helps healing the severed limb, reducing some of the time necessary to cicatrize.",
Tooltip_Improvised_surgeon_kit = "Improvised surgeon kit. To be used on an amputated limb
Helps healing the severed limb, reducing a little the time necessary to cicatrize.",
- Tooltip_equip_prothesis_hand = "Water Resistance is the time multiplier for actions
Without prosthesis, the multiplier is 2"
- Tooltip_equip_prothesis_fore = "Water Resistance is the time multiplier for actions
Without prosthesis, the multiplier is 2.5"
- Tooltip_prosthesic_limb = "A prosthetic limb. You'll have to wait until your limb is cicatrized before installing it.
It's done by having a bandage (alcohol is better) when cut, use a surgeon kit and wait."
+ Tooltip_equip_prothesis_hand = "A prosthesis equipped to the forearm",
+ Tooltip_equip_prothesis_fore = "A prosthesis equipped to the hand",
+ Tooltip_prosthesic_limb = "A prosthetic limb. You'll have to wait until your limb is cicatrized before installing it.
It's done by having a bandage (alcohol is better) when cut, use a surgeon kit and wait.",
Tooltip_ProstheticKnife = "Prost Knife test",
@@ -13,21 +13,21 @@ Tooltip_EN = {
- Recipe_Tooltip_Wooden_hook = "Make a prosthesic wooden hook.
Can be used on an amputated hand or forearm.
Can't be equipped if the upper arm is amputated."
- Recipe_Tooltip_Metal_hook = "Make a prosthesic metal hook.
Can be used on an amputated hand or forearm.
Can't be equipped if the upper arm is amputated."
- Recipe_Tooltip_Metal_hand = "Make a prosthesic metal hand.
Can be used on an amputated hand or forearm.
Can't be equipped if the upper arm is amputated."
+ Recipe_Tooltip_Wooden_hook = "Make a prosthesic wooden hook.
Can be used on an amputated hand or forearm.
Can't be equipped if the upper arm is amputated.",
+ Recipe_Tooltip_Metal_hook = "Make a prosthesic metal hook.
Can be used on an amputated hand or forearm.
Can't be equipped if the upper arm is amputated.",
+ Recipe_Tooltip_Metal_hand = "Make a prosthesic metal hand.
Can be used on an amputated hand or forearm.
Can't be equipped if the upper arm is amputated.",
- Recipe_Tooltip_Real_surgeon_kit = "Make a real surgeon kit.
Helps healing the severed limb, reducing a lot of the time necessary to cicatrize."
- Recipe_Tooltip_Surgeon_kit = "Make a surgeon kit.
Helps healing the severed limb, reducing some of the time necessary to cicatrize."
+ Recipe_Tooltip_Real_surgeon_kit = "Make a real surgeon kit.
Helps healing the severed limb, reducing a lot of the time necessary to cicatrize.",
+ Recipe_Tooltip_Surgeon_kit = "Make a surgeon kit.
Helps healing the severed limb, reducing some of the time necessary to cicatrize.",
Recipe_Tooltip_Improvised_surgeon_kit = "Make an improvised surgeon kit.
Helps healing the severed limb, reducing a little the time necessary to cicatrize."
- Tooltip_SurgeonMag1 = "Learn how to make an improvised surgeon kit!"
- Tooltip_SurgeonMag2 = "Learn how to make a surgeon kit!"
- Tooltip_SurgeonMag3 = "Learn how to make a real surgeon kit!"
+ Tooltip_SurgeonMag1 = "Learn how to make an improvised surgeon kit!",
+ Tooltip_SurgeonMag2 = "Learn how to make a surgeon kit!",
+ Tooltip_SurgeonMag3 = "Learn how to make a real surgeon kit!",
- Tooltip_ProthesisMag1 = "Learn how to make a wooden hook!"
- Tooltip_ProthesisMag2 = "Learn how to make a metal hook!"
- Tooltip_ProthesisMag3 = "Learn how to make a metal hand!"
+ Tooltip_ProthesisMag1 = "Learn how to make a wooden hook!",
+ Tooltip_ProthesisMag2 = "Learn how to make a metal hook!",
+ Tooltip_ProthesisMag3 = "Learn how to make a metal hand!",
diff --git a/media/scripts/TOC_items.txt b/media/scripts/TOC_items.txt
index 48072ab..45b11f5 100644
--- a/media/scripts/TOC_items.txt
+++ b/media/scripts/TOC_items.txt
@@ -161,7 +161,6 @@ imports
BloodLocation = Hands,
Icon = woodenHook,
Tooltip = Tooltip_equip_prothesis_hand,
- WaterResistance = 15,
CanHaveHoles = false,
}
@@ -208,7 +207,6 @@ imports
BloodLocation = Hands,
Icon = metalHook,
Tooltip = Tooltip_equip_prothesis_hand,
- WaterResistance = 13,
CanHaveHoles = false,
}
@@ -223,7 +221,6 @@ imports
BloodLocation = Hands,
Icon = metalHand,
Tooltip = Tooltip_equip_prothesis_hand,
- WaterResistance = 11,
CanHaveHoles = false,
}
@@ -238,7 +235,6 @@ imports
BloodLocation = Hands,
Icon = metalHand,
Tooltip = Tooltip_equip_prothesis_hand",
- WaterResistance = 11,
CanHaveHoles = false,
}
@@ -253,7 +249,6 @@ imports
BloodLocation = LowerArms;Hands,
Icon = woodenHook,
Tooltip = Tooltip_equip_prothesis_fore,
- WaterResistance = 16,
CanHaveHoles = false,
}
@@ -266,10 +261,8 @@ imports
ClothingItem = Prost_Left_LowerArm_WoodenHook,
BodyLocation = TOC_ArmLeftProsthesis,
BloodLocation = LowerArms;Hands,
-
Icon = woodenHook,
Tooltip = Tooltip_equip_prothesis_fore,
- WaterResistance = 16,
CanHaveHoles = false,
}
@@ -284,7 +277,6 @@ imports
BloodLocation = LowerArms;Hands,
Icon = metalHook,
Tooltip = Tooltip_equip_prothesis_fore,
- WaterResistance = 14,
CanHaveHoles = false,
}
@@ -300,7 +292,6 @@ imports
Icon = metalHook,
Tooltip = Tooltip_equip_prothesis_fore,
- WaterResistance = 14,
CanHaveHoles = false,
}
@@ -315,7 +306,6 @@ imports
BloodLocation = LowerArms;Hands,
Icon = metalHand,
Tooltip = Tooltip_equip_prothesis_fore,
- WaterResistance = 12,
CanHaveHoles = false,
}
@@ -330,7 +320,6 @@ imports
BloodLocation = LowerArms;Hands,
Icon = metalHand,
Tooltip = Tooltip_equip_prothesis_fore,
- WaterResistance = 12,
CanHaveHoles = false,
}