foundryvtt / pf2e

A community contributed game system for Pathfinder Second Edition.
https://foundryvtt.com/packages/pf2e
Apache License 2.0
418 stars 349 forks source link

Allow rollMode as an option within PF2Check.roll() #677

Closed cswendrowski closed 2 years ago

cswendrowski commented 4 years ago

In GitLab by @atnoslen on Aug 5, 2020, 02:05

Has an options field, but does not have the ability to change the roll mode outside of the chat drop down.

Looking within the code where the chat message is created,

check-modifiers-dialog.ts

    const message = await roll.toMessage({
      speaker: context.actor ? ChatMessage.getSpeaker({ actor: context.actor }) : ChatMessage.getSpeaker(),
      flavor: `<b>${check.name}</b><div style="display: flex; flex-wrap: wrap;">${modifierBreakdown}${optionBreakdown}</div>`,
    });

Similar to #316.

Use case: Consider the Seek Action.

The GM attempts a single secret Perception check for you

A macro can be created such that it has an entry within the action itself for the PC to click. Without having the user change their chat settings to perform.

Workaround

1) Change chat settings manually. Prone to being forgotten before roll, also left in state for future rolls. Not intuitive. 2) Create roll manually. Does not include modifier breakdown, which is a fantastic added value.

Example from Wiki macro Roll Perception Secretly for Targets. This forces a gmroll, but could also be set to broll or any roll type from https://foundryvtt.com/article/dice/

const actor = token.actor;
const roll = new Roll("1d20 + @attributes.perception.value", actor.getRollData()).roll();
roll.toMessage({flavor: `Privately rolled ${actor.name} Perception:`}, {rollMode: 'gmroll'});

Example Action Entry:

image

From within Character Sheet:

image

And if action is clicked itself and sent to chat:

image

cswendrowski commented 4 years ago

In GitLab by @nikolaj-a on Aug 15, 2020, 12:12

Addressed by https://gitlab.com/hooking/foundry-vtt---pathfinder-2e/-/merge_requests/786.