extends GutTest const GameScene = preload("res://scenes/Game.tscn") var game: Game func before_each() -> void: game = GameScene.instantiate() add_child_autofree(game) await get_tree().process_frame func test_surface_stairs_are_immediately_open_then_first_dungeon_floor_has_a_deadline() -> void: var state := game.get_game_state() var hud := game.get_node("HUD") as GameHud state.player.cell = state.floor_state.exit hud.refresh(state, [], game.get_run_state()) assert_eq(hud.get_context_prompt(), "Espace — Descendre l’escalier") game._unhandled_input(_key_event(KEY_E)) assert_eq(game.get_run_state().current_floor, 1) assert_eq(state.player.cell, state.floor_state.entrance) assert_eq(hud.get_context_prompt(), "Espace — Monter l’escalier") assert_eq(game.get_run_state().current_floor_deadline().remaining_days(), 15) func _key_event(keycode: Key) -> InputEventKey: var event := InputEventKey.new() event.keycode = keycode event.physical_keycode = keycode event.pressed = true return event