1
0
Fork 0
roguelike-game/src/map_builders/mushroom_forest.rs

51 lines
2.1 KiB
Rust

use super::prefab_builder::prefab_sections::{DROW_ENTRY, UNDERGROUND_FORT};
use super::{
AreaEndingPosition, AreaStartingPosition, BuilderChain, CellularAutomataBuilder,
CullUnreachable, PrefabBuilder, VoronoiSpawning, WaveformCollapseBuilder, XEnd, XStart, YEnd,
YStart,
};
pub fn mushroom_entrance(new_depth: i32, 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())
.with(PrefabBuilder::sectional(UNDERGROUND_FORT));
chain
}
pub fn mushroom_builder(new_depth: i32, 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
}
pub fn mushroom_exit(new_depth: i32, 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())
.with(PrefabBuilder::sectional(DROW_ENTRY));
chain
}