Skip to content

Commit

Permalink
Changed default affliction duration to be the maximum duration rather…
Browse files Browse the repository at this point in the history
… than the first stage
  • Loading branch information
shemetz committed Jan 17, 2024
1 parent 3399adf commit 05c7283
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripts/pf2e-extempore-effects.js
Original file line number Diff line number Diff line change
Expand Up @@ -432,9 +432,9 @@ const defineDurationFromTextOfAffliction = (itemDescriptionText) => {
const maximumDurationMatch = itemDescriptionText
// example: '<p><strong>Maximum Duration</strong> 6 rounds</p>'
.match(/<p>\s*<strong>\s*Maximum Duration<\/strong> (\d+ rounds?)\s*<\/p>/)
// defaults to maximum duration if 1st-stage duration doesn't exist, because some creatures (like Athach) are bugged and don't mention specific stage durations
const firstStageDuration = firstStageDurationMatch?.[1] ?? maximumDurationMatch?.[1] ?? ''
const durationObj = defineDurationFromText(firstStageDuration, itemDescriptionText)
// defaults to maximum duration
const chosenDurationText = maximumDurationMatch?.[1] ?? firstStageDurationMatch?.[1] ?? ''
const durationObj = defineDurationFromText(chosenDurationText, itemDescriptionText)
return {
...durationObj,
// tick down at end of turn rather than start of turn, afflictions are special this way
Expand Down

0 comments on commit 05c7283

Please sign in to comment.