diff --git a/game/modules/tome/class/Game.lua b/game/modules/tome/class/Game.lua index 818ee8a4972dc7d43565f7b5ae1826cdc57febeb..c76488037190542c486df40fb2033f3dd6700135 100644 --- a/game/modules/tome/class/Game.lua +++ b/game/modules/tome/class/Game.lua @@ -1510,6 +1510,11 @@ do return end self.player:playerLevelup(nil, false) end, + TOGGLE_AUTOTALENT = function() + self.player.no_automatic_talents = not self.player.no_automatic_talents + game.log("#GOLD#Automatic talent usage: %s", not self.player.no_automatic_talents and "#LIGHT_GREEN#enabled" or "#LIGHT_RED#disabled") + end, + SAVE_GAME = function() self:saveGame() end, diff --git a/game/modules/tome/class/Player.lua b/game/modules/tome/class/Player.lua index e074403ec6db7c717c534079dac3be352460065b..ed1864cb0f774449cfbefb8b25f6c50b0ae5d3f1 100644 --- a/game/modules/tome/class/Player.lua +++ b/game/modules/tome/class/Player.lua @@ -705,6 +705,8 @@ end --- Try to auto use listed talents -- This should be called in your actors "act()" method function _M:automaticTalents() + if self.no_automatic_talents then return end + self:attr("_forbid_sounds", 1) for tid, c in pairs(self.talents_auto) do local t = self.talents_def[tid] diff --git a/game/modules/tome/data/keybinds/tome.lua b/game/modules/tome/data/keybinds/tome.lua index 97e2c3d0ea7805f8dfca0aab864bd0078b551c70..f8d91f23dc9b5d19b055a2ed5d32935afda81dee 100644 --- a/game/modules/tome/data/keybinds/tome.lua +++ b/game/modules/tome/data/keybinds/tome.lua @@ -218,4 +218,11 @@ defineAction{ type = "LOCK_TOOLTIP_COMPARE", group = "interface", name = "Locks tooltip in place while comparing items", -} \ No newline at end of file +} + +defineAction{ + default = { "sym:_p:true:false:false:false" }, + type = "TOGGLE_AUTOTALENT", + group = "action", + name = "Toggle automatic talent usage", +}