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

feat: add duration data model #18

Open
wants to merge 2 commits into
base: packet-2-datamodels
Choose a base branch
from

Conversation

akrigline
Copy link
Contributor

@akrigline akrigline commented Mar 23, 2023

Examples

Magic Missile
Duration: Instantaneous

{
  type: 'instantaneous',
}

Comprehend Languages
Duration: 1 hour

{
  type: 'time',
  rounds: 600,
}

Mage Armor
Duration: 8 hours

{
  type: 'time',
  rounds: 4800, // 600 * 8
}

Shield (assuming unchanged from SRD 5.1)
Duration: 1 round
...Until the start of your next turn

{
  type: 'time',
  rounds: 1,
  special: 'start of your next turn'
}

@akrigline akrigline marked this pull request as draft March 23, 2023 22:26
@akrigline akrigline marked this pull request as ready for review March 23, 2023 22:43

// Describes when during a round an effect might end
// e.g. "end of target's turn" or "end of caster's turn"
special: new fields.StringField({
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can probably do better than special, such as effectEnds. Perhaps we can offer choices? Off the top of my head, I can think of the following options:

  • Start of Round
  • End of Round
  • Start of Target's Turn
  • End of Target's Turn
  • Start of Caster's Turn
  • End of Caster's Turn
  • None (purely time based)

We may also want to have a Concentration choice, or perhaps Concentration is a bool on the duration

if (rounds < 10) {
return {
number: rounds,
unit: "turns"
Copy link
Contributor

Choose a reason for hiding this comment

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

We'll want to localize these, probably with a label on top of a machine-friendly unit that we already have

@cswendrowski
Copy link
Contributor

Great work, left some thoughts but feel free to merge as-is

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.

None yet

2 participants