feat: complete playtest parity improvements

This commit is contained in:
goose
2026-10-08 19:06:19 -04:00
parent cce25a1908
commit eca098b4b9
139 changed files with 3001 additions and 982 deletions
+18
View File
@@ -10,6 +10,24 @@ func before_each() -> void:
add_child_autofree(game)
await get_tree().process_frame
func test_walking_on_an_undiscovered_trap_records_complete_structured_events() -> void:
var state := game.get_game_state()
state.enemies.clear()
state.player.perception = 0
var trap_cell := state.player.cell + Vector2i.RIGHT
state.floor_state.traps[trap_cell] = {"trap_id": &"trap_dart"}
game._unhandled_input(_key_event(KEY_RIGHT))
assert_eq(state.player.cell, trap_cell)
var trap_events := game.get_run_state().recent_events(8).filter(func(event: GameEvent) -> bool: return event.kind in [&"trap_triggered", &"trap_status_applied"])
# One structured trigger, one structured status, plus the legacy TurnResult
# compatibility event are all journaled with complete actor/cell metadata.
assert_eq(trap_events.size(), 3)
assert_eq(trap_events.filter(func(event: GameEvent) -> bool: return event.kind == &"trap_status_applied").size(), 1)
assert_true(trap_events.all(func(event: GameEvent) -> bool: return event.actor_id == state.player.id and event.cell == trap_cell))
assert_true(state.player.has_status(&"poison"))
func test_real_input_route_reveals_secret_discovers_and_disarms_trap_then_uses_shrine_and_reads_board() -> void:
var state := game.get_game_state()
state.enemies.clear()