More basic stuff for prosthesis
This commit is contained in:
@@ -8,4 +8,4 @@
|
|||||||
<m_AllowRandomTint>false</m_AllowRandomTint>
|
<m_AllowRandomTint>false</m_AllowRandomTint>
|
||||||
<textureChoices>metal_base</textureChoices>
|
<textureChoices>metal_base</textureChoices>
|
||||||
<textureChoices>metal_base</textureChoices>
|
<textureChoices>metal_base</textureChoices>
|
||||||
</clothingItem>
|
</clothingItem>
|
||||||
11
media/clothing/clothingItems/Prost_Hook_R.xml
Normal file
11
media/clothing/clothingItems/Prost_Hook_R.xml
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
|
<clothingItem>
|
||||||
|
<m_MaleModel>Prosthesis\hookArm_R_F</m_MaleModel>
|
||||||
|
<m_FemaleModel>Prosthesis\hookArm_R_F</m_FemaleModel>
|
||||||
|
<m_GUID>8ee7e1bc-2c21-428e-a15d-760d98df973d</m_GUID>
|
||||||
|
|
||||||
|
<m_Static>false</m_Static>
|
||||||
|
<m_AllowRandomTint>false</m_AllowRandomTint>
|
||||||
|
<textureChoices>metal_base</textureChoices>
|
||||||
|
<textureChoices>metal_base</textureChoices>
|
||||||
|
</clothingItem>
|
||||||
@@ -31,6 +31,9 @@
|
|||||||
<path>media/clothing/clothingItems/Prost_Hook_L.xml</path>
|
<path>media/clothing/clothingItems/Prost_Hook_L.xml</path>
|
||||||
<guid>05338f5e-e984-49c2-be79-81af9ae8e818</guid>
|
<guid>05338f5e-e984-49c2-be79-81af9ae8e818</guid>
|
||||||
</files>
|
</files>
|
||||||
|
<files>
|
||||||
|
<path>media/clothing/clothingItems/Prost_Hook_R.xml</path>
|
||||||
|
<guid>8ee7e1bc-2c21-428e-a15d-760d98df973d</guid>
|
||||||
|
</files>
|
||||||
|
|
||||||
</fileGuidTable>
|
</fileGuidTable>
|
||||||
@@ -1 +1,62 @@
|
|||||||
|
local CommonMethods = require("TOC_Common")
|
||||||
|
local PlayerHandler = require("Handlers/TOC_PlayerHandler")
|
||||||
|
|
||||||
|
-------------------------
|
||||||
|
|
||||||
|
---@class ProsthesisHandler
|
||||||
|
local ProsthesisHandler = {}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function ProsthesisHandler.SetHealthPanelTexture()
|
||||||
|
-- TODO do it
|
||||||
|
end
|
||||||
|
|
||||||
|
---comment
|
||||||
|
---@param bodyLocation string
|
||||||
|
---@return boolean
|
||||||
|
function ProsthesisHandler.CheckIfEquippable(bodyLocation)
|
||||||
|
print("Current item is a prosthesis")
|
||||||
|
local side = CommonMethods.GetSide(bodyLocation)
|
||||||
|
|
||||||
|
for i=1, #PlayerHandler.amputatedLimbs do
|
||||||
|
local limbName = PlayerHandler.amputatedLimbs[i]
|
||||||
|
if string.contains(limbName, side) and not string.contains(limbName, "UpperArm") then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- No acceptable cut limbs
|
||||||
|
getPlayer():Say("I can't equip this")
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
--* Overrides *--
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function ISWearClothing:isValid()
|
||||||
|
local bodyLocation = self.item:getBodyLocation()
|
||||||
|
if not string.contains(bodyLocation, "TOC_ArmProst") then
|
||||||
|
return true
|
||||||
|
else
|
||||||
|
return ProsthesisHandler.CheckIfEquippable(bodyLocation)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
local og_ISClothingExtraAction_isValid = ISClothingExtraAction.isValid
|
||||||
|
function ISClothingExtraAction:isValid()
|
||||||
|
local bodyLocation = self.item:getBodyLocation()
|
||||||
|
|
||||||
|
if og_ISClothingExtraAction_isValid(self) and not string.contains(bodyLocation, "TOC_ArmProst") then
|
||||||
|
return true
|
||||||
|
else
|
||||||
|
return ProsthesisHandler.CheckIfEquippable(bodyLocation)
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
return ProsthesisHandler
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
local CommonMethods = {}
|
local CommonMethods = {}
|
||||||
|
|
||||||
---Returns the side for a certain limb
|
---Returns the side for a certain limb or prosthesis
|
||||||
---@param limbName string
|
---@param name string
|
||||||
---@return string "L" or "R"
|
---@return string "L" or "R"
|
||||||
function CommonMethods.GetSide(limbName)
|
function CommonMethods.GetSide(name)
|
||||||
if string.find(limbName, "_L") then return "L" else return "R" end
|
if string.find(name, "_L") then return "L" else return "R" end
|
||||||
end
|
end
|
||||||
|
|
||||||
return CommonMethods
|
return CommonMethods
|
||||||
@@ -28,7 +28,7 @@ function Main.SetupTraits()
|
|||||||
t:addXPBoost(Perks.Strength, -1)
|
t:addXPBoost(Perks.Strength, -1)
|
||||||
end
|
end
|
||||||
|
|
||||||
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_Insensitive_desc"), false, false)
|
||||||
|
|
||||||
TraitFactory.setMutualExclusive("Amputee_Hand", "Amputee_LowerArm")
|
TraitFactory.setMutualExclusive("Amputee_Hand", "Amputee_LowerArm")
|
||||||
TraitFactory.setMutualExclusive("Amputee_Hand", "Amputee_UpperArm")
|
TraitFactory.setMutualExclusive("Amputee_Hand", "Amputee_UpperArm")
|
||||||
|
|||||||
@@ -41,8 +41,8 @@ end
|
|||||||
function ISHealthPanel.GetHighestAmputation()
|
function ISHealthPanel.GetHighestAmputation()
|
||||||
-- TODO Cache this instead of doing it here!
|
-- TODO Cache this instead of doing it here!
|
||||||
ISHealthPanel.highestAmputations = {}
|
ISHealthPanel.highestAmputations = {}
|
||||||
for i=1, #StaticData.LIMBS_STRINGS do
|
for i=1, #PlayerHandler.amputatedLimbs do
|
||||||
local limbName = StaticData.LIMBS_STRINGS[i]
|
local limbName = PlayerHandler.amputatedLimbs[i]
|
||||||
local index = CommonMethods.GetSide(limbName)
|
local index = CommonMethods.GetSide(limbName)
|
||||||
if PlayerHandler.modDataHandler:getIsCut(limbName) and PlayerHandler.modDataHandler:getIsVisible(limbName) then
|
if PlayerHandler.modDataHandler:getIsCut(limbName) and PlayerHandler.modDataHandler:getIsVisible(limbName) then
|
||||||
ISHealthPanel.highestAmputations[index] = limbName
|
ISHealthPanel.highestAmputations[index] = limbName
|
||||||
|
|||||||
@@ -1,4 +1,9 @@
|
|||||||
ContextMenu_EN = {
|
ContextMenu_EN = {
|
||||||
ContextMenu_Amputate = "Amputate",
|
ContextMenu_Amputate = "Amputate",
|
||||||
|
|
||||||
|
|
||||||
|
ContextMenu_InstallProstRight = "Install prosthesis on right arm",
|
||||||
|
ContextMenu_InstallProstLeft = "Install prosthesis on left arm",
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,2 +1,13 @@
|
|||||||
UI_EN = {
|
UI_EN = {
|
||||||
|
UI_trait_Amputee_Hand = "Amputated Left Hand",
|
||||||
|
UI_trait_Amputee_Hand_desc = "",
|
||||||
|
|
||||||
|
UI_trait_Amputee_LowerArm = "Amputated Left Forearm",
|
||||||
|
UI_trait_Amputee_LowerArm_desc = "",
|
||||||
|
|
||||||
|
UI_trait_Amputee_UpperArm = "Amputated Left Upper arm",
|
||||||
|
UI_trait_Amputee_UpperArm_desc = "",
|
||||||
|
|
||||||
|
UI_trait_Insensitive = "Insensitive",
|
||||||
|
UI_trait_Insensitive_desc = ""
|
||||||
}
|
}
|
||||||
BIN
media/models_X/Prosthesis/hookArm_R_F.fbx
Normal file
BIN
media/models_X/Prosthesis/hookArm_R_F.fbx
Normal file
Binary file not shown.
@@ -120,13 +120,36 @@ module TOC
|
|||||||
}
|
}
|
||||||
/****************** Clothing that look like a cut limb ******************/
|
/****************** Clothing that look like a cut limb ******************/
|
||||||
|
|
||||||
item Prosthesis_Hook_L
|
item Prost_Hook_L
|
||||||
{
|
{
|
||||||
Type = Clothing,
|
Type = Clothing,
|
||||||
DisplayCategory = Prosthesis,
|
DisplayCategory = Prosthesis,
|
||||||
DisplayName = Hook Arm Test,
|
DisplayName = Hook Arm Test Left,
|
||||||
ClothingItem = Prost_Hook_L,
|
ClothingItem = Prost_Hook_L,
|
||||||
|
ClothingItemExtra = Prost_Hook_R,
|
||||||
|
ClothingItemExtraOption = InstallProstRight,
|
||||||
|
clothingExtraSubmenu = InstallProstLeft,
|
||||||
BodyLocation = TOC_ArmProstLeft,
|
BodyLocation = TOC_ArmProstLeft,
|
||||||
|
Weight = 0,
|
||||||
|
CombatSpeedModifier = 0.7,
|
||||||
|
BloodLocation = UpperArms;UpperBody,
|
||||||
|
Insulation = 1.0,
|
||||||
|
WindResistance = 1.0,
|
||||||
|
WaterResistance = 1.0,
|
||||||
|
Icon = genericAmputation,
|
||||||
|
CanHaveHoles = false,
|
||||||
|
}
|
||||||
|
|
||||||
|
item Prost_Hook_R
|
||||||
|
{
|
||||||
|
Type = Clothing,
|
||||||
|
DisplayCategory = Prosthesis,
|
||||||
|
DisplayName = Hook Arm Test Right,
|
||||||
|
ClothingItem = Prost_Hook_R,
|
||||||
|
ClothingItemExtra = Prost_Hook_L,
|
||||||
|
ClothingItemExtraOption = InstallProstLeft,
|
||||||
|
clothingExtraSubmenu = InstallProstRight,
|
||||||
|
BodyLocation = TOC_ArmProstRight,
|
||||||
|
|
||||||
Weight = 0,
|
Weight = 0,
|
||||||
CombatSpeedModifier = 0.7,
|
CombatSpeedModifier = 0.7,
|
||||||
|
|||||||
Reference in New Issue
Block a user