First hack to get a random gen map going.

This commit is contained in:
Zed A. Shaw 2025-01-30 13:23:12 -05:00
parent 2daa1c9bd5
commit 56d67aba28
7 changed files with 72 additions and 34 deletions

View file

@ -110,10 +110,17 @@ void WorldBuilder::stylize_room(int room, string tile_name, float size) {
bool placed = $map.place_entity(room, pos_out);
dbc::check(placed, "failed to place style in room");
dbc::log("FIX THE SYTLE ROOM TO VARY FLOOR OR WALL");
tile_name = tile_name == "FLOOR_TILE" ? "WALL_PLAIN" : tile_name;
for(matrix::circle it{$map.$walls, pos_out, size}; it.next();) {
for(int x = it.left; x < it.right; x++) {
if(!$map.iswall(x, it.y)) {
if($map.iswall(x, it.y)) {
// a wall tile
$map.$tiles.set_tile(x, it.y, tile_name);
} else {
// a floor tile
$map.$tiles.set_tile(x, it.y, "FLOOR_TILE");
}
}
}