Repository navigation
Invisibility potion HUD
YCQinBob edited this page Sep 17, 2026
·
1 revision
Task: #133
PR: #140
Feature: HUD #98
Shows remaining stealth (15s) and cooldown (45s) on the player stats HUD.
- Inventory /
tryUse InvisibilityPotionComponentCombatStatsComponentPlayerStatsDisplay- Enemy AI (
invisiblePlayer)
- Drink → 15s stealth, HUD counts down.
- Stealth ends → 45s
Invis CD. - Already stealthed → refresh.
- On cooldown → drink rejected.
- Hostile damage blocked while stealthed.
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]
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
InvisibilityPotionComponentTest