Skip to content

Enemy Visibility & DM Control #102

Description

@FirebrickRed

Summary

Allow DMs to hide enemy identities from players until dramatically revealed. DM sees actual names while players see "???" or generic descriptors. Also provides commands for DM to control entity actions in combat.

Phase: MVP Combat System
Systems: Combat System, Entity Display, DM Tools

Prerequisites

Goals

  • Hidden enemy names for players (DM always sees real names)
  • Reveal/hide commands for dramatic moments
  • Scoreboard shows hidden names appropriately
  • DM commands to attack and deal damage as entities
  • Entity turn announcements use appropriate names

Hidden Name System

Default Behavior

// When entity added to combat, can be marked as hidden
combatant.setHidden(true);

// Player view
String displayName = combatant.isHidden() ? "???" : combatant.getActualName();

// DM view (always sees real name)
String dmDisplayName = combatant.getActualName() + (combatant.isHidden() ? " [hidden]" : "");

Generic Descriptors (Optional Enhancement)

// Instead of "???" use generic descriptor based on creature type
String getHiddenName(DndEntityInstance entity) {
    String size = entity.getSize();        // "Medium"
    String type = entity.getCreatureType(); // "Humanoid"
    return size + " " + type;              // "Medium Humanoid"
}
// Player sees: "Medium Humanoid" instead of "Goblin Chief"

Commands

Visibility Control

# Hide entity name from players
/combat hide goblin_chief
> Goblin Chief is now hidden from players (shown as "???")

# Reveal entity name to all players
/combat reveal goblin_chief
> The mysterious figure is revealed to be... Goblin Chief!
> [Dramatic announcement to all players]

# Add entity as hidden from the start
/combat add goblin_chief --hidden
> Added ??? to combat (Goblin Chief - hidden)

DM Entity Control

# DM attacks as entity
/combat enemy goblin_chief attack Alice
> Goblin Chief attacks Alice with Scimitar!
> Roll: 15 + 4 = 19 vs AC 14 → HIT!
> [Proceeds to damage prompt or auto-damage]

# DM attacks with specific attack (if entity has multiple)
/combat enemy goblin_chief attack Alice --attack scimitar

# DM deals damage as entity
/combat enemy goblin_chief damage Alice 8
> Goblin Chief deals 8 slashing damage to Alice!
> Alice HP: 25 → 17

# DM rolls damage as entity
/combat enemy goblin_chief damage Alice --roll 1d6+2
> Goblin Chief rolls damage: [4]+2 = 6 slashing
> Alice HP: 25 → 19

# DM heals entity
/combat enemy goblin_chief heal 10
> Goblin Chief healed for 10 HP
> HP: 5 → 15

Scoreboard Display

Player View

━━━ INITIATIVE ━━━
→ 19 Alice
  15 Bob
  12 ???                  ← Hidden enemy
  8  Kobold Scout         ← Revealed enemy
━━━━━━━━━━━━━━━━━━
Round: 2

DM View

━━━ INITIATIVE ━━━
→ 19 Alice
  15 Bob
  12 Goblin Chief [H]     ← [H] = Hidden
  8  Kobold Scout
━━━━━━━━━━━━━━━━━━
Round: 2

Implementation Challenge

// Minecraft scoreboard is global - same for all players
// Options:
// 1. Use player-specific action bar/boss bar for hidden info
// 2. Create separate scoreboard teams per viewer (complex)
// 3. DM gets chat-based turn order, players get scoreboard (MVP approach)

// MVP Approach: 
// - Scoreboard shows player-visible names (??? for hidden)
// - DM gets additional chat message with real names

Turn Announcements

Hidden Entity Turn (Player View)

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
??? prepares to act...
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Hidden Entity Turn (DM View - Private Message)

[DM] It's Goblin Chief's turn (hidden as ???)
• 1 Action
• 1 Bonus Action
• 30 ft movement
Available attacks: Scimitar (+4, 1d6+2 slashing)

Revealed Entity Turn

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
DM: It's Goblin Chief's turn
• 1 Action
• 1 Bonus Action
• 30 ft movement
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Reveal Announcement

/combat reveal assassin

Player broadcast:

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
The hooded figure throws back their cloak...
It's the Guild Assassin!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Optional dramatic variants:

/combat reveal assassin --dramatic
> [Plays sound effect, dramatic pause]

/combat reveal assassin --message "The assassin removes their mask..."
> The assassin removes their mask...
> It's the Guild Assassin!

Entity Attack Integration

// When DM uses /combat enemy <entity> attack <target>

// 1. Get entity's attacks from YAML definition
List<DndAttack> attacks = entity.getAttacks();

// 2. Select attack (first by default, or --attack flag)
DndAttack attack = selectAttack(attacks, args);

// 3. Roll attack using entity's to_hit bonus
int roll = DiceRoller.rollDice(1, 20);
int total = roll + attack.getToHit();

// 4. Check vs target AC
if (total >= target.getArmorClass()) {
    // Prompt for damage or auto-roll
    String damageDice = attack.getDamage();
    int damage = DiceRoller.parseDiceRoll(damageDice);
    target.takeDamage(damage);
}

Permission Checks

// Only DM can use these commands
if (!sender.hasPermission("jkvtt.dm")) {
    sender.sendMessage("Only the DM can control enemies!");
    return;
}

Tab Completion

/combat reveal <TAB>      → List hidden entities only
/combat hide <TAB>        → List revealed entities only
/combat enemy <TAB>       → List all entities in combat
/combat enemy <entity> attack <TAB>  → List valid targets
/combat enemy <entity> attack <target> --attack <TAB>  → List entity's attacks

Future Enhancements (Not MVP)

  • Guest player entity control (let another player run an enemy)
  • Entity AI suggestions based on stats
  • Auto-attack patterns
  • Legendary actions/lair actions
  • See DM Entity Possession System #78 (DM Entity Possession) for full entity control

Related Issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    combatCombat, HP, initiative, damagedm-toolsDM-specific commands and featuresenhancementNew feature or requestnpc/entityFor issues pertaining to npc's or monsters and is referred to as entities in the mod pack

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions