I think I got almost everything. Now to check it

This commit is contained in:
Pao
2023-01-18 02:56:09 +01:00
parent 45e4aff79d
commit 5b3e10c0db
13 changed files with 352 additions and 378 deletions

View File

@@ -40,16 +40,16 @@ function ISInstallProsthesis:perform()
return
end
local prosthesis_name =TocFindCorrectClothingProsthesis(self.item:getType(), part_name)
local prosthesis_name =TocFindCorrectClothingProsthesis(prosthesis_base_name, part_name)
self.cloth = self.character:getInventory():AddItem(prosthesis_name)
if self.cloth ~= nil then
if part_name then
toc_data[part_name].is_prosthesis_equipped = true -- TODO should we show that the hand has a prost too if it's installed in the forearm?
toc_data[part_name].prosthesis_factor = TocFindProsthesisFactorFromItem(self.cloth)
toc_data.Limbs[part_name].is_prosthesis_equipped = true -- TODO should we show that the hand has a prost too if it's installed in the forearm?
toc_data.Limbs[part_name].equipped_prosthesis = toc_data.Prosthesis[prosthesis_base_name][part_name]
self.character:getInventory():Remove(self.item)
self.character:setWornItem(self.cloth:getBodyLocation(), self.cloth)
end

View File

@@ -55,8 +55,8 @@ function ISUninstallProsthesis:perform()
print("Found prost in " .. part_name)
if part_name then
toc_data[part_name].is_prosthesis_equipped = false
toc_data[part_name].prosthesis_factor = 1
toc_data.Limbs[part_name].is_prosthesis_equipped = false
--toc_data.Limbs[part_name].prosthesis_factor = 1 -- TODO This is wrong
--local side = string.gsub(part_name, "Hand" or "Forearm", "")
local item_full_type = self.item:getFullType()

View File

@@ -22,21 +22,22 @@ function ISBaseTimedAction:adjustMaxTime(maxTime)
for _, part_name in ipairs(all_body_parts) do
if toc_data[part_name].is_cut then
if toc_data.Limbs[part_name].is_cut then
if toc_data[part_name].is_prosthesis_equipped then
modified_max_time = modified_max_time * toc_data[part_name].prosthesis_factor
if toc_data.Limbs[part_name].is_prosthesis_equipped then
modified_max_time = modified_max_time * toc_data.Limbs[part_name].equipped_prosthesis.prosthesis_factor
else
modified_max_time = modified_max_time * 2
end
if toc_data[part_name].is_cauterized then
if toc_data.Limbs[part_name].is_cauterized then
modified_max_time = modified_max_time * burn_factor
end
-- Perk scaling
if part_name == "RightHand" or part_name == "LeftHand" then
if part_name == "Right_Hand" or part_name == "Left_Hand" then
modified_max_time = modified_max_time * (1 + (9 - self.character:getPerkLevel(Perks[part_name])) / 20 )
end