[b15b] "Increase all healing by %" do not affect regen

Where bugs go to lie down and rest

Moderator: Moderator

Post Reply
Message
Author
hops
Halfling
Posts: 111
Joined: Tue Sep 21, 2010 9:05 am

[b15b] "Increase all healing by %" do not affect regen

#1 Post by hops »

bug or feature?
Considering Infusion:Regeneration as the main source of healing, I think healing_factor should be taken into calculation of regen.

edge2054
Retired Ninja
Posts: 3756
Joined: Fri May 28, 2010 4:38 pm

Re: [b15b] "Increase all healing by %" do not affect regen

#2 Post by edge2054 »

It's a feature though I understand where you're coming from.

Heal is technically a damage type that adds rather then subtracts life.

Regen effects could be done as healing damage over several turns like cuts or bleeds in which case healing factor would effect it but currently (I believe) it just adds to how fast the character heals per turn instead.

hops
Halfling
Posts: 111
Joined: Tue Sep 21, 2010 9:05 am

Re: [b15b] "Increase all healing by %" do not affect regen

#3 Post by hops »

There is this piece of code in game/modules/tome/class/Actor.lua

Code: Select all

--- Called before healing
function _M:onHeal(value, src)
    if self:hasEffect(self.EFF_UNSTOPPABLE) then
        return 0
    end
    return value * (self.healing_factor or 1)
end
Maybe we can have a similar function onRegen. EFF_UNSTOPPABLE should be checked for regen from infusion too. ( though I do not know whether this is already implemented in other method.)

In the engine, we can have for ActorLife.lua

Code: Select all

 --- Regenerate life, call it from your actor class act() method
 function _M:regenLife()
 	if self.life_regen then
-	   self.life = util.bound(self.life + self.life_regen, 0, self.max_life)
+        value = self.life_regen
+        if self.onRegen then value = self:onRegen(value, src) end
+		self.life = util.bound(self.life + value, 0, self.max_life)
 	end
 end

Zonk
Sher'Tul
Posts: 1067
Joined: Sat Mar 01, 2003 4:01 pm

Re: [b15b] "Increase all healing by %" do not affect regen

#4 Post by Zonk »

I'd love this too - would make the Belt of Calm Water significantly more useful to characters without healing spells/effects.

Regeneration after all is just natural healing so not having it affected feels a bit weird, although I do understand it might be for coding issues(natural regen uses a different system than healing).
ToME online profile: http://te4.org/users/zonk
Addons (most likely obsolete): Wights, Trolls, Starting prodigy, Alternate save/resistance system

Post Reply