Skip to content
This repository has been archived by the owner on Jan 21, 2023. It is now read-only.

Enhancement Request: Trigger Regeneration more Flexibly #298

Open
Jeznar opened this issue Jun 14, 2022 · 4 comments
Open

Enhancement Request: Trigger Regeneration more Flexibly #298

Jeznar opened this issue Jun 14, 2022 · 4 comments
Labels
enhancement improvement to existing feature
Milestone

Comments

@Jeznar
Copy link

Jeznar commented Jun 14, 2022

Based on my understanding, this module triggers regeneration if an actor has an item that exactly matches one of two words (Regeneration or Self-Repair). I would like to see that changed to trigger on any item that starts with one of those strings allowing items with names like Regeneration, Vampire and Regeneration, Lycanthrope to be used to the same effect. This in turn allows for more options in how to manage the items.

I've made this change in my local copy of the module by changing line 35 of dnd5e-helpers/scripts/modules/Regeneration.js from:

const regen = actor.items.find(i => i.name === regenName || i.name === selfRepairName);

to:

const regen = actor.items.find(i => i.name.startsWith(regenName) || i.name.startsWith(selfRepairName));
@MrPotatoZed
Copy link

Looks like this would be addressed by the change mentioned above but I just want to note in case you think about another approach that it would be helpful if the creatures with features named "Regeneration." would trigger regeneration. Looks like creatures imported from roll20 campaigns have the period inserted in the name of the regeneration feature either by roll20 or by the importer and it took me a while to realize the period in the name was what was blocking 5e helpers from working. It's not particularly hard to remove the period from the feature name but the issue is figuring which creatures I need to go in and change the names for. If it is possible to recognize features with a period after the name it would be appreciated.

@trioderegion
Copy link
Owner

5e Helpers will never try to account for the quirks of importers, particularly those in the gray-area of Roll20 exports.

@trioderegion
Copy link
Owner

After briefly considering tossing this into 4.2.0. I think I'm going to hold off. I would like to push Regeneration configuration beyond the stock two we have (for legacy reasons) into special traits for more flexibility.

@Jeznar
Copy link
Author

Jeznar commented Jul 31, 2022

I would like to push Regeneration configuration beyond the stock two we have (for legacy reasons) into special traits for more flexibility.

I'm not sure what that actually means, but as long as more flexibility is crafted in I like it. Especially if we get away from having magic names for items that trigger a scan of the description for more magic words.

@trioderegion trioderegion modified the milestones: next, 4.3.0 Aug 11, 2022
@trioderegion trioderegion added the enhancement improvement to existing feature label Aug 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement improvement to existing feature
Projects
None yet
Development

No branches or pull requests

3 participants