56 lines
2.7 KiB
Markdown
56 lines
2.7 KiB
Markdown
# SLICE-5.3 — Ouvrir une porte avec Espace ou E
|
||
|
||
## Demo
|
||
Le joueur se place à côté d’une porte fermée. Le prompt indique l’action ; Espace ou E ouvre la porte, le journal confirme, le gobelin répond une fois, puis le joueur traverse la cellule désormais praticable.
|
||
|
||
## Track
|
||
Interaction de monde : porte.
|
||
|
||
## Blocked by
|
||
S5.2, car cette tranche consomme son Input Map, prompt contextuel et HUD responsive.
|
||
|
||
## Unblocks
|
||
S5.4.
|
||
|
||
## Requirements
|
||
- `input:interact-space-and-E`
|
||
- `domain:try_interact`
|
||
- `event:door_opened,nothing_to_interact`
|
||
- `fov:recalculate-after-door`
|
||
- `test-runner:GUT`
|
||
- `e2e:Godot-headless`
|
||
- `visual:Xvfb`
|
||
|
||
## Repo / branche
|
||
`DungeonCrawlerWorld | slice/s5-3-door-interaction | main ou tête Review S5.2 | lead`
|
||
|
||
## Worktree
|
||
`git worktree add .worktrees/s5-3 -b slice/s5-3-door-interaction main`
|
||
|
||
## Micro-tâches TDD
|
||
|
||
- [ ] **M1 — Input interact** : test rouge : `KEY_SPACE` et `KEY_E` mappent à `interact`, et vrai InputEvent converge avec `submit_test_interact`; config + chemin Game ; vert.
|
||
- [ ] **M2 — Cible porte** : test rouge domaine : porte adjacente dans ordre contractuel est choisie ; `try_interact()` transforme `CLOSED_DOOR` en `FLOOR`, émet `door_opened` ; vert.
|
||
- [ ] **M3 — Aucun cible** : test rouge : `nothing_to_interact`, position/PV inchangés, aucune réponse ennemie ; vert.
|
||
- [ ] **M4 — Tour/FOV** : test rouge : porte ouverte recalcul FOV et un seul `enemy_*` après action valide ; vert.
|
||
- [ ] **M5 — E2E/capture** : vraie scène, InputEvent espace, log/prompt/porte rendue, déplacement à travers porte ; capture Xvfb état ouvert.
|
||
|
||
## Deliverables
|
||
- `project.godot` : Input Map interact.
|
||
- `scripts/domain/game_state.gd` et résolveur d’interaction dédié : règles et réponse ennemi sans couplage UI.
|
||
- `scripts/game/game.gd` : `submit_test_interact`, route partagée InputEvent.
|
||
- présentation map/HUD : tuile ouverte/sol, journal et prompt après ouverture.
|
||
- tests unitaire/E2E, README.
|
||
|
||
## Contract
|
||
L’ordre de voisinage et les kinds de `_contracts.md` sont obligatoires. L’action valide appelle une fois le mécanisme existant de réponse ennemie ; action vide ne l’appelle jamais. Ne pas dupliquer l’IA.
|
||
|
||
## Acceptance criteria
|
||
- Étant donné une porte fermée adjacente, quand Espace/E est pressé, alors résultat `door_opened`, cellule `FLOOR`, journal confirmé et FOV mise à jour.
|
||
- Étant donné porte ouverte, quand le joueur avance, alors il traverse.
|
||
- Étant donné ennemi vivant, une seule réponse est présente après la porte ouverte.
|
||
- Étant donné rien à interagir, résultat `nothing_to_interact` sans réponse ennemie.
|
||
|
||
## Proof
|
||
Tests rouges/verts M1–M4, E2E `test_door_interaction_e2e.gd`, `verify.sh`, capture, revue et PR.
|