fix: keep stairs interaction read-only

This commit is contained in:
goose
2026-10-01 16:00:47 -04:00
parent b469c6decb
commit a8e59544ff
7 changed files with 13 additions and 79 deletions
-6
View File
@@ -18,12 +18,6 @@ const TARGET_OFFSETS: Array[Vector2i] = [
static func resolve(state: GameState) -> Array[TurnResult]:
var results: Array[TurnResult] = []
if state.map.get_cell(state.player.cell) == GridMapState.CellKind.STAIRS:
state.exit_reached = true
results.append(TurnResultType.new(state.player.id, &"stairs_used", state.player.cell, state.player.cell, &"", 0, "You descend the stairs."))
TurnResolverType.append_enemy_response(state, results)
return results
var door_cell := _find_closed_door(state)
if door_cell.x >= 0:
state.map.set_cell(door_cell, GridMapState.CellKind.FLOOR)
+7 -4
View File
@@ -25,10 +25,7 @@ func _ready() -> void:
_sync_enemy_views()
hud.refresh(game_state)
audio_library.set_ambience_context("exploration")
var user_args := OS.get_cmdline_user_args()
if "--capture-door" in user_args:
submit_test_interact()
if "--capture" in user_args or "--capture-door" in user_args:
if "--capture" in OS.get_cmdline_user_args():
_capture_visual_check()
func _capture_visual_check() -> void:
@@ -78,6 +75,8 @@ func get_actor_cell_rect(actor_id: StringName) -> Rect2:
return Rect2()
func _process_interact() -> Array[TurnResult]:
if game_state.get_context_target() in [&"stairs", &"exit_reached"]:
return _refresh_hud_for_context()
var results := game_state.try_interact()
_sync_map_renderer_visibility()
player_view.refresh()
@@ -87,6 +86,10 @@ func _process_interact() -> Array[TurnResult]:
hud.refresh(game_state, results)
return results
func _refresh_hud_for_context() -> Array[TurnResult]:
hud.refresh(game_state)
return []
func _process_action(direction: Vector2i) -> Array[TurnResult]:
var results := game_state.try_player_action(direction)
_sync_map_renderer_visibility()
+1 -1
View File
@@ -28,7 +28,7 @@ if [[ -z "${DISPLAY:-}" ]]; then
fi
set +e
timeout --foreground 20s "${runner[@]}" "$GODOT_BIN" --path . -- --capture-door >"$log_path" 2>&1
timeout --foreground 20s "${runner[@]}" "$GODOT_BIN" --path . -- --capture >"$log_path" 2>&1
status=$?
set -e
if (( status != 0 )); then