diff --git a/media/lua/client/TOC_Initialization.lua b/media/lua/client/TOC_Initialization.lua deleted file mode 100644 index 727b35a..0000000 --- a/media/lua/client/TOC_Initialization.lua +++ /dev/null @@ -1,43 +0,0 @@ -local PlayerHandler = require("TOC_PlayerHandler.lua") - - ------------------- ----@class Initialization -local Initialization = {} - - -function Initialization.StartMain() - -- Starts initialization for local client - Events.OnCreatePlayer.Add(PlayerHandler.InitializePlayer) - - Initialization.SetupTraits() - -end - -function Initialization.SetupTraits() - -- TODO Where is Perks.Left_Hand? - local amp1 = TraitFactory.addTrait("Amputee_Hand", getText("UI_trait_Amputee_Hand"), -8, getText("UI_trait_Amputee_Hand_desc"), false, false) - amp1:addXPBoost(Perks.Left_Hand, 4) - amp1:addXPBoost(Perks.Fitness, -1) - amp1:addXPBoost(Perks.Strength, -1) - - local amp2 = TraitFactory.addTrait("Amputee_LowerArm", getText("UI_trait_Amputee_LowerArm"), -10, getText("UI_trait_Amputee_LowerArm_desc"), false, false) - amp2:addXPBoost(Perks.Left_Hand, 4) - amp2:addXPBoost(Perks.Fitness, -1) - amp2:addXPBoost(Perks.Strength, -1) - - local amp3 = TraitFactory.addTrait("Amputee_UpperArm", getText("UI_trait_Amputee_UpperArm"), -20, getText("UI_trait_Amputee_UpperArm_desc"), false, false) - amp3:addXPBoost(Perks.Left_Hand, 4) - amp3:addXPBoost(Perks.Fitness, -1) - amp3:addXPBoost(Perks.Strength, -1) - - TraitFactory.addTrait("Insensitive", getText("UI_trait_Insensitive"), 6, getText("UI_trait_Insensitivedesc"), false, - false) - TraitFactory.setMutualExclusive("Amputee_Hand", "Amputee_LowerArm") - TraitFactory.setMutualExclusive("Amputee_Hand", "Amputee_UpperArm") - TraitFactory.setMutualExclusive("Amputee_LowerArm", "Amputee_UpperArm") -end - - - -Events.OnGameBoot.Add(Initialization.StartMain) \ No newline at end of file diff --git a/media/lua/client/TOC_Main.lua b/media/lua/client/TOC_Main.lua new file mode 100644 index 0000000..cd8cd77 --- /dev/null +++ b/media/lua/client/TOC_Main.lua @@ -0,0 +1,47 @@ +local PlayerHandler = require("TOC_PlayerHandler.lua") + + +------------------ +---@class Main +local Main = {} + + +function Main.Start() + -- Starts initialization for local client + Events.OnCreatePlayer.Add(PlayerHandler.InitializePlayer) + Main.SetupTraits() + +end + +---Setups the custom traits +function Main.SetupTraits() + -- Perks.Left_Hand is defined in perks.txt + + local traitsTable = {} + local trait1 = TraitFactory.addTrait("Amputee_Hand", getText("UI_trait_Amputee_Hand"), -8, getText("UI_trait_Amputee_Hand_desc"), false, false) + traitsTable[1] = trait1 + + local trait2 = TraitFactory.addTrait("Amputee_LowerArm", getText("UI_trait_Amputee_LowerArm"), -10, getText("UI_trait_Amputee_LowerArm_desc"), false, false) + traitsTable[2] = trait2 + + local trait3 = TraitFactory.addTrait("Amputee_UpperArm", getText("UI_trait_Amputee_UpperArm"), -20, getText("UI_trait_Amputee_UpperArm_desc"), false, false) + traitsTable[2] = trait3 + + for i=1, #traitsTable do + local t = traitsTable[i] + 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_Insensitivedesc"), false, false) + + TraitFactory.setMutualExclusive("Amputee_Hand", "Amputee_LowerArm") + TraitFactory.setMutualExclusive("Amputee_Hand", "Amputee_UpperArm") + TraitFactory.setMutualExclusive("Amputee_LowerArm", "Amputee_UpperArm") +end + + +--* Events *-- + +Events.OnGameBoot.Add(Main.Start) \ No newline at end of file diff --git a/media/perks.txt b/media/perks.txt new file mode 100644 index 0000000..c965553 --- /dev/null +++ b/media/perks.txt @@ -0,0 +1,54 @@ +VERSION = 1, + +perk Prosthesis +{ + parent = None, + translation = Prosthesis, + passive = false, + xp1 = 0, + xp2 = 0, + xp3 = 0, + xp4 = 0, + xp5 = 0, + xp6 = 0, + xp7 = 0, + xp8 = 0, + xp9 = 0, + xp10 = 0, +} + +perk Left_Hand +{ + 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, + passive = false, + xp1 = 50, + xp2 = 100, + xp3 = 200, + xp4 = 500, + xp5 = 1000, + xp6 = 2500, + xp7 = 4000, + xp8 = 6000, + xp9 = 7000, + xp10 = 9000, +} \ No newline at end of file