feat(simulation): complete interaction and monologue pipelines (#413, #414, #415)

Three fixes to make the gameplay loop functional end-to-end:

- Add Interactable component to NPC spawn so E-prompt detection works
- Build monologue trigger system (enter_location + time_idle) with
  MonologueBuffer/MonologueState components, wire through ObserverSnapshot
  as current_monologue field, decode on client and display via HUD
- Change PlayerAction::Interact from unit to struct variant carrying
  optional target_entity_id and verb fields

Bumps protocol version from 4 to 5. Regenerates MessagePack fixtures.
All 200 tests pass (170 unit + 30 integration).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-13 19:23:47 +01:00
co-authored by Claude Opus 4.6
parent 8228ef3c1c
commit 3c106aa2d0
27 changed files with 480 additions and 30 deletions
+4 -3
View File
@@ -33,7 +33,7 @@ fn snapshot_roundtrip_over_unix_socket() {
let bridge = LocalBridge::accept(&server_path).expect("failed to accept");
let snapshot = ObserverSnapshot {
version: 4,
version: PROTOCOL_VERSION,
tick: 42,
game_time: GameTime {
day: 0,
@@ -54,6 +54,7 @@ fn snapshot_roundtrip_over_unix_socket() {
}],
visible_tiles: vec![],
nearby_interactions: vec![],
current_monologue: None,
};
bridge
@@ -116,7 +117,7 @@ fn input_roundtrip_over_unix_socket() {
},
PlayerInput {
tick: 11,
action: PlayerAction::Interact,
action: PlayerAction::Interact { target_entity_id: None, verb: None },
},
];
@@ -134,7 +135,7 @@ fn input_roundtrip_over_unix_socket() {
_ => panic!("expected MoveNorth action"),
}
match &received_inputs[1].action {
PlayerAction::Interact => {}
PlayerAction::Interact { .. } => {}
_ => panic!("expected Interact action"),
}
}