extends "res://scripts/prologue.gd"

# Isolated composition study. The selected scene and its routes are unchanged.
func _capture_map_review() -> void:
	status.hide()
	for id in actors:
		actors[id].position = Vector2(map_layout.pixel_stops[id][0], map_layout.pixel_stops[id][1])
		actors[id].show()
		actors[id].face("north")
	actors.ganoes.pose("tiptoe")
	actors.ganoes.visual.frame = 2
	actors.ganoes.visual.pause()
	actors.commander.pose("lean")
	actors.fiddler.pose("lean")
	await _capture("architecture_before_v1")
	# A tower at the wall return rather than an object in the middle of a floor.
	# These are existing masonry tiles: no new painted asset is implied.
	var tower := TileMapLayer.new()
	tower.tile_set = floor_layer.tile_set
	tower.z_index = 1
	world.add_child(tower)
	for y in range(2, 5):
		for x in range(16, 20):
			tower.set_cell(Vector2i(x,y), 0, Vector2i(0,1))
	for x in range(16,20):
		tower.set_cell(Vector2i(x,1), 0, Vector2i(1,1))
	for child in world.get_children():
		if child is Sprite2D and child.texture and child.texture.resource_path.ends_with("citadel_portal_v1.png"):
			child.position = Vector2(512,48)
			child.z_index = 2
	# Remove the now-unmotivated stair fragment and quiet the immediate stage.
	for y in range(5,11):
		for x in range(20):
			var tile := Vector2i(0,0) if (x + y) % 4 != 0 else Vector2i(1,0)
			floor_layer.set_cell(Vector2i(x,y), 1, tile)
	await _capture("architecture_after_v1")
	map_overlay.grid_visible = true
	map_overlay.queue_redraw()
	await _capture("architecture_grid_v1")
