diff --git a/server/src/mob.rs b/server/src/mob.rs index e97e1c86..ffb8f784 100644 --- a/server/src/mob.rs +++ b/server/src/mob.rs @@ -1,35 +1,17 @@ use uuid::Uuid; -use rand::prelude::*; -use rand::distributions::Alphanumeric; use std::iter; use construct::{Construct}; -use skill::{Skill}; +use names::{name}; pub fn generate_mob() -> Construct { - let mut rng = thread_rng(); - - let name: String = iter::repeat(()) - .map(|()| rng.sample(Alphanumeric)) - .take(8) - .collect(); - let mob = Construct::new() - .named(&name); + .named(&name()); return mob; } -// fn quick_game(player_size: usize) -> Vec { -// iter::repeat_with(|| -// generate_mob() -// .set_account(Uuid::nil()) -// .learn(Skill::Attack)) -// .take(player_size) -// .collect::>() -// } - pub fn instance_mobs(player_id: Uuid) -> Vec { iter::repeat_with(|| generate_mob() @@ -38,89 +20,3 @@ pub fn instance_mobs(player_id: Uuid) -> Vec { .take(3) .collect::>() } - -// fn zone_3v2_attack(player_lvl: u8) -> Vec { -// let x = Construct::new() -// .named(&"hench".to_string()) -// .learn(Skill::Attack); - -// let y = Construct::new() -// .named(&"bench".to_string()) -// .learn(Skill::Attack); - -// return vec![x, y]; -// } - -// fn zone_2v2_caster(player_lvl: u8) -> Vec { -// let x = Construct::new() -// .named(&"robe".to_string()) -// .learn(Skill::Blast); - -// let y = Construct::new() -// .named(&"wizard hat".to_string()) -// .learn(Skill::Blast); - -// return vec![x, y]; -// } - -// fn zone_3v3_melee_miniboss(player_lvl: u8) -> Vec { -// let x = Construct::new() -// .named(&"jungle juice".to_string()) -// .learn(Skill::Attack); - -// let y = Construct::new() -// .named(&"bamboo basher".to_string()) -// .learn(Skill::Attack) -// .learn(Skill::Stun); - -// let z = Construct::new() -// .named(&"lemongrass tea".to_string()) -// .learn(Skill::Attack); - -// return vec![x, y, z]; -// } - -// fn zone_3v3_healer_boss(player_lvl: u8) -> Vec { -// let x = Construct::new() -// .named(&"coinage".to_string()) -// .learn(Skill::Attack) -// .learn(Skill::Parry) -// .learn(Skill::Block); - -// let y = Construct::new() -// .named(&"wololo".to_string()) -// // big strong -// // .learn(Skill::Blast) -// .learn(Skill::Heal) -// .learn(Skill::Triage); - -// let z = Construct::new() -// .named(&"quarry".to_string()) -// .learn(Skill::Attack) -// .learn(Skill::Parry) -// .learn(Skill::Stun); - -// return vec![x, y, z]; -// } - - -// pub fn generate_mob_player(mode: GameMode, constructs: &Vec) -> Player { -// let mut mob_player = Player::new(Uuid::nil()); - -// let construct_lvl = constructs.iter().max_by_key(|c| c.lvl).unwrap().lvl; -// let player_size = constructs.len(); - -// let mobs = match mode { -// GameMode::Normal => quick_game(construct_lvl, player_size), -// GameMode::Zone3v2Attack => zone_3v2_attack(construct_lvl), -// GameMode::Zone2v2Caster => zone_2v2_caster(construct_lvl), -// GameMode::Zone3v3MeleeMiniboss => zone_3v3_melee_miniboss(construct_lvl), -// GameMode::Zone3v3HealerBoss => zone_3v3_healer_boss(construct_lvl), -// _ => panic!("{:?} not handled for pve mobs", mode), -// }; - -// mob_player.set_constructs(mobs); - -// return mob_player; - -// }