slows treants back down, reduces spawnrate in grassy rooms

This commit is contained in:
Llywelwyn 2023-08-30 09:19:48 +01:00
parent 64caf0dc1a
commit 1f95bf14ee
3 changed files with 7 additions and 4 deletions

View file

@ -430,7 +430,7 @@
"flags": ["LARGE_GROUP", "GREEN_BLOOD"], "flags": ["LARGE_GROUP", "GREEN_BLOOD"],
"level": 2, "level": 2,
"bac": 12, "bac": 12,
"speed": 12, "speed": 3,
"vision_range": 16, "vision_range": 16,
"attacks": [{ "name": "lashes", "hit_bonus": 4, "damage": "1d8" }], "attacks": [{ "name": "lashes", "hit_bonus": 4, "damage": "1d8" }],
"loot": { "table": "scrolls", "chance": 0.05 } "loot": { "table": "scrolls", "chance": 0.05 }

View file

@ -287,7 +287,7 @@ fn random_room_builder(rng: &mut rltk::RandomNumberGenerator, builder: &mut Buil
_ => builder.with(VoronoiSpawning::new()), _ => builder.with(VoronoiSpawning::new()),
} }
builder.with(ThemeRooms::grass(10)); builder.with(ThemeRooms::grass(12));
} }
fn random_shape_builder(rng: &mut rltk::RandomNumberGenerator, builder: &mut BuilderChain, end: bool) -> bool { fn random_shape_builder(rng: &mut rltk::RandomNumberGenerator, builder: &mut BuilderChain, end: bool) -> bool {

View file

@ -38,7 +38,8 @@ impl ThemeRooms {
let idx = build_data.map.xy_idx(x, y); let idx = build_data.map.xy_idx(x, y);
if tile_walkable(build_data.map.tiles[idx]) && build_data.map.tiles[idx] != TileType::DownStair { if tile_walkable(build_data.map.tiles[idx]) && build_data.map.tiles[idx] != TileType::DownStair {
let tar = if x < room.x1 || x > room.x2 || y < room.y1 || y > room.y2 { 45 } else { 90 }; let tar = if x < room.x1 || x > room.x2 || y < room.y1 || y > room.y2 { 45 } else { 90 };
if rng.roll_dice(1, 100) <= tar { let roll = rng.roll_dice(1, 100);
if roll <= tar {
match rng.roll_dice(1, 6) { match rng.roll_dice(1, 6) {
1..=4 => { 1..=4 => {
build_data.map.tiles[idx] = TileType::Grass; build_data.map.tiles[idx] = TileType::Grass;
@ -48,9 +49,11 @@ impl ThemeRooms {
} }
_ => { _ => {
build_data.map.tiles[idx] = TileType::HeavyFoliage; build_data.map.tiles[idx] = TileType::HeavyFoliage;
build_data.spawn_list.push((idx, "treant_small".to_string()));
} }
} }
if roll < 5 {
build_data.spawn_list.push((idx, "treant_small".to_string()));
}
} }
} }
} }