ai refactor, mob spawns now take into account player level, small fixes

This commit is contained in:
Llywelwyn 2023-07-31 22:24:38 +01:00
parent c00418f7c8
commit 6cef899ef6
21 changed files with 301 additions and 148 deletions

View file

@ -1,10 +1,16 @@
use super::{BuilderChain, BuilderMap, InitialMapBuilder, Position, TileType};
use std::collections::HashSet;
pub fn town_builder(new_id: i32, _rng: &mut rltk::RandomNumberGenerator, width: i32, height: i32) -> BuilderChain {
let difficulty = 0;
pub fn town_builder(
new_id: i32,
_rng: &mut rltk::RandomNumberGenerator,
width: i32,
height: i32,
difficulty: i32,
initial_player_level: i32,
) -> BuilderChain {
rltk::console::log(format!("DEBUGINFO: Building town (ID:{}, DIFF:{})", new_id, difficulty));
let mut chain = BuilderChain::new(new_id, width, height, difficulty, "<PLACEHOLDER>");
let mut chain = BuilderChain::new(new_id, width, height, difficulty, "<PLACEHOLDER>", initial_player_level);
chain.start_with(TownBuilder::new());
return chain;