diff --git a/game/modules/tome/class/Actor.lua b/game/modules/tome/class/Actor.lua index 352403d06a820a8b65adfef932b90719fca70eb5..a76cfc9a28632bfde1a904a9bbb214793934ca20 100644 --- a/game/modules/tome/class/Actor.lua +++ b/game/modules/tome/class/Actor.lua @@ -3138,6 +3138,7 @@ function _M:die(src, death_note) self:move(self.x, self.y, true) self:check("on_resurrect", "basic_resurrect") self:triggerHook{"Actor:resurrect", reason="basic_resurrect"} + self:fireTalentCheck("callbackOnResurrect", "basic_resurrect") if self:attr("self_resurrect_chat") then local chat = Chat.new(self.self_resurrect_chat, self, game.player) @@ -5984,6 +5985,7 @@ local sustainCallbackCheck = { callbackOnDeath = "talents_on_death", callbackOnDeathbox = "talents_on_deathbox", callbackOnSummonDeath = "talents_on_summon_death", + callbackOnResurrect = "talents_on_resurrect", callbackOnDie = "talents_on_die", callbackOnKill = "talents_on_kill", callbackOnSummonKill = "talents_on_summon_kill", diff --git a/game/modules/tome/data/talents/undeads/lich.lua b/game/modules/tome/data/talents/undeads/lich.lua index 791afdda8e04201e998bd8d384f9409b92ecbc69..2c7fde94feaf3fae1bc2d5557c167b310129cf91 100644 --- a/game/modules/tome/data/talents/undeads/lich.lua +++ b/game/modules/tome/data/talents/undeads/lich.lua @@ -35,7 +35,7 @@ newTalent{ self.lich_first_rez = true _G.a=dialog dialog:cleanActor(self) - dialog:resurrectBasic(self) + dialog:resurrectBasic(self, "lich_rebirth") dialog:restoreResources(self) self:callTalent(self.T_LICH, "becomeLich") @@ -48,7 +48,7 @@ newTalent{ elseif not self:hasEffect(self.EFF_LICH_HUNGER) and not self.lich_no_more_regen then list[#list+1] = {name=("Lich Regeneration (%d turns)"):tformat(t.getTurns(self, t)), action=function() dialog:cleanActor(self) - dialog:resurrectBasic(self) + dialog:resurrectBasic(self, "lich_regen") dialog:restoreResources(self) game.level.map:particleEmitter(self.x, self.y, 1, "demon_teleport") diff --git a/game/modules/tome/dialogs/DeathDialog.lua b/game/modules/tome/dialogs/DeathDialog.lua index 48040ffaf089c290a53c25812667f3df4e54ea10..7d2fc20a80436c74f5fb89518aa40a6197df0bdf 100644 --- a/game/modules/tome/dialogs/DeathDialog.lua +++ b/game/modules/tome/dialogs/DeathDialog.lua @@ -128,7 +128,7 @@ function _M:restoreResources(actor) end --- Basic resurrection -function _M:resurrectBasic(actor) +function _M:resurrectBasic(actor, reason) actor.dead = false actor.died = (actor.died or 0) + 1 @@ -160,6 +160,8 @@ function _M:resurrectBasic(actor) game.paused = true actor:checkTwoHandedPenalty() + + actor:fireTalentCheck("callbackOnResurrect", reason or "unknown") end --- Send the party to the Eidolon Plane @@ -177,7 +179,7 @@ function _M:eidolonPlane() local is_exploration = game.permadeath == game.PERMADEATH_INFINITE self:cleanActor(self.actor) - self:resurrectBasic(self.actor) + self:resurrectBasic(self.actor, "eidolon_plane") for e, _ in pairs(game.party.members) do self:cleanActor(e) end @@ -222,7 +224,7 @@ function _M:use(item) game.logPlayer(self.actor, "#LIGHT_BLUE#You resurrect! CHEATER!") self:cleanActor(self.actor) - self:resurrectBasic(self.actor) + self:resurrectBasic(self.actor, "cheat") self:restoreResources(self.actor) self.actor:check("on_resurrect", "cheat") self.actor:triggerHook{"Actor:resurrect", reason="cheat"} @@ -231,7 +233,7 @@ function _M:use(item) game.logPlayer(self.actor, "#LIGHT_RED#The Blood of Life rushes through your dead body. You come back to life!") self:cleanActor(self.actor) - self:resurrectBasic(self.actor) + self:resurrectBasic(self.actor, "blood_life") self:restoreResources(self.actor) world:gainAchievement("UNSTOPPABLE", actor) self.actor:check("on_resurrect", "blood_life") @@ -251,7 +253,7 @@ function _M:use(item) game.logPlayer(self.actor, "#YELLOW#Your bones magically knit back together. You are once more able to dish out pain to your foes!") self:cleanActor(self.actor) - self:resurrectBasic(self.actor) + self:resurrectBasic(self.actor, "skeleton") self:restoreResources(self.actor) world:gainAchievement("UNSTOPPABLE", actor) self.actor:check("on_resurrect", "skeleton") @@ -263,7 +265,7 @@ function _M:use(item) game.logPlayer(self.actor, "#YELLOW#Your %s is consumed and disappears! You come back to life!", o:getName{do_colour=true}) self:cleanActor(self.actor) - self:resurrectBasic(self.actor) + self:resurrectBasic(self.actor, "consume", o) self:restoreResources(self.actor) world:gainAchievement("UNSTOPPABLE", actor) self.actor:check("on_resurrect", "consume", o)