Skip to content

feat: add duration data model#18

Open
akrigline wants to merge 2 commits into
foundryvtt:packet-2-datamodelsfrom
ElfFriend-DnD:akrigline/duration
Open

feat: add duration data model#18
akrigline wants to merge 2 commits into
foundryvtt:packet-2-datamodelsfrom
ElfFriend-DnD:akrigline/duration

Conversation

@akrigline
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

2 participants