Cleaning
This commit is contained in:
5
.vscode/settings.json
vendored
5
.vscode/settings.json
vendored
@@ -50,6 +50,9 @@
|
||||
"isForceDropHeavyItem",
|
||||
"isFHModKeyDown",
|
||||
"getPlayerData",
|
||||
"FHSwapHandsAction"
|
||||
"FHSwapHandsAction",
|
||||
"getClassFieldVal",
|
||||
"SandboxVars",
|
||||
"getClassField"
|
||||
]
|
||||
}
|
||||
@@ -36,14 +36,12 @@ function CheckIfProsthesisCanBeEquipped(part_name)
|
||||
-- check if prosthesis is in the surgeon inventory... we need to get it before
|
||||
end
|
||||
|
||||
|
||||
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
|
||||
return true
|
||||
|
||||
end
|
||||
|
||||
-------------------------------
|
||||
|
||||
|
||||
@@ -51,18 +49,10 @@ end
|
||||
|
||||
function CheckIfProsthesisAlreadyInstalled(limbs_data, part_name)
|
||||
|
||||
local r = "Right"
|
||||
local l = "Left"
|
||||
|
||||
|
||||
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)
|
||||
for _, side in ipairs(TOC_sides) do
|
||||
if string.find(part_name, side) then
|
||||
return (limbs_data[side .. "_Hand"].is_prosthesis_equipped or limbs_data[side .. "_LowerArm"].is_prosthesis_equipped)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
end
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -30,19 +30,9 @@ function TocCheckCompatibilityWithOlderVersions(mod_data)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
TocResetClothingItemBodyLocation(player, side, limb)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
-- TODO this should be moved
|
||||
|
||||
function TryToToResetEverythingOtherPlayer(_, patient, surgeon)
|
||||
sendClientCommand(surgeon, "TOC", "AskToResetEverything", { patient:getOnlineID() })
|
||||
end
|
||||
|
||||
@@ -94,6 +94,4 @@ function TocTestBodyLocations()
|
||||
print(list:get(i -1):getId())
|
||||
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
@@ -34,10 +34,6 @@ function TocEquipProsthesisLocal(_, player, part_name)
|
||||
end
|
||||
|
||||
function TocUnequipProsthesisLocal(_, player, part_name)
|
||||
--local equipped_prosthesis = TocFindItemInProstBodyLocation(part_name, patient)
|
||||
|
||||
ISTimedActionQueue.add(ISUninstallProsthesis:new(player, player, part_name))
|
||||
|
||||
--ISTimedActionQueue.add(ISUninstallProsthesis:new(patient, equipped_prosthesis,
|
||||
-- patient:getBodyDamage():getBodyPart(TocGetBodyPartTypeFromPartName(part_name))))
|
||||
end
|
||||
|
||||
@@ -26,7 +26,7 @@ local function OverrideFancyHandwork()
|
||||
end
|
||||
--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
|
||||
ISTimedActionQueue.add(ISUnequipAction:new(self.chr, item, 20))
|
||||
equip = false
|
||||
@@ -38,7 +38,7 @@ local function OverrideFancyHandwork()
|
||||
if primary and isForceDropHeavyItem(primary) then
|
||||
ISTimedActionQueue.add(ISUnequipAction:new(self.chr, primary, 50))
|
||||
----- treat "equip" as if we have something equipped from here down
|
||||
equip = false
|
||||
equip = false
|
||||
end
|
||||
if mod then
|
||||
-- If we still have something equipped in secondary, unequip
|
||||
@@ -71,8 +71,6 @@ local function OverrideFancyHandwork()
|
||||
getPlayerData(self.chr:getPlayerNum()).playerInventory:refreshBackpacks()
|
||||
end
|
||||
|
||||
|
||||
|
||||
local og_FHSwapHandsAction = FHSwapHandsAction.start
|
||||
|
||||
function FHSwapHandsAction:start()
|
||||
@@ -105,5 +103,4 @@ local function OverrideFancyHandwork()
|
||||
|
||||
end
|
||||
|
||||
|
||||
Events.OnGameStart.Add(OverrideFancyHandwork)
|
||||
Events.OnGameStart.Add(OverrideFancyHandwork)
|
||||
|
||||
@@ -144,28 +144,13 @@ local function OnClickTocMainUI(button, args)
|
||||
end
|
||||
|
||||
local function OnClickTocDescUI(button, args)
|
||||
|
||||
-- Gets every arg from main
|
||||
|
||||
local patient = desc_ui.patient
|
||||
local surgeon = desc_ui.surgeon
|
||||
|
||||
|
||||
-- Validate action
|
||||
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
|
||||
if args.option ~= "Nothing" then
|
||||
TryTocAction(_, desc_ui.part_name, args.option, surgeon, patient)
|
||||
end
|
||||
main_ui:close()
|
||||
|
||||
@@ -354,9 +339,6 @@ end
|
||||
-- Setup stuff with variables and shit
|
||||
|
||||
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.patient = patient
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
-- 6 skin tones or 5?
|
||||
|
||||
function TocSetCorrectTextureForAmputation(item, player)
|
||||
local human_visual = player:getHumanVisual()
|
||||
local texture_string = human_visual:getSkinTexture()
|
||||
|
||||
@@ -71,7 +71,7 @@ function TocSetInitData(mod_data, player)
|
||||
Left_LowerArm = {},
|
||||
Left_UpperArm = {},
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
Accepted_Prosthesis = {}
|
||||
@@ -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].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
|
||||
|
||||
@@ -299,7 +299,8 @@ function TheOnlyCure.CutLimb(part_name, surgeon_factor, bandage_table, painkille
|
||||
|
||||
|
||||
-- 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 -
|
||||
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))
|
||||
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
|
||||
|
||||
|
||||
-- Heal the infection here
|
||||
|
||||
Reference in New Issue
Block a user