again
This commit is contained in:
31
media/lua/client/TOC_CommonFunctions.lua
Normal file
31
media/lua/client/TOC_CommonFunctions.lua
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
function GetBodyParts()
|
||||||
|
local bodyparts = { "RightHand", "RightForearm", "RightArm", "LeftHand", "LeftForearm", "LeftArm"}
|
||||||
|
return bodyparts
|
||||||
|
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 FindTocDataPartNameFromBodyPartType(toc_data, bodyPartType)
|
||||||
|
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
|
||||||
|
elseif bodyPartType == BodyPartType.Hand_L then return toc_data.LeftHand
|
||||||
|
elseif bodyPartType == BodyPartType.ForeArm_L then return toc_data.LeftForearm
|
||||||
|
elseif bodyPartType == BodyPartType.UpperArm_L then return toc_data.LeftArm
|
||||||
|
else return nil
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
@@ -67,4 +67,3 @@ function FixSingleBodyPartType(body_part_type, use_oven)
|
|||||||
--body_part_type:setBleedingTime(ZombRand(1, 5)) -- Reset the bleeding, maybe make it random
|
--body_part_type:setBleedingTime(ZombRand(1, 5)) -- Reset the bleeding, maybe make it random
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -72,33 +72,6 @@ function find_clothName2_TOC(name)
|
|||||||
if name == "LeftArm" then return "TOC.ArmLeft_noArm" end
|
if name == "LeftArm" then return "TOC.ArmLeft_noArm" end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function TheOnlyCure.FindTocDataPartNameFromBodyPartType(toc_data, bodyPartType)
|
|
||||||
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
|
|
||||||
elseif bodyPartType == BodyPartType.Hand_L then return toc_data.LeftHand
|
|
||||||
elseif bodyPartType == BodyPartType.ForeArm_L then return toc_data.LeftForearm
|
|
||||||
elseif bodyPartType == BodyPartType.UpperArm_L then return toc_data.LeftArm
|
|
||||||
else return nil
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function find_bodyPart_TOC(modData, bodyPart)
|
|
||||||
if modData.RightHand == nil then modData = modData.TOC end
|
|
||||||
if bodyPart:getType() == BodyPartType.Hand_R then return modData.RightHand
|
|
||||||
elseif bodyPart:getType() == BodyPartType.ForeArm_R then return modData.RightForearm
|
|
||||||
elseif bodyPart:getType() == BodyPartType.UpperArm_R then return modData.RightArm
|
|
||||||
elseif bodyPart:getType() == BodyPartType.Hand_L then return modData.LeftHand
|
|
||||||
elseif bodyPart:getType() == BodyPartType.ForeArm_L then return modData.LeftForearm
|
|
||||||
elseif bodyPart:getType() == BodyPartType.UpperArm_L then return modData.LeftArm
|
|
||||||
else return nil
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function find_protheseID_TOC(item)
|
function find_protheseID_TOC(item)
|
||||||
local itemType = item:getType()
|
local itemType = item:getType()
|
||||||
if string.find(itemType, "WoodenHook") then return 1
|
if string.find(itemType, "WoodenHook") then return 1
|
||||||
|
|||||||
Reference in New Issue
Block a user