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

[#893] Add summoning actor updates & overall workflow #3217

Merged
merged 2 commits into from
Mar 15, 2024
Merged

Conversation

arbron
Copy link
Collaborator

@arbron arbron commented Mar 8, 2024

Moves the summoning data into an EmbeddedDataField to allow for the summoning methods to be defined there rather than taking up a bunch of space in ActionTemplate.

Introduces SummonsData#summon method which takes the ID of a summoning profile and proceeds through the process of summoning the actor:

  1. Fetches the actor to summon based on the profile. This will eventually need some extra work to handle summoning from compendiums.

  2. Minimizes the actor sheet (if open) and determine placement on scene. Currently the placement is a placeholder method that just places the summons in a fixed position.

  3. Iterates over all token placements, requesting updates that will be made to the actor and its contained items for each placement.

  • Match proficiency is applied using an active effect
  • AC bonus is applied to ac.flat value if calc is flat, otherwise it uses an active effect to apply to ac.bonus
  • HP bonus is applied to hp.max unless summoned creature is a PC without an overriden maximum HP, in which case it uses an effect
  • Match attacks calculates the to hit based on the ability specified on the summoning item. It fetches attack bonuses from the summoner, but it uses spell bonuses in place of weapon bonuses
  • Match save simply swaps to flat scaling mode with the DC from the item or the summoner's spell DC.
  1. Synthesizes token data with the updates.

  2. Once all tokens are ready, maximizes the sheet if it was previously minimized and creates token documents on the scene.

@arbron arbron added epic feature request in progress ux User experience related features or bugs labels Mar 8, 2024
@arbron arbron added this to the D&D5E 3.1.0 milestone Mar 8, 2024
@arbron arbron requested a review from Fyorl March 8, 2024 19:56
@arbron arbron self-assigned this Mar 8, 2024
@krbz999
Copy link
Contributor

krbz999 commented Mar 8, 2024

This will eventually need some extra work to handle summoning from compendiums.

Let's not.

@arbron
Copy link
Collaborator Author

arbron commented Mar 8, 2024

This will eventually need some extra work to handle summoning from compendiums.

Let's not.

We gotta, otherwise there is no way to deliver these pre-configured. Players that add a spell to their sheet shouldn't then have to go into a specific compendium, import the actors, and then drag them onto their spells before they can actually use them.

@arbron arbron force-pushed the summoning-workflow branch 2 times, most recently from c66e085 to 5daf9db Compare March 8, 2024 22:19
Moves the summoning data into an `EmbeddedDataField` to allow for
the summoning methods to be defined there rather than taking up a
bunch of space in `ActionTemplate`.

Introduces `SummonsData#summon` method which takes the ID of a
summoning profile and proceeds through the process of summoning the
actor:

1) Fetches the actor to summon based on the profile. This will
eventually need some extra work to handle summoning from compendiums.

2) Minimizes the actor sheet (if open) and determine placement on
scene. Currently the placement is a placeholder method that just
places the summons in a fixed position.

3) Iterates over all token placements, requesting updates that will
be made to the actor and its contained items for each placement.

 - Match proficiency is applied using an active effect

 - AC bonus is applied to `ac.flat` value if calc is `flat`, otherwise
   it uses an active effect to apply to `ac.bonus`

 - HP bonus is applied to `hp.max` unless summoned creature is a PC
   without an overriden maximum HP, in which case it uses an effect

 - Match attacks calculates the to hit based on the ability specified
   on the summoning item. It fetches attack bonuses from the summoner,
   but it uses spell bonuses in place of weapon bonuses

 - Match save simply swaps to flat scaling mode with the DC from the
   item or the summoner's spell DC.

4) Synthesizes token data with the updates.

5) Once all tokens are ready, maximizes the sheet if it was previously
minimized and creates token documents on the scene.
@arbron arbron force-pushed the summoning-workflow branch from 5daf9db to aa283cf Compare March 8, 2024 23:10
Copy link
Contributor

@Fyorl Fyorl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice, thank you Jeff

@arbron arbron merged commit 113581c into 3.1.x Mar 15, 2024
@arbron arbron deleted the summoning-workflow branch March 15, 2024 22:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants