more work on level generators

This commit is contained in:
2024-11-05 12:02:45 +01:00
parent 5311f56ca0
commit 72f7be2ed8
3 changed files with 58 additions and 11 deletions

View File

@@ -19,7 +19,7 @@ pub const ROOM_MIN_WIDTH: usize = 4;
pub const ROOM_MIN_HEIGHT: usize = 4;
/// How many levels does the dungeon have?
pub const LEVELS: usize = 2;
pub const LEVELS: usize = 4;
/// length of a game frame in ms
pub const FRAME_LENGTH: u64 = 100;
@@ -46,6 +46,12 @@ pub fn get_monsters_per_level() -> Vec<HashMap<MonsterTypes, std::ops::RangeIncl
(MonsterTypes::Skeleton, 33),
(MonsterTypes::Snake, 33),
],
// level 4
vec![
(MonsterTypes::Orc, 34),
(MonsterTypes::Skeleton, 33),
(MonsterTypes::Snake, 33),
],
];
if tmp.len() < LEVELS {
panic!(
@@ -79,8 +85,8 @@ pub fn get_room_type_per_level() -> Vec<HashMap<RoomType, std::ops::RangeInclusi
// level 1
vec![
(RoomType::EmptyRoom, 50),
(RoomType::ArtifactRoom, 25),
(RoomType::MonsterRoom, 5),
(RoomType::ArtifactRoom, 10),
(RoomType::MonsterRoom, 20),
(RoomType::BasicRoom, 20),
],
// level 2
@@ -91,7 +97,17 @@ pub fn get_room_type_per_level() -> Vec<HashMap<RoomType, std::ops::RangeInclusi
(RoomType::ArtifactRoom, 13),
],
// level 3
vec![(RoomType::EmptyRoom, 50), (RoomType::MonsterRoom, 50)],
vec![
(RoomType::EmptyRoom, 50),
(RoomType::BasicRoom, 25),
(RoomType::MonsterRoom, 25),
],
// level 4
vec![
(RoomType::BasicRoom, 33),
(RoomType::MonsterRoom, 33),
(RoomType::ArtifactRoom, 34),
],
];
if tmp.len() < LEVELS {
panic!(