Skip to content

DM can prompt and grant advantage/disadvantage for ability/skill/save checks #61

Description

@FirebrickRed

Priority: LOW
Status: TODO
Depends on: Issue #60 (Ability checks and saving throws), Issue #55 (Skill rolling)

Description

Allow DMs to prompt players for specific checks and optionally grant advantage/disadvantage automatically, streamlining combat and roleplay scenarios.

Current State

  • ✅ Players can manually roll skills, ability checks, and saves with advantage/disadvantage
  • ❌ DM must verbally ask for rolls
  • ❌ Players must manually select advantage/disadvantage even when DM specifies it
  • ❌ No way to prompt specific rolls

Use Cases

Example 1: Combat

DM: "Everyone roll DEX saves for fireball"
Current: Players manually open character sheets, find DEX, select save, choose normal roll
Desired: DM runs command, players get clickable prompt

Example 2: Advantage/Disadvantage

DM: "Roll Stealth with advantage because you're hidden"
Current: Player opens sheet, finds Stealth, selects advantage
Desired: DM grants advantage automatically

Proposed Implementation

DM Commands

Check Prompt Command

/check <player|party> <type> <target> [advantage|disadvantage]

Examples:
/check @Notch ability STR              → "Notch, roll STR check"
/check @party save DEX advantage       → "Party, roll DEX save with advantage"
/check @Notch skill STEALTH            → "Notch, roll Stealth"
/check @party ability INT disadvantage → "Party, roll INT check with disadvantage"

Alternative: Specific Commands

/rollcheck <player|party> <ability> [adv|dis]
/rollsave <player|party> <ability> [adv|dis]
/rollskill <player|party> <skill> [adv|dis]

Player Experience

Option A: Clickable Chat Message

[DM] Notch, roll DEX save with advantage
[Click here to roll] ← Clickable, auto-opens character sheet with advantage pre-selected

Option B: Auto-open Menu

  • Command automatically opens RollOptionsMenu for player
  • Advantage/disadvantage option pre-highlighted or auto-selected
  • Player clicks to confirm

Option C: Chat + Button

[DM] Party, roll STR check
Below: d20 +3[STR]
[Roll for me] ← Button in chat that auto-rolls

Recommendation: Option A - clickable chat message that opens the appropriate menu with adv/dis pre-applied

Technical Implementation

State Tracking:

class PendingRollRequest {
    UUID playerId;
    RollType type; // SKILL, ABILITY_CHECK, SAVING_THROW
    String target; // "STEALTH" or "STRENGTH"
    RollModifier modifier; // NORMAL, ADVANTAGE, DISADVANTAGE
    long timestamp; // Expire after 5 minutes
}

Flow:

  1. DM runs /check @Notch save DEX advantage
  2. System creates PendingRollRequest for Notch
  3. Notch sees chat message: "Roll DEX save with advantage" + [Click to Roll]
  4. Click → Opens character sheet → DEX save → Advantage auto-selected
  5. Request cleared after roll or 5min timeout

Integration Points:

  • Extend RollOptionsMenu to accept pre-selected modifier
  • Add command handler in plugin main class
  • Add PendingRollRequestManager to track active requests
  • Clickable text components using Adventure API

Chat Output

DM Command:

/check @Notch save DEX advantage

Chat (visible to all):

[DM] Notch, roll DEX save with advantage
     d20 +3[DEX] +2[Prof]
     [Click to Roll] ← clickable by Notch only

After Roll:

[Notch] rolled DEX save with advantage: 18 (d20: [15, 10] +3[DEX] +2[Prof])

Party Support

When targeting party:

/check @party save WIS

All party members see:

[DM] Party, roll WIS save
     [Roll] ← Each player sees their own modifier

Each player gets individual PendingRollRequest with their character's modifier.

Acceptance Criteria

  • DM can prompt specific player for ability check, save, or skill
  • DM can prompt entire party
  • DM can specify advantage/disadvantage in command
  • Players receive clickable chat prompt
  • Click opens appropriate menu with modifier pre-applied
  • Chat shows calculated modifier for player's character
  • Requests expire after 5 minutes
  • Works for skills, ability checks, and saving throws

Alternative: Auto-Roll Option

Optional enhancement:
Add /autocheck variant that rolls immediately without player interaction:

/autocheck @party save DEX advantage
→ Automatically rolls for all party members, broadcasts results

Use case: DM needs quick results during combat.

Future Enhancements

  • DC (Difficulty Class) tracking: /check @party save DEX dc15 → Shows pass/fail
  • Roll history/log for DM to review
  • Secret rolls (only DM sees result)
  • Initiative rolls: /initiative @party

Related Issues

Notes

  • Requires party system to be implemented for party targeting
  • Should respect DM permissions (Issue DM Role Management System #46)
  • Consider mobile/console players who can't easily click chat

Metadata

Metadata

Assignees

No one assigned

    Labels

    combatCombat, HP, initiative, damage

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions