1
0
Fork 0

Update random_builder function with temporary setup

This commit is contained in:
Timothy Warren 2021-12-15 15:51:01 -05:00
parent 099f373ee8
commit 9ef557d938
3 changed files with 38 additions and 28 deletions

View File

@ -180,33 +180,41 @@ fn random_initial_builder(rng: &mut RandomNumberGenerator) -> (Box<dyn InitialMa
pub fn random_builder(new_depth: i32, rng: &mut RandomNumberGenerator) -> BuilderChain {
let mut builder = BuilderChain::new(new_depth);
let (random_starter, has_rooms) = random_initial_builder(rng);
builder.start_with(random_starter);
// let (random_starter, has_rooms) = random_initial_builder(rng);
// builder.start_with(random_starter);
//
// if has_rooms {
// builder
// .with(RoomBasedSpawner::new())
// .with(RoomBasedStairs::new())
// .with(RoomBasedStartingPosition::new());
// } else {
// builder
// .with(AreaStartingPosition::new(XStart::Center, YStart::Center))
// .with(CullUnreachable::new())
// .with(VoronoiSpawning::new())
// .with(DistantExit::new());
// }
//
// if rng.roll_dice(1, 3) == 1 {
// builder.with(WaveformCollapseBuilder::new());
// }
//
// if rng.roll_dice(1, 20) == 1 {
// builder.with(PrefabBuilder::sectional(
// prefab_builder::prefab_sections::UNDERGROUND_FORT,
// ));
// }
//
// builder.with(PrefabBuilder::vaults());
if has_rooms {
builder
.with(RoomBasedSpawner::new())
.with(RoomBasedStairs::new())
.with(RoomBasedStartingPosition::new());
} else {
builder
.with(AreaStartingPosition::new(XStart::Center, YStart::Center))
.with(CullUnreachable::new())
.with(VoronoiSpawning::new())
.with(DistantExit::new());
}
if rng.roll_dice(1, 3) == 1 {
builder.with(WaveformCollapseBuilder::new());
}
if rng.roll_dice(1, 20) == 1 {
builder.with(PrefabBuilder::sectional(
prefab_builder::prefab_sections::UNDERGROUND_FORT,
));
}
builder.with(PrefabBuilder::vaults());
builder
.start_with(BspDungeonBuilder::new())
.with(RoomCornerRounder::new())
.with(AreaStartingPosition::new(XStart::Center, YStart::Center))
.with(CullUnreachable::new())
.with(VoronoiSpawning::new())
.with(DistantExit::new());
builder
}

View File

@ -1,6 +1,7 @@
use rltk::RandomNumberGenerator;
use crate::map_builders::{BuilderMap, MetaMapBuilder};
use crate::{Rect, TileType};
use rltk::RandomNumberGenerator;
pub struct RoomCornerRounder {}

View File

@ -1,7 +1,8 @@
use rltk::RandomNumberGenerator;
use crate::map_builders::common::{paint, Symmetry};
use crate::map_builders::{BuilderMap, MetaMapBuilder};
use crate::{Rect, TileType};
use rltk::RandomNumberGenerator;
pub struct RoomExploder {}