summary refs log tree commit diff
path: root/rabbit-bugfix/hooks/load.lua
diff options
context:
space:
mode:
authorRabbit Whispers <us@starfall.systems>2025-06-14 12:58:57 -0500
committerRabbit Whispers <us@starfall.systems>2025-06-14 13:08:50 -0500
commit9c55fe0f404f26de278aeed490579b042a441d9b (patch)
tree37485d3ac8dc2290be1440beb9728438250574b6 /rabbit-bugfix/hooks/load.lua
parent7380279bedc3040cc4a923395368a5de8ffa7874 (diff)
bugfix: patch Adept in hooks rather than overload
Diffstat (limited to 'rabbit-bugfix/hooks/load.lua')
-rw-r--r--rabbit-bugfix/hooks/load.lua17
1 files changed, 17 insertions, 0 deletions
diff --git a/rabbit-bugfix/hooks/load.lua b/rabbit-bugfix/hooks/load.lua
new file mode 100644
index 0000000..7ae7c8d
--- /dev/null
+++ b/rabbit-bugfix/hooks/load.lua
@@ -0,0 +1,17 @@
+class:bindHook("ToME:load", function(self, data)
+	local Talents = require 'engine.interface.ActorTalents'
+	local TD = Talents.talents_def
+
+	-- update passives when adept is taken
+	if TD.T_ADEPT then
+		TD.T_ADEPT.passives = function(self, t, p)
+			self:talentTemporaryValue(p, "all_talents_bonus_level", 1.5)
+
+			if not self._updating_adept then
+				self._updating_adept = true
+				self:updateAllTalentsPassives()
+				self._updating_adept = nil
+			end
+		end
+	end
+end)