This commit is contained in:
Pao
2023-01-30 18:16:02 +01:00
parent 18ceeb0cb5
commit 3afedacbb3
11 changed files with 23 additions and 120 deletions

View File

@@ -50,6 +50,9 @@
"isForceDropHeavyItem", "isForceDropHeavyItem",
"isFHModKeyDown", "isFHModKeyDown",
"getPlayerData", "getPlayerData",
"FHSwapHandsAction" "FHSwapHandsAction",
"getClassFieldVal",
"SandboxVars",
"getClassField"
] ]
} }

View File

@@ -36,14 +36,12 @@ function CheckIfProsthesisCanBeEquipped(part_name)
-- check if prosthesis is in the surgeon inventory... we need to get it before -- check if prosthesis is in the surgeon inventory... we need to get it before
end end
function CheckIfProsthesisCanBeUnequipped(part_name) function CheckIfProsthesisCanBeUnequipped(part_name)
-- TODO we should get item here to be sure that we can do this action instead of relying on some later checks -- TODO we should get item here to be sure that we can do this action instead of relying on some later checks
return true return true
end end
------------------------------- -------------------------------
@@ -51,18 +49,10 @@ end
function CheckIfProsthesisAlreadyInstalled(limbs_data, part_name) function CheckIfProsthesisAlreadyInstalled(limbs_data, part_name)
local r = "Right" for _, side in ipairs(TOC_sides) do
local l = "Left" if string.find(part_name, side) then
return (limbs_data[side .. "_Hand"].is_prosthesis_equipped or limbs_data[side .. "_LowerArm"].is_prosthesis_equipped)
end
if string.find(part_name, r) then
return (limbs_data[r .. "_Hand"].is_prosthesis_equipped or limbs_data[r .. "_LowerArm"].is_prosthesis_equipped)
elseif string.find(part_name, l) then
return (limbs_data[l .. "_Hand"].is_prosthesis_equipped or limbs_data[l .. "_LowerArm"].is_prosthesis_equipped)
end end
end end

View File

@@ -1,55 +0,0 @@
-- --Default options.
-- local options = {
-- roll_up_sleeves_on_amputated_limbs = true,
-- }
--https://steamcommunity.com/workshop/filedetails/discussion/2169435993/4260919351480715709/#c4260919351482087243
-- -- Connecting the options to the menu, so user can change them.
-- if ModOptions and ModOptions.getInstance then
-- print("TOC: Found ModOptions, loading it")
-- local settings = ModOptions:getInstance(options, "Amputation2", "The Only Cure but better")
-- -- FIXME this stuff breaks everything, it's a no go for now
-- settings.names = {
-- roll_up_sleeves_on_amputated_limbs = "Roll up jacket sleeves for amputated limbs",
-- }
-- ModOptions:loadFile()
-- local roll_up_sleeves = settings:getData("roll_up_sleeves_on_amputated_limbs")
-- print("TOC: Rolling up sleeves => " .. tostring(options.roll_up_sleeves_on_amputated_limbs))
-- -- Run it now since we're in the menu, presumably
-- TocSetSleeves(options.roll_up_sleeves_on_amputated_limbs)
-- function roll_up_sleeves:OnApply(val)
-- self:resetLua()
-- end
-- local function TocOnResetLua(reason)
-- print("TOC: OnResetLua running TocSetSleeves")
-- TocSetSleeves(options.roll_up_sleeves_on_amputated_limbs)
-- end
-- Events.OnResetLua.Add(TocOnResetLua)
-- else
-- -------------------
-- -- DEFAULT SETTINGS
-- ------------------
-- -- TODO Test this when mod options is not installed
--
-- end
-- --Make a link
-- TOC_Options = {}
-- TOC_Options = options

View File

@@ -30,19 +30,9 @@ function TocCheckCompatibilityWithOlderVersions(mod_data)
end end
end end
TocResetClothingItemBodyLocation(player, side, limb) TocResetClothingItemBodyLocation(player, side, limb)
end end
end end
end end
end end

View File

@@ -1,3 +1,5 @@
-- TODO this should be moved
function TryToToResetEverythingOtherPlayer(_, patient, surgeon) function TryToToResetEverythingOtherPlayer(_, patient, surgeon)
sendClientCommand(surgeon, "TOC", "AskToResetEverything", { patient:getOnlineID() }) sendClientCommand(surgeon, "TOC", "AskToResetEverything", { patient:getOnlineID() })
end end

View File

@@ -94,6 +94,4 @@ function TocTestBodyLocations()
print(list:get(i -1):getId()) print(list:get(i -1):getId())
end end
end end

View File

@@ -34,10 +34,6 @@ function TocEquipProsthesisLocal(_, player, part_name)
end end
function TocUnequipProsthesisLocal(_, player, part_name) function TocUnequipProsthesisLocal(_, player, part_name)
--local equipped_prosthesis = TocFindItemInProstBodyLocation(part_name, patient)
ISTimedActionQueue.add(ISUninstallProsthesis:new(player, player, part_name)) ISTimedActionQueue.add(ISUninstallProsthesis:new(player, player, part_name))
--ISTimedActionQueue.add(ISUninstallProsthesis:new(patient, equipped_prosthesis,
-- patient:getBodyDamage():getBodyPart(TocGetBodyPartTypeFromPartName(part_name))))
end end

View File

@@ -26,7 +26,7 @@ local function OverrideFancyHandwork()
end end
--ISInventoryPaneContextMenu.transferIfNeeded(self.chr, item) --ISInventoryPaneContextMenu.transferIfNeeded(self.chr, item)
-- If we already have the item equipped -- If we already have the item equipped
if (primary and primary == item) or (secondary and secondary == item) then if (primary and primary == item) or (secondary and secondary == item) then
ISTimedActionQueue.add(ISUnequipAction:new(self.chr, item, 20)) ISTimedActionQueue.add(ISUnequipAction:new(self.chr, item, 20))
equip = false equip = false
@@ -71,8 +71,6 @@ local function OverrideFancyHandwork()
getPlayerData(self.chr:getPlayerNum()).playerInventory:refreshBackpacks() getPlayerData(self.chr:getPlayerNum()).playerInventory:refreshBackpacks()
end end
local og_FHSwapHandsAction = FHSwapHandsAction.start local og_FHSwapHandsAction = FHSwapHandsAction.start
function FHSwapHandsAction:start() function FHSwapHandsAction:start()
@@ -105,5 +103,4 @@ local function OverrideFancyHandwork()
end end
Events.OnGameStart.Add(OverrideFancyHandwork) Events.OnGameStart.Add(OverrideFancyHandwork)

View File

@@ -144,28 +144,13 @@ local function OnClickTocMainUI(button, args)
end end
local function OnClickTocDescUI(button, args) local function OnClickTocDescUI(button, args)
-- Gets every arg from main
-- Gets every arg from main
local patient = desc_ui.patient local patient = desc_ui.patient
local surgeon = desc_ui.surgeon local surgeon = desc_ui.surgeon
if args.option ~= "Nothing" then
-- Validate action TryTocAction(_, desc_ui.part_name, args.option, surgeon, patient)
if args.option == "Cut" then
TryTocAction(_, desc_ui.part_name, "Cut", surgeon, patient)
elseif args.option == "Operate" then
TryTocAction(_, desc_ui.part_name, "Operate", surgeon, patient)
elseif args.option == "Equip" then
TryTocAction(_, desc_ui.part_name, "Equip", surgeon, patient)
-- TODO probably completely broken for MP
-- TODO this is really janky
elseif args.option == "Unequip" then
TryTocAction(_, desc_ui.part_name, "Unequip", surgeon, patient)
elseif args.option == "Nothing" then
print("Just do nothing") -- TODO workaround
end end
main_ui:close() main_ui:close()
@@ -354,9 +339,6 @@ end
-- Setup stuff with variables and shit -- Setup stuff with variables and shit
function SetupTocMainUI(surgeon, patient, limbs_data) function SetupTocMainUI(surgeon, patient, limbs_data)
-- TODO add a ontick to update it regularly
main_ui.surgeon = surgeon -- we shouldn't need an arg for this main_ui.surgeon = surgeon -- we shouldn't need an arg for this
main_ui.patient = patient main_ui.patient = patient

View File

@@ -1,5 +1,3 @@
-- 6 skin tones or 5?
function TocSetCorrectTextureForAmputation(item, player) function TocSetCorrectTextureForAmputation(item, player)
local human_visual = player:getHumanVisual() local human_visual = player:getHumanVisual()
local texture_string = human_visual:getSkinTexture() local texture_string = human_visual:getSkinTexture()

View File

@@ -116,7 +116,7 @@ function TocSetInitData(mod_data, player)
mod_data.TOC.Limbs[part_name].is_prosthesis_equipped = false mod_data.TOC.Limbs[part_name].is_prosthesis_equipped = false
mod_data.TOC.Limbs[part_name].equipped_prosthesis = {} -- TODO i'm still not usign this, I should though mod_data.TOC.Limbs[part_name].equipped_prosthesis = {} -- TODO i'm still not usign this, I should though
-- Even if there are some duplicates, this is just easier in the end since we're gonna get fairly easily part_name -- Even if there are some duplicates, this is just easier in the end since we're gonna get fairly easily part_name
@@ -299,7 +299,8 @@ function TheOnlyCure.CutLimb(part_name, surgeon_factor, bandage_table, painkille
-- If bandages are available, use them -- If bandages are available, use them
adiacent_body_part:setBandaged(bandage_table.use_bandage, 10, bandage_table.is_bandage_sterilized, bandage_table.bandage_type) adiacent_body_part:setBandaged(bandage_table.use_bandage, 10, bandage_table.is_bandage_sterilized,
bandage_table.bandage_type)
@@ -321,7 +322,8 @@ function TheOnlyCure.CutLimb(part_name, surgeon_factor, bandage_table, painkille
limbs_data[depended_v].cicatrization_time = limbs_data[part_name].cicatrization_base_time - limbs_data[depended_v].cicatrization_time = limbs_data[part_name].cicatrization_base_time -
surgeon_factor * 50 surgeon_factor * 50
local should_depended_v_be_healed_of_bite = limbs_data[depended_v].is_infected and body_damage:getInfectionLevel() < 20 local should_depended_v_be_healed_of_bite = limbs_data[depended_v].is_infected and
body_damage:getInfectionLevel() < 20
local depended_body_part = body_damage:getBodyPart(TocGetBodyPartFromPartName(depended_v)) local depended_body_part = body_damage:getBodyPart(TocGetBodyPartFromPartName(depended_v))
TocSetParametersForMissingLimb(depended_body_part, should_depended_v_be_healed_of_bite) TocSetParametersForMissingLimb(depended_body_part, should_depended_v_be_healed_of_bite)
@@ -331,7 +333,7 @@ function TheOnlyCure.CutLimb(part_name, surgeon_factor, bandage_table, painkille
end end
end end
-- Heal the infection here -- Heal the infection here