Rename treasure room

This commit is contained in:
Joachim Lusiardi 2024-10-27 06:24:14 +01:00
parent b833b43c7c
commit 1ae7ff45ab
1 changed files with 4 additions and 4 deletions

View File

@ -24,7 +24,7 @@ enum RoomType {
StairUp,
StairDown,
BasicRoom,
TreasureRoom,
ArtifactRoom,
MonsterRoom,
EmptyRoom,
}
@ -105,13 +105,13 @@ impl LevelGenerator {
room_types.push(RoomType::StairDown);
}
room_types.push(RoomType::MonsterRoom);
room_types.push(RoomType::TreasureRoom);
room_types.push(RoomType::ArtifactRoom);
// generate a random set of rooms and shuffle them
for _ in room_types.len()..ROOMS_HORIZONTAL * ROOMS_VERTICAL {
match rng.gen_range(1..=100) {
// TODO tune room type distribution
1..=33 => room_types.push(RoomType::EmptyRoom),
34..=66 => room_types.push(RoomType::TreasureRoom),
34..=66 => room_types.push(RoomType::ArtifactRoom),
67..=90 => room_types.push(RoomType::MonsterRoom),
_ => room_types.push(RoomType::BasicRoom),
}
@ -298,7 +298,7 @@ impl LevelGenerator {
StructureElement::Floor;
}
}
if room.kind == RoomType::TreasureRoom {
if room.kind == RoomType::ArtifactRoom {
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);
// TODO randomize artifacts