Skip to content

feat(ConditionTracker): Enhance Advantage/Disadvantage and add presets - #2337

Merged
nmbradley merged 17 commits into
Roll20:masterfrom
steverobertsuk:sr/conditiontracker-v1-2-0
Oct 13, 2026
Merged

nmbradley merged 17 commits into
Roll20:masterfrom
steverobertsuk:sr/conditiontracker-v1-2-0

Conversation

@steverobertsuk

Copy link
Copy Markdown
Contributor

Enhances Advantage/Disadvantage tracking with new options, introduces an intuitive preset system, and refines Turn Tracker displays.

Added

  • Any-attacker Advantage / Disadvantage (--attacker any): Allows tracking effects that apply to any creature attacking a target (e.g., Help, Faerie Fire, Dodge). The source is the creature granting the effect, the Turn Tracker row is placed under the target, and the marker is on the target.
  • Reason label (--reason ): Provides an optional label for Advantage/Disadvantage effects, displayed in the row and chat (e.g., Help).
  • Single-use tracking (--once true|false): Marks an Advantage/Disadvantage to be consumed after the next attack. Displays 1× in the Turn Tracker's 'pr' column and presents a Mark as Used button in the apply summary and removal menu.
  • --used command: Removes a single-use effect and announces it as consumed, rather than simply removed.
  • Start of source next turn duration: A new duration type that expires as soon as the source token's next turn begins, ideal for effects like Help or Dodge.
  • Presets (--preset help): Introduces pre-configured effect setups. The Help preset automatically configures any-attacker Advantage, single-use, with a Help reason and start-of-turn duration. Presets are conveniently listed at the top of the wizard's condition step for supported systems.

Changed

  • The Advantage/Disadvantage wizard now features a guided flow, asking Who has advantage? (with an Any attacker option), Granted by (optional), Against whom?, and How many attacks? instead of generic prompts.
  • Advantage/Disadvantage effects granted by one creature now place their marker on that creature (the source), rather than the attacked creature.
  • Re-applying an identical effect now refreshes its duration and details, replacing the existing entry instead of rejecting it as a duplicate.
  • Turn-anchored durations now display ⏳ in the Turn Tracker's 'pr' column for better clarity, while round counts continue to show the remaining rounds.
  • The handout and help card have been updated to reflect new options and durations. Other locales will fall back to English for new strings until their translations are synchronised.

Fixed

  • The wizard correctly carries the chosen subject through all steps to the Turn Tracker row and into created macros.
  • Corrected corrupted placeholder templates in five locales (de, af, it, pl, and ko) that previously displayed literal mask tokens in chat.
  • Ensured the standard-conditions handout heading dynamically shows the active game system ({system}) instead of a hardcoded D&D 5e in non-English locales.
  • The Spanish macro-reinstalled message now accurately lists all five macros.
  • Emojis are now correctly displayed on self-targeted condition rows.

Developer

  • The scripts/sync-locales.mjs script has been improved to prevent placeholder-only strings from being sent for translation and rejects any translation that alters placeholders, reverting to the English text.

Signed-off-by: Steve Roberts steve@shadowcomputers.co.uk

…trings

Strings made up only of placeholders and punctuation, such as {source} {verb} {target}., were sent for translation with their placeholders masked. The translation service translated the mask tokens themselves, so the placeholders could not be restored and literal text such as PLATZHALTER0TOKEN ended up in the locale files.

- Skip translation when nothing translatable remains after masking.
- Reject any translation that loses a placeholder, keep the English text and log a warning.

Signed-off-by: Steve Roberts <steve@shadowcomputers.co.uk>
… locales

The German, Afrikaans, Italian, Polish and Korean locale files contained translated mask tokens (for example PLATZHALTER0TOKEN) in place of their placeholders, so apply announcements, no-by rows and the Korean 0 HP title printed that text literally.

Restore the affected templates to their placeholder form. They contain no translatable words, so they match the English source.

Signed-off-by: Steve Roberts <steve@shadowcomputers.co.uk>
…t headings

The standard conditions heading used a {system} placeholder in English but was hard-coded to D&D 5e in every other locale, so the handout named the wrong system whenever another game system was configured.

Replace the hard-coded name with the {system} placeholder in all translated locales.

Signed-off-by: Steve Roberts <steve@shadowcomputers.co.uk>
…message

The Spanish macro-reinstalled message still named only the wizard and multi-target macros. Add the report-token, saved and classify placeholders so it matches the English source.

Signed-off-by: Steve Roberts <steve@shadowcomputers.co.uk>
The self-target Turn Tracker template was the only display template without the {emoji} placeholder, so rows such as a creature knocking itself prone appeared without their condition emoji.

Add the placeholder to the template in every locale.

Signed-off-by: Steve Roberts <steve@shadowcomputers.co.uk>
Effects such as Help and Dodge end when the source creature's next turn begins, which the end-of-turn options could only approximate by running a full turn too long.

- Add the turnStart duration type and the Start of source next turn option.
- Expire turnStart conditions as soon as their anchor token reaches the top of the Turn Tracker, and exclude them from end-of-turn decrements.

Signed-off-by: Steve Roberts <steve@shadowcomputers.co.uk>
…cker

Turn-anchored durations showed a bare 2 or 1 in the pr column, which reads like an initiative value.

Round counts still show the rounds remaining. Turn-anchored durations now show an hourglass, and single-use effects show a use marker.

Signed-off-by: Steve Roberts <steve@shadowcomputers.co.uk>
… the Help preset

Add the templates, wizard prompts, messages and handout rows used by the any-attacker advantage model, reason labels, single-use tracking, the start-of-turn duration and the Help preset.

New handout rows are appended so that existing translated rows keep their positions. Other locales fall back to English for the new keys until the locale sync is run.

Signed-off-by: Steve Roberts <steve@shadowcomputers.co.uk>
…nd single use

Advantage and Disadvantage could only say that one creature has it against another, which cannot express Help, Faerie Fire or Dodge, where whoever attacks the target benefits.

- Add --attacker any, where the source is the creature granting the effect and the row is anchored under the target.
- Add --reason for a label such as Help, and --once for effects used up by the next attack.
- Word rows, apply messages and removal messages for the new forms, including a used announcement.
- Let a record name the token carrying its marker, so advantage held by one creature is marked on that creature.
- Reject the new options on other condition types.
- Move the start-of-turn option next to the other turn-anchored durations.

Signed-off-by: Steve Roberts <steve@shadowcomputers.co.uk>
…preset

The generic Subject, Source and Target prompts led the GM to pick the helper as the creature that has advantage. Advantage and Disadvantage now ask who has it (with an Any attacker option), who granted it, against whom, and how many attacks it covers.

- Add --preset help, which pre-fills any-attacker advantage, single use, the Help reason and the start-of-turn duration so only the helper and the target are picked. Presets are offered at the top of the condition step.
- Add --used and a Mark as Used button in the apply summary and removal menu for single-use effects.
- Offer the Start of source next turn duration in the wizard and describe it in summaries.
- Carry the chosen subject through the duration and details steps and into created macros. It was previously dropped before the effect was applied.
- Refresh an identical effect when it is re-applied instead of rejecting it as a duplicate, so the same Help can be given again each round.
- Place the marker for advantage held by one creature on that creature.

Signed-off-by: Steve Roberts <steve@shadowcomputers.co.uk>
…set and new durations

- README: describe the advantage wizard prompts, the Help preset, the new command options, row wording, pr column markers and refresh-on-reapply behaviour.
- TESTING: add a manual checklist for advantage, Help and single-use effects, and update the duplicate and duration checks.
- DEVELOPERS and MOD_FILE_MAP: cover the turnStart duration, the presets module and the extra advantage record fields.

Signed-off-by: Steve Roberts <steve@shadowcomputers.co.uk>
- Add the 1.2.0 changelog entry.
- Set the version to 1.2.0 in script.json and package.json, and list 1.1.0 under previous versions.
- Correct the subjectPromptBypass option description to include Advantage and Disadvantage.
- Regenerate ConditionTracker.js and add the 1.2.0 release bundle.

Signed-off-by: Steve Roberts <steve@shadowcomputers.co.uk>
… row

Roll20 advances the Turn Tracker one row at a time, so a condition row sits at the top between two token turns. The handler recorded that as nobody's turn and then ignored the next token reaching the top, so start-of-turn expiry (such as the Help preset) never fired when the preceding row was a condition row.

Detect the turn ending and the turn starting separately. End-of-turn and round durations are unchanged. Saved-effect reminders now also fire for a token whose turn follows a condition row.

Rebuild the bundle and the 1.2.0 snapshot.

Signed-off-by: Steve Roberts <steve@shadowcomputers.co.uk>
Signed-off-by: Steve Roberts <steve@shadowcomputers.co.uk>
… locales

prettier.format() does not read .prettierrc.json on its own, so the locale sync wrote files with Prettier's defaults: double quotes, an 80-column width and default trailing commas.

Resolve the project config for each locale file and pass it to the formatter so generated locales match the rest of the source.

Signed-off-by: Steve Roberts <steve@shadowcomputers.co.uk>
…uests

The locale sync only retried timeouts. Any other failure, such as rate limiting or a network error, fell back to the English string without logging anything, so a run could leave a locale untranslated with no indication why.

Retry every failed request with a logged warning, and log an error naming the string kept in English once the retries are exhausted.

Signed-off-by: Steve Roberts <steve@shadowcomputers.co.uk>
Add the strings introduced for any-attacker advantage, reasons, single-use effects, the Help preset and the start-of-source-turn duration to all 23 non-English locales.

Generated with the locale sync script. Example commands that the translator would have altered are kept in English.

Signed-off-by: Steve Roberts <steve@shadowcomputers.co.uk>
@nmbradley
nmbradley merged commit 5dc93b5 into Roll20:master Oct 13, 2026
1 check passed
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