Working new model

This commit is contained in:
Pao
2023-03-20 01:02:16 +01:00
parent 436d668096
commit 20883a1c38
24 changed files with 23 additions and 21 deletions
@@ -1,7 +1,7 @@
<?xml version='1.0' encoding='UTF-8'?> <?xml version='1.0' encoding='UTF-8'?>
<clothingItem> <clothingItem>
<m_MaleModel>Prost_Left_LowerArm_LeatherBase_MetalHook_Male</m_MaleModel> <m_MaleModel>Prost_Left_LowerArm_Base_Hook_Male</m_MaleModel>
<m_FemaleModel>Prost_Left_LowerArm_LeatherBase_MetalHook_Female</m_FemaleModel> <m_FemaleModel>Prost_Left_LowerArm_Base_Hook_Female</m_FemaleModel>
<m_GUID>129ee688-d4bb-4297-8eb2-f88974001217</m_GUID> <m_GUID>129ee688-d4bb-4297-8eb2-f88974001217</m_GUID>
<m_Static>false</m_Static> <m_Static>false</m_Static>
<m_AllowRandomTint>false</m_AllowRandomTint> <m_AllowRandomTint>false</m_AllowRandomTint>
@@ -1,7 +1,7 @@
<?xml version='1.0' encoding='UTF-8'?> <?xml version='1.0' encoding='UTF-8'?>
<clothingItem> <clothingItem>
<m_MaleModel>Prost_Right_LowerArm_Hook_Male</m_MaleModel> <m_MaleModel>Prost_Right_LowerArm_Base_Hook_Male</m_MaleModel>
<m_FemaleModel>Prost_Right_LowerArm_Hook_Female</m_FemaleModel> <m_FemaleModel>Prost_Right_LowerArm_Base_Hook_Female</m_FemaleModel>
<m_GUID>1eb56768-d7ef-46e4-ac07-91d0e43d15fb</m_GUID> <m_GUID>1eb56768-d7ef-46e4-ac07-91d0e43d15fb</m_GUID>
<m_Static>false</m_Static> <m_Static>false</m_Static>
<m_AllowRandomTint>false</m_AllowRandomTint> <m_AllowRandomTint>false</m_AllowRandomTint>
+2 -2
View File
@@ -58,7 +58,7 @@
<guid>714b78a7-8895-4f48-a29d-b6f12909db0e</guid> <guid>714b78a7-8895-4f48-a29d-b6f12909db0e</guid>
</files> </files>
<files> <files>
<path>media/clothing/clothingItems/Prost_Right_LowerArm_MetalHook.xml</path> <path>media/clothing/clothingItems/Prost_Right_LowerArm_LeatherBase_MetalHook.xml</path>
<guid>1eb56768-d7ef-46e4-ac07-91d0e43d15fb</guid> <guid>1eb56768-d7ef-46e4-ac07-91d0e43d15fb</guid>
</files> </files>
<files> <files>
@@ -70,7 +70,7 @@
<guid>aea8e02a-cba0-48d0-9eb0-7087651306b0</guid> <guid>aea8e02a-cba0-48d0-9eb0-7087651306b0</guid>
</files> </files>
<files> <files>
<path>media/clothing/clothingItems/Prost_Left_lowerArm_MetalHook.xml</path> <path>media/clothing/clothingItems/Prost_Left_LowerArm_LeatherBase_MetalHook.xml</path>
<guid>129ee688-d4bb-4297-8eb2-f88974001217</guid> <guid>129ee688-d4bb-4297-8eb2-f88974001217</guid>
</files> </files>
<files> <files>
@@ -36,8 +36,9 @@ function TOC_LocalActions.EquipProsthesis(_, player, partName)
local surgeonInv = player:getInventory() local surgeonInv = player:getInventory()
-- TODO Find a better way to filter objects. Disabled for now and only gets LeatherBase -- TODO Find a better way to filter objects. Disabled for now and only gets LeatherBase
local prosthesisToEquip = surgeonInv:getItemFromType('TOC.ProstNormal_LeatherBase_MetalHook') local prosthesisToEquip = surgeonInv:getItemFromType('TOC.LeatherBase_MetalHook')
if prosthesisToEquip then if prosthesisToEquip then
ISTimedActionQueue.add(TOC_InstallProsthesisAction:new(player, player, prosthesisToEquip, partName)) ISTimedActionQueue.add(TOC_InstallProsthesisAction:new(player, player, prosthesisToEquip, partName))
else else
@@ -58,12 +58,13 @@ function TOC.OperateLimb(partName, surgeonFactor, useOven)
if limbsData[partName].isOperated == false and limbsData[partName].isCut == true then if limbsData[partName].isOperated == false and limbsData[partName].isCut == true then
limbsData[partName].isOperated = true limbsData[partName].isOperated = true
limbsData[partName].cicatrizationTime = limbsData[partName].cicatrizationTime - (surgeonFactor * 200) limbsData[partName].cicatrizationTime = limbsData[partName].cicatrizationTime - (surgeonFactor * 200)
if useOven then limbsData[partName].is_cauterized = true end if useOven then limbsData[partName].isCauterized = true end
for _, depended_v in pairs(limbParameters[partName].depends_on) do for _, dependedPart in pairs(limbParameters[partName].dependsOn) do
limbsData[depended_v].isOperated = true limbsData[dependedPart].isOperated = true
limbsData[depended_v].cicatrizationTime = limbsData[depended_v].cicatrizationTime - -- TODO We should not have cicatrization time for depended parts.
(surgeonFactor * 200) -- limbsData[dependedPart].cicatrizationTime = limbsData[dependedPart].cicatrizationTime -
if useOven then limbsData[depended_v].isCauterized = true end -- (surgeonFactor * 200)
if useOven then limbsData[dependedPart].isCauterized = true end
end end
end end
@@ -16,7 +16,7 @@ function TOC.EquipProsthesis(partName, prosthesisItem, prosthesisBaseName)
local player = getPlayer() local player = getPlayer()
local TOCModData = player:getModData().TOC local TOCModData = player:getModData().TOC
local equippedProsthesis = GenerateEquippedProsthesis(prosthesisItem, player:getInventory(), "Hand") local equippedProsthesis = GenerateEquippedProsthesis(prosthesisItem, player:getInventory(), partName)
--print("TOC: Test durability new item " .. added_prosthesis_mod_data.TOC.durability) --print("TOC: Test durability new item " .. added_prosthesis_mod_data.TOC.durability)
+5 -5
View File
@@ -50,9 +50,9 @@ end
---comment ---comment
---@param prosthesisItem any Normal item ---@param prosthesisItem any Normal item
---@param inventory any player inventory ---@param inventory any player inventory
---@param limb any ---@param partName any
---@return any equipped_prosthesis clothing item equipped prosthesis ---@return any equipped_prosthesis clothing item equipped prosthesis
function GenerateEquippedProsthesis(prosthesisItem, inventory, limb) function GenerateEquippedProsthesis(prosthesisItem, inventory, partName)
-- TODO Durability should be decided from the clothing item xml. Same thing for disassembling stuff -- TODO Durability should be decided from the clothing item xml. Same thing for disassembling stuff
-- TODO some stuff should be defined by the limb, like -10 if forearm in speed -- TODO some stuff should be defined by the limb, like -10 if forearm in speed
-- when we equip a prosthesis, we're gonna pass these parameters to the newly generated clothing item -- when we equip a prosthesis, we're gonna pass these parameters to the newly generated clothing item
@@ -78,11 +78,11 @@ function GenerateEquippedProsthesis(prosthesisItem, inventory, limb)
-- durability_top, speed_top = GetProsthesisStats(top_table, prosthesis_name) -- durability_top, speed_top = GetProsthesisStats(top_table, prosthesis_name)
end end
local baseName = prosthesisItem:getType()
local equippedProsthesisName = TocFindCorrectClothingProsthesis() local equippedProsthesisName = TocFindCorrectClothingProsthesis(baseName, partName)
local equippedProsthesis = inventory:AddItem(prosthesisName) local equippedProsthesis = inventory:AddItem(equippedProsthesisName)
equippedProsthesis:setCondition(prosthesisItem:getCondition()) equippedProsthesis:setCondition(prosthesisItem:getCondition())
equippedProsthesis:getModData().TOC = { equippedProsthesis:getModData().TOC = {
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1 -1
View File
@@ -555,7 +555,7 @@ item Prost_Left_LowerArm_LeatherBase_MetalHook
BodyLocation = TOC_ArmLeftProsthesis, BodyLocation = TOC_ArmLeftProsthesis,
BloodLocation = Hands, BloodLocation = Hands,
Icon = metalLeg, Icon = metalLeg,
Tooltip = TempTooltip, Tooltip = Tooltip test lower arm test whatever,
CanHaveHoles = false, CanHaveHoles = false,
} }
item Prost_Right_LowerArm_LeatherBase_MetalHook item Prost_Right_LowerArm_LeatherBase_MetalHook