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

Concentration automation #3028

Closed
9 tasks done
Fyorl opened this issue Feb 12, 2024 · 5 comments
Closed
9 tasks done

Concentration automation #3028

Fyorl opened this issue Feb 12, 2024 · 5 comments
Assignees
Labels
api epic system: active effects ui User interface related features or bugs ux User experience related features or bugs
Milestone

Comments

@Fyorl
Copy link
Contributor

Fyorl commented Feb 12, 2024

Must Haves

  • When casting a spell, create an AE that can act as the origin of any effects applied by that spell.
    • Eagerly created for concentration spells.
    • Lazily created (i.e. if one of the spell's effects is applied to any target) for non-concentration spells that have a duration.
  • If the spell requires concentration, the AE should apply the 'concentrating' status.
  • Deleting this AE should delete all AEs that were connected to it.
  • Create an extra field on the Actor data model for a bonus to concentration saves specifically. Probably in special traits?
  • When an Actor takes damage, create a roll request chat message to roll a Constitution (concentration) saving throw with an auto-calculated DC. Send this message to any owner of the Actor.
  • Display a warning message in the spell use dialog that reminds a player if their character is already concentrating on something.
  • Automatically end concentration if another spell requiring concentration is cast regardless.
  • The spell use dialog should allow for an option to not have this instance of the spell require concentration.

Ideal

  • Extend this functionality to any item with the concentration property.

Additional Notes

  • Auto-calculating concentration save DC is dependant on us enabling the resistances/immunities/vulnerabilities automation. Not too much work left to do there though. Mostly UI/UX.
@Fyorl Fyorl added epic ui User interface related features or bugs api ux User experience related features or bugs system: active effects labels Feb 12, 2024
@Fyorl Fyorl added this to the D&D5E 3.1.0 milestone Feb 12, 2024
@schultzcole
Copy link
Collaborator

When the origin effect on the casting actor ends, do we also end any effects on other actors that have the origin effect as their origin?

@krbz999
Copy link
Contributor

krbz999 commented Feb 12, 2024

The chat message prompt for saving throws should also have utility buttons for:

  • ending concentration easily (perhaps store the uuid of the concentration effect).
  • removing templates created from the item on which the actor was concentrating (easy comparison due to templateDocument.flags.dnd5e.origin).

Extend this functionality to any item with the concentration property.

We should make use of Item5e#requiresConcentration. There should not be an issue extending this to all item types from the very beginning.

@Fyorl
Copy link
Contributor Author

Fyorl commented Feb 12, 2024

When the origin effect on the casting actor ends, do we also end any effects on other actors that have the origin effect as their origin?

Good catch, that is a glaring omission from the requirements. Just to be clear though, we are not intending on handling AE expiration with this epic. Handling manual deletion of AEs should be fine though.

@Fyorl
Copy link
Contributor Author

Fyorl commented Feb 12, 2024

A note on logistics for auto-deleting 'connected' AEs (i.e. those that have the 'concentrating' AE as their origin):

This is probably achievable in ActiveEffect5e#_onDelete by checking for game.users.activeGM and having them perform the deletion of connected AEs. We could potentially block the deletion of the source AE in _preDelete if there is no GM present in order to prevent AEs from becoming orphaned.

In order to efficiently determine which AEs are connected to the source AE, we will probably have to save a back-reference on the source AE whenever a new AE is created that uses the source AE as its origin.

@JPMeehan
Copy link
Contributor

JPMeehan commented Feb 13, 2024

For automatically ending concentration when casting another spell with concentration: Making that somehow configurable or its own function would really help with trying to manage the MCDM talent, which is designed around maintaining multiple concentrations. There's also at least one official monster with multiple concentrations, Niv-Mizzet.

(EDIT: Looks like this is covered in #3034)

krbz999 added a commit to krbz999/dnd5e that referenced this issue Mar 1, 2024
krbz999 added a commit to krbz999/dnd5e that referenced this issue Mar 1, 2024
krbz999 added a commit to krbz999/dnd5e that referenced this issue Mar 2, 2024
krbz999 added a commit to krbz999/dnd5e that referenced this issue Mar 2, 2024
krbz999 added a commit to krbz999/dnd5e that referenced this issue Mar 5, 2024
krbz999 added a commit to krbz999/dnd5e that referenced this issue Mar 5, 2024
krbz999 added a commit to krbz999/dnd5e that referenced this issue Mar 5, 2024
krbz999 added a commit to krbz999/dnd5e that referenced this issue Mar 5, 2024
krbz999 added a commit to krbz999/dnd5e that referenced this issue Mar 6, 2024
krbz999 added a commit to krbz999/dnd5e that referenced this issue Mar 6, 2024
krbz999 added a commit to krbz999/dnd5e that referenced this issue Mar 6, 2024
krbz999 added a commit to krbz999/dnd5e that referenced this issue Mar 6, 2024
krbz999 added a commit to krbz999/dnd5e that referenced this issue Mar 6, 2024
Fyorl added a commit that referenced this issue Mar 6, 2024
arbron added a commit that referenced this issue Mar 20, 2024
[#3028] Prompt for concentration save when damage is taken
@Fyorl Fyorl closed this as completed Mar 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api epic system: active effects ui User interface related features or bugs ux User experience related features or bugs
Projects
None yet
Development

No branches or pull requests

4 participants