I think I got almost everything. Now to check it
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
function GetBodyParts()
|
function GetBodyParts()
|
||||||
local bodyparts = { "RightHand", "RightForearm", "RightArm", "LeftHand", "LeftForearm", "LeftArm"}
|
local bodyparts = { "Right_Hand", "Right_LowerArm", "Right_UpperArm",
|
||||||
|
"Left_Hand", "Left_LowerArm", "Left_UpperArm"}
|
||||||
return bodyparts
|
return bodyparts
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -18,25 +19,35 @@ function GetOtherBodyPartTypes()
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function FindTocDataPartNameFromBodyPartType(toc_data, bodyPartType)
|
function GetAcceptingProsthesisBodyPartTypes()
|
||||||
if bodyPartType == BodyPartType.Hand_R then return toc_data.RightHand
|
|
||||||
elseif bodyPartType == BodyPartType.ForeArm_R then return toc_data.RightForearm
|
|
||||||
elseif bodyPartType == BodyPartType.UpperArm_R then return toc_data.RightArm
|
return {BodyPartType.Hand_R, BodyPartType.ForeArm_R,
|
||||||
elseif bodyPartType == BodyPartType.Hand_L then return toc_data.LeftHand
|
BodyPartType.Hand_L, BodyPartType.ForeArm_L}
|
||||||
elseif bodyPartType == BodyPartType.ForeArm_L then return toc_data.LeftForearm
|
|
||||||
elseif bodyPartType == BodyPartType.UpperArm_L then return toc_data.LeftArm
|
|
||||||
|
end
|
||||||
|
|
||||||
|
-- TODO Change name
|
||||||
|
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
|
else return nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function FindTocBodyPartNameFromBodyPartType(bodyPartType)
|
function FindTocBodyPartNameFromBodyPartType(bodyPartType)
|
||||||
if bodyPartType == BodyPartType.Hand_R then return "RightHand"
|
if bodyPartType == BodyPartType.Hand_R then return "Right_Hand"
|
||||||
elseif bodyPartType == BodyPartType.ForeArm_R then return "RightForearm"
|
elseif bodyPartType == BodyPartType.ForeArm_R then return "Right_LowerArm"
|
||||||
elseif bodyPartType == BodyPartType.UpperArm_R then return "RightArm"
|
elseif bodyPartType == BodyPartType.UpperArm_R then return "Right_UpperArm"
|
||||||
elseif bodyPartType == BodyPartType.Hand_L then return "LeftHand"
|
elseif bodyPartType == BodyPartType.Hand_L then return "Left_Hand"
|
||||||
elseif bodyPartType == BodyPartType.ForeArm_L then return "LeftForearm"
|
elseif bodyPartType == BodyPartType.ForeArm_L then return "Left_LowerArm"
|
||||||
elseif bodyPartType == BodyPartType.UpperArm_L then return "LeftArm"
|
elseif bodyPartType == BodyPartType.UpperArm_L then return "Left_UpperArm"
|
||||||
else return nil
|
else return nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -4,121 +4,131 @@ function TestStuffToc()
|
|||||||
|
|
||||||
local mod_data = player:getModData().TOC
|
local mod_data = player:getModData().TOC
|
||||||
|
|
||||||
mod_data.TOC = {}
|
|
||||||
|
|
||||||
mod_data.TOC = {
|
if mod_data.TOC == nil then
|
||||||
|
mod_data.TOC = {}
|
||||||
|
|
||||||
Limbs = {},
|
mod_data.TOC = {
|
||||||
Prosthesis = {},
|
|
||||||
Generic = {},
|
Limbs = {},
|
||||||
}
|
Prosthesis = {},
|
||||||
|
Generic = {},
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
--------
|
--------
|
||||||
-- NEW NAMING SCHEME
|
-- NEW NAMING SCHEME
|
||||||
|
|
||||||
---- Amputations
|
---- Amputations
|
||||||
|
|
||||||
-- Amputation_Left_Hand
|
-- Amputation_Left_Hand
|
||||||
-- Amputation_Right_UpperArm
|
-- Amputation_Right_UpperArm
|
||||||
|
|
||||||
|
|
||||||
---- Prosthesis to equip
|
---- Prosthesis to equip
|
||||||
-- Prost_Left_Hand_MetalHook
|
-- Prost_Left_Hand_MetalHook
|
||||||
-- Prost_Right_Forearm_WoodenHook
|
-- Prost_Right_Forearm_WoodenHook
|
||||||
|
|
||||||
--- Objects
|
--- Objects
|
||||||
-- Prost_Object_WoddenHook
|
-- Prost_Object_WoddenHook
|
||||||
|
|
||||||
|
|
||||||
local sides = {"Left", "Right"}
|
local sides = {"Left", "Right"}
|
||||||
local limbs = {"Hand", "LowerArm", "UpperArm"} -- Let's follow their naming
|
local limbs = {"Hand", "LowerArm", "UpperArm"} -- Let's follow their naming
|
||||||
|
|
||||||
|
|
||||||
local prosthesis_list = {"WoodenHook", "MetalHook", "MetalHand"}
|
local prosthesis_list = {"WoodenHook", "MetalHook", "MetalHand"}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
local accepted_prosthesis_hand = {"WoodenHook", "MetalHook", "MetalHand"}
|
local accepted_prosthesis_hand = {"WoodenHook", "MetalHook", "MetalHand"}
|
||||||
local accepted_prosthesis_lowerarm = {"WoodenHook", "MetalHook", "MetalHand"}
|
local accepted_prosthesis_lowerarm = {"WoodenHook", "MetalHook", "MetalHand"}
|
||||||
local accepted_prosthesis_upperarm = {} -- For future stuff
|
local accepted_prosthesis_upperarm = {} -- For future stuff
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
for _, side in ipairs(sides) do
|
for _, side in ipairs(sides) do
|
||||||
for _, limb in ipairs(limbs) do
|
for _, limb in ipairs(limbs) do
|
||||||
|
|
||||||
local part_name = side .. "_" .. limb
|
local part_name = side .. "_" .. limb
|
||||||
|
|
||||||
mod_data.TOC.Limbs[part_name].is_cut = false
|
mod_data.TOC.Limbs[part_name].is_cut = false
|
||||||
mod_data.TOC.Limbs[part_name].is_infected = false
|
mod_data.TOC.Limbs[part_name].is_infected = false
|
||||||
mod_data.TOC.Limbs[part_name].is_operated = false
|
mod_data.TOC.Limbs[part_name].is_operated = false
|
||||||
mod_data.TOC.Limbs[part_name].is_cicatrized = false
|
mod_data.TOC.Limbs[part_name].is_cicatrized = false
|
||||||
mod_data.TOC.Limbs[part_name].is_cauterized = false
|
mod_data.TOC.Limbs[part_name].is_cauterized = false
|
||||||
mod_data.TOC.Limbs[part_name].is_amputation_shown = false
|
mod_data.TOC.Limbs[part_name].is_amputation_shown = false
|
||||||
|
|
||||||
mod_data.TOC.Limbs[part_name].cicatrization_time = 0
|
mod_data.TOC.Limbs[part_name].cicatrization_time = 0
|
||||||
|
|
||||||
|
|
||||||
mod_data.TOC.Limbs[part_name].is_prosthesis_equipped = false
|
mod_data.TOC.Limbs[part_name].is_prosthesis_equipped = false
|
||||||
mod_data.TOC.Limbs[part_name].prosthesis_factor = 1.0
|
mod_data.TOC.Limbs[part_name].prosthesis_factor = 1.0
|
||||||
mod_data.TOC.Limbs[part_name].prosthesis_material_id = nil
|
mod_data.TOC.Limbs[part_name].prosthesis_material_id = nil
|
||||||
|
|
||||||
|
|
||||||
-- Even if there are some duplicates, this is just easier in the end since we're gonna get fairly easily part_name
|
-- Even if there are some duplicates, this is just easier in the end since we're gonna get fairly easily part_name
|
||||||
if limb == "Hand" then
|
|
||||||
mod_data.TOC.Limbs[part_name].cicatrization_base_time = 1700
|
|
||||||
mod_data.TOC.Limbs[part_name].depends_on = {}
|
if limb == "Hand" then
|
||||||
mod_data.TOC.Prosthesis.AcceptedProsthesis[part_name] = accepted_prosthesis_hand
|
mod_data.TOC.Limbs[part_name].cicatrization_base_time = 1700
|
||||||
elseif limb == "LowerArm" then
|
mod_data.TOC.Limbs[part_name].depends_on = {}
|
||||||
mod_data.TOC.Limbs[part_name].cicatrization_base_time = 1800
|
|
||||||
mod_data.TOC.Limbs[part_name].depends_on = {side .. "_Hand",}
|
mod_data.TOC.Prosthesis.AcceptedProsthesis[part_name] = accepted_prosthesis_hand
|
||||||
mod_data.TOC.Prosthesis.AcceptedProsthesis[part_name] = accepted_prosthesis_lowerarm
|
mod_data.TOC.Prosthesis["WoodenHook"][part_name].prosthesis_factor = 1.5
|
||||||
elseif limb == "UpperArm" then
|
mod_data.TOC.Prosthesis["MetalHook"][part_name].prosthesis_factor = 1.3
|
||||||
mod_data.TOC.Limbs[part_name].cicatrization_base_time = 2000
|
mod_data.TOC.Prosthesis["MetalHand"][part_name].prosthesis_factor = 1.1
|
||||||
mod_data.TOC.Limbs[part_name].depends_on = {side .. "_Hand", side .. "_LowerArm",}
|
|
||||||
mod_data.TOC.Prosthesis.AcceptedProsthesis[part_name] = accepted_prosthesis_upperarm
|
|
||||||
|
elseif limb == "LowerArm" then
|
||||||
|
mod_data.TOC.Limbs[part_name].cicatrization_base_time = 1800
|
||||||
|
mod_data.TOC.Limbs[part_name].depends_on = {side .. "_Hand",}
|
||||||
|
mod_data.TOC.Prosthesis.AcceptedProsthesis[part_name] = accepted_prosthesis_lowerarm
|
||||||
|
|
||||||
|
mod_data.TOC.Prosthesis["WoodenHook"][part_name].prosthesis_factor = 1.65
|
||||||
|
mod_data.TOC.Prosthesis["MetalHook"][part_name].prosthesis_factor = 1.45
|
||||||
|
mod_data.TOC.Prosthesis["MetalHand"][part_name].prosthesis_factor = 1.25
|
||||||
|
elseif limb == "UpperArm" then
|
||||||
|
mod_data.TOC.Limbs[part_name].cicatrization_base_time = 2000
|
||||||
|
mod_data.TOC.Limbs[part_name].depends_on = {side .. "_Hand", side .. "_LowerArm",}
|
||||||
|
mod_data.TOC.Prosthesis.AcceptedProsthesis[part_name] = accepted_prosthesis_upperarm
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
for _, v in ipairs(prosthesis_list) do
|
-- Setup traits
|
||||||
|
if player:HasTrait("Amputee_Hand") then
|
||||||
|
|
||||||
mod_data.TOC.Prosthesis[v].prosthesis_factor = 1.0 -- Default
|
-- TODO override AddItem so we can change the texture dynamically based on skin color
|
||||||
mod_data.TOC.Limbs[v].prosthesis_material_id = nil -- Set texture?
|
local amputation_clothing = player:getInventory():AddItem("TOC.Amputation_Left_Hand")
|
||||||
|
player:setWornItem(amputation_clothing:getBodyLocation(), amputation_clothing)
|
||||||
-- TODO Something else?
|
mod_data.TOC.Left_Hand.is_cut = true
|
||||||
|
mod_data.TOC.Left_Hand.is_operated = true
|
||||||
|
mod_data.TOC.Left_Hand.is_amputation_shown = true
|
||||||
|
mod_data.TOC.Left_Hand.is_cicatrized = true
|
||||||
|
elseif player:HasTrait("Amputee_LowerArm") then
|
||||||
|
local amputation_clothing = player:getInventory():AddItem("TOC.Amputation_Left_LowerArm")
|
||||||
|
player:setWornItem(amputation_clothing:getBodyLocation(), amputation_clothing)
|
||||||
|
mod_data.TOC.Left_LowerArm.is_cut = true
|
||||||
|
mod_data.TOC.Left_LowerArm.is_operated = true
|
||||||
|
mod_data.TOC.Left_LowerArm.is_amputation_shown = true
|
||||||
|
mod_data.TOC.Left_LowerArm.is_cicatrized = true
|
||||||
|
elseif player:HasTrait("Amputee_UpperArm") then
|
||||||
|
local amputation_clothing = player:getInventory():AddItem("TOC.Amputation_Left_UpperArm")
|
||||||
|
player:setWornItem(amputation_clothing:getBodyLocation(), amputation_clothing)
|
||||||
|
mod_data.TOC.Left_UpperArm.is_cut = true
|
||||||
|
mod_data.TOC.Left_UpperArm.is_operated = true
|
||||||
|
mod_data.TOC.Left_UpperArm.is_amputation_shown = true
|
||||||
|
mod_data.TOC.Left_UpperArm.is_cicatrized = true
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Setup traits
|
|
||||||
if player:HasTrait("Amputee_Hand") then
|
|
||||||
local amputation_clothing = player:getInventory():AddItem("TOC.Amputation_Left_Hand")
|
|
||||||
player:setWornItem(amputation_clothing:getBodyLocation(), amputation_clothing)
|
|
||||||
mod_data.TOC.Left_Hand.is_cut = true
|
|
||||||
mod_data.TOC.Left_Hand.is_operated = true
|
|
||||||
mod_data.TOC.Left_Hand.is_amputation_shown = true
|
|
||||||
mod_data.TOC.Left_Hand.is_cicatrized = true
|
|
||||||
elseif player:HasTrait("Amputee_LowerArm") then
|
|
||||||
local amputation_clothing = player:getInventory():AddItem("TOC.Amputation_Left_LowerArm")
|
|
||||||
player:setWornItem(amputation_clothing:getBodyLocation(), amputation_clothing)
|
|
||||||
mod_data.TOC.Left_LowerArm.is_cut = true
|
|
||||||
mod_data.TOC.Left_LowerArm.is_operated = true
|
|
||||||
mod_data.TOC.Left_LowerArm.is_amputation_shown = true
|
|
||||||
mod_data.TOC.Left_LowerArm.is_cicatrized = true
|
|
||||||
elseif player:HasTrait("Amputee_UpperArm") then
|
|
||||||
local amputation_clothing = player:getInventory():AddItem("TOC.Amputation_Left_UpperArm")
|
|
||||||
player:setWornItem(amputation_clothing:getBodyLocation(), amputation_clothing)
|
|
||||||
mod_data.TOC.Left_UpperArm.is_cut = true
|
|
||||||
mod_data.TOC.Left_UpperArm.is_operated = true
|
|
||||||
mod_data.TOC.Left_UpperArm.is_amputation_shown = true
|
|
||||||
mod_data.TOC.Left_UpperArm.is_cicatrized = true
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -36,11 +36,11 @@ end
|
|||||||
------------------------------
|
------------------------------
|
||||||
-- UI Visible stuff functions
|
-- UI Visible stuff functions
|
||||||
local function GetImageName(part_name, toc_data)
|
local function GetImageName(part_name, toc_data)
|
||||||
local part_data = toc_data[part_name];
|
local part_data = toc_data.Limbs[part_name]
|
||||||
local name = ""
|
local name = ""
|
||||||
|
|
||||||
if part_data.is_cut and part_data.is_cicatrized and part_data.is_prosthesis_equipped then -- Cut and equip
|
if part_data.is_cut and part_data.is_cicatrized and part_data.is_prosthesis_equipped then -- Cut and equip
|
||||||
if part_name == "RightHand" or part_name == "LeftHand" then
|
if part_name == "Right_Hand" or part_name == "Left_Hand" then
|
||||||
name = "media/ui/TOC/" .. part_name .. "/Hook.png"
|
name = "media/ui/TOC/" .. part_name .. "/Hook.png"
|
||||||
else
|
else
|
||||||
name = "media/ui/TOC/" .. part_name .. "/Prothesis.png"
|
name = "media/ui/TOC/" .. part_name .. "/Prothesis.png"
|
||||||
@@ -60,12 +60,12 @@ local function GetImageName(part_name, toc_data)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- If foreaerm equip, change hand
|
-- If foreaerm equip, change hand
|
||||||
if part_name == "RightHand" and toc_data["RightForearm"].is_prosthesis_equipped then
|
if part_name == "Right_Hand" and toc_data["Right_LowerArm"].is_prosthesis_equipped then
|
||||||
name = "media/ui/TOC/" .. part_name .. "/Hook.png"
|
name = "media/ui/TOC/" .. part_name .. "/Hook.png"
|
||||||
elseif part_name == "LeftHand" and toc_data["LeftForearm"].is_prosthesis_equipped then
|
elseif part_name == "Left_Hand" and toc_data["Left_LowerArm"].is_prosthesis_equipped then
|
||||||
name = "media/ui/TOC/" .. part_name .. "/Hook.png"
|
name = "media/ui/TOC/" .. part_name .. "/Hook.png"
|
||||||
end
|
end
|
||||||
return name;
|
return name
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@@ -221,28 +221,28 @@ function CreateTocMainUI()
|
|||||||
main_ui:setWidthPercent(0.1)
|
main_ui:setWidthPercent(0.1)
|
||||||
|
|
||||||
main_ui:addImageButton("b11", "", OnClickTocMainUI)
|
main_ui:addImageButton("b11", "", OnClickTocMainUI)
|
||||||
main_ui["b11"]:addArg("part_name", "RightArm")
|
main_ui["b11"]:addArg("part_name", "Right_UpperArm")
|
||||||
|
|
||||||
|
|
||||||
main_ui:addImageButton("b12", "", OnClickTocMainUI)
|
main_ui:addImageButton("b12", "", OnClickTocMainUI)
|
||||||
main_ui["b12"]:addArg("part_name", "LeftArm")
|
main_ui["b12"]:addArg("part_name", "Left_UpperArm")
|
||||||
|
|
||||||
main_ui:nextLine()
|
main_ui:nextLine()
|
||||||
|
|
||||||
main_ui:addImageButton("b21", "", OnClickTocMainUI)
|
main_ui:addImageButton("b21", "", OnClickTocMainUI)
|
||||||
main_ui["b21"]:addArg("part_name", "RightForearm")
|
main_ui["b21"]:addArg("part_name", "Right_LowerArm")
|
||||||
|
|
||||||
|
|
||||||
main_ui:addImageButton("b22", "", OnClickTocMainUI)
|
main_ui:addImageButton("b22", "", OnClickTocMainUI)
|
||||||
main_ui["b22"]:addArg("part_name", "LeftForearm")
|
main_ui["b22"]:addArg("part_name", "Left_LowerArm")
|
||||||
|
|
||||||
main_ui:nextLine()
|
main_ui:nextLine()
|
||||||
|
|
||||||
main_ui:addImageButton("b31", "", OnClickTocMainUI)
|
main_ui:addImageButton("b31", "", OnClickTocMainUI)
|
||||||
main_ui["b31"]:addArg("part_name", "RightHand")
|
main_ui["b31"]:addArg("part_name", "Right_Hand")
|
||||||
|
|
||||||
main_ui:addImageButton("b32", "", OnClickTocMainUI)
|
main_ui:addImageButton("b32", "", OnClickTocMainUI)
|
||||||
main_ui["b32"]:addArg("part_name", "LeftHand")
|
main_ui["b32"]:addArg("part_name", "Left_Hand")
|
||||||
|
|
||||||
main_ui:saveLayout()
|
main_ui:saveLayout()
|
||||||
|
|
||||||
@@ -353,14 +353,14 @@ function SetupTocMainUI(surgeon, patient, toc_data)
|
|||||||
main_ui["b31"]:addArg("toc_data", toc_data)
|
main_ui["b31"]:addArg("toc_data", toc_data)
|
||||||
main_ui["b32"]:addArg("toc_data", toc_data)
|
main_ui["b32"]:addArg("toc_data", toc_data)
|
||||||
|
|
||||||
main_ui["b11"]:setPath(GetImageName("RightArm", toc_data))
|
main_ui["b11"]:setPath(GetImageName("Right_UpperArm", toc_data))
|
||||||
main_ui["b12"]:setPath(GetImageName("LeftArm", toc_data))
|
main_ui["b12"]:setPath(GetImageName("Left_UpperArm", toc_data))
|
||||||
|
|
||||||
main_ui["b21"]:setPath(GetImageName("RightForearm", toc_data))
|
main_ui["b21"]:setPath(GetImageName("Right_LowerArm", toc_data))
|
||||||
main_ui["b22"]:setPath(GetImageName("LeftForearm", toc_data))
|
main_ui["b22"]:setPath(GetImageName("Left_LowerArm", toc_data))
|
||||||
|
|
||||||
main_ui["b31"]:setPath(GetImageName("RightHand", toc_data))
|
main_ui["b31"]:setPath(GetImageName("Right_Hand", toc_data))
|
||||||
main_ui["b32"]:setPath(GetImageName("LeftHand", toc_data))
|
main_ui["b32"]:setPath(GetImageName("Left_Hand", toc_data))
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -368,7 +368,7 @@ function SetupTocMainUI(surgeon, patient, toc_data)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function SetupTocDescUI(surgeon, patient, toc_data, part_name)
|
function SetupTocDescUI(surgeon, patient, toc_data, part_name)
|
||||||
local part_data = toc_data[part_name]
|
local part_data = toc_data.Limbs[part_name]
|
||||||
desc_ui["textTitle"]:setText(TocGetDisplayText(part_name))
|
desc_ui["textTitle"]:setText(TocGetDisplayText(part_name))
|
||||||
desc_ui.part_name = part_name
|
desc_ui.part_name = part_name
|
||||||
desc_ui.surgeon = surgeon
|
desc_ui.surgeon = surgeon
|
||||||
@@ -387,7 +387,7 @@ function SetupTocDescUI(surgeon, patient, toc_data, part_name)
|
|||||||
desc_ui["status"]:setColor(1, 0, 1, 0)
|
desc_ui["status"]:setColor(1, 0, 1, 0)
|
||||||
|
|
||||||
-- Another check for UpperArm
|
-- Another check for UpperArm
|
||||||
if part_name == "RightArm" or part_name == "LeftArm" then
|
if part_name == "Right_UpperArm" or part_name == "Left_UpperArm" then
|
||||||
desc_ui["b1"]:setVisible(false)
|
desc_ui["b1"]:setVisible(false)
|
||||||
else
|
else
|
||||||
desc_ui["b1"]:setText("Equip")
|
desc_ui["b1"]:setText("Equip")
|
||||||
@@ -458,18 +458,18 @@ function SetupTocDescUI(surgeon, patient, toc_data, part_name)
|
|||||||
|
|
||||||
-- Prosthesis Level
|
-- Prosthesis Level
|
||||||
if string.find(part_name, "Right") then
|
if string.find(part_name, "Right") then
|
||||||
local lv = patient:getPerkLevel(Perks.RightHand) + 1
|
local lv = patient:getPerkLevel(Perks.Right_Hand) + 1
|
||||||
desc_ui["textLV2"]:setText("Level: " .. lv .. " / 10")
|
desc_ui["textLV2"]:setText("Level: " .. lv .. " / 10")
|
||||||
|
|
||||||
local xp = patient:getXp():getXP(Perks.RightHand)
|
local xp = patient:getXp():getXP(Perks.Right_Hand)
|
||||||
local min, max = FindMinMax(lv)
|
local min, max = FindMinMax(lv)
|
||||||
desc_ui["pbarNLV"]:setMinMax(min, max)
|
desc_ui["pbarNLV"]:setMinMax(min, max)
|
||||||
desc_ui["pbarNLV"]:setValue(xp)
|
desc_ui["pbarNLV"]:setValue(xp)
|
||||||
else
|
else
|
||||||
local lv = patient:getPerkLevel(Perks.LeftHand) + 1
|
local lv = patient:getPerkLevel(Perks.Left_Hand) + 1
|
||||||
desc_ui["textLV2"]:setText("Level: " .. lv .. " / 10")
|
desc_ui["textLV2"]:setText("Level: " .. lv .. " / 10")
|
||||||
|
|
||||||
local xp = patient:getXp():getXP(Perks.LeftHand)
|
local xp = patient:getXp():getXP(Perks.Left_Hand)
|
||||||
local min, max = FindMinMax(lv)
|
local min, max = FindMinMax(lv)
|
||||||
desc_ui["pbarNLV"]:setMinMax(min, max)
|
desc_ui["pbarNLV"]:setMinMax(min, max)
|
||||||
desc_ui["pbarNLV"]:setValue(xp)
|
desc_ui["pbarNLV"]:setValue(xp)
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ function TheOnlyCure.CheckIfPlayerIsInfected(player, toc_data)
|
|||||||
local body_damage = player:getBodyDamage()
|
local body_damage = player:getBodyDamage()
|
||||||
|
|
||||||
for _, v in ipairs(GetLimbsBodyPartTypes()) do
|
for _, v in ipairs(GetLimbsBodyPartTypes()) do
|
||||||
local toc_bodypart = FindTocDataPartNameFromBodyPartType(toc_data, v)
|
local toc_bodypart = FindTocDataPartNameFromBodyPartType(toc_data.Limbs, v)
|
||||||
if body_damage:getBodyPart(v):bitten() and toc_bodypart ~= nil then
|
if body_damage:getBodyPart(v):bitten() and toc_bodypart ~= nil then
|
||||||
if toc_bodypart.is_cut == false then
|
if toc_bodypart.is_cut == false then
|
||||||
toc_bodypart.is_infected = true
|
toc_bodypart.is_infected = true
|
||||||
@@ -212,17 +212,21 @@ function TheOnlyCure.UpdateEveryTenMinutes()
|
|||||||
if player == nil then
|
if player == nil then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
local toc_data = player:getModData().TOC
|
local part_data = player:getModData().TOC.Limbs
|
||||||
|
|
||||||
|
|
||||||
--Experience for prosthesis
|
--Experience for prosthesis user
|
||||||
if toc_data.RightHand.is_prosthesis_equipped or toc_data.RightForearm.is_prosthesis_equipped then player:getXp():AddXP(Perks.RightHand, 4) end
|
for _, side in ipairs({"Left", "Right"}) do
|
||||||
if toc_data.LeftHand.is_prosthesis_equipped or toc_data.LeftForearm.is_prosthesis_equipped then player:getXp():AddXP(Perks.LeftHand, 4) end
|
if part_data[side .. "_Hand"].is_prosthesis_equipped or part_data[side .. "_LowerArm"].is_prosthesis_equipped then
|
||||||
|
player:getXp():AddXP(Perks[side .. "_Hand"], 4)
|
||||||
|
end
|
||||||
|
|
||||||
-- Updates the cicatrization timesssss
|
end
|
||||||
|
|
||||||
|
-- Updates the cicatrization time
|
||||||
for _, part_name in pairs(GetBodyParts()) do
|
for _, part_name in pairs(GetBodyParts()) do
|
||||||
if toc_data[part_name].is_cut and not toc_data[part_name].is_cicatrized then
|
if part_data[part_name].is_cut and not part_data[part_name].is_cicatrized then
|
||||||
toc_data[part_name].cicatrization_time = toc_data[part_name].cicatrization_time - 1 -- TODO Make it more "dynamic"
|
part_data[part_name].cicatrization_time = part_data[part_name].cicatrization_time - 1 -- TODO Make it more "dynamic"
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -14,124 +14,142 @@ Arm = "Arm"
|
|||||||
function TheOnlyCure.InitTheOnlyCure(_, player)
|
function TheOnlyCure.InitTheOnlyCure(_, player)
|
||||||
|
|
||||||
local mod_data = player:getModData()
|
local mod_data = player:getModData()
|
||||||
--local toc_data = player:getModData().TOC
|
|
||||||
|
|
||||||
if mod_data.TOC == nil then
|
if mod_data.TOC == nil then
|
||||||
|
|
||||||
mod_data.TOC = {}
|
mod_data.TOC = {}
|
||||||
print("CREATING NEW TOC STUF")
|
|
||||||
|
|
||||||
local rightHand = "RightHand"
|
|
||||||
local rightForearm = "RightForearm"
|
|
||||||
local rightArm = "RightArm"
|
|
||||||
|
|
||||||
local leftHand = "LeftHand"
|
|
||||||
local leftForearm = "LeftForearm"
|
|
||||||
local leftArm = "LeftArm"
|
|
||||||
|
|
||||||
|
|
||||||
local prothesis_list = {"WoodenHook", "MetalHook", "MetalHand"}
|
|
||||||
|
|
||||||
mod_data.TOC = {
|
mod_data.TOC = {
|
||||||
RightHand = {},
|
|
||||||
RightForearm = {},
|
|
||||||
RightArm = {},
|
|
||||||
|
|
||||||
LeftHand = {},
|
Limbs = {},
|
||||||
LeftForearm = {},
|
Prosthesis = {},
|
||||||
LeftArm = {},
|
Generic = {},
|
||||||
|
|
||||||
is_other_bodypart_infected = false
|
|
||||||
}
|
}
|
||||||
|
--------
|
||||||
|
-- NEW NAMING SCHEME
|
||||||
|
|
||||||
for _ ,v in pairs(GetBodyParts()) do
|
---- Amputations
|
||||||
mod_data.TOC[v].is_cut = false
|
|
||||||
mod_data.TOC[v].is_infected = false
|
|
||||||
mod_data.TOC[v].is_operated = false
|
|
||||||
mod_data.TOC[v].is_cicatrized = false
|
|
||||||
mod_data.TOC[v].is_cauterized = false
|
|
||||||
mod_data.TOC[v].is_amputation_shown = false
|
|
||||||
|
|
||||||
mod_data.TOC[v].cicatrization_time = 0
|
-- Amputation_Left_Hand
|
||||||
|
-- Amputation_Right_UpperArm
|
||||||
|
|
||||||
|
|
||||||
mod_data.TOC[v].is_prosthesis_equipped = false
|
---- Prosthesis to equip
|
||||||
mod_data.TOC[v].prosthesis_factor = 1.0
|
-- Prost_Left_Hand_MetalHook
|
||||||
mod_data.TOC[v].prosthesis_material_id = nil
|
-- Prost_Right_Forearm_WoodenHook
|
||||||
|
|
||||||
|
--- Objects
|
||||||
|
-- Prost_Object_WoddenHook
|
||||||
|
|
||||||
|
|
||||||
|
local sides = {"Left", "Right"}
|
||||||
|
local limbs = {"Hand", "LowerArm", "UpperArm"} -- Let's follow their naming
|
||||||
|
|
||||||
|
|
||||||
|
local prosthesis_list = {"WoodenHook", "MetalHook", "MetalHand"}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
local accepted_prosthesis_hand = {"WoodenHook", "MetalHook", "MetalHand"}
|
||||||
|
local accepted_prosthesis_lowerarm = {"WoodenHook", "MetalHook", "MetalHand"}
|
||||||
|
local accepted_prosthesis_upperarm = {} -- For future stuff
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
for _, side in ipairs(sides) do
|
||||||
|
for _, limb in ipairs(limbs) do
|
||||||
|
|
||||||
|
local part_name = side .. "_" .. limb
|
||||||
|
|
||||||
|
mod_data.TOC.Limbs[part_name].is_cut = false
|
||||||
|
mod_data.TOC.Limbs[part_name].is_infected = false
|
||||||
|
mod_data.TOC.Limbs[part_name].is_operated = false
|
||||||
|
mod_data.TOC.Limbs[part_name].is_cicatrized = false
|
||||||
|
mod_data.TOC.Limbs[part_name].is_cauterized = false
|
||||||
|
mod_data.TOC.Limbs[part_name].is_amputation_shown = false
|
||||||
|
|
||||||
|
mod_data.TOC.Limbs[part_name].cicatrization_time = 0
|
||||||
|
|
||||||
|
|
||||||
|
mod_data.TOC.Limbs[part_name].is_prosthesis_equipped = false
|
||||||
|
mod_data.TOC.Limbs[part_name].equipped_prosthesis = {}
|
||||||
|
|
||||||
|
-- Even if there are some duplicates, this is just easier in the end since we're gonna get fairly easily part_name
|
||||||
|
|
||||||
|
|
||||||
|
if limb == "Hand" then
|
||||||
|
mod_data.TOC.Limbs[part_name].cicatrization_base_time = 1700
|
||||||
|
mod_data.TOC.Limbs[part_name].depends_on = {}
|
||||||
|
|
||||||
|
|
||||||
|
mod_data.TOC.Prosthesis.AcceptedProsthesis[part_name] = accepted_prosthesis_hand
|
||||||
|
mod_data.TOC.Prosthesis["WoodenHook"][part_name].prosthesis_factor = 1.5
|
||||||
|
mod_data.TOC.Prosthesis["MetalHook"][part_name].prosthesis_factor = 1.3
|
||||||
|
mod_data.TOC.Prosthesis["MetalHand"][part_name].prosthesis_factor = 1.1
|
||||||
|
|
||||||
|
|
||||||
|
elseif limb == "LowerArm" then
|
||||||
|
mod_data.TOC.Limbs[part_name].cicatrization_base_time = 1800
|
||||||
|
mod_data.TOC.Limbs[part_name].depends_on = {side .. "_Hand",}
|
||||||
|
mod_data.TOC.Prosthesis.AcceptedProsthesis[part_name] = accepted_prosthesis_lowerarm
|
||||||
|
|
||||||
|
mod_data.TOC.Prosthesis["WoodenHook"][part_name].prosthesis_factor = 1.65
|
||||||
|
mod_data.TOC.Prosthesis["MetalHook"][part_name].prosthesis_factor = 1.45
|
||||||
|
mod_data.TOC.Prosthesis["MetalHand"][part_name].prosthesis_factor = 1.25
|
||||||
|
elseif limb == "UpperArm" then
|
||||||
|
mod_data.TOC.Limbs[part_name].cicatrization_base_time = 2000
|
||||||
|
mod_data.TOC.Limbs[part_name].depends_on = {side .. "_Hand", side .. "_LowerArm",}
|
||||||
|
mod_data.TOC.Prosthesis.AcceptedProsthesis[part_name] = accepted_prosthesis_upperarm
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Setup traits
|
||||||
|
if player:HasTrait("Amputee_Hand") then
|
||||||
|
|
||||||
-- Manual stuff, just a temporary fix since this is kinda awful
|
-- TODO override AddItem so we can change the texture dynamically based on skin color
|
||||||
mod_data.TOC[rightHand].depends_on = {}
|
local amputation_clothing = player:getInventory():AddItem("TOC.Amputation_Left_Hand")
|
||||||
mod_data.TOC[rightForearm].depends_on = {rightHand}
|
player:setWornItem(amputation_clothing:getBodyLocation(), amputation_clothing)
|
||||||
mod_data.TOC[rightArm].depends_on = { rightHand, rightForearm }
|
mod_data.TOC.Left_Hand.is_cut = true
|
||||||
|
mod_data.TOC.Left_Hand.is_operated = true
|
||||||
mod_data.TOC[leftHand].depends_on = {}
|
mod_data.TOC.Left_Hand.is_amputation_shown = true
|
||||||
mod_data.TOC[leftForearm].depends_on = { leftHand }
|
mod_data.TOC.Left_Hand.is_cicatrized = true
|
||||||
mod_data.TOC[leftArm].depends_on = { leftHand, leftForearm }
|
elseif player:HasTrait("Amputee_LowerArm") then
|
||||||
|
local amputation_clothing = player:getInventory():AddItem("TOC.Amputation_Left_LowerArm")
|
||||||
|
player:setWornItem(amputation_clothing:getBodyLocation(), amputation_clothing)
|
||||||
-- Setup cicatrization times
|
mod_data.TOC.Left_LowerArm.is_cut = true
|
||||||
mod_data.TOC[rightHand].cicatrization_base_time = 1700
|
mod_data.TOC.Left_LowerArm.is_operated = true
|
||||||
mod_data.TOC[leftHand].cicatrization_base_time = 1700
|
mod_data.TOC.Left_LowerArm.is_amputation_shown = true
|
||||||
mod_data.TOC[rightForearm].cicatrization_base_time = 1800
|
mod_data.TOC.Left_LowerArm.is_cicatrized = true
|
||||||
mod_data.TOC[leftForearm].cicatrization_base_time = 1800
|
elseif player:HasTrait("Amputee_UpperArm") then
|
||||||
mod_data.TOC[rightArm].cicatrization_base_time = 2000
|
local amputation_clothing = player:getInventory():AddItem("TOC.Amputation_Left_UpperArm")
|
||||||
mod_data.TOC[leftArm].cicatrization_base_time = 2000
|
player:setWornItem(amputation_clothing:getBodyLocation(), amputation_clothing)
|
||||||
|
mod_data.TOC.Left_UpperArm.is_cut = true
|
||||||
|
mod_data.TOC.Left_UpperArm.is_operated = true
|
||||||
|
mod_data.TOC.Left_UpperArm.is_amputation_shown = true
|
||||||
-- Setup a table with all the acceptable prosthesis
|
mod_data.TOC.Left_UpperArm.is_cicatrized = true
|
||||||
mod_data.TOC.prosthesis_table = {}
|
|
||||||
|
|
||||||
for _, v in ipairs(prothesis_list) do
|
|
||||||
mod_data.TOC.prosthesis_table[v] = {
|
|
||||||
material_id = 1,
|
|
||||||
something = "Something"
|
|
||||||
}
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- Traits setup
|
|
||||||
if player:HasTrait("amputee1") then
|
|
||||||
local cloth = player:getInventory():AddItem("TOC.ArmLeft_noHand")
|
|
||||||
player:setWornItem(cloth:getBodyLocation(), cloth)
|
|
||||||
mod_data.TOC.LeftHand.is_cut=true; mod_data.TOC.LeftHand.is_operated=true; mod_data.TOC.LeftHand.is_amputation_shown=true; mod_data.TOC.LeftHand.is_cicatrized=true
|
|
||||||
player:getInventory():AddItem("TOC.MetalHook")
|
|
||||||
end
|
|
||||||
if player:HasTrait("amputee2") then
|
|
||||||
local cloth = player:getInventory():AddItem("TOC.ArmLeft_noForearm")
|
|
||||||
player:setWornItem(cloth:getBodyLocation(), cloth)
|
|
||||||
mod_data.TOC.LeftHand.is_cut=true; mod_data.TOC.LeftHand.is_operated=true
|
|
||||||
mod_data.TOC.LeftForearm.is_cut=true; mod_data.TOC.LeftForearm.is_operated=true; mod_data.TOC.LeftForearm.is_amputation_shown=true; mod_data.TOC.LeftForearm.is_cicatrized=true
|
|
||||||
player:getInventory():AddItem("TOC.MetalHook")
|
|
||||||
end
|
|
||||||
if player:HasTrait("amputee3") then
|
|
||||||
local cloth = player:getInventory():AddItem("TOC.ArmLeft_noArm")
|
|
||||||
player:setWornItem(cloth:getBodyLocation(), cloth)
|
|
||||||
mod_data.TOC.LeftHand.is_cut=true; mod_data.TOC.LeftHand.is_operated=true
|
|
||||||
mod_data.TOC.LeftForearm.is_cut=true; mod_data.TOC.LeftForearm.is_operated=true
|
|
||||||
mod_data.TOC.LeftArm.is_cut=true; mod_data.TOC.LeftArm.is_operated=true; mod_data.TOC.LeftArm.is_amputation_shown=true; mod_data.TOC.LeftArm.is_cicatrized=true
|
|
||||||
player:getInventory():AddItem("TOC.MetalHook")
|
|
||||||
end
|
|
||||||
|
|
||||||
player:transmitModData()
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function TheOnlyCure.DeclareTraits()
|
function TheOnlyCure.DeclareTraits()
|
||||||
local amp1 = TraitFactory.addTrait("amputee1", getText("UI_trait_Amputee1"), -8, getText("UI_trait_Amputee1desc"), false, false)
|
local amp1 = TraitFactory.addTrait("Amputee_Hand", getText("UI_trait_Amputee_Hand"), -8, getText("UI_trait_Amputee_Hand_desc"), false, false)
|
||||||
amp1:addXPBoost(Perks.LeftHand, 4)
|
amp1:addXPBoost(Perks.Left_Hand, 4)
|
||||||
local amp2 = TraitFactory.addTrait("amputee2", getText("UI_trait_Amputee2"), -10, getText("UI_trait_Amputee2desc"), false, false)
|
|
||||||
amp2:addXPBoost(Perks.LeftHand, 4)
|
local amp2 = TraitFactory.addTrait("Amputee_LowerArm", getText("UI_trait_Amputee_LowerArm"), -10, getText("UI_trait_Amputee_LowerArm_desc"), false, false)
|
||||||
local amp3 = TraitFactory.addTrait("amputee3", getText("UI_trait_Amputee3"), -20, getText("UI_trait_Amputee3desc"), false, false)
|
amp2:addXPBoost(Perks.Left_Hand, 4)
|
||||||
amp3:addXPBoost(Perks.LeftHand, 4)
|
|
||||||
|
local amp3 = TraitFactory.addTrait("Amputee_UpperArm", getText("UI_trait_Amputee_UpperArm"), -20, getText("UI_trait_Amputee_UpperArm_desc"), false, false)
|
||||||
|
amp3:addXPBoost(Perks.Left_Hand, 4)
|
||||||
|
|
||||||
TraitFactory.addTrait("Insensitive", getText("UI_trait_Insensitive"), 6, getText("UI_trait_Insensitivedesc"), false, false)
|
TraitFactory.addTrait("Insensitive", getText("UI_trait_Insensitive"), 6, getText("UI_trait_Insensitivedesc"), false, false)
|
||||||
TraitFactory.setMutualExclusive("amputee1", "amputee2")
|
TraitFactory.setMutualExclusive("Amputee_Hand", "Amputee_LowerArm")
|
||||||
TraitFactory.setMutualExclusive("amputee1", "amputee3")
|
TraitFactory.setMutualExclusive("Amputee_Hand", "Amputee_UpperArm")
|
||||||
TraitFactory.setMutualExclusive("amputee2", "amputee3")
|
TraitFactory.setMutualExclusive("Amputee_LowerArm", "Amputee_UpperArm")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -40,15 +40,15 @@ function ISInstallProsthesis:perform()
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local prosthesis_name =TocFindCorrectClothingProsthesis(self.item:getType(), part_name)
|
local prosthesis_name =TocFindCorrectClothingProsthesis(prosthesis_base_name, part_name)
|
||||||
self.cloth = self.character:getInventory():AddItem(prosthesis_name)
|
self.cloth = self.character:getInventory():AddItem(prosthesis_name)
|
||||||
|
|
||||||
if self.cloth ~= nil then
|
if self.cloth ~= nil then
|
||||||
|
|
||||||
|
|
||||||
if part_name then
|
if part_name then
|
||||||
toc_data[part_name].is_prosthesis_equipped = true -- TODO should we show that the hand has a prost too if it's installed in the forearm?
|
toc_data.Limbs[part_name].is_prosthesis_equipped = true -- TODO should we show that the hand has a prost too if it's installed in the forearm?
|
||||||
toc_data[part_name].prosthesis_factor = TocFindProsthesisFactorFromItem(self.cloth)
|
toc_data.Limbs[part_name].equipped_prosthesis = toc_data.Prosthesis[prosthesis_base_name][part_name]
|
||||||
|
|
||||||
self.character:getInventory():Remove(self.item)
|
self.character:getInventory():Remove(self.item)
|
||||||
self.character:setWornItem(self.cloth:getBodyLocation(), self.cloth)
|
self.character:setWornItem(self.cloth:getBodyLocation(), self.cloth)
|
||||||
|
|||||||
@@ -55,8 +55,8 @@ function ISUninstallProsthesis:perform()
|
|||||||
|
|
||||||
print("Found prost in " .. part_name)
|
print("Found prost in " .. part_name)
|
||||||
if part_name then
|
if part_name then
|
||||||
toc_data[part_name].is_prosthesis_equipped = false
|
toc_data.Limbs[part_name].is_prosthesis_equipped = false
|
||||||
toc_data[part_name].prosthesis_factor = 1
|
--toc_data.Limbs[part_name].prosthesis_factor = 1 -- TODO This is wrong
|
||||||
|
|
||||||
--local side = string.gsub(part_name, "Hand" or "Forearm", "")
|
--local side = string.gsub(part_name, "Hand" or "Forearm", "")
|
||||||
local item_full_type = self.item:getFullType()
|
local item_full_type = self.item:getFullType()
|
||||||
|
|||||||
@@ -22,21 +22,22 @@ function ISBaseTimedAction:adjustMaxTime(maxTime)
|
|||||||
for _, part_name in ipairs(all_body_parts) do
|
for _, part_name in ipairs(all_body_parts) do
|
||||||
|
|
||||||
|
|
||||||
if toc_data[part_name].is_cut then
|
if toc_data.Limbs[part_name].is_cut then
|
||||||
|
|
||||||
|
if toc_data.Limbs[part_name].is_prosthesis_equipped then
|
||||||
|
modified_max_time = modified_max_time * toc_data.Limbs[part_name].equipped_prosthesis.prosthesis_factor
|
||||||
|
|
||||||
if toc_data[part_name].is_prosthesis_equipped then
|
|
||||||
modified_max_time = modified_max_time * toc_data[part_name].prosthesis_factor
|
|
||||||
|
|
||||||
else
|
else
|
||||||
modified_max_time = modified_max_time * 2
|
modified_max_time = modified_max_time * 2
|
||||||
end
|
end
|
||||||
if toc_data[part_name].is_cauterized then
|
if toc_data.Limbs[part_name].is_cauterized then
|
||||||
modified_max_time = modified_max_time * burn_factor
|
modified_max_time = modified_max_time * burn_factor
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
-- Perk scaling
|
-- Perk scaling
|
||||||
if part_name == "RightHand" or part_name == "LeftHand" then
|
if part_name == "Right_Hand" or part_name == "Left_Hand" then
|
||||||
modified_max_time = modified_max_time * (1 + (9 - self.character:getPerkLevel(Perks[part_name])) / 20 )
|
modified_max_time = modified_max_time * (1 + (9 - self.character:getPerkLevel(Perks[part_name])) / 20 )
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,3 @@
|
|||||||
function GetBodyParts()
|
|
||||||
local bodyparts = { "RightHand", "RightForearm", "RightArm", "LeftHand", "LeftForearm", "LeftArm"}
|
|
||||||
return bodyparts
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
-- TODO Find a better name
|
-- TODO Find a better name
|
||||||
function GetProsthesisLisHumanReadable()
|
function GetProsthesisLisHumanReadable()
|
||||||
return {"WoodenHook", "MetalHook", "MetalHand"}
|
return {"WoodenHook", "MetalHook", "MetalHand"}
|
||||||
@@ -21,6 +15,8 @@ end
|
|||||||
|
|
||||||
function GetInstallableProsthesisList()
|
function GetInstallableProsthesisList()
|
||||||
|
|
||||||
|
-- TODO Delete this and re do it
|
||||||
|
|
||||||
|
|
||||||
-- To make it future proof since i'm gonna add stuff, let's cycle through already known prosthesis
|
-- To make it future proof since i'm gonna add stuff, let's cycle through already known prosthesis
|
||||||
local prosthesis_list = GetProsthesisList()
|
local prosthesis_list = GetProsthesisList()
|
||||||
@@ -45,53 +41,17 @@ function GetInstallableProsthesisList()
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function GetLimbsBodyPartTypes()
|
|
||||||
|
|
||||||
return {BodyPartType.Hand_R, BodyPartType.ForeArm_R, BodyPartType.UpperArm_R,
|
|
||||||
BodyPartType.Hand_L, BodyPartType.ForeArm_L, BodyPartType.UpperArm_L}
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
function GetOtherBodyPartTypes()
|
|
||||||
|
|
||||||
return {BodyPartType.Torso_Upper, BodyPartType.Torso_Lower, BodyPartType.Head, BodyPartType.Neck,
|
|
||||||
BodyPartType.Groin, BodyPartType.UpperLeg_L, BodyPartType.UpperLeg_R, BodyPartType.LowerLeg_L,
|
|
||||||
BodyPartType.LowerLeg_R, BodyPartType.Foot_L, BodyPartType.Foot_R, BodyPartType.Back}
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
function GetAcceptingProsthesisBodyPartTypes()
|
|
||||||
|
|
||||||
|
|
||||||
return {BodyPartType.Hand_R, BodyPartType.ForeArm_R,
|
|
||||||
BodyPartType.Hand_L, BodyPartType.ForeArm_L}
|
|
||||||
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
function GetAcceptingProsthesisBodyParts()
|
|
||||||
return {"RightHand", "RightForearm", "LeftHand", "LeftForearm"}
|
|
||||||
end
|
|
||||||
|
|
||||||
function GetNonAcceptingProsthesisBodyParts()
|
|
||||||
return {"RightArm", "LeftArm"}
|
|
||||||
end
|
|
||||||
|
|
||||||
function GetAmputatedLimbFullTypes()
|
|
||||||
|
|
||||||
return {"TOC.ArmRight_noHand", "TOC.ArmRight_noForearm", "TOC.ArmRight_noArm",
|
|
||||||
"TOC.ArmLeft_noHand", "TOC.ArmLeft_noForearm", "TOC.ArmLeft_noArm"}
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
local function PartNameToBodyLocation(name)
|
local function PartNameToBodyLocation(name)
|
||||||
if name == "RightHand" then return "ArmRight_Prot" end
|
if name == "Right_Hand" then return "ArmRight_Prot" end
|
||||||
if name == "RightForearm" then return "ArmRight_Prot" end
|
if name == "Right_LowerArm" then return "ArmRight_Prot" end
|
||||||
if name == "RightArm" then return "ArmRight_Prot" end
|
if name == "Right_UpperArm" then return "ArmRight_Prot" end
|
||||||
if name == "LeftHand" then return "ArmLeft_Prot" end
|
if name == "Left_Hand" then return "ArmLeft_Prot" end
|
||||||
if name == "LeftForearm" then return "ArmLeft_Prot" end
|
if name == "Left_LowerArm" then return "ArmLeft_Prot" end
|
||||||
if name == "LeftArm" then return "ArmLeft_Prot" end
|
if name == "Left_UpperArm" then return "ArmLeft_Prot" end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@@ -111,12 +71,12 @@ end
|
|||||||
|
|
||||||
function TocGetPartNameFromBodyPartType(body_part)
|
function TocGetPartNameFromBodyPartType(body_part)
|
||||||
|
|
||||||
if body_part == BodyPartType.Hand_R then return "RightHand"
|
if body_part == BodyPartType.Hand_R then return "Right_Hand"
|
||||||
elseif body_part == BodyPartType.ForeArm_R then return "RightForearm"
|
elseif body_part == BodyPartType.ForeArm_R then return "Right_LowerArm"
|
||||||
elseif body_part == BodyPartType.UpperArm_R then return "RightArm"
|
elseif body_part == BodyPartType.UpperArm_R then return "Right_UpperArm"
|
||||||
elseif body_part == BodyPartType.Hand_L then return "LeftHand"
|
elseif body_part == BodyPartType.Hand_L then return "Left_Hand"
|
||||||
elseif body_part == BodyPartType.ForeArm_L then return "LeftForearm"
|
elseif body_part == BodyPartType.ForeArm_L then return "Left_LowerArm"
|
||||||
elseif body_part == BodyPartType.UpperArm_L then return "LeftArm"
|
elseif body_part == BodyPartType.UpperArm_L then return "Left_UpperArm"
|
||||||
else return nil
|
else return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -143,33 +103,23 @@ function find_clothName_TOC(bodyPart)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function TocGetDisplayText(part_name)
|
function TocGetDisplayText(part_name)
|
||||||
if part_name == "RightHand" then return getText("UI_ContextMenu_RightHand") end
|
return getText("UI_ContextMenu_" .. part_name)
|
||||||
if part_name == "RightForearm" then return getText("UI_ContextMenu_RightForearm") end
|
|
||||||
if part_name == "RightArm" then return getText("UI_ContextMenu_RightArm") end
|
|
||||||
if part_name == "LeftHand" then return getText("UI_ContextMenu_LeftHand") end
|
|
||||||
if part_name == "LeftForearm" then return getText("UI_ContextMenu_LeftForearm") end
|
|
||||||
if part_name == "LeftArm" then return getText("UI_ContextMenu_LeftArm") end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function TocGetBodyPartTypeFromBodyPart(part_name)
|
function TocGetBodyPartTypeFromBodyPart(part_name)
|
||||||
if part_name == "RightHand" then return BodyPartType.Hand_R end
|
if part_name == "Right_Hand" then return BodyPartType.Hand_R end
|
||||||
if part_name == "RightForearm" then return BodyPartType.ForeArm_R end
|
if part_name == "Right_LowerArm" then return BodyPartType.ForeArm_R end
|
||||||
if part_name == "RightArm" then return BodyPartType.UpperArm_R end
|
if part_name == "Right_UpperArm" then return BodyPartType.UpperArm_R end
|
||||||
if part_name == "LeftHand" then return BodyPartType.Hand_L end
|
if part_name == "Left_Hand" then return BodyPartType.Hand_L end
|
||||||
if part_name == "LeftForearm" then return BodyPartType.ForeArm_L end
|
if part_name == "Left_LowerArm" then return BodyPartType.ForeArm_L end
|
||||||
if part_name == "LeftArm" then return BodyPartType.UpperArm_L end
|
if part_name == "Left_UpperArm" then return BodyPartType.UpperArm_L end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function TocFindAmputatedClothingFromPartName(part_name)
|
function TocFindAmputatedClothingFromPartName(part_name)
|
||||||
if part_name == "RightHand" then return "TOC.ArmRight_noHand" end
|
return "TOC.Amputation_" .. part_name
|
||||||
if part_name == "RightForearm" then return "TOC.ArmRight_noForearm" end
|
|
||||||
if part_name == "RightArm" then return "TOC.ArmRight_noArm" end
|
|
||||||
if part_name == "LeftHand" then return "TOC.ArmLeft_noHand" end
|
|
||||||
if part_name == "LeftForearm" then return "TOC.ArmLeft_noForearm" end
|
|
||||||
if part_name == "LeftArm" then return "TOC.ArmLeft_noArm" end
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- TODO finish this
|
-- TODO finish this
|
||||||
@@ -190,6 +140,10 @@ end
|
|||||||
function TocFindProsthesisFactorFromItem(item)
|
function TocFindProsthesisFactorFromItem(item)
|
||||||
|
|
||||||
local itemType = item:getType()
|
local itemType = item:getType()
|
||||||
|
|
||||||
|
-- TODO change this
|
||||||
|
|
||||||
|
|
||||||
if string.find(itemType, "WoodenHook") and string.find(itemType, "noHand") then return 1.5
|
if string.find(itemType, "WoodenHook") and string.find(itemType, "noHand") then return 1.5
|
||||||
elseif string.find(itemType, "WoodenHook") and string.find(itemType, "noForearm") then return 1.65
|
elseif string.find(itemType, "WoodenHook") and string.find(itemType, "noForearm") then return 1.65
|
||||||
elseif string.find(itemType, "MetalHook") and string.find(itemType, "noHand") then return 1.3
|
elseif string.find(itemType, "MetalHook") and string.find(itemType, "noHand") then return 1.3
|
||||||
@@ -202,32 +156,7 @@ end
|
|||||||
|
|
||||||
function TocFindCorrectClothingProsthesis(item_name, part_name)
|
function TocFindCorrectClothingProsthesis(item_name, part_name)
|
||||||
|
|
||||||
|
local correct_name = "TOC." .. item_name .. "_" .. part_name
|
||||||
-- for _, v in ipairs(GetProsthesisList()) do
|
|
||||||
-- if string.find(item, v)
|
|
||||||
|
|
||||||
-- end
|
|
||||||
|
|
||||||
local lowered_part_name = string.lower(part_name)
|
|
||||||
local side = string.match(lowered_part_name, "left")
|
|
||||||
|
|
||||||
if side == nil then
|
|
||||||
side = "right"
|
|
||||||
end
|
|
||||||
|
|
||||||
local limb = string.match(part_name, "Hand")
|
|
||||||
if limb == nil then
|
|
||||||
limb = "Forearm"
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
-- Just to accomodate this horrendous naming scheme, let's have Hand or Forearm again... Jesus dude
|
|
||||||
-- if limb then
|
|
||||||
-- limb = limb:gsub("^%l", string.upper)
|
|
||||||
-- end
|
|
||||||
|
|
||||||
local correct_name = "TOC." .. item_name .. "_" .. side .. "_no" .. limb
|
|
||||||
|
|
||||||
return correct_name
|
return correct_name
|
||||||
|
|
||||||
end
|
end
|
||||||
@@ -7,6 +7,7 @@
|
|||||||
local group = BodyLocations.getGroup("Human")
|
local group = BodyLocations.getGroup("Human")
|
||||||
|
|
||||||
|
|
||||||
|
-- TODO Change these names too, jesus they suck so bad
|
||||||
group:getOrCreateLocation("ArmRight")
|
group:getOrCreateLocation("ArmRight")
|
||||||
group:getOrCreateLocation("ArmLeft")
|
group:getOrCreateLocation("ArmLeft")
|
||||||
group:getOrCreateLocation("LegRight")
|
group:getOrCreateLocation("LegRight")
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ IGUI_EN = {
|
|||||||
|
|
||||||
IGUI_char_Hand_multi = "Time multi due to amp/tot",
|
IGUI_char_Hand_multi = "Time multi due to amp/tot",
|
||||||
|
|
||||||
IGUI_perks_RightHand = "Right hand",
|
IGUI_perks_Right_Hand = "Right hand",
|
||||||
IGUI_perks_LeftHand = "Left hand",
|
IGUI_perks_Left_Hand = "Left hand",
|
||||||
IGUI_perks_Protheses = "Protheses skills",
|
IGUI_perks_Prosthesis_Skill_desc = "Prosthesis skills",
|
||||||
}
|
}
|
||||||
@@ -17,12 +17,12 @@ UI_EN = {
|
|||||||
UI_trait_Insensitive = "Insensitive to pain",
|
UI_trait_Insensitive = "Insensitive to pain",
|
||||||
UI_trait_Insensitivedesc = "Reduces maximum pain.",
|
UI_trait_Insensitivedesc = "Reduces maximum pain.",
|
||||||
|
|
||||||
UI_ContextMenu_RightHand = "Right hand",
|
UI_ContextMenu_Right_Hand = "Right hand",
|
||||||
UI_ContextMenu_RightForearm = "Right forearm",
|
UI_ContextMenu_Right_LowerArm = "Right forearm",
|
||||||
UI_ContextMenu_RightArm = "Right arm",
|
UI_ContextMenu_Right_UpperArm = "Right arm",
|
||||||
UI_ContextMenu_LeftHand = "Left hand",
|
UI_ContextMenu_Left_Hand = "Left hand",
|
||||||
UI_ContextMenu_LeftForearm = "Left forearm",
|
UI_ContextMenu_Left_LowerArm = "Left forearm",
|
||||||
UI_ContextMenu_LeftArm = "Left arm",
|
UI_ContextMenu_Left_UpperArm = "Left arm",
|
||||||
|
|
||||||
UI_ContextMenu_My = "My ",
|
UI_ContextMenu_My = "My ",
|
||||||
UI_ContextMenu_Now_cut = " is now healed!",
|
UI_ContextMenu_Now_cut = " is now healed!",
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ perk Protheses
|
|||||||
xp10 = 0,
|
xp10 = 0,
|
||||||
}
|
}
|
||||||
|
|
||||||
perk LeftHand
|
perk Left_Hand
|
||||||
{
|
{
|
||||||
parent = Protheses,
|
parent = Protheses,
|
||||||
name = LeftHand,
|
name = LeftHand,
|
||||||
@@ -35,7 +35,7 @@ perk LeftHand
|
|||||||
xp10 = 9000,
|
xp10 = 9000,
|
||||||
}
|
}
|
||||||
|
|
||||||
perk RightHand
|
perk Right_Hand
|
||||||
{
|
{
|
||||||
parent = Protheses,
|
parent = Protheses,
|
||||||
name = RightHand,
|
name = RightHand,
|
||||||
|
|||||||
Reference in New Issue
Block a user