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

Impact and momentum tweaks #33

Draft
wants to merge 108 commits into
base: main
Choose a base branch
from
Draft

Conversation

rsek
Copy link
Contributor

@rsek rsek commented Jan 24, 2022

this PR is based on #29 (so it's smaller than it looks - i just don't know how to mark PRs as dependent on each other, if it's possible, haha). it resolves XenotropicDev/TheOracle#71 and makes several cosmetic tweaks to impact- and momentum-related output (plus some methods to support making those tweaks). i'm pretty sure it's done, but i'm marking it as Draft because i haven't had a chance to thoroughly test/review it yet or clean up comments.

Impact autocomplete

  • impacts are serialized to a Dictionary<string, Term> (for the time being) from glossary.json, filtered by whether they can apply to PCs, and are provided as autocomplete options (with simple StartsWith() matching)
  • the slash command will accept any string as a valid Impact (which remain a List<string> on the PlayerCharacter class), it just hints users towards the 'vanilla' options
    • this should make our lives easier if we want to add, say, reminders like "hey, you're Wounded, are you sure you want to increase your health?", while still retaining the flexibility of custom impacts
    • they're only case-insensitive in one direction atm, so i may add something to correct input like wounded to Wounded if there's a case-insensitive match among the 'canon' options (less likely with autocorrect, but possible)

Revised /player-character impacts command

Screen Shot 2022-01-24 at 6 29 32 AM

  • the new slash command option "action" can be either "Add" or "Remove"
    • i considered a "pure" toggle without that, but given that the player won't necessarily be looking at their sheet (and thus their impacts), it could lead to the frustrating experience of toggling something you'd forgotten about and ending up with the opposite of your desired impact state

the slash command provides feedback to the user via ephemeral, with a link button to the PC embed:
Screen Shot 2022-01-24 at 6 36 14 AM

if for some reason it can't add or remove the desired impact, it returns a similar status message so that the user can see if they typoed something or tried to add something that was already there.
Screen Shot 2022-01-24 at 6 38 27 AM

Momentum Burn

Momentum burn now replaces the old roll embed, but retains the old roll output, too (styled as strikethrough).

Screen Shot 2022-01-24 at 6 14 29 AM

the real reason i did this is because i think it's satisfying to see the old roll struck out and the new result replacing it :D but practically speaking it reduces clutter a little, too, and keeps a nice little record of the event.

Non-user-facing changes

various utilities, all of which support the above in some way - mostly for the purposes of composing or styling text input, or generating a component.

Further development

  • move refs to relevant moves (from data included in glossary)
  • the impacts doesn't currently fall back to last used character id; currently that functionality embedded in /roll action-pc, so i'll need to externalize it in some fashion
  • a custom character autocomplete handler could return a string like "Marc Progress (Doomed, Wounded, Shaken)" as autocomplete result instead of just "Marc Progress", offering useful contextual information
    • some way to create such handlers programmatically (basically something where we can say "reference these same db items, but output this specific information from them") might be interesting, but i'm not sure that could work with how autocomplete handlers are currently structured by Discord.net.
  • not relevant for this PR, but for the sake of me remembering this later: rendering some player character data in an ephemeral embed could be a way for ppl to "peek" at (or even interact with) their character sheet without even switching to a different channel
    • i wonder how well it'd work to unmoor PCs from non-ephemeral posts entirely and have them only visible by invoking an ephemeral. would losing a single "anchor point" like that make things too abstract? what about once Modals are available? hmm...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

autocomplete handler for Impacts
1 participant