Cleaning
This commit is contained in:
5
.vscode/settings.json
vendored
5
.vscode/settings.json
vendored
@@ -50,6 +50,9 @@
|
|||||||
"isForceDropHeavyItem",
|
"isForceDropHeavyItem",
|
||||||
"isFHModKeyDown",
|
"isFHModKeyDown",
|
||||||
"getPlayerData",
|
"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
|
-- 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
|
||||||
|
|||||||
@@ -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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
TocResetClothingItemBodyLocation(player, side, limb)
|
TocResetClothingItemBodyLocation(player, side, limb)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -94,6 +94,4 @@ function TocTestBodyLocations()
|
|||||||
print(list:get(i -1):getId())
|
print(list:get(i -1):getId())
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
@@ -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
|
||||||
|
|||||||
@@ -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)
|
||||||
@@ -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
|
||||||
|
|
||||||
|
|||||||
@@ -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()
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user