Skip to content

Invisibility potion HUD

YCQinBob edited this page Sep 17, 2026 · 1 revision

Invisibility potion HUD

Task: #133
PR: #140
Feature: HUD #98

Shows remaining stealth (15s) and cooldown (45s) on the player stats HUD.

Participants

  • Inventory / tryUse
  • InvisibilityPotionComponent
  • CombatStatsComponent
  • PlayerStatsDisplay
  • Enemy AI (invisiblePlayer)

Behaviour

  • Drink → 15s stealth, HUD counts down.
  • Stealth ends → 45s Invis CD.
  • Already stealthed → refresh.
  • On cooldown → drink rejected.
  • Hostile damage blocked while stealthed.

Flowchart

flowchart TD
    A[Player uses potion] --> B{On cooldown?}
    B -->|yes| C[Reject drink]
    B -->|no| D{Already stealthed?}
    D -->|yes| E[Refresh 15s]
    D -->|no| F[Start 15s stealth]
    E --> G[HUD: Invisibility remaining]
    F --> G
    G --> H[AI: invisiblePlayer]
    G --> I[Hostile damage blocked]
    I --> J[15s ends]
    J --> K[Start 45s cooldown]
    K --> L[HUD: Invis CD]
Loading

Sequence diagram

sequenceDiagram
    participant Inv as Inventory
    participant Potion as InvisibilityPotionComponent
    participant Stats as CombatStatsComponent
    participant HUD as PlayerStatsDisplay
    participant AI as Enemy AI

    Inv->>Potion: tryUse
    Potion->>Potion: start or refresh 15s
    Potion->>HUD: duration text
    Potion->>AI: invisiblePlayer
    Stats->>Potion: hostile damage
    Potion-->>Stats: blocked while stealthed
    Note over Potion: 15s ends
    Potion->>Potion: 45s cooldown
    Potion->>HUD: Invis CD
Loading

Tests

  • InvisibilityPotionComponentTest

Table of Contents

Home

Test Plan

Team 2

Features

Components
Player
Items and Inventory
Enemies
Interactable NPCs
Cutscenes and Dialogue
Music
Bosses
Rooms
Weapons
Abilities & Spells
Game Screens and Areas
Dungeons

Game Engine

Getting Started

Entities and Components

Service Locator

Loading Resources

Logging

Unit Testing

Debug Terminal

Input Handling

UI

Animations

Audio

AI

Physics

Terrain

Concurrency & Threading

Settings

Troubleshooting

MacOS Setup Guide

Clone this wiki locally