Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
74bb34bbc8 | ||
|
|
1b235ebaa4 | ||
|
|
44d486dfeb | ||
|
|
5cc982188a | ||
|
|
aadbe02df4 | ||
|
|
20bed84910 | ||
|
|
fc3113f243 | ||
|
|
be368738ba | ||
|
|
4209f690a8 | ||
|
|
a3a2614124 | ||
|
|
50f6db9344 | ||
|
|
17d554d269 | ||
|
|
1bef713de5 | ||
|
|
92334b2f54 |
@@ -7,7 +7,7 @@
|
|||||||
<img src='https://img.shields.io/badge/Steam-000000?style=for-the-badge&logo=steam&logoColor=white' />
|
<img src='https://img.shields.io/badge/Steam-000000?style=for-the-badge&logo=steam&logoColor=white' />
|
||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
# You're bitten. You have two choices.
|
You're bitten. You have two choices.
|
||||||
Wait until you succumb to the virus or take matters into your hands. Cut off that infected part and live to die another day.
|
Wait until you succumb to the virus or take matters into your hands. Cut off that infected part and live to die another day.
|
||||||
|
|
||||||
This version of **The Only Cure** has been rebuilt from scratch to support future additions and to feel as close as possible as a vanilla mechanic.
|
This version of **The Only Cure** has been rebuilt from scratch to support future additions and to feel as close as possible as a vanilla mechanic.
|
||||||
@@ -16,7 +16,6 @@ This version of **The Only Cure** has been rebuilt from scratch to support futur
|
|||||||
|
|
||||||
Supports **Single Player** and **Multiplayer**!
|
Supports **Single Player** and **Multiplayer**!
|
||||||
|
|
||||||
|
|
||||||
# Setup
|
# Setup
|
||||||
Use it with the following mods for the intended experience:
|
Use it with the following mods for the intended experience:
|
||||||
- [Fancy Handwork](https://steamcommunity.com/sharedfiles/filedetails/?id=2904920097)
|
- [Fancy Handwork](https://steamcommunity.com/sharedfiles/filedetails/?id=2904920097)
|
||||||
|
|||||||
BIN
dev_stuff/logos/TOC_LOGOv2_ByChuck_169_with_title.png
Normal file
BIN
dev_stuff/logos/TOC_LOGOv2_ByChuck_169_with_title.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 540 KiB |
@@ -57,6 +57,7 @@ function DataController:setup(key)
|
|||||||
---@type tocModDataType
|
---@type tocModDataType
|
||||||
self.tocData = {
|
self.tocData = {
|
||||||
-- Generic stuff that does not belong anywhere else
|
-- Generic stuff that does not belong anywhere else
|
||||||
|
isInitializing = true,
|
||||||
isIgnoredPartInfected = false,
|
isIgnoredPartInfected = false,
|
||||||
isAnyLimbCut = false,
|
isAnyLimbCut = false,
|
||||||
limbs = {},
|
limbs = {},
|
||||||
@@ -86,9 +87,16 @@ function DataController:setup(key)
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Add it to global mod data
|
-- Add it to client global mod data
|
||||||
ModData.add(key, self.tocData)
|
ModData.add(key, self.tocData)
|
||||||
|
|
||||||
|
-- Sync with the server
|
||||||
|
self:apply()
|
||||||
|
|
||||||
|
-- -- Disable lock
|
||||||
|
-- self.tocData.isInitializing = false
|
||||||
|
-- ModData.add(key, self.tocData)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
---In case of desync between the table on ModData and the table here
|
---In case of desync between the table on ModData and the table here
|
||||||
@@ -100,7 +108,7 @@ function DataController:applyOnlineData(tocData)
|
|||||||
end
|
end
|
||||||
|
|
||||||
---@param key string
|
---@param key string
|
||||||
function DataController:loadLocalData(key)
|
function DataController:tryLoadLocalData(key)
|
||||||
self.tocData = ModData.get(key)
|
self.tocData = ModData.get(key)
|
||||||
|
|
||||||
--TOC_DEBUG.printTable(self.tocData)
|
--TOC_DEBUG.printTable(self.tocData)
|
||||||
@@ -368,6 +376,8 @@ end
|
|||||||
function DataController.ReceiveData(key, data)
|
function DataController.ReceiveData(key, data)
|
||||||
-- During startup the game can return Bob as the player username, adding a useless ModData table
|
-- During startup the game can return Bob as the player username, adding a useless ModData table
|
||||||
if key == "TOC_Bob" then return end
|
if key == "TOC_Bob" then return end
|
||||||
|
if not luautils.stringStarts(key, StaticData.MOD_NAME .. "_") then return end
|
||||||
|
|
||||||
|
|
||||||
TOC_DEBUG.print("ReceiveData for " .. key)
|
TOC_DEBUG.print("ReceiveData for " .. key)
|
||||||
if data == {} or data == nil then
|
if data == {} or data == nil then
|
||||||
@@ -387,6 +397,7 @@ function DataController.ReceiveData(key, data)
|
|||||||
-- TODO Add update from server scenario
|
-- TODO Add update from server scenario
|
||||||
|
|
||||||
if handler.isResetForced then
|
if handler.isResetForced then
|
||||||
|
TOC_DEBUG.print("Forced reset")
|
||||||
handler:setup(key)
|
handler:setup(key)
|
||||||
elseif data then
|
elseif data then
|
||||||
if data.isUpdateFromServer then
|
if data.isUpdateFromServer then
|
||||||
@@ -394,7 +405,8 @@ function DataController.ReceiveData(key, data)
|
|||||||
end
|
end
|
||||||
handler:applyOnlineData(data)
|
handler:applyOnlineData(data)
|
||||||
elseif username == getPlayer():getUsername() then
|
elseif username == getPlayer():getUsername() then
|
||||||
handler:loadLocalData(key)
|
TOC_DEBUG.print("loading local data")
|
||||||
|
handler:tryLoadLocalData(key)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@@ -434,7 +446,7 @@ Events.OnReceiveGlobalModData.Add(DataController.ReceiveData)
|
|||||||
--- SP Only initialization
|
--- SP Only initialization
|
||||||
---@param key string
|
---@param key string
|
||||||
function DataController:initSinglePlayer(key)
|
function DataController:initSinglePlayer(key)
|
||||||
self:loadLocalData(key)
|
self:tryLoadLocalData(key)
|
||||||
if self.tocData == nil or self.isResetForced then
|
if self.tocData == nil or self.isResetForced then
|
||||||
self:setup(key)
|
self:setup(key)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -15,8 +15,12 @@ local StaticData = require("TOC/StaticData")
|
|||||||
-- a prosthesis on, that can trigger random bleeds.
|
-- a prosthesis on, that can trigger random bleeds.
|
||||||
|
|
||||||
local function CheckHandFeasibility(limbName)
|
local function CheckHandFeasibility(limbName)
|
||||||
|
TOC_DEBUG.print("Checking hand feasibility: " .. limbName)
|
||||||
local dcInst = DataController.GetInstance()
|
local dcInst = DataController.GetInstance()
|
||||||
return not dcInst:getIsCut(limbName) or dcInst:getIsProstEquipped(limbName)
|
|
||||||
|
local isFeasible = not dcInst:getIsCut(limbName) or dcInst:getIsProstEquipped(limbName)
|
||||||
|
TOC_DEBUG.print("isFeasible: " .. tostring(isFeasible))
|
||||||
|
return isFeasible
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@@ -107,6 +111,8 @@ end
|
|||||||
---A recreation of the original method, but with amputations in mind
|
---A recreation of the original method, but with amputations in mind
|
||||||
---@param dcInst DataController
|
---@param dcInst DataController
|
||||||
function ISEquipWeaponAction:performWithAmputation(dcInst)
|
function ISEquipWeaponAction:performWithAmputation(dcInst)
|
||||||
|
|
||||||
|
TOC_DEBUG.print("running ISEquipWeaponAction performWithAmputation")
|
||||||
local hand = nil
|
local hand = nil
|
||||||
local otherHand = nil
|
local otherHand = nil
|
||||||
local getMethodFirst = nil
|
local getMethodFirst = nil
|
||||||
@@ -130,6 +136,10 @@ function ISEquipWeaponAction:performWithAmputation(dcInst)
|
|||||||
setMethodSecond = self.character.setSecondaryHandItem
|
setMethodSecond = self.character.setSecondaryHandItem
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local isFirstValid = CheckHandFeasibility(hand)
|
||||||
|
local isSecondValid = CheckHandFeasibility(otherHand)
|
||||||
|
|
||||||
|
|
||||||
if not self.twoHands then
|
if not self.twoHands then
|
||||||
if getMethodFirst(self.character) and getMethodFirst(self.character):isRequiresEquippedBothHands() then
|
if getMethodFirst(self.character) and getMethodFirst(self.character):isRequiresEquippedBothHands() then
|
||||||
setMethodFirst(self.character, nil)
|
setMethodFirst(self.character, nil)
|
||||||
@@ -145,10 +155,10 @@ function ISEquipWeaponAction:performWithAmputation(dcInst)
|
|||||||
setMethodSecond(self.character, nil)
|
setMethodSecond(self.character, nil)
|
||||||
-- TODO We should use the CachedData indexable instead of dcInst
|
-- TODO We should use the CachedData indexable instead of dcInst
|
||||||
|
|
||||||
if not dcInst:getIsCut(hand) then
|
if isFirstValid then
|
||||||
setMethodSecond(self.character, self.item)
|
setMethodSecond(self.character, self.item)
|
||||||
-- Check other HAND!
|
-- Check other HAND!
|
||||||
elseif not dcInst:getIsCut(otherHand) then
|
elseif isSecondValid then
|
||||||
setMethodFirst(self.character, self.item)
|
setMethodFirst(self.character, self.item)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -156,13 +166,10 @@ function ISEquipWeaponAction:performWithAmputation(dcInst)
|
|||||||
setMethodFirst(self.character, nil)
|
setMethodFirst(self.character, nil)
|
||||||
setMethodSecond(self.character, nil)
|
setMethodSecond(self.character, nil)
|
||||||
|
|
||||||
|
|
||||||
local isFirstValid = CheckHandFeasibility(hand)
|
|
||||||
local isSecondValid = CheckHandFeasibility(otherHand)
|
|
||||||
-- TOC_DEBUG.print("First Hand: " .. tostring(hand))
|
-- TOC_DEBUG.print("First Hand: " .. tostring(hand))
|
||||||
-- TOC_DEBUG.print("Prost Group: " .. tostring(prostGroup))
|
-- --TOC_DEBUG.print("Prost Group: " .. tostring(prostGroup))
|
||||||
-- TOC_DEBUG.print("Other Hand: " .. tostring(otherHand))
|
-- TOC_DEBUG.print("Other Hand: " .. tostring(otherHand))
|
||||||
-- TOC_DEBUG.print("Other Prost Group: " .. tostring(otherProstGroup))
|
-- --TOC_DEBUG.print("Other Prost Group: " .. tostring(otherProstGroup))
|
||||||
|
|
||||||
-- TOC_DEBUG.print("isPrimaryHandValid: " .. tostring(isFirstValid))
|
-- TOC_DEBUG.print("isPrimaryHandValid: " .. tostring(isFirstValid))
|
||||||
-- TOC_DEBUG.print("isSecondaryHandValid: " .. tostring(isSecondValid))
|
-- TOC_DEBUG.print("isSecondaryHandValid: " .. tostring(isSecondValid))
|
||||||
|
|||||||
@@ -33,6 +33,9 @@ function LocalPlayerController.InitializePlayer(isForced)
|
|||||||
Events.OnAmputatedLimb.Add(LocalPlayerController.ToggleUpdateAmputations)
|
Events.OnAmputatedLimb.Add(LocalPlayerController.ToggleUpdateAmputations)
|
||||||
LocalPlayerController.ToggleUpdateAmputations()
|
LocalPlayerController.ToggleUpdateAmputations()
|
||||||
|
|
||||||
|
-- Manage their traits
|
||||||
|
LocalPlayerController.ManageTraits(playerObj)
|
||||||
|
|
||||||
-- Since isForced is used to reset an existing player data, we're gonna clean their ISHealthPanel table too
|
-- Since isForced is used to reset an existing player data, we're gonna clean their ISHealthPanel table too
|
||||||
if isForced then
|
if isForced then
|
||||||
local ItemsController = require("TOC/Controllers/ItemsController")
|
local ItemsController = require("TOC/Controllers/ItemsController")
|
||||||
@@ -47,13 +50,16 @@ end
|
|||||||
---Handles the traits
|
---Handles the traits
|
||||||
---@param playerObj IsoPlayer
|
---@param playerObj IsoPlayer
|
||||||
function LocalPlayerController.ManageTraits(playerObj)
|
function LocalPlayerController.ManageTraits(playerObj)
|
||||||
local AmputationHandler = require("Handlers/TOC_AmputationHandler")
|
local AmputationHandler = require("TOC/Handlers/AmputationHandler")
|
||||||
for k, v in pairs(StaticData.TRAITS_BP) do
|
for k, v in pairs(StaticData.TRAITS_BP) do
|
||||||
if playerObj:HasTrait(k) then
|
if playerObj:HasTrait(k) then
|
||||||
-- Once we find one, we should be done.
|
-- Once we find one, we should be done since they're exclusive
|
||||||
local tempHandler = AmputationHandler:new(v)
|
local tempHandler = AmputationHandler:new(v, playerObj)
|
||||||
tempHandler:execute(false) -- No damage
|
tempHandler:execute(false) -- No damage
|
||||||
tempHandler:close()
|
tempHandler:close()
|
||||||
|
|
||||||
|
-- The wound should be already cicatrized
|
||||||
|
LocalPlayerController.HandleSetCicatrization(DataController.GetInstance(), playerObj, v)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -257,14 +263,11 @@ function LocalPlayerController.UpdateAmputations()
|
|||||||
cicTime = cicTime - cicDec
|
cicTime = cicTime - cicDec
|
||||||
|
|
||||||
|
|
||||||
dcInst:setCicatrizationTime(limbName, cicTime)
|
|
||||||
TOC_DEBUG.print("New cicatrization time: " .. tostring(cicTime))
|
TOC_DEBUG.print("New cicatrization time: " .. tostring(cicTime))
|
||||||
if cicTime <= 0 then
|
if cicTime <= 0 then
|
||||||
TOC_DEBUG.print(tostring(limbName) .. " is cicatrized")
|
LocalPlayerController.HandleSetCicatrization(dcInst, pl, limbName)
|
||||||
dcInst:setIsCicatrized(limbName, true)
|
else
|
||||||
-- Set visual
|
dcInst:setCicatrizationTime(limbName, cicTime)
|
||||||
local ItemsController = require("TOC/Controllers/ItemsController")
|
|
||||||
ItemsController.Player.OverrideAmputationItemVisuals(pl, limbName, true)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -285,6 +288,23 @@ function LocalPlayerController.ToggleUpdateAmputations()
|
|||||||
CommonMethods.SafeStartEvent("EveryHours", LocalPlayerController.UpdateAmputations)
|
CommonMethods.SafeStartEvent("EveryHours", LocalPlayerController.UpdateAmputations)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
--* Cicatrization and cicatrization visuals *--
|
||||||
|
|
||||||
|
---Set the boolean and cicTime in DCINST and the visuals for the amputated limb
|
||||||
|
---@param dcInst DataController
|
||||||
|
---@param playerObj IsoPlayer
|
||||||
|
---@param limbName string
|
||||||
|
function LocalPlayerController.HandleSetCicatrization(dcInst, playerObj, limbName)
|
||||||
|
TOC_DEBUG.print(tostring(limbName) .. " is cicatrized")
|
||||||
|
dcInst:setIsCicatrized(limbName, true)
|
||||||
|
dcInst:setCicatrizationTime(limbName, 0)
|
||||||
|
|
||||||
|
-- Set visuals for the amputation
|
||||||
|
local ItemsController = require("TOC/Controllers/ItemsController")
|
||||||
|
ItemsController.Player.OverrideAmputationItemVisuals(playerObj, limbName, true)
|
||||||
|
end
|
||||||
|
|
||||||
--* Object drop handling when amputation occurs
|
--* Object drop handling when amputation occurs
|
||||||
|
|
||||||
|
|
||||||
@@ -334,10 +354,20 @@ function LocalPlayerController.DropItemsAfterAmputation(limbName)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- TODO Consider 2 handed weapons too
|
||||||
|
|
||||||
|
-- equipped items too
|
||||||
|
if side == "R" then
|
||||||
|
pl:setPrimaryHandItem(nil)
|
||||||
|
elseif side == "L" then
|
||||||
|
pl:setSecondaryHandItem(nil)
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
Events.OnAmputatedLimb.Add(LocalPlayerController.DropItemsAfterAmputation)
|
Events.OnAmputatedLimb.Add(LocalPlayerController.DropItemsAfterAmputation)
|
||||||
|
Events.OnProsthesisUnequipped.Add(LocalPlayerController.DropItemsAfterAmputation)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
--* Setup Events *--
|
--* Setup Events *--
|
||||||
LuaEventManager.AddEvent("OnAmputatedLimb") --Triggered when a limb has been amputated
|
LuaEventManager.AddEvent("OnAmputatedLimb") --Triggered when a limb has been amputated
|
||||||
|
LuaEventManager.AddEvent("OnProsthesisUnequipped")
|
||||||
LuaEventManager.AddEvent("OnReceivedTocData") -- Triggered when TOC data is ready
|
LuaEventManager.AddEvent("OnReceivedTocData") -- Triggered when TOC data is ready
|
||||||
|
|||||||
@@ -111,6 +111,8 @@ end
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
--* Hand feasibility caching *--
|
--* Hand feasibility caching *--
|
||||||
CachedDataHandler.handFeasibility = {}
|
CachedDataHandler.handFeasibility = {}
|
||||||
|
|
||||||
|
|||||||
@@ -70,7 +70,6 @@ function ProsthesisHandler.CheckIfEquippable(fullType)
|
|||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
---Handle equipping or unequipping prosthetics
|
---Handle equipping or unequipping prosthetics
|
||||||
---@param item InventoryItem
|
---@param item InventoryItem
|
||||||
---@param isEquipping boolean
|
---@param isEquipping boolean
|
||||||
@@ -100,7 +99,7 @@ local function HandleProsthesisValidation(item, isEquippable)
|
|||||||
local isProst = ProsthesisHandler.CheckIfProst(item)
|
local isProst = ProsthesisHandler.CheckIfProst(item)
|
||||||
if not isProst then return isEquippable end
|
if not isProst then return isEquippable end
|
||||||
|
|
||||||
local fullType = item:getFullType() -- use fulltype for side
|
local fullType = item:getFullType() -- use fulltype for side
|
||||||
if isEquippable then
|
if isEquippable then
|
||||||
isEquippable = ProsthesisHandler.CheckIfEquippable(fullType)
|
isEquippable = ProsthesisHandler.CheckIfEquippable(fullType)
|
||||||
else
|
else
|
||||||
@@ -133,8 +132,6 @@ function ISClothingExtraAction:isValid()
|
|||||||
return HandleProsthesisValidation(testItem, isEquippable)
|
return HandleProsthesisValidation(testItem, isEquippable)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
--[[
|
--[[
|
||||||
Horrendous workaround
|
Horrendous workaround
|
||||||
|
|
||||||
@@ -161,7 +158,6 @@ function ISClothingExtraAction:perform()
|
|||||||
if isProst then
|
if isProst then
|
||||||
group:setMultiItem("TOC_ArmProst", true)
|
group:setMultiItem("TOC_ArmProst", true)
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local og_ISUnequipAction_perform = ISUnequipAction.perform
|
local og_ISUnequipAction_perform = ISUnequipAction.perform
|
||||||
@@ -176,8 +172,15 @@ function ISUnequipAction:perform()
|
|||||||
|
|
||||||
if isProst then
|
if isProst then
|
||||||
group:setMultiItem("TOC_ArmProst", true)
|
group:setMultiItem("TOC_ArmProst", true)
|
||||||
|
|
||||||
|
-- we need to fetch the limbname associated to the prosthesis
|
||||||
|
local side = CommonMethods.GetSide(self.item:getFullType())
|
||||||
|
local highestAmputatedLimbs = CachedDataHandler.GetHighestAmputatedLimbs(getPlayer():getUsername())
|
||||||
|
if highestAmputatedLimbs then
|
||||||
|
local hal = highestAmputatedLimbs[side]
|
||||||
|
triggerEvent("OnProsthesisUnequipped", hal)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
return ProsthesisHandler
|
return ProsthesisHandler
|
||||||
|
|||||||
@@ -6,39 +6,12 @@ require("TOC/Events")
|
|||||||
|
|
||||||
---@class Main
|
---@class Main
|
||||||
local Main = {
|
local Main = {
|
||||||
_version = 2.0
|
_version = "2.0.2"
|
||||||
}
|
}
|
||||||
|
|
||||||
---Setups the custom traits
|
|
||||||
function Main.SetupTraits()
|
|
||||||
-- Perks.Left_Hand is defined in perks.txt
|
|
||||||
|
|
||||||
local traitsTable = {
|
|
||||||
[1] = TraitFactory.addTrait("Amputee_Hand", getText("UI_trait_Amputee_Hand"), -8, getText("UI_trait_Amputee_Hand_desc"), false, false),
|
|
||||||
[2] = TraitFactory.addTrait("Amputee_LowerArm", getText("UI_trait_Amputee_LowerArm"), -10, getText("UI_trait_Amputee_LowerArm_desc"), false, false),
|
|
||||||
[3] = TraitFactory.addTrait("Amputee_UpperArm", getText("UI_trait_Amputee_UpperArm"), -20, getText("UI_trait_Amputee_UpperArm_desc"), false, false)
|
|
||||||
}
|
|
||||||
|
|
||||||
for i=1, #traitsTable do
|
|
||||||
|
|
||||||
---@type Trait
|
|
||||||
local t = traitsTable[i]
|
|
||||||
---@diagnostic disable-next-line: undefined-field
|
|
||||||
t:addXPBoost(Perks.Left_Hand, 4)
|
|
||||||
t:addXPBoost(Perks.Fitness, -1)
|
|
||||||
t:addXPBoost(Perks.Strength, -1)
|
|
||||||
end
|
|
||||||
|
|
||||||
TraitFactory.addTrait("Insensitive", getText("UI_trait_Insensitive"), 6, getText("UI_trait_Insensitive_desc"), false, false)
|
|
||||||
|
|
||||||
TraitFactory.setMutualExclusive("Amputee_Hand", "Amputee_LowerArm")
|
|
||||||
TraitFactory.setMutualExclusive("Amputee_Hand", "Amputee_UpperArm")
|
|
||||||
TraitFactory.setMutualExclusive("Amputee_LowerArm", "Amputee_UpperArm")
|
|
||||||
end
|
|
||||||
|
|
||||||
function Main.Start()
|
function Main.Start()
|
||||||
TOC_DEBUG.print("running Start method")
|
TOC_DEBUG.print("Starting The Only Cure version " .. tostring(Main._version))
|
||||||
Main.SetupTraits()
|
--Main.SetupTraits()
|
||||||
Main.SetupEvents()
|
Main.SetupEvents()
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -47,6 +20,7 @@ function Main.SetupEvents()
|
|||||||
Events.OnReceivedTocData.Add(CachedDataHandler.CalculateCacheableValues)
|
Events.OnReceivedTocData.Add(CachedDataHandler.CalculateCacheableValues)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function Main.InitializePlayer()
|
function Main.InitializePlayer()
|
||||||
---Looop until we've successfully initialized the mod
|
---Looop until we've successfully initialized the mod
|
||||||
local function TryToInitialize()
|
local function TryToInitialize()
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
require "TimedActions/ISBaseTimedAction"
|
require "TimedActions/ISBaseTimedAction"
|
||||||
local DataController = require("TOC/Controllers/DataController")
|
local DataController = require("TOC/Controllers/DataController")
|
||||||
|
local LocalPlayerController = require("TOC/Controllers/LocalPlayerController")
|
||||||
---------------
|
---------------
|
||||||
|
|
||||||
---@class CauterizeAction : ISBaseTimedAction
|
---@class CauterizeAction : ISBaseTimedAction
|
||||||
@@ -72,11 +73,14 @@ function CauterizeAction:perform()
|
|||||||
|
|
||||||
local dcInst = DataController.GetInstance()
|
local dcInst = DataController.GetInstance()
|
||||||
dcInst:setCicatrizationTime(self.limbName, 0)
|
dcInst:setCicatrizationTime(self.limbName, 0)
|
||||||
dcInst:setIsCicatrized(self.limbName, true)
|
|
||||||
dcInst:setIsCauterized(self.limbName, true)
|
dcInst:setIsCauterized(self.limbName, true)
|
||||||
|
|
||||||
-- we don't care about the depended limbs, since they're alread "cicatrized"
|
-- Set isCicatrized and the visuals in one go, since this action is gonna be run only on a single client
|
||||||
|
LocalPlayerController.HandleSetCicatrization(dcInst, self.character, self.limbName)
|
||||||
|
|
||||||
|
-- TODO Add specific visuals for cauterization
|
||||||
|
|
||||||
|
-- we don't care about the depended limbs, since they're alread "cicatrized"
|
||||||
dcInst:apply()
|
dcInst:apply()
|
||||||
|
|
||||||
ISBaseTimedAction.perform(self)
|
ISBaseTimedAction.perform(self)
|
||||||
|
|||||||
@@ -29,12 +29,11 @@ function ServerDataHandler.AddTable(key, table)
|
|||||||
--TOC_DEBUG.printTable(table)
|
--TOC_DEBUG.printTable(table)
|
||||||
|
|
||||||
-- Set that the data has been modified and it's updated on the server
|
-- Set that the data has been modified and it's updated on the server
|
||||||
table.isUpdateFromServer = true
|
table.isUpdateFromServer = true -- FIX this is useless as of now
|
||||||
|
|
||||||
ModData.add(key, table) -- Add it to the server mod data
|
ModData.add(key, table) -- Add it to the server mod data
|
||||||
ServerDataHandler.modData[key] = table
|
ServerDataHandler.modData[key] = table
|
||||||
|
|
||||||
|
|
||||||
-- Since this could be triggered by a different client than the one referenced in the key, we're gonna
|
-- Since this could be triggered by a different client than the one referenced in the key, we're gonna
|
||||||
-- apply the changes back to the key client again to be sure that everything is in sync
|
-- apply the changes back to the key client again to be sure that everything is in sync
|
||||||
local username = CommandsData.GetUsername(key)
|
local username = CommandsData.GetUsername(key)
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
---@alias limbsTable {Hand_L : partDataType, ForeArm_L : partDataType, UpperArm_L : partDataType, Hand_R : partDataType, ForeArm_R : partDataType, UpperArm_R : partDataType }
|
---@alias limbsTable {Hand_L : partDataType, ForeArm_L : partDataType, UpperArm_L : partDataType, Hand_R : partDataType, ForeArm_R : partDataType, UpperArm_R : partDataType }
|
||||||
---@alias prosthesisData {isProstEquipped : boolean, prostFactor : number }
|
---@alias prosthesisData {isProstEquipped : boolean, prostFactor : number }
|
||||||
---@alias prosthesesTable {Top_L : prosthesisData, Top_R : prosthesisData } -- TODO add Bottom_L and Bottom_R
|
---@alias prosthesesTable {Top_L : prosthesisData, Top_R : prosthesisData } -- TODO add Bottom_L and Bottom_R
|
||||||
---@alias tocModDataType { limbs : limbsTable, prostheses : prosthesesTable, isIgnoredPartInfected : boolean, isAnyLimbCut : boolean, isUpdateFromServer : boolean }
|
---@alias tocModDataType { limbs : limbsTable, prostheses : prosthesesTable, isIgnoredPartInfected : boolean, isAnyLimbCut : boolean, isUpdateFromServer : boolean, isInitializing : boolean}
|
||||||
---------------------------
|
---------------------------
|
||||||
|
|
||||||
|
|
||||||
@@ -232,9 +232,9 @@ end
|
|||||||
|
|
||||||
-- Link a trait to a specific body part
|
-- Link a trait to a specific body part
|
||||||
StaticData.TRAITS_BP = {
|
StaticData.TRAITS_BP = {
|
||||||
AmputeeHand = "Hand_L",
|
Amputee_Hand = "Hand_L",
|
||||||
AmputeeLowerArm = "ForeArm_L",
|
Amputee_ForeArm = "ForeArm_L",
|
||||||
AmputeeUpeerArm = "UpperArm_L"
|
Amputee_UpperArm = "UpperArm_L"
|
||||||
}
|
}
|
||||||
|
|
||||||
-----------------
|
-----------------
|
||||||
|
|||||||
49
media/lua/shared/TOC/Traits.lua
Normal file
49
media/lua/shared/TOC/Traits.lua
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
|
||||||
|
---Setups the custom TOC traits
|
||||||
|
|
||||||
|
local TRAITS = {
|
||||||
|
Amputee_Hand = "Amputee_Hand",
|
||||||
|
Amputee_ForeArm = "Amputee_ForeArm",
|
||||||
|
Amputee_UpperArm = "Amputee_UpperArm",
|
||||||
|
Insensitive = "Insensitive"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
local function GetTraitText(trait)
|
||||||
|
return getText("UI_trait_" .. trait)
|
||||||
|
end
|
||||||
|
|
||||||
|
local function GetTraitDesc(trait)
|
||||||
|
return getText("UI_trait_" .. trait .. "_desc")
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
local function SetupTraits()
|
||||||
|
-- Perks.Left_Hand is defined in perks.txt
|
||||||
|
|
||||||
|
local traitsTable = {
|
||||||
|
[1] = TraitFactory.addTrait(TRAITS.Amputee_Hand, GetTraitText(TRAITS.Amputee_Hand), -8, GetTraitDesc(TRAITS.Amputee_Hand), false, false),
|
||||||
|
[2] = TraitFactory.addTrait(TRAITS.Amputee_ForeArm, GetTraitText(TRAITS.Amputee_ForeArm), -10, GetTraitDesc(TRAITS.Amputee_ForeArm), false, false),
|
||||||
|
[3] = TraitFactory.addTrait(TRAITS.Amputee_UpperArm, GetTraitText(TRAITS.Amputee_UpperArm), -20, GetTraitDesc(TRAITS.Amputee_UpperArm), false, false)
|
||||||
|
}
|
||||||
|
|
||||||
|
for i=1, #traitsTable do
|
||||||
|
|
||||||
|
---@type Trait
|
||||||
|
local t = traitsTable[i]
|
||||||
|
---@diagnostic disable-next-line: undefined-field
|
||||||
|
t:addXPBoost(Perks.Left_Hand, 4)
|
||||||
|
t:addXPBoost(Perks.Fitness, -1)
|
||||||
|
t:addXPBoost(Perks.Strength, -1)
|
||||||
|
end
|
||||||
|
|
||||||
|
TraitFactory.addTrait(TRAITS.Insensitive, GetTraitText(TRAITS.Insensitive), 6, GetTraitDesc(TRAITS.Insensitive), false, false)
|
||||||
|
|
||||||
|
TraitFactory.setMutualExclusive(TRAITS.Amputee_Hand, TRAITS.Amputee_ForeArm)
|
||||||
|
TraitFactory.setMutualExclusive(TRAITS.Amputee_Hand, TRAITS.Amputee_UpperArm)
|
||||||
|
TraitFactory.setMutualExclusive(TRAITS.Amputee_ForeArm, TRAITS.Amputee_UpperArm)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Events.OnGameBoot.Add(SetupTraits)
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
UI_DE = {
|
UI_DE = {
|
||||||
UI_trait_Amputee_Hand = "Amputierte linke Hand",
|
UI_trait_Amputee_Hand = "Amputierte linke Hand",
|
||||||
UI_trait_Amputee_Hand_desc = "",
|
UI_trait_Amputee_Hand_desc = "",
|
||||||
UI_trait_Amputee_LowerArm = "Amputierter linker Unterarm",
|
UI_trait_Amputee_ForeArm = "Amputierter linker Unterarm",
|
||||||
UI_trait_Amputee_LowerArm_desc = "",
|
UI_trait_Amputee_ForeArm_desc = "",
|
||||||
UI_trait_Amputee_UpperArm = "Amputierter linker Oberarm",
|
UI_trait_Amputee_UpperArm = "Amputierter linker Oberarm",
|
||||||
UI_trait_Amputee_UpperArm_desc = "",
|
UI_trait_Amputee_UpperArm_desc = "",
|
||||||
UI_trait_Insensitive = "Unempfindlich",
|
UI_trait_Insensitive = "Unempfindlich",
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ UI_EN = {
|
|||||||
UI_trait_Amputee_Hand = "Amputated Left Hand",
|
UI_trait_Amputee_Hand = "Amputated Left Hand",
|
||||||
UI_trait_Amputee_Hand_desc = "",
|
UI_trait_Amputee_Hand_desc = "",
|
||||||
|
|
||||||
UI_trait_Amputee_LowerArm = "Amputated Left Forearm",
|
UI_trait_Amputee_ForeArm = "Amputated Left Forearm",
|
||||||
UI_trait_Amputee_LowerArm_desc = "",
|
UI_trait_Amputee_ForeArm_desc = "",
|
||||||
|
|
||||||
UI_trait_Amputee_UpperArm = "Amputated Left Upper arm",
|
UI_trait_Amputee_UpperArm = "Amputated Left Upper arm",
|
||||||
UI_trait_Amputee_UpperArm_desc = "",
|
UI_trait_Amputee_UpperArm_desc = "",
|
||||||
|
|||||||
33
media/lua/shared/Translate/IT/ContextMenu_IT.txt
Normal file
33
media/lua/shared/Translate/IT/ContextMenu_IT.txt
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
ContextMenu_IT = {
|
||||||
|
ContextMenu_Amputate = "Amputa",
|
||||||
|
ContextMenu_Amputate_Bandage = "Amputa e fascia",
|
||||||
|
ContextMenu_Amputate_Stitch = "Amputa e metti i punti",
|
||||||
|
ContextMenu_Amputate_Stitch_Bandage = "Amputate, metti i punti e fascia",
|
||||||
|
|
||||||
|
ContextMenu_Cauterize = "Cauterizza",
|
||||||
|
|
||||||
|
ContextMenu_Limb_Hand_L = "Mano Sinistra",
|
||||||
|
ContextMenu_Limb_ForeArm_L = "Avambraccio Sinistro",
|
||||||
|
ContextMenu_Limb_UpperArm_L = "Braccio Superiore Sinistro",
|
||||||
|
ContextMenu_Limb_Hand_R = "Mano Destra",
|
||||||
|
ContextMenu_Limb_ForeArm_R = "Avambraccio Destro",
|
||||||
|
ContextMenu_Limb_UpperArm_R = "Braccio Superiore Destro",
|
||||||
|
|
||||||
|
ContextMenu_InstallProstRight = "Installa protesi sul braccio destro",
|
||||||
|
ContextMenu_InstallProstLeft = "Installa protesi sul braccio sinistro",
|
||||||
|
|
||||||
|
ContextMenu_PutTourniquetArmLeft = "Metti laccio emostatico sul braccio sinistro",
|
||||||
|
ContextMenu_PutTourniquetLegL = "Metti laccio emostatico sulla gamba sinistra",
|
||||||
|
ContextMenu_PutTourniquetArmRight = "Metti laccio emostatico sul braccio destro",
|
||||||
|
ContextMenu_PutTourniquetLegR = "Metti laccio emostatico sulla gamba destra",
|
||||||
|
|
||||||
|
|
||||||
|
ContextMenu_CleanWound = "Pulisci ferita",
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
ContextMenu_Admin_TOC = "TOC",
|
||||||
|
ContextMenu_Admin_ResetTOC = "Reset Amputations",
|
||||||
|
ContextMenu_Admin_ForceAmputation = "Force Amputation",
|
||||||
|
|
||||||
|
}
|
||||||
18
media/lua/shared/Translate/IT/IG_UI_IT.txt
Normal file
18
media/lua/shared/Translate/IT/IG_UI_IT.txt
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
IG_UI_IT = {
|
||||||
|
IGUI_perks_Amputations = "Amputazioni",
|
||||||
|
IGUI_perks_Side_R = "Parte destra",
|
||||||
|
IGUI_perks_Side_L = "Parte sinistra",
|
||||||
|
IGUI_perks_Prosthesis = "Protesi",
|
||||||
|
IGUI_perks_ProstFamiliarity= "Familiarità",
|
||||||
|
|
||||||
|
IGUI_ItemCat_Prosthesis = "Protesi",
|
||||||
|
IGUI_ItemCat_Surgery = "Operazioni mediche",
|
||||||
|
IGUI_ItemCat_Amputation = "Amputazione"
|
||||||
|
|
||||||
|
IGUI_HealthPanel_Cicatrization = "Cicatrizzazione",
|
||||||
|
IGUI_HealthPanel_Cicatrized = "Cicatrizzata",
|
||||||
|
IGUI_HealthPanel_Cauterized = "Cauterizzata",
|
||||||
|
IGUI_HealthPanel_WoundDirtyness = "Sporcizia della ferita",
|
||||||
|
IGUI_HealthPanel_ProstEquipped = "Protesi installata",
|
||||||
|
|
||||||
|
}
|
||||||
11
media/lua/shared/Translate/IT/ItemName_IT.txt
Normal file
11
media/lua/shared/Translate/IT/ItemName_IT.txt
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
ItemName_IT = {
|
||||||
|
|
||||||
|
ItemName_TOC.Surg_Arm_Tourniquet_L = "Laccio emostatico",
|
||||||
|
ItemName_TOC.Surg_Arm_Tourniquet_R = "Laccio emostatico",
|
||||||
|
|
||||||
|
ItemName_TOC.Prost_NormalArm_L = "Braccio Prostetico",
|
||||||
|
ItemName_TOC.Prost_NormalArm_R = "Braccio Prostetico",
|
||||||
|
|
||||||
|
ItemName_TOC.Prost_HookArm_L = "Braccio prostetico - Uncino",
|
||||||
|
ItemName_TOC.Prost_HookArm_R = "Braccio prostetico - Uncino",
|
||||||
|
}
|
||||||
4
media/lua/shared/Translate/IT/Recipes_IT.txt
Normal file
4
media/lua/shared/Translate/IT/Recipes_IT.txt
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
Recipes_IT = {
|
||||||
|
Recipe_Craft_Prosthetic_Arm = "Costruisci un braccio prostetico",
|
||||||
|
Recipe_Craft_Prosthetic_Hook = "Costruisci un braccio prostetico con uncino",
|
||||||
|
}
|
||||||
7
media/lua/shared/Translate/IT/Sandbox_IT.txt
Normal file
7
media/lua/shared/Translate/IT/Sandbox_IT.txt
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
Sandbox_IT = {
|
||||||
|
Sandbox_TOC = "The Only Cure",
|
||||||
|
Sandbox_TOC_CicatrizationSpeed = "Velocità cicatrizzazione",
|
||||||
|
Sandbox_TOC_WoundDirtynessMultiplier = "Moltiplicatore sporcizia ferita",
|
||||||
|
Sandbox_TOC_SurgeonAbilityImportance = "Importanza abilità medico",
|
||||||
|
|
||||||
|
}
|
||||||
10
media/lua/shared/Translate/IT/Tooltip_IT.txt
Normal file
10
media/lua/shared/Translate/IT/Tooltip_IT.txt
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
Tooltip_IT = {
|
||||||
|
|
||||||
|
Tooltip_Surgery_CantCauterize = "Non puoi cauterizzare la ferita",
|
||||||
|
|
||||||
|
Tooltip_Surgery_And = " e "
|
||||||
|
Tooltip_Surgery_TempTooLow = "La temperatura è troppo bassa",
|
||||||
|
Tooltip_Surgery_Coward = "Non sei abbastanza coraggioso",
|
||||||
|
Tooltip_Surgery_LimbNotFree = "Devi rimuovere la protesi",
|
||||||
|
|
||||||
|
}
|
||||||
16
media/lua/shared/Translate/IT/UI_IT.txt
Normal file
16
media/lua/shared/Translate/IT/UI_IT.txt
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
UI_IT = {
|
||||||
|
UI_trait_Amputee_Hand = "Mano Sinistra Amputata",
|
||||||
|
UI_trait_Amputee_Hand_desc = "",
|
||||||
|
|
||||||
|
UI_trait_Amputee_ForeArm = "Avambraccio Sinistro Amputato",
|
||||||
|
UI_trait_Amputee_ForeArm_desc = "",
|
||||||
|
|
||||||
|
UI_trait_Amputee_UpperArm = "Parte superiore del Braccio Sinistro Amputato",
|
||||||
|
UI_trait_Amputee_UpperArm_desc = "",
|
||||||
|
|
||||||
|
UI_trait_Insensitive = "Insensibile",
|
||||||
|
UI_trait_Insensitive_desc = "",
|
||||||
|
|
||||||
|
|
||||||
|
UI_Say_CantEquip = "Non posso equipaggiarlo..."
|
||||||
|
}
|
||||||
BIN
media/ui/Traits/trait_Amputee_ForeArm.png
Normal file
BIN
media/ui/Traits/trait_Amputee_ForeArm.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
BIN
media/ui/Traits/trait_Amputee_Hand.png
Normal file
BIN
media/ui/Traits/trait_Amputee_Hand.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
BIN
media/ui/Traits/trait_Amputee_UpperArm.png
Normal file
BIN
media/ui/Traits/trait_Amputee_UpperArm.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
BIN
media/ui/Traits/trait_insensitive.png
Normal file
BIN
media/ui/Traits/trait_insensitive.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 237 B |
4
mod.info
4
mod.info
@@ -1,8 +1,8 @@
|
|||||||
name=The Only Cure
|
name=The Only Cure
|
||||||
poster=poster.png
|
poster=poster.png
|
||||||
description=Bitten? Not a problem!
|
description=You've been bitten. You have only two choices.
|
||||||
id=TheOnlyCure
|
id=TheOnlyCure
|
||||||
icon=icon.png
|
icon=icon.png
|
||||||
url=https://github.com/ZioPao/The-Only-Cure
|
url=https://github.com/ZioPao/The-Only-Cure
|
||||||
modversion=2.0.1
|
modversion=2.0.3
|
||||||
pzversion=41.65
|
pzversion=41.65
|
||||||
|
|||||||
Reference in New Issue
Block a user