diff --git a/src/level_generator.rs b/src/level_generator.rs index 024b3d2..b8e62c4 100644 --- a/src/level_generator.rs +++ b/src/level_generator.rs @@ -11,7 +11,7 @@ use rand::rngs::ThreadRng; use crate::level::{Level, StructureElement}; use crate::monster::Monster; -use crate::artifacts::{Artifact, Chest}; +use crate::artifacts::{Artifact, Chest, Potion}; use crate::position::Position; const ROOMS_VERTICAL: usize = 7; @@ -264,7 +264,11 @@ impl LevelGenerator { if room.kind == RoomType::TreasureRoom { let t_x = left + room.offset_x + rng.gen_range(0..room.width); let t_y = top + room.offset_y + rng.gen_range(0..room.height); - artifacts.push(Box::new(Chest::new(Position::new(self.level, t_x, t_y)))); + // TODO randomize artifacts + match rng.gen_range(1..=100) { + 1..=50 => { artifacts.push(Box::new(Chest::new(Position::new(self.level, t_x, t_y)))); } + _ => { artifacts.push(Box::new(Potion::new(Position::new(self.level, t_x, t_y)))); } + }; } if room.kind == RoomType::MonsterRoom { let t_x = left + room.offset_x + rng.gen_range(0..room.width);