Let's switch back to the OG name

This commit is contained in:
Pao
2023-03-04 00:35:21 +01:00
parent f55fe877f7
commit cf0c93fb4b
89 changed files with 651 additions and 651 deletions

View File

@@ -1,11 +1,11 @@
------------------------------------------
------------- JUST CUT IT OUT ------------
-------------- THE ONLY CURE -------------
------------------------------------------
----------- CUT LIMB FUNCTIONS -----------
-- Seems to be the first file loaded, so let's add this
if JCIO == nil then
JCIO = {}
if TOC == nil then
TOC = {}
end
@@ -18,7 +18,7 @@ local function CheckIfStillInfected(limbsData)
local check = false
for _, v in pairs(JCIO_Common.GetPartNames()) do
for _, v in pairs(TOC_Common.GetPartNames()) do
if limbsData[v].isInfected then
check = true
end
@@ -33,7 +33,7 @@ end
local function CureInfection(bodyDamage, partName)
local bodyPartType = bodyDamage:getBodyPart(JCIO_Common.GetBodyPartFromPartName(partName))
local bodyPartType = bodyDamage:getBodyPart(TOC_Common.GetBodyPartFromPartName(partName))
bodyDamage:setInfected(false)
bodyPartType:SetInfected(false)
@@ -59,8 +59,8 @@ end
local function DeleteOtherAmputatedLimbs(side)
-- if left hand is cut and we cut left lowerarm, then delete hand
for _, limb in pairs(JCIO.limbNames) do
local partName = "JCIO.Amputation_" .. side .. "_" .. limb
for _, limb in pairs(TOC.limbNames) do
local partName = "TOC.Amputation_" .. side .. "_" .. limb
local amputatedLimbItem = getPlayer():getInventory():FindAndReturn(partName)
if amputatedLimbItem then
getPlayer():getInventory():Remove(amputatedLimbItem)
@@ -99,11 +99,11 @@ local function SetParametersForMissingLimb(bodyPart, isHealingBite)
end
function JCIO.DamagePlayerDuringAmputation(patient, partName)
function TOC.DamagePlayerDuringAmputation(patient, partName)
-- Since we're cutting that specific part, it only makes sense that the bleeding starts from there.
-- Then, we just delete the bleeding somewhere else before applying the other damage to to upper part of the limb
local bodyPartType = JCIO_Common.GetBodyPartFromPartName(partName)
local bodyPartType = TOC_Common.GetBodyPartFromPartName(partName)
local bodyDamage = patient:getBodyDamage()
local bodyDamagePart = bodyDamage:getBodyPart(bodyPartType)
@@ -116,14 +116,14 @@ end
local function FindTourniquetInWornItems(patient, side)
local checkString = "Surgery_" .. side .. "_Tourniquet"
local item = JCIO_Common.FindItemInWornItems(patient, checkString)
local item = TOC_Common.FindItemInWornItems(patient, checkString)
return item
end
local function FindWristWatchInWornItems(patient, side)
local checkString = "Watch_" .. side
local item = JCIO_Common.FindItemInWornItems(patient, checkString)
local item = TOC_Common.FindItemInWornItems(patient, checkString)
return item
end
@@ -139,27 +139,27 @@ end
---@param surgeonFactor any the surgeon factor, which will determine some stats for the inflicted wound
---@param bandageTable any bandages info
---@param painkillerTable any painkillers info, not used
JCIO.CutLimb = function(partName, surgeonFactor, bandageTable, painkillerTable)
TOC.CutLimb = function(partName, surgeonFactor, bandageTable, painkillerTable)
-- TODO Separate Cut Limb in side and limb instead of single part_name
-- Items get unequipped in ISCutLimb.Start
local player = getPlayer()
local jcioModData = player:getModData().JCIO
local limbParameters = JCIO.limbParameters
local limbsData = jcioModData.limbs
local TOCModData = player:getModData().TOC
local limbParameters = TOC.limbParameters
local limbsData = TOCModData.limbs
-- Cut Hand -> Damage in forearm
-- Cut Forearm -> Damage in Upperarm
-- Cut UpperArm -> Damage to torso
local bodyDamage = player:getBodyDamage()
local bodyPart = bodyDamage:getBodyPart(JCIO_Common.GetBodyPartFromPartName(partName))
local adjacentBodyPart = player:getBodyDamage():getBodyPart(JCIO_Common.GetAdjacentBodyPartFromPartName(partName))
local bodyPart = bodyDamage:getBodyPart(TOC_Common.GetBodyPartFromPartName(partName))
local adjacentBodyPart = player:getBodyDamage():getBodyPart(TOC_Common.GetAdjacentBodyPartFromPartName(partName))
local stats = player:getStats()
local side = JCIO_Common.GetSideFromPartName(partName)
local side = TOC_Common.GetSideFromPartName(partName)
@@ -238,7 +238,7 @@ JCIO.CutLimb = function(partName, surgeonFactor, bandageTable, painkillerTable)
local canHealDependedV = limbsData[depended_v].isInfected and
bodyDamage:getInfectionLevel() < 20
local depended_body_part = bodyDamage:getBodyPart(JCIO_Common.GetBodyPartFromPartName(depended_v))
local depended_body_part = bodyDamage:getBodyPart(TOC_Common.GetBodyPartFromPartName(depended_v))
SetParametersForMissingLimb(depended_body_part, canHealDependedV)
if canHealDependedV then
@@ -275,19 +275,19 @@ JCIO.CutLimb = function(partName, surgeonFactor, bandageTable, painkillerTable)
DeleteOtherAmputatedLimbs(side)
--Equip new model for amputation
local amputation_clothing_item_name = JCIO_Common.FindAmputatedClothingName(partName)
local amputation_clothing_item_name = TOC_Common.FindAmputatedClothingName(partName)
print(amputation_clothing_item_name)
local amputation_clothing_item = player:getInventory():AddItem(amputation_clothing_item_name)
JCIO_Visuals.SetTextureForAmputation(amputation_clothing_item, player, false)
TOC_Visuals.SetTextureForAmputation(amputation_clothing_item, player, false)
player:setWornItem(amputation_clothing_item:getBodyLocation(), amputation_clothing_item)
-- Set blood on the amputated limb
JCIO_Visuals.SetBloodOnAmputation(getPlayer(), adjacentBodyPart)
TOC_Visuals.SetBloodOnAmputation(getPlayer(), adjacentBodyPart)
if partName == "Left_Foot" or partName == "Right_Foot" then
JCIO_Anims.SetMissingFootAnimation(true)
TOC_Anims.SetMissingFootAnimation(true)
end
end

View File

@@ -1,31 +1,31 @@
------------------------------------------
------------- JUST CUT IT OUT ------------
-------------- THE ONLY CURE -------------
------------------------------------------
------------- LOCAL ACTIONS --------------
--Used to handle SP scenarios
if JCIO_LocalActions == nil then
JCIO_LocalActions = {}
if TOC_LocalActions == nil then
TOC_LocalActions = {}
end
function JCIO_LocalActions.Cut(_, player, partName)
if JCIO_Common.GetSawInInventory(player) ~= nil then
ISTimedActionQueue.add(JCIO_CutLimbAction:new(player, player, partName))
function TOC_LocalActions.Cut(_, player, partName)
if TOC_Common.GetSawInInventory(player) ~= nil then
ISTimedActionQueue.add(TOC_CutLimbAction:new(player, player, partName))
else
player:Say("I don't have a saw on me")
end
end
function JCIO_LocalActions.Operate(_, player, partName, useOven)
function TOC_LocalActions.Operate(_, player, partName, useOven)
if useOven then
ISTimedActionQueue.add(JCIO_OperateLimbAction:new(player, player, _, partName, useOven));
ISTimedActionQueue.add(TOC_OperateLimbAction:new(player, player, _, partName, useOven));
else
local kit = JCIO_Common.GetKitInInventory(player)
local kit = TOC_Common.GetKitInInventory(player)
if kit ~= nil then
ISTimedActionQueue.add(JCIO_OperateLimbAction:new(player, player, kit, partName, false))
ISTimedActionQueue.add(TOC_OperateLimbAction:new(player, player, kit, partName, false))
else
player:Say("I don't have a kit on me")
end
@@ -33,18 +33,18 @@ function JCIO_LocalActions.Operate(_, player, partName, useOven)
end
-- TODO This is gonna get deleted
function JCIO_LocalActions.EquipProsthesis(_, player, partName)
function TOC_LocalActions.EquipProsthesis(_, player, partName)
local surgeonInv = player:getInventory()
local prosthesisToEquip = surgeonInv:getItemFromType('TOC.MetalHand') or
surgeonInv:getItemFromType('TOC.MetalHook') or
surgeonInv:getItemFromType('TOC.WoodenHook')
if prosthesisToEquip then
ISTimedActionQueue.add(JCIO_InstallProsthesisAction:new(player, player, prosthesisToEquip, partName))
ISTimedActionQueue.add(TOC_InstallProsthesisAction:new(player, player, prosthesisToEquip, partName))
else
player:Say("I need a prosthesis")
end
end
function JCIO_LocalActions.UnequipProsthesis(_, player, partName)
ISTimedActionQueue.add(JCIO_UninstallProsthesisAction:new(player, player, partName))
function TOC_LocalActions.UnequipProsthesis(_, player, partName)
ISTimedActionQueue.add(TOC_UninstallProsthesisAction:new(player, player, partName))
end

View File

@@ -22,11 +22,11 @@ end
local function SetBodyPartsStatusAfterOperation(player, limbParameters, partName, useOven)
local bodyPartType = player:getBodyDamage():getBodyPart(JCIO_Common.GetAdjacentBodyPartFromPartName(partName))
local bodyPartType = player:getBodyDamage():getBodyPart(TOC_Common.GetAdjacentBodyPartFromPartName(partName))
FixSingleBodyPartType(bodyPartType, useOven)
for _, v in pairs(limbParameters[partName].dependsOn) do
local dependedBodyPartType = player:getBodyDamage():getBodyPart(JCIO_Common.GetAdjacentBodyPartFromPartName(v))
local dependedBodyPartType = player:getBodyDamage():getBodyPart(TOC_Common.GetAdjacentBodyPartFromPartName(v))
FixSingleBodyPartType(dependedBodyPartType, useOven)
end
@@ -39,15 +39,15 @@ end
---@param partName any
---@param surgeonFactor any
---@param useOven boolean wheter using oven instead of a kit or not
function JCIO.OperateLimb(partName, surgeonFactor, useOven)
function TOC.OperateLimb(partName, surgeonFactor, useOven)
local player = getPlayer()
local jcioModData = player:getModData().JCIO
local TOCModData = player:getModData().TOC
local limbParameters = JCIO.limbParameters
local limbsData = jcioModData.limbs
local limbParameters = TOC.limbParameters
local limbsData = TOCModData.limbs
if useOven then
local stats = player:getStats()

View File

@@ -8,32 +8,32 @@
---@param partName string
---@param prosthesisItem any the prosthesis item
---@param prosthesisBaseName string I don't really remember
function JCIO.EquipProsthesis(partName, prosthesisItem, prosthesisBaseName)
function TOC.EquipProsthesis(partName, prosthesisItem, prosthesisBaseName)
-- TODO probably will have to move this from the TOC menu to classic equip to have dynamic durability
-- TODO We need to pass the original item so we can get its data!
local player = getPlayer()
local jcioModData = player:getModData().JCIO
local TOCModData = player:getModData().TOC
local equippedProsthesis = GenerateEquippedProsthesis(prosthesisItem, player:getInventory(), "Hand")
--print("JCIO: Test durability new item " .. added_prosthesis_mod_data.TOC.durability)
--print("TOC: Test durability new item " .. added_prosthesis_mod_data.TOC.durability)
-- TODO equippedProsthesis must have something like the ProsthesisFactor from before!!!
if partName ~= nil then
if equippedProsthesis ~= nil then
jcioModData.limbs[partName].isProsthesisEquipped = true
TOCModData.limbs[partName].isProsthesisEquipped = true
-- Fill equippedProsthesis with the correct stuff
-- TODO For prosthetics we should fetch the data from a modData INSIDE them!
-- TODO Change the value passed, it's wrong
--jcioModData.limbs[partName].equippedProsthesis = jcioModData.Prosthesis[prosthesisBaseName][partName]
--TOCModData.limbs[partName].equippedProsthesis = TOCModData.Prosthesis[prosthesisBaseName][partName]
if player:isFemale() then
equippedProsthesis:getVisual():setTextureChoice(1)
@@ -51,13 +51,13 @@ end
---Unequip a prosthesis clothing item and returns it to the inventory as a normal item
---@param partName string
function JCIO.UnequipProsthesis(patient, partName, equippedProsthesis)
function TOC.UnequipProsthesis(patient, partName, equippedProsthesis)
-- TODO Pass the parameters generated from EquipProsthesis to the re-generated normal item
local jcioModData = patient:getModData().JCIO
jcioModData.limbs[partName].isProsthesisEquipped = false
local TOCModData = patient:getModData().TOC
TOCModData.limbs[partName].isProsthesisEquipped = false
local equippedProstFullType = equippedProsthesis:getFullType()
@@ -70,16 +70,16 @@ function JCIO.UnequipProsthesis(patient, partName, equippedProsthesis)
local equippedProstModData = equippedProsthesis:getModData()
local baseProstItem = patient:getInventory():AddItem("JCIO." .. prostName)
local baseProstItem = patient:getInventory():AddItem("TOC." .. prostName)
local baseProstItemModData = baseProstItem.getModData()
baseProstItemModData.JCIO = {
durability = equippedProstModData.JCIO.durability,
speed = equippedProstModData.JCIO.speed
baseProstItemModData.TOC = {
durability = equippedProstModData.TOC.durability,
speed = equippedProstModData.TOC.speed
}
patient:setWornItem(equippedProsthesis:getBodyLocation(), nil)
patient:getInventory():Remove(equippedProsthesis)
jcioModData.limbs[partName].equippedProsthesis = nil
TOCModData.limbs[partName].equippedProsthesis = nil
end
end
end