1
0
Fork 0

Add new mushroom-based level

This commit is contained in:
Timothy Warren 2022-01-28 14:08:22 -05:00
parent 04db51ca03
commit b8e02e550e
2 changed files with 20 additions and 0 deletions

View File

@ -360,6 +360,7 @@ pub fn level_builder(
5 => limestone_transition_builder(new_depth, rng, width, height),
6 => dwarf_fort_builder(new_depth, rng, width, height),
7 => mushroom_entrance(new_depth, rng, width, height),
8 => mushroom_builder(new_depth, rng, width, height),
_ => random_builder(new_depth, rng, width, height),
}
}

View File

@ -24,3 +24,22 @@ pub fn mushroom_entrance(
chain
}
pub fn mushroom_builder(
new_depth: i32,
_rng: &mut ::rltk::RandomNumberGenerator,
width: i32,
height: i32,
) -> BuilderChain {
let mut chain = BuilderChain::new(new_depth, width, height, "Into the Mushroom Grove");
chain
.start_with(CellularAutomataBuilder::new())
.with(WaveformCollapseBuilder::new())
.with(AreaStartingPosition::new(XStart::Center, YStart::Center))
.with(CullUnreachable::new())
.with(AreaStartingPosition::new(XStart::Right, YStart::Center))
.with(AreaEndingPosition::new(XEnd::Left, YEnd::Center))
.with(VoronoiSpawning::new());
chain
}