From 5731b346cd0a3672e1d9b8f5919656528f975c41 Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Fri, 4 Feb 2022 09:41:46 -0500 Subject: [PATCH] Add the Dark elf city --- src/map_builders.rs | 3 +++ src/map_builders/dark_elves.rs | 17 +++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 src/map_builders/dark_elves.rs diff --git a/src/map_builders.rs b/src/map_builders.rs index 07508dd..58dd921 100644 --- a/src/map_builders.rs +++ b/src/map_builders.rs @@ -6,6 +6,7 @@ mod bsp_interior; mod cellular_automata; mod common; mod cull_unreachable; +mod dark_elves; mod distant_exit; mod dla; mod door_placement; @@ -42,6 +43,7 @@ use bsp_dungeon::BspDungeonBuilder; use bsp_interior::BspInteriorBuilder; use cellular_automata::CellularAutomataBuilder; use cull_unreachable::CullUnreachable; +use dark_elves::*; use distant_exit::DistantExit; use dla::DLABuilder; use door_placement::DoorPlacement; @@ -354,6 +356,7 @@ pub fn level_builder(new_depth: i32, width: i32, height: i32) -> BuilderChain { 7 => mushroom_entrance(new_depth, width, height), 8 => mushroom_builder(new_depth, width, height), 9 => mushroom_exit(new_depth, width, height), + 10 => dark_elf_city(new_depth, width, height), _ => random_builder(new_depth, width, height), } } diff --git a/src/map_builders/dark_elves.rs b/src/map_builders/dark_elves.rs new file mode 100644 index 0000000..22f944d --- /dev/null +++ b/src/map_builders/dark_elves.rs @@ -0,0 +1,17 @@ +use super::{ + AreaEndingPosition, AreaStartingPosition, BspInteriorBuilder, BuilderChain, CullUnreachable, + VoronoiSpawning, XEnd, XStart, YEnd, YStart, +}; + +pub fn dark_elf_city(new_depth: i32, width: i32, height: i32) -> BuilderChain { + let mut chain = BuilderChain::new(new_depth, width, height, "Dark Elven City"); + chain + .start_with(BspInteriorBuilder::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 +}