ToME: the Tales of Maj'Eyal

Everything about ToME
It is currently Sat Oct 20, 2018 6:13 pm

All times are UTC




Post new topic Reply to topic  [ 10 posts ] 
Author Message
PostPosted: Sun Dec 18, 2016 4:32 pm 
Offline
Sher'Tul Godslayer

Joined: Thu Jan 23, 2003 8:13 pm
Posts: 1563
Location: A shallow water area south of Bree
It's apparently a common annoyance for users of the Wild-Gift/Fungus tree: the relatively anemic regeneration effect triggered by Fungal Growth blocks other, actually useful regeneration talents from being used. This can be bypassed by right-clicking on the mini-regeneration effect to end it early, of course, but that's still a hassle.

The obvious solution, it seems, would be to have Fungal Growth use its own regeration-like effect that doesn't block the usual regeneration effect. To that end, I offer my new Fungal Growth addon.

The new Fungal Regeneration effect triggered by Fungal Growth stacks normally with other regeneration effects; since it's usually a pretty small effect (notably because it isn't [and wasn't] enhanced by Wild Growth), I figure that's not a huge power boost. If the assembled commentariat disagrees, then a later version we can always have Fungal Regeneration auto-cancel itself when a Regeneration effect is active.

[Implementation notes:]
Code:
Hooks:
  ToME:load [to load our Fungal Regeneration effect and install our callbackOnHeal on Wild Growth]
Superload:
  mod.class.Actor:
    setEffect() [to block Fungal Growth's Regeneration effect in favor of ours]

_________________
"Blessed are the yeeks, for they shall inherit Arda..."


Top
 Profile  
 
PostPosted: Sun Dec 18, 2016 6:21 pm 
Offline
Thalore

Joined: Fri Jul 18, 2014 11:48 am
Posts: 149
At first use healing ability that applied new regen efffect, an error pop-up:
Code:
[LOG]   Player's healing fungi accelerate.
stack traceback:
   [C]: in function 'error'
   /engine/interface/ActorTalents.lua:150: in function </engine/interface/ActorTalents.lua:140>
Lua Error: /engine/interface/GameTargeting.lua:119: /engine/interface/ActorTalents.lua:150: /data-fungal_regen/timed-effects.lua:43: attempt to index global 'Particles' (a nil value)
stack traceback:
   /data-fungal_regen/timed-effects.lua:43: in function 'activate'
   /engine/interface/ActorTemporaryEffects.lua:147: in function 'setEffect'
   /hooks/fungal_regen/load.lua:29: in function 'callTalent'
   /mod/class/Actor.lua:5026: in function 'cb'
   /mod/class/Actor.lua:2042: in function 'onHeal'
   /engine/interface/ActorLife.lua:57: in function 'heal'
   /data/talents/gifts/call.lua:96: in function </data/talents/gifts/call.lua:90>
   [C]: in function 'xpcall'
   /engine/interface/ActorTalents.lua:147: in function </engine/interface/ActorTalents.lua:140>
   At [C]:-1
   At [C]:-1 error
   At /engine/interface/GameTargeting.lua:119 fct
   At /engine/interface/GameTargeting.lua:125 targetMode
   At /engine/interface/GameTargeting.lua:254 targetMouse
   At /mod/class/Game.lua:2157 fct
   At /engine/Mouse.lua:58

Then new effect going to negative number of turns, and cannot be canceled via right click even in dev mode.

edit: game version 1.4.9 with embers and ashes.

_________________
Sorry for my bed English

Insane Atamathon in 1 game turn
The Ultimate Endgame Boss


Top
 Profile  
 
PostPosted: Sun Dec 18, 2016 9:47 pm 
Offline
Sher'Tul Godslayer

Joined: Thu Jan 23, 2003 8:13 pm
Posts: 1563
Location: A shallow water area south of Bree
St_ranger_er wrote:
At first use healing ability that applied new regen efffect, an error pop-up: [...]

[sound F/X: source diving] …I swear I tested that code before releasing it. *sigh* Pushing out v1a to fix this. We Apologize for the Error.™

_________________
"Blessed are the yeeks, for they shall inherit Arda..."


Top
 Profile  
 
PostPosted: Mon Dec 19, 2016 2:40 pm 
Offline
Thalore

Joined: Fri Jul 18, 2014 11:48 am
Posts: 149
Found a bug/feature: when fungi regen caused by healing infusion, direct heal from nature's touch doesn't overwrite old one, and therefore can not provide extra turn (through ancestral life). Personally i'm fine with don"t overwrite part, but if i want use heals for extra turns it does't prevent me from manually-cancel-regen tediousness, which is, i think, one of two most importent things about this ancestral life/fungal growth interaction.

_________________
Sorry for my bed English

Insane Atamathon in 1 game turn
The Ultimate Endgame Boss


Top
 Profile  
 
PostPosted: Tue Dec 20, 2016 1:01 am 
Offline
Sher'Tul Godslayer

Joined: Thu Jan 23, 2003 8:13 pm
Posts: 1563
Location: A shallow water area south of Bree
St_ranger_er wrote:
Found a bug/feature: when fungi regen caused by healing infusion, direct heal from nature's touch doesn't overwrite old one, and therefore can not provide extra turn (through ancestral life). Personally i'm fine with don"t overwrite part, but if i want use heals for extra turns it does't prevent me from manually-cancel-regen tediousness, which is, i think, one of two most importent things about this ancestral life/fungal growth interaction.

[sound F/X: source diving] Hmm, tricky. The Ancestral Life energy refund happens inside the Regeneration effect's activate() method, and thus also in Fungal Regeneration's activate() method; to get it to happen in the case you describe, since activate() isn't being called, we'd have to arrange for it to happen somewhere else. Give me a little time on this one.

_________________
"Blessed are the yeeks, for they shall inherit Arda..."


Top
 Profile  
 
PostPosted: Wed Dec 21, 2016 11:48 am 
Offline
Thalore

Joined: Fri Jul 18, 2014 11:48 am
Posts: 149
I have the idea how it can be done, maybe it helps:
add callbackOnHeal in ancestral life talent. something like that:
Code:
   
callbackOnHeal = function(self, t, value)
    game.log("===callbackOnHeal start===")
    
    if self:attr("fungal_growth") and self:attr("allow_on_heal") and value > 0 then
      if self:knowTalent(self.T_ANCESTRAL_LIFE) and not self:attr("disable_ancestral_life") then
        local t = self:getTalentFromId(self.T_ANCESTRAL_LIFE)
        self.energy.value = self.energy.value + (t.getTurn(self, t) * game.energy_to_act / 100)
      end
    end 
   
    game.log("===callbackOnHeal end===")
   end

and remove added turns when new fungi applied.

edit:
or add the same code as on_merge in fungi regen timed effect.

_________________
Sorry for my bed English

Insane Atamathon in 1 game turn
The Ultimate Endgame Boss


Top
 Profile  
 
PostPosted: Wed Dec 21, 2016 10:30 pm 
Offline
Sher'Tul Godslayer

Joined: Thu Jan 23, 2003 8:13 pm
Posts: 1563
Location: A shallow water area south of Bree
St_ranger_er wrote:
edit:
or add the same code as on_merge in fungi regen timed effect.

GMTA. :wink: That's now up as v1b.

_________________
"Blessed are the yeeks, for they shall inherit Arda..."


Top
 Profile  
 
PostPosted: Thu Dec 22, 2016 12:11 am 
Offline
Perspiring Physicist

Joined: Sun Sep 09, 2012 7:43 am
Posts: 5759
Healing Infusion can't trigger Ancestral Life... Deliberately disables it.

_________________
My feedback meter decays into coding. Give me feedback and I make mods.


Top
 Profile  
 
PostPosted: Thu Dec 22, 2016 4:10 pm 
Offline
Sher'Tul Godslayer

Joined: Thu Jan 23, 2003 8:13 pm
Posts: 1563
Location: A shallow water area south of Bree
HousePet wrote:
Healing Infusion can't trigger Ancestral Life... Deliberately disables it.

Right, but it does trigger Fungal Growth. The sequence of events AIUI is:
  • Player uses healing infusion. This triggers Fungal Growth's Regeneration (without this addon) or Fungal Regeneration (with this addon) effect,, which normally would trigger Ancestral Life but does not due to the disabling you mention.
  • While the above effect is still active, player uses Nature's Touch. Because a Regeneration/Fungal Regeneration effect is active, no regeneration effect is triggered and so Ancestral Life isn't triggered.
That second step is the key; even with (the previous version of) this addon, the player would have to manually deactivate Fungal Regeneration before using a non-infusion healing effect to get Ancestral Life to trigger, and obviating that manual deactivation step was pretty much the point of this addon in the first place.

_________________
"Blessed are the yeeks, for they shall inherit Arda..."


Top
 Profile  
 
PostPosted: Thu Dec 22, 2016 10:03 pm 
Offline
Sher'Tul Godslayer

Joined: Mon Feb 14, 2011 11:16 pm
Posts: 2263
Zizzo wrote:
HousePet wrote:
Healing Infusion can't trigger Ancestral Life... Deliberately disables it.

Right, but it does trigger Fungal Growth. The sequence of events AIUI is:
  • Player uses healing infusion. This triggers Fungal Growth's Regeneration (without this addon) or Fungal Regeneration (with this addon) effect,, which normally would trigger Ancestral Life but does not due to the disabling you mention.
  • While the above effect is still active, player uses Nature's Touch. Because a Regeneration/Fungal Regeneration effect is active, no regeneration effect is triggered and so Ancestral Life isn't triggered.
That second step is the key; even with (the previous version of) this addon, the player would have to manually deactivate Fungal Regeneration before using a non-infusion healing effect to get Ancestral Life to trigger, and obviating that manual deactivation step was pretty much the point of this addon in the first place.


Hope this makes it into the core game

_________________
MADNESS rocks


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group