Skip to content

[#5175] rollmode sources foundation#7101

Open
Kapuzenjoe wants to merge 2 commits into
foundryvtt:6.0.xfrom
Kapuzenjoe:5175-rollmode-sources
Open

[#5175] rollmode sources foundation#7101
Kapuzenjoe wants to merge 2 commits into
foundryvtt:6.0.xfrom
Kapuzenjoe:5175-rollmode-sources

Conversation

@Kapuzenjoe

Copy link
Copy Markdown
Contributor

Maybe Closes #5175

Builds the data foundation for surfacing advantage/disadvantage source labels on the sheet and in roll dialogs.

Changes:

  • Extends modeCounts on AdvantageModeField with sources[] and overrideSource (captured automatically during Active Effect application via change.effect, or explicitly via setMode({ source }))
  • Adds { label: true } option to hasConditionEffect to return the responsible condition label directly instead of a boolean
  • Adds AdvantageModeField.collectSources(model, keyPaths) (parallel to combineFields, returns a flat list of { value, source } entries for attribution)
  • Adds Actor5e#_prepareRollModeAttributions(keyPaths): resolves collected sources to AttributionDescription[], handling pre-resolved labels, lazy Active Effect resolution, and manual toggles
  • Updates all setMode call sites (armor, conditions, flags) to pass a source

Usage (e.g. #7081):

// Get resolved attribution entries for a roll's advantage sources:
const attributions = this._prepareRollModeAttributions([
  "abilities.dex.check.roll.mode",
  "skills.acr.roll.mode"
]);
// → [{ value: 1, label: "Poisoned", document: null }, ...]

@Fyorl Fyorl added system: dice Dice rolling functionality system: actor sheets strategic Requires sign-off from a core Foundry VTT developer before merge. labels Jun 9, 2026
@thatlonelybugbear

Copy link
Copy Markdown
Contributor

Nice. I can rework #7081 based on this if it goes ahead.

@revilowaldow

Copy link
Copy Markdown

Very keen to see this system implemented <3 thank you everyone who's contributed so far

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

strategic Requires sign-off from a core Foundry VTT developer before merge. system: actor sheets system: dice Dice rolling functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Break down sources of advantage/disadvantage in roll dialog/sheet tooltip

4 participants