names to file

This commit is contained in:
Llywelwyn 2023-08-27 03:13:58 +01:00
parent e1eae7efaf
commit 486807fc84
6 changed files with 41 additions and 10 deletions

View file

@ -11,6 +11,7 @@ use super::{
YStart,
};
use rltk::prelude::*;
use crate::data::names::*;
pub fn forest_builder(
new_id: i32,
@ -20,7 +21,15 @@ pub fn forest_builder(
difficulty: i32,
initial_player_level: i32
) -> BuilderChain {
let mut chain = BuilderChain::new(false, new_id, width, height, difficulty, "the woods", initial_player_level);
let mut chain = BuilderChain::new(
false,
new_id,
width,
height,
difficulty,
NAME_FOREST_BUILDER,
initial_player_level
);
chain.start_with(CellularAutomataBuilder::new());
chain.with(AreaStartingPosition::new(XStart::CENTRE, YStart::CENTRE));
chain.with(CullUnreachable::new());

View file

@ -37,6 +37,7 @@ use specs::prelude::*;
use voronoi_spawning::VoronoiSpawning;
use super::config::CONFIG;
use super::data::ids::*;
use super::data::names::*;
//use wfc::WaveFunctionCollapseBuilder;
mod room_exploder;
use room_exploder::RoomExploder;
@ -319,7 +320,7 @@ fn random_shape_builder(rng: &mut rltk::RandomNumberGenerator, builder: &mut Bui
}
fn overmap_builder() -> BuilderChain {
let mut builder = BuilderChain::new(true, ID_OVERMAP, 69, 41, 0, "the world", 1);
let mut builder = BuilderChain::new(true, ID_OVERMAP, 69, 41, 0, NAME_OVERMAP, 1);
builder.start_with(PrefabBuilder::overmap());
return builder;
}
@ -333,7 +334,15 @@ pub fn random_builder(
initial_player_level: i32
) -> BuilderChain {
rltk::console::log(format!("DEBUGINFO: Building random (ID:{}, DIFF:{})", new_id, difficulty));
let mut builder = BuilderChain::new(false, new_id, width, height, difficulty, "the dungeon", initial_player_level);
let mut builder = BuilderChain::new(
false,
new_id,
width,
height,
difficulty,
NAME_DUNGEON_RANDOM,
initial_player_level
);
let type_roll = rng.roll_dice(1, 2);
let mut want_doors = true;
match type_roll {

View file

@ -1,5 +1,6 @@
use super::{ BuilderChain, BuilderMap, InitialMapBuilder, Position, TileType };
use std::collections::HashSet;
use crate::data::names::*;
pub fn town_builder(
new_id: i32,
@ -10,7 +11,15 @@ pub fn town_builder(
initial_player_level: i32
) -> BuilderChain {
rltk::console::log(format!("DEBUGINFO: Building town (ID:{}, DIFF:{})", new_id, difficulty));
let mut chain = BuilderChain::new(false, new_id, width, height, difficulty, "the town", initial_player_level);
let mut chain = BuilderChain::new(
false,
new_id,
width,
height,
difficulty,
NAME_STARTER_TOWN,
initial_player_level
);
chain.start_with(TownBuilder::new());
return chain;
@ -65,6 +74,8 @@ impl TownBuilder {
x: build_data.width - 2,
y: wall_gap_y,
});
let overmap_entrance = build_data.map.xy_idx(build_data.width - 2, wall_gap_y);
build_data.map.tiles[overmap_entrance] = TileType::ToOvermap;
build_data.take_snapshot();
}