From 3394de064c73fe394a4e7edec7cadc5f869ef1d1 Mon Sep 17 00:00:00 2001 From: "Zed A. Shaw" Date: Fri, 13 Mar 2026 11:36:21 -0400 Subject: [PATCH] New scripting style mazes incorporated. --- src/game/worldbuilder.cpp | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/src/game/worldbuilder.cpp b/src/game/worldbuilder.cpp index 90b17ef..0849b3e 100644 --- a/src/game/worldbuilder.cpp +++ b/src/game/worldbuilder.cpp @@ -42,21 +42,20 @@ void WorldBuilder::stylize_rooms() { } void WorldBuilder::generate_map() { - maze::Builder maze($map); + auto script = R"( + [ + {"action": "hunt_and_kill"}, + {"action": "clear"}, + {"action": "randomize_rooms", "data": [3]}, + {"action": "hunt_and_kill"}, + {"action": "make_doors"} + ] + )"_json; - maze.hunt_and_kill(); - maze.clear(); - - maze.randomize_rooms(ROOM_SIZE); - - if($map.width() > 20) { - maze.inner_box(4, 2); - } - - maze.hunt_and_kill(); + auto [maze, valid] = maze::script($map, script); + dbc::check(valid, "invalid maze"); $map.init_tiles(); - stylize_rooms(); } @@ -113,7 +112,6 @@ DinkyECS::Entity WorldBuilder::configure_entity_in_room(DinkyECS::World &world, return entity; } - inline json &select_entity_type(GameConfig &config, json &gen_config) { int enemy_test = Random::uniform(0,100); int device_test = Random::uniform(0, 100);