ToME: the Tales of Maj'Eyal
http://forums.te4.org/

[v1.3.0+] Use Alchemist Gems From Inventory
http://forums.te4.org/viewtopic.php?f=50&t=46604
Page 1 of 1

Author:  Zizzo [ Thu Jul 14, 2016 11:24 pm ]
Post subject:  [v1.3.0+] Use Alchemist Gems From Inventory

Dunno if anyone else does this, but I like to keep some low-tier alchemist gems around to use for talents like Gem Portal or Refit Golem, saving my high-tier gems for bombs. It's kind of annoying swapping wielded gems every time, so I whipped up a new addon Use Alchemist Gems from Inventory. This affects the talents:
  • Refit Golem
  • Gem Portal
  • Throw Bomb
  • Shockwave Bomb
  • Thunderclap
(Let me know if I've missed any…) On the right-click binding menu for the talent (or via the Talents dialog), you can choose the new option "Prompt for alchemist gems to use with this talent"; with that in place, when you use the talent, an inventory dialog will pop up listing your alchemist gems in inventory and in your quiver, allowing you to choose which ones to use. Canceling out of this dialog will cancel the talent usage.

Now, to make this work, the internal implementation has to actually physically swap the selected gems into the quiver before using the talent and back out afterward, so you'll see log messages to that effect (I've tried to make an effort to avoid triggering Swift Hands' cooldown; let me know if I got that wrong or missed something related). And yes, technically this is probably sort of cheating, so it probably won't be going into ZOmnibus.

[And for addon developers, if your addon adds talents that use alchemist gems and you want them to be bindable with this talent, all you need to do is add a 'uses_alchemist_gems' field to your talent definition; its value should be either the number of gems needed or a function(self,t) that returns the number of gems needed.]

[Technical notes:]
Code:
Hooks:
  ToME:load [to mark talents that use alchemist gems]
Superload:
  mod.class.Actor:
    hasAlchemistWeapon() [to change alchemist gems for talent description purposes]
    preUseTalent() [to prompt for and wield alchemist gems]
    postUseTalent() [to re-wield original alchemist gems]
  mod.dialog.UseTalents:
    use() [overloaded, to add our binding to the appropriate talents]

Author:  Zizzo [ Sat Oct 15, 2016 9:49 pm ]
Post subject:  Re: [v1.3.0+] Use Alchemist Gems From Inventory

Quickie release 1a, adding a warning popup to the character creation dialog to prevent this addon from being used with the (for now) mutually incompatible Arcane Combat Tweaks addon.

Author:  Zizzo [ Fri Mar 10, 2017 12:36 am ]
Post subject:  Re: [v1.3.0+] Use Alchemist Gems From Inventory

Release v2 uses the new UseTalents:generate and UseTalents:use hooks added by DarkGod (thanks again!) to add our "Prompt for alchemist gems to use with this talent" command to the right-click menu of talents that use alchemist gems. There should be no visible change in functionality, but we're now compatible with Arcane Combat Tweaks (for all your really eclectic Adventurer needs :wink: ) — if you upgrade both addons at the same time.

[And another reminder here: if you're using this addon together with Restart Sustains or ZOmnibus, be sure to upgrade those addons when you upgrade this one.]

Also, as long as I was in the neighborhood, I added markers to the hotkey icons of any talents that you've bound to prompt for alchemist gems, as a convenient reminder:

Attachment:
bind-mark.png
bind-mark.png [ 26.94 KiB | Viewed 1087 times ]

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/