Perks handling
This commit is contained in:
@@ -6,9 +6,6 @@ local StaticData = require("TOC_StaticData")
|
|||||||
|
|
||||||
|
|
||||||
-- LIST OF STUFF THAT THIS CLASS NEEDS TO DO
|
-- LIST OF STUFF THAT THIS CLASS NEEDS TO DO
|
||||||
|
|
||||||
-- Main thing, should contain the other handlers when needed
|
|
||||||
-- Handling Items (as in amputations spawns)
|
|
||||||
-- Update current player status (infection checks)
|
-- Update current player status (infection checks)
|
||||||
-- handle stats increase\decrease
|
-- handle stats increase\decrease
|
||||||
|
|
||||||
@@ -77,7 +74,7 @@ function PlayerHandler.CheckInfection(character)
|
|||||||
for i=1, #StaticData.IGNORED_PARTS_STRINGS do
|
for i=1, #StaticData.IGNORED_PARTS_STRINGS do
|
||||||
local bodyPartType = BodyPartType[StaticData.IGNORED_PARTS_STRINGS[i]]
|
local bodyPartType = BodyPartType[StaticData.IGNORED_PARTS_STRINGS[i]]
|
||||||
local bodyPart = bd:getBodyPart(bodyPartType)
|
local bodyPart = bd:getBodyPart(bodyPartType)
|
||||||
if bodyPart and bodyPart:bitten() or bodyPart:IsInfected() then
|
if bodyPart and (bodyPart:bitten() or bodyPart:IsInfected()) then
|
||||||
PlayerHandler.modDataHandler:setIsIgnoredPartInfected(true)
|
PlayerHandler.modDataHandler:setIsIgnoredPartInfected(true)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -86,4 +83,21 @@ end
|
|||||||
|
|
||||||
Events.OnPlayerGetDamage.Add(PlayerHandler.CheckInfection)
|
Events.OnPlayerGetDamage.Add(PlayerHandler.CheckInfection)
|
||||||
|
|
||||||
|
---comment
|
||||||
|
---@param player IsoPlayer
|
||||||
|
function PlayerHandler.UpdatePerks(player)
|
||||||
|
-- TODO If player has an amputated limb, they're gonna level up them while doing normal stuff, getting better at it dynamically
|
||||||
|
-- TODO We should have a way to check if the player has done any amputation at all instead of having to check manually each time
|
||||||
|
|
||||||
|
-- TODO Should be run when player is doing stuff like picking up objects, not randomly
|
||||||
|
for side, _ in pairs(StaticData.SIDES_STRINGS) do
|
||||||
|
local limbName = "Hand_" .. side
|
||||||
|
if ModDataHandler.GetInstance():getIsCut(limbName) then
|
||||||
|
player:getXp():AddXP(Perks[limbName], 0.1)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
Events.OnPlayerUpdate.Add(PlayerHandler.UpdatePerks)
|
||||||
|
|
||||||
return PlayerHandler
|
return PlayerHandler
|
||||||
@@ -9,7 +9,6 @@ local AmputationHandler = require("Handlers/TOC_AmputationHandler")
|
|||||||
TestFramework.registerTestModule("Functionality", "PlayerHandler", function()
|
TestFramework.registerTestModule("Functionality", "PlayerHandler", function()
|
||||||
local Tests = {}
|
local Tests = {}
|
||||||
function Tests.InitializePlayer()
|
function Tests.InitializePlayer()
|
||||||
-- TODO This breaks the Test Framework mod for some reason.
|
|
||||||
local pl = getPlayer()
|
local pl = getPlayer()
|
||||||
PlayerHandler.InitializePlayer(_, pl, true)
|
PlayerHandler.InitializePlayer(_, pl, true)
|
||||||
end
|
end
|
||||||
|
|||||||
9
media/lua/shared/Translate/EN/IG_UI_EN.txt
Normal file
9
media/lua/shared/Translate/EN/IG_UI_EN.txt
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
IG_UI_EN = {
|
||||||
|
IGUI_perks_Amputations = "Amputations",
|
||||||
|
IGUI_perks_Hand_R = "Right Hand",
|
||||||
|
IGUI_perks_Hand_L = "Left Hand",
|
||||||
|
|
||||||
|
IGUI_perks_Prosthesis = "Prosthesis",
|
||||||
|
IGUI_perks_ProstFamiliarity= "Familiarity",
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,5 +1,57 @@
|
|||||||
VERSION = 1,
|
VERSION = 1,
|
||||||
|
|
||||||
|
perk Amputations
|
||||||
|
{
|
||||||
|
parent = None,
|
||||||
|
translation = Amputations,
|
||||||
|
passive = false,
|
||||||
|
xp1 = 0,
|
||||||
|
xp2 = 0,
|
||||||
|
xp3 = 0,
|
||||||
|
xp4 = 0,
|
||||||
|
xp5 = 0,
|
||||||
|
xp6 = 0,
|
||||||
|
xp7 = 0,
|
||||||
|
xp8 = 0,
|
||||||
|
xp9 = 0,
|
||||||
|
xp10 = 0,
|
||||||
|
}
|
||||||
|
perk Hand_L
|
||||||
|
{
|
||||||
|
parent = Amputations,
|
||||||
|
name = Hand_L,
|
||||||
|
translation = Hand_L,
|
||||||
|
passive = false,
|
||||||
|
xp1 = 50,
|
||||||
|
xp2 = 100,
|
||||||
|
xp3 = 200,
|
||||||
|
xp4 = 500,
|
||||||
|
xp5 = 1000,
|
||||||
|
xp6 = 2500,
|
||||||
|
xp7 = 4000,
|
||||||
|
xp8 = 5000,
|
||||||
|
xp9 = 7000,
|
||||||
|
xp10 = 9000,
|
||||||
|
}
|
||||||
|
perk Hand_R
|
||||||
|
{
|
||||||
|
parent = Amputations,
|
||||||
|
name = Hand_R,
|
||||||
|
translation = Hand_R,
|
||||||
|
passive = false,
|
||||||
|
xp1 = 50,
|
||||||
|
xp2 = 100,
|
||||||
|
xp3 = 200,
|
||||||
|
xp4 = 500,
|
||||||
|
xp5 = 1000,
|
||||||
|
xp6 = 2500,
|
||||||
|
xp7 = 4000,
|
||||||
|
xp8 = 6000,
|
||||||
|
xp9 = 7000,
|
||||||
|
xp10 = 9000,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
perk Prosthesis
|
perk Prosthesis
|
||||||
{
|
{
|
||||||
parent = None,
|
parent = None,
|
||||||
@@ -16,30 +68,11 @@ perk Prosthesis
|
|||||||
xp9 = 0,
|
xp9 = 0,
|
||||||
xp10 = 0,
|
xp10 = 0,
|
||||||
}
|
}
|
||||||
|
perk ProstFamiliarity
|
||||||
perk Left_Hand
|
|
||||||
{
|
{
|
||||||
parent = Prosthesis,
|
parent = Prosthesis,
|
||||||
name = Left_Hand,
|
name = ProstFamiliarity,
|
||||||
translation = Left_Hand,
|
translation = ProstFamiliarity,
|
||||||
passive = false,
|
|
||||||
xp1 = 50,
|
|
||||||
xp2 = 100,
|
|
||||||
xp3 = 200,
|
|
||||||
xp4 = 500,
|
|
||||||
xp5 = 1000,
|
|
||||||
xp6 = 2500,
|
|
||||||
xp7 = 4000,
|
|
||||||
xp8 = 5000,
|
|
||||||
xp9 = 7000,
|
|
||||||
xp10 = 9000,
|
|
||||||
}
|
|
||||||
|
|
||||||
perk Right_Hand
|
|
||||||
{
|
|
||||||
parent = Prosthesis,
|
|
||||||
name = Right_Hand,
|
|
||||||
translation = Right_Hand,
|
|
||||||
passive = false,
|
passive = false,
|
||||||
xp1 = 50,
|
xp1 = 50,
|
||||||
xp2 = 100,
|
xp2 = 100,
|
||||||
|
|||||||
Reference in New Issue
Block a user