feat: add floor time pressure and gated stairs

This commit is contained in:
goose
2026-10-03 00:25:24 -04:00
parent 4b9776ce20
commit 4b6521d308
22 changed files with 388 additions and 11 deletions
+15
View File
@@ -64,9 +64,24 @@ static func generate(seed: String, floor_number: int, catalog: ContentCatalog) -
floor.map.set_cell(floor.exit, GridMapStateType.CellKind.STAIRS)
floor.metadata["room_graph"] = graph.to_dict()
floor.metadata["tree_door_cells"] = tree_door_cells
_materialize_safe_room_beds(floor)
FloorPopulatorType.populate(floor, catalog, seed)
return floor
# Beds must be installed before population so the occupancy-aware population
# pass cannot place an NPC on a safe room's resting tile.
static func _materialize_safe_room_beds(floor: FloorState) -> void:
var bed_cells: Array[Vector2i] = []
for room in floor.rooms:
if room.kind not in [&"sanctuary", &"refuge"]:
continue
var bed_cell := _room_center(room.bounds)
if bed_cell == floor.entrance or bed_cell == floor.exit:
continue
floor.map.set_cell(bed_cell, GridMapStateType.CellKind.BED)
bed_cells.append(bed_cell)
floor.metadata["bed_cells"] = bed_cells
static func _place_rooms(rng: DeterministicRng) -> Array[RoomState]:
var rooms: Array[RoomState] = []
for room_index in range(ROOM_COUNT):
+2
View File
@@ -13,6 +13,8 @@ static func populate(floor: FloorState, catalog: ContentCatalog, population_seed
floor.entrance: true,
floor.exit: true,
}
for bed_cell: Vector2i in floor.metadata.get("bed_cells", []):
occupied[bed_cell] = true
var serial := 0
for room in floor.rooms:
if room.kind == &"entrance":