From 98feab2cb553dd7324cb26f88bcdb96c96be0b6d Mon Sep 17 00:00:00 2001 From: DarkGod <darkgod@net-core.org> Date: Wed, 16 Nov 2016 22:40:52 +0100 Subject: [PATCH] stuff for .. stuff --- game/engines/default/engine/ui/ActorFrame.lua | 4 ++++ game/modules/tome/class/Actor.lua | 1 + game/modules/tome/class/Player.lua | 4 ++-- game/modules/tome/class/interface/ActorLife.lua | 2 ++ 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/game/engines/default/engine/ui/ActorFrame.lua b/game/engines/default/engine/ui/ActorFrame.lua index 321a355c3b..a68814ac95 100644 --- a/game/engines/default/engine/ui/ActorFrame.lua +++ b/game/engines/default/engine/ui/ActorFrame.lua @@ -34,6 +34,10 @@ function _M:init(t) Base.init(self, t) end +function _M:setActor(actor) + self.actor = actor +end + function _M:generate() end diff --git a/game/modules/tome/class/Actor.lua b/game/modules/tome/class/Actor.lua index 0f25d86602..93ab444e1d 100644 --- a/game/modules/tome/class/Actor.lua +++ b/game/modules/tome/class/Actor.lua @@ -4936,6 +4936,7 @@ local sustainCallbackCheck = { callbackOnDeath = "talents_on_death", callbackOnDeathbox = "talents_on_deathbox", callbackOnSummonDeath = "talents_on_summon_death", + callbackOnDie = "talents_on_die", callbackOnKill = "talents_on_kill", callbackOnMeleeAttack = "talents_on_melee_attack", callbackOnMeleeHit = "talents_on_melee_hit", diff --git a/game/modules/tome/class/Player.lua b/game/modules/tome/class/Player.lua index 130087e2f3..b85eef0f6d 100644 --- a/game/modules/tome/class/Player.lua +++ b/game/modules/tome/class/Player.lua @@ -436,7 +436,7 @@ function _M:updateMainShader() if solipsism_power > 0 then game.fbo_shader:setUniform("solipsism_warning", solipsism_power) else game.fbo_shader:setUniform("solipsism_warning", 0) end end - if (self:attr("no_healing") or ((self.healing_factor or 1) <= 0)) ~= self.old_healwarn then + if ((self:attr("no_healing") or ((self.healing_factor or 1) <= 0)) ~= self.old_healwarn) and not self:attr("no_healing_no_warning") then if (self:attr("no_healing") or ((self.healing_factor or 1) <= 0)) then game.fbo_shader:setUniform("intensify", {0.3,1.3,0.3,1}) else @@ -977,7 +977,7 @@ function _M:restCheck() if not self.resting.rest_turns then if self.air_regen < 0 then return false, "losing breath!" end if self.life_regen <= 0 then return false, "losing health!" end - if self.life < self.max_life and self.life_regen> 0 then return true end + if self.life < self.max_life and self.life_regen > 0 and not self:attr("no_life_regen") then return true end if self.air < self.max_air and self.air_regen > 0 and not self.is_suffocating then return true end for act, def in pairs(game.party.members) do if game.level:hasEntity(act) and not act.dead then if act.life < act.max_life and act.life_regen > 0 and not act:attr("no_life_regen") then return true end diff --git a/game/modules/tome/class/interface/ActorLife.lua b/game/modules/tome/class/interface/ActorLife.lua index 3c42989f74..9f6ed540d7 100644 --- a/game/modules/tome/class/interface/ActorLife.lua +++ b/game/modules/tome/class/interface/ActorLife.lua @@ -26,6 +26,8 @@ module(..., package.seeall, class.inherit(Base)) local function oktodie(self, value, src, death_note) if self:knowTalent(self.T_CAUTERIZE) and self:triggerTalent(self.T_CAUTERIZE, nil, value) then return false, 0 + elseif self:fireTalentCheck("callbackOnDie", value, src, death_note) then + return false, 0 else if src and src.on_kill and src:on_kill(self) then return false, value end return self:die(src, death_note), value -- GitLab