Fixed traits icons
This commit is contained in:
@@ -1,3 +1,26 @@
|
||||
-- Init
|
||||
function TocCutLimbForTrait(player, limbs_data, part_name)
|
||||
local amputation_clothing_item = player:getInventory():AddItem("TOC.Amputation_" .. part_name)
|
||||
TocSetCorrectTextureForAmputation(amputation_clothing_item, player, true)
|
||||
|
||||
player:setWornItem(amputation_clothing_item:getBodyLocation(), amputation_clothing_item)
|
||||
limbs_data[part_name].is_cut = true
|
||||
limbs_data[part_name].is_operated = true
|
||||
limbs_data[part_name].is_amputation_shown = true
|
||||
limbs_data[part_name].is_cicatrized = true
|
||||
|
||||
for _, v in pairs(limbs_data[part_name].depends_on) do
|
||||
limbs_data[v].is_cut = true
|
||||
limbs_data[v].is_operated = true
|
||||
limbs_data[v].is_amputation_shown = false
|
||||
limbs_data[v].is_cicatrized = true
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
-- CutLimb
|
||||
function TocCheckIfStillInfected(limbs_data)
|
||||
if limbs_data == nil then
|
||||
@@ -177,7 +200,7 @@ function TocFindItemInProstBodyLocation(part_name, patient)
|
||||
end
|
||||
|
||||
|
||||
-- Debug cheat
|
||||
-- Debug cheat and update every minute for cicatrization
|
||||
function TocFindAmputationOrProsthesisName(part_name, player, choice)
|
||||
local worn_items = player:getWornItems()
|
||||
for i = 1, worn_items:size() - 1 do
|
||||
|
||||
@@ -130,52 +130,13 @@ function TocSetInitData(mod_data, player)
|
||||
|
||||
-- Setup traits
|
||||
if player:HasTrait("Amputee_Hand") then
|
||||
|
||||
local amputation_clothing_item = player:getInventory():AddItem("TOC.Amputation_Left_Hand")
|
||||
TocSetCorrectTextureForAmputation(amputation_clothing_item, player, true)
|
||||
|
||||
player:setWornItem(amputation_clothing_item:getBodyLocation(), amputation_clothing_item)
|
||||
mod_data.TOC.Limbs.Left_Hand.is_cut = true
|
||||
mod_data.TOC.Limbs.Left_Hand.is_operated = true
|
||||
mod_data.TOC.Limbs.Left_Hand.is_amputation_shown = true
|
||||
mod_data.TOC.Limbs.Left_Hand.is_cicatrized = true
|
||||
TocCutLimbForTrait(player, mod_data.TOC.Limbs, "Left_Hand")
|
||||
elseif player:HasTrait("Amputee_LowerArm") then
|
||||
local amputation_clothing_item = player:getInventory():AddItem("TOC.Amputation_Left_LowerArm")
|
||||
TocSetCorrectTextureForAmputation(amputation_clothing_item, player, true)
|
||||
|
||||
player:setWornItem(amputation_clothing_item:getBodyLocation(), amputation_clothing_item)
|
||||
mod_data.TOC.Limbs.Left_LowerArm.is_cut = true
|
||||
mod_data.TOC.Limbs.Left_LowerArm.is_operated = true
|
||||
mod_data.TOC.Limbs.Left_LowerArm.is_amputation_shown = true
|
||||
mod_data.TOC.Limbs.Left_LowerArm.is_cicatrized = true
|
||||
|
||||
for _, v in pairs(mod_data.TOC.Limbs.Left_LowerArm.depends_on) do
|
||||
mod_data.TOC.Limbs[v].is_cut = true
|
||||
mod_data.TOC.Limbs[v].is_operated = true
|
||||
mod_data.TOC.Limbs[v].is_amputation_shown = false
|
||||
mod_data.TOC.Limbs[v].is_cicatrized = true
|
||||
end
|
||||
TocCutLimbForTrait(player, mod_data.TOC.Limbs, "Left_LowerArm")
|
||||
elseif player:HasTrait("Amputee_UpperArm") then
|
||||
local amputation_clothing_item = player:getInventory():AddItem("TOC.Amputation_Left_UpperArm")
|
||||
TocSetCorrectTextureForAmputation(amputation_clothing_item, player, true)
|
||||
|
||||
player:setWornItem(amputation_clothing_item:getBodyLocation(), amputation_clothing_item)
|
||||
mod_data.TOC.Limbs.Left_UpperArm.is_cut = true
|
||||
mod_data.TOC.Limbs.Left_UpperArm.is_operated = true
|
||||
mod_data.TOC.Limbs.Left_UpperArm.is_amputation_shown = true
|
||||
mod_data.TOC.Limbs.Left_UpperArm.is_cicatrized = true
|
||||
|
||||
for _, v in pairs(mod_data.TOC.Limbs.Left_UpperArm.depends_on) do
|
||||
mod_data.TOC.Limbs[v].is_cut = true
|
||||
mod_data.TOC.Limbs[v].is_operated = true
|
||||
mod_data.TOC.Limbs[v].is_amputation_shown = false
|
||||
mod_data.TOC.Limbs[v].is_cicatrized = true
|
||||
end
|
||||
TocCutLimbForTrait(player, mod_data.TOC.Limbs, "Left_UpperArm")
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
end
|
||||
|
||||
function TocUpdateBaseData(mod_data)
|
||||
|
||||
Reference in New Issue
Block a user