diff --git a/media/lua/client/Handlers/TOC_PlayerHandler.lua b/media/lua/client/Handlers/TOC_PlayerHandler.lua index 7f1af88..654f15a 100644 --- a/media/lua/client/Handlers/TOC_PlayerHandler.lua +++ b/media/lua/client/Handlers/TOC_PlayerHandler.lua @@ -6,9 +6,6 @@ local StaticData = require("TOC_StaticData") -- 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) -- handle stats increase\decrease @@ -77,7 +74,7 @@ function PlayerHandler.CheckInfection(character) for i=1, #StaticData.IGNORED_PARTS_STRINGS do local bodyPartType = BodyPartType[StaticData.IGNORED_PARTS_STRINGS[i]] 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) end end @@ -86,4 +83,21 @@ end 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 \ No newline at end of file diff --git a/media/lua/client/TOC_Test.lua b/media/lua/client/TOC_Test.lua index d98e64a..cdd30b5 100644 --- a/media/lua/client/TOC_Test.lua +++ b/media/lua/client/TOC_Test.lua @@ -9,7 +9,6 @@ local AmputationHandler = require("Handlers/TOC_AmputationHandler") TestFramework.registerTestModule("Functionality", "PlayerHandler", function() local Tests = {} function Tests.InitializePlayer() - -- TODO This breaks the Test Framework mod for some reason. local pl = getPlayer() PlayerHandler.InitializePlayer(_, pl, true) end diff --git a/media/lua/shared/Translate/ContextMenu_EN.txt b/media/lua/shared/Translate/EN/ContextMenu_EN.txt similarity index 100% rename from media/lua/shared/Translate/ContextMenu_EN.txt rename to media/lua/shared/Translate/EN/ContextMenu_EN.txt diff --git a/media/lua/shared/Translate/EN/IG_UI_EN.txt b/media/lua/shared/Translate/EN/IG_UI_EN.txt new file mode 100644 index 0000000..1d8983c --- /dev/null +++ b/media/lua/shared/Translate/EN/IG_UI_EN.txt @@ -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", + +} \ No newline at end of file diff --git a/media/lua/shared/Translate/UI_EN.txt b/media/lua/shared/Translate/EN/UI_EN.txt similarity index 100% rename from media/lua/shared/Translate/UI_EN.txt rename to media/lua/shared/Translate/EN/UI_EN.txt diff --git a/media/perks.txt b/media/perks.txt index c965553..24d9ca5 100644 --- a/media/perks.txt +++ b/media/perks.txt @@ -1,5 +1,57 @@ 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 { parent = None, @@ -16,30 +68,11 @@ perk Prosthesis xp9 = 0, xp10 = 0, } - -perk Left_Hand +perk ProstFamiliarity { parent = Prosthesis, - name = Left_Hand, - translation = Left_Hand, - 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, + name = ProstFamiliarity, + translation = ProstFamiliarity, passive = false, xp1 = 50, xp2 = 100,