feat: present combat feedback in HUD

This commit is contained in:
goose
2026-10-01 08:17:21 -04:00
parent 84d6d653ad
commit 1dd1b36b5e
9 changed files with 86 additions and 9 deletions
+16 -7
View File
@@ -1,4 +1,4 @@
# Dungeon Crawler World — S1 Walking Skeleton
# Dungeon Crawler World — S3 Combat HUD
## Prerequisites
Godot 4.2+ (verified with Godot 4.5) is required. GUT **9.5.0** is vendored and pinned at `addons/gut`.
@@ -17,11 +17,20 @@ GODOT_BIN=/snap/bin/godot4 ./scripts/verify.sh
```
Scripts use `GODOT_BIN`, otherwise discover `godot4`, then `godot`, and run headlessly.
## Correctif et revue
- La FOV est désormais calculée contre la carte : les murs et portes fermées restent visibles mais masquent les cases situées derrière eux.
- Le positionnement des vues d’acteurs est aligné sur l’origine des tuiles.
- Les chemins d’entrée clavier et de test E2E sont vérifiés sur le même traitement d’action ; la réponse `enemy_moved` est couverte.
- Vérification effectuée : `./scripts/test-unit.sh` (7/7), `./scripts/test-e2e.sh` (2/2) et `./scripts/verify.sh` (unitaires 7/7, E2E 2/2).
## Combat HUD
- `HUD/PlayerHealthLabel` and `HUD/EnemyHealthLabel` show current hit points; the latter reports `No active target` after the goblin is defeated.
- `HUD/CombatSummaryLabel` is the separate public combat state: it identifies the current target and its hit points, then explicitly reports no active target after removal.
- Every `melee` and `enemy_melee` `TurnResult` is routed to its actor view. `ActorView.last_damage` records the received amount and the sprite is tinted red to make the hit visible.
- `HUD/EventLog` keeps appending all combat messages. The public E2E seam remains `Game.submit_test_action(Vector2i)` and uses the same action processor as keyboard input.
## Verification
```bash
GODOT_BIN=/snap/bin/godot4 ./scripts/test-unit.sh
GODOT_BIN=/snap/bin/godot4 ./scripts/test-e2e.sh
GODOT_BIN=/snap/bin/godot4 ./scripts/verify.sh
GODOT_BIN=/snap/bin/godot4 timeout 3s /snap/bin/godot4 --headless --path .
```
The focused presentation unit test plus resolver tests and the real-scene E2E cover hit feedback, counterattack feedback, HUD values/summary/log, and enemy removal.
## Limits
This slice deliberately provides one compact map, one deterministic goblin, direct pursuit, no persistence, inventory, audio, or animation.
This slice deliberately provides one compact map, one deterministic goblin, direct pursuit, no persistence, inventory, audio, or animations/tweens. Damage feedback remains a persistent tint/state rather than a timed animation.