More dungeons

This commit is contained in:
Joshua Barretto 2019-08-04 10:09:51 +01:00
parent c7d2fbc20e
commit 7c6479a1fa
3 changed files with 11 additions and 5 deletions

BIN
assets/world/structure/dungeon/ruins-2.vox (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/world/structure/dungeon/ruins.vox (Stored with Git LFS)

Binary file not shown.

View File

@ -2,7 +2,7 @@ use crate::{
all::ForestKind, all::ForestKind,
block::StructureMeta, block::StructureMeta,
sim::{LocationInfo, SimChunk}, sim::{LocationInfo, SimChunk},
util::{Sampler, UnitChooser}, util::{RandomPerm, Sampler, UnitChooser},
World, CONFIG, World, CONFIG,
}; };
use common::{ use common::{
@ -24,13 +24,16 @@ pub struct ColumnGen<'a> {
} }
static UNIT_CHOOSER: UnitChooser = UnitChooser::new(0x700F4EC7); static UNIT_CHOOSER: UnitChooser = UnitChooser::new(0x700F4EC7);
static DUNGEON_RAND: RandomPerm = RandomPerm::new(0x42782335);
lazy_static! { lazy_static! {
pub static ref DUNGEONS: Vec<Arc<Structure>> = vec![ pub static ref DUNGEONS: Vec<Arc<Structure>> = vec![
// green oaks
assets::load_map("world/structure/dungeon/ruins.vox", |s: Structure| s assets::load_map("world/structure/dungeon/ruins.vox", |s: Structure| s
.with_center(Vec3::new(57, 58, 62))) .with_center(Vec3::new(57, 58, 62)))
.unwrap(), .unwrap(),
assets::load_map("world/structure/dungeon/ruins-2.vox", |s: Structure| s
.with_center(Vec3::new(53, 57, 60)))
.unwrap(),
]; ];
} }
@ -68,7 +71,7 @@ impl<'a> ColumnGen<'a> {
seed, seed,
meta: Some(StructureMeta::Volume { meta: Some(StructureMeta::Volume {
units: UNIT_CHOOSER.get(seed), units: UNIT_CHOOSER.get(seed),
volume: &DUNGEONS[0], volume: &DUNGEONS[DUNGEON_RAND.get(seed) as usize % DUNGEONS.len()],
}), }),
}) })
} else { } else {