Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reminder text doesn't work with repeated keywords #20

Closed
twanvl opened this issue May 5, 2020 · 2 comments
Closed

Reminder text doesn't work with repeated keywords #20

twanvl opened this issue May 5, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@twanvl
Copy link
Owner

twanvl commented May 5, 2020

Keywords that have a cost parameter that are under an ability that has the key word, even inside other words, but isn't the keyword, bug out reminder texts on the first ability. Example:
Equipped creature has wither.
Equip 1

is unable to have reminder text applied to "wither". A work around has been added for Equip specifically in the text filter, but other keywords are still like this. example:

Creatures you control with cycling have wither.
Cycling 2

This only happens when the keyword is below the non-keyword line, if it is above it the bug does not occur.

@twanvl twanvl added the bug Something isn't working label May 5, 2020
@twanvl
Copy link
Owner Author

twanvl commented May 12, 2020

Cause:

  • The KeywordTrie is used to find which keywords appear in the text. In the example above, Cycling is encountered first.
  • Then a regex is used to find the position of the match, which finds the second instance of "Cycling".
  • keyword processing is continued from there, so "wither" is skipped.

@twanvl
Copy link
Owner Author

twanvl commented May 15, 2020

Possible solution:

  • re-start the keyword trie from every word boundary, matching only keywords that start there
  • Similarly, make the regexes also match only at the start.

@twanvl twanvl closed this as completed in b3ddb29 May 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant