Readding amputation models

This commit is contained in:
ZioPao
2023-11-07 18:33:06 +01:00
parent 6c84ab14b7
commit 74b625b287
54 changed files with 422 additions and 3 deletions

View File

@@ -75,6 +75,8 @@ function AmputationHandler:execute()
ModDataHandler.GetInstance():setCutLimb(self.limbName, false, false, false, surgeonFactor)
-- Give the player the correct amputation item
self:deleteOldAmputationItem()
self:spawnAmputationItem()
end
---Force the execution of the amputation for a trait
@@ -136,11 +138,10 @@ function AmputationHandler:getAmputationTexturesIndex(isCicatrized)
return matchedIndex - 1
end
---Spawns and equips the correct amputation item to the player. In case there was another amputation on the same side, it's gonna get deleted
---Spawns and equips the correct amputation item to the player.
---@private
function AmputationHandler:spawnAmputationItem()
-- TODO Check if there are previous amputation clothing items on that side and deletes them
print("Clothing name " .. StaticData.AMPUTATION_CLOTHING_ITEM_BASE .. self.limbName)
local clothingItem = self.patient:getInventory():AddItem(StaticData.AMPUTATION_CLOTHING_ITEM_BASE .. self.limbName)
local texId = self:getAmputationTexturesIndex(false)

View File

@@ -0,0 +1,16 @@
-- TODO This part is still one of the weakest and we don't have a better solution yet
local function AddBodyLocationBefore(newLocation, moveToLocation)
local group = BodyLocations.getGroup("Human")
local list = getClassFieldVal(group, getClassField(group, 1))
group:getOrCreateLocation(newLocation)
local newItem = list:get(list:size()-1)
print("TOC: Created new body location" .. newItem:getId())
list:remove(newItem) -- We can't use the Index, it works if we pass the item though!
local i = group:indexOf(moveToLocation)
list:add(i, newItem)
end
AddBodyLocationBefore("TOC_ArmRight", "Shoes")
AddBodyLocationBefore("TOC_ArmLeft", "Shoes")