[v1.5.0+] Don't Summon While Meditating

A place to post your add ons and ideas for them

Moderator: Moderator

Post Reply
Message
Author
Zizzo
Sher'Tul Godslayer
Posts: 2521
Joined: Thu Jan 23, 2003 8:13 pm
Location: A shallow water area south of Bree
Contact:

[v1.5.0+] Don't Summon While Meditating

#1 Post by Zizzo »

When I started out with Summoners, my initial assessment of the Meditation talent was, "Okay, obviously you want this one active all the time for equilibrium management. I mean, who cares about a damage penalty that only applies to the player, right?" [sound F/X: audience laugh track] :oops: Well, even so, it's still useful sometimes to pop Meditation for a few turns to rein in your equilibrium — which means every so often, my summons will start feeling lackluster, and I'll notice that I accidentally left Meditation active. :oops:

Hence my new Don't Summon While Meditating addon, which basically pops up a confirmation dialog if you try to summon something while the Meditation talent is active, configurable via new game option "Gameplay | Confirm summons while meditating". In theory, this should apply to any talent that uses equilibrium and is flagged as "is a summon", including talents from other addons; this is untested, however, and addon load ordering might factor in.

(Looking ahead, this addon strikes me as the sort of "protection from not paying attention" addon that led to ZOmnibus Lite in the first place, so it could maybe be merged into ZOmnibus but probably not ZOmnibus Lite.)

[Technical notes:]

Code: Select all

Hooks:
  ToME:load [to modify summoning talents]
  GameOptions:generateList [to add our game option]
"Blessed are the yeeks, for they shall inherit Arda..."

Zizzo
Sher'Tul Godslayer
Posts: 2521
Joined: Thu Jan 23, 2003 8:13 pm
Location: A shallow water area south of Bree
Contact:

Re: [v1.5.0+] Don't Summon While Meditating

#2 Post by Zizzo »

Well, that was a bit unnerving. A Steam user reported an error when using the Mummified Egg-sac of Ungolë; the stack trace didn't appear to go through any of my addons, but it demonstrably only happened when using ZOmnibus. I eventually tracked it down to this addon. See, Ungolë's use_power.use() uses some deep getfenv() wizardry to reach through the Spider talent's action method to grab a local function that probably isn't accessible any other way. [Seems like there ought to have been a more straightforward way of arranging it, but when in Eyal, I guess…] We, however, replace that action() method (among several others), and thus were screwing up the wizardry. That should be fixed in v1a.1, just pushed out.
"Blessed are the yeeks, for they shall inherit Arda..."

astralInferno
Uruivellas
Posts: 834
Joined: Mon Jan 27, 2014 10:40 am

Re: [v1.5.0+] Don't Summon While Meditating

#3 Post by astralInferno »

this is horrifying wizardry. o.o

...I wonder if it's possible to set up an on_pre_use that gives you a popup to clear before it works...
I guess if that was easy/useful you'd have done it. xD

Zizzo
Sher'Tul Godslayer
Posts: 2521
Joined: Thu Jan 23, 2003 8:13 pm
Location: A shallow water area south of Bree
Contact:

Re: [v1.5.0+] Don't Summon While Meditating

#4 Post by Zizzo »

astralInferno wrote:...I wonder if it's possible to set up an on_pre_use that gives you a popup to clear before it works...
I guess if that was easy/useful you'd have done it. xD
That would probably require a :talentDialog(), and I don't know if on_pre_use() is called with the right coroutine setup to use that. I vaguely recall having to specially set that up in the T2 module for the "are you sure you want to wield a katana with a shield?" prompt.
"Blessed are the yeeks, for they shall inherit Arda..."

Post Reply