New scripting style mazes incorporated.
This commit is contained in:
parent
1b2276c08f
commit
3394de064c
1 changed files with 11 additions and 13 deletions
|
|
@ -42,21 +42,20 @@ void WorldBuilder::stylize_rooms() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void WorldBuilder::generate_map() {
|
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();
|
auto [maze, valid] = maze::script($map, script);
|
||||||
maze.clear();
|
dbc::check(valid, "invalid maze");
|
||||||
|
|
||||||
maze.randomize_rooms(ROOM_SIZE);
|
|
||||||
|
|
||||||
if($map.width() > 20) {
|
|
||||||
maze.inner_box(4, 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
maze.hunt_and_kill();
|
|
||||||
|
|
||||||
$map.init_tiles();
|
$map.init_tiles();
|
||||||
|
|
||||||
stylize_rooms();
|
stylize_rooms();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -113,7 +112,6 @@ DinkyECS::Entity WorldBuilder::configure_entity_in_room(DinkyECS::World &world,
|
||||||
return entity;
|
return entity;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline json &select_entity_type(GameConfig &config, json &gen_config) {
|
inline json &select_entity_type(GameConfig &config, json &gen_config) {
|
||||||
int enemy_test = Random::uniform<int>(0,100);
|
int enemy_test = Random::uniform<int>(0,100);
|
||||||
int device_test = Random::uniform<int>(0, 100);
|
int device_test = Random::uniform<int>(0, 100);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue