diff --git a/common/src/comp/stats.rs b/common/src/comp/stats.rs index 5d0adba2e6..af4f9a9ac5 100644 --- a/common/src/comp/stats.rs +++ b/common/src/comp/stats.rs @@ -71,7 +71,8 @@ impl Health { self.last_change = (0.0, change); } - pub fn set_maximum(&mut self, amount: u32) { + // This is private because max hp is based on the level + fn set_maximum(&mut self, amount: u32) { self.maximum = amount; self.current = self.current.min(self.maximum); } @@ -160,7 +161,7 @@ impl Stats { // TODO: Delete this once stat points will be a thing pub fn update_max_hp(&mut self) { - self.health.set_maximum(42 * self.level.amount); + self.health.set_maximum(27 + 15 * self.level.amount); } } diff --git a/common/src/sys/agent.rs b/common/src/sys/agent.rs index ed337de06c..0e4a658917 100644 --- a/common/src/sys/agent.rs +++ b/common/src/sys/agent.rs @@ -132,7 +132,7 @@ impl<'a> System<'a> for Sys { } } Agent::Enemy { bearing, target } => { - const SIGHT_DIST: f32 = 30.0; + const SIGHT_DIST: f32 = 18.0; const MIN_ATTACK_DIST: f32 = 3.25; let mut choose_new = false; diff --git a/common/src/sys/combat.rs b/common/src/sys/combat.rs index 78cba752c0..68d432a137 100644 --- a/common/src/sys/combat.rs +++ b/common/src/sys/combat.rs @@ -74,7 +74,7 @@ impl<'a> System<'a> for Sys { { kind.attack_recover_duration() } else { - Duration::from_secs(1) + Duration::from_millis(250) }; let (deal_damage, should_end) = if let Some(Attack { time_left, applied }) = diff --git a/common/src/sys/controller.rs b/common/src/sys/controller.rs index c63f726055..7ee25ea044 100644 --- a/common/src/sys/controller.rs +++ b/common/src/sys/controller.rs @@ -140,7 +140,7 @@ impl Sys { // Attack if !character.action.is_attack() { Attack { - time_left: Duration::from_millis(100), + time_left: Duration::from_millis(250), applied: false, } } else { diff --git a/server/src/sys/terrain.rs b/server/src/sys/terrain.rs index c72866d385..c6ca4ab53e 100644 --- a/server/src/sys/terrain.rs +++ b/server/src/sys/terrain.rs @@ -2,7 +2,7 @@ use super::SysTimer; use crate::{chunk_generator::ChunkGenerator, client::Client, Tick}; use common::{ assets, - comp::{self, Player, Pos}, + comp::{self, item, Player, Pos}, event::{EventBus, ServerEvent}, msg::ServerMsg, state::TerrainChanges, @@ -111,7 +111,7 @@ impl<'a> System<'a> for Sys { let mut scale = 1.0; // TODO: Remove this and implement scaling or level depending on stuff like species instead - stats.level.set_level(rand::thread_rng().gen_range(1, 10)); + stats.level.set_level(rand::thread_rng().gen_range(1, 4)); if npc.boss { if rand::random::() < 0.8 { @@ -121,7 +121,7 @@ impl<'a> System<'a> for Sys { ); body = comp::Body::Humanoid(comp::humanoid::Body::random()); } - stats.level.set_level(rand::thread_rng().gen_range(20, 50)); + stats.level.set_level(rand::thread_rng().gen_range(8, 15)); scale = 2.0 + rand::random::(); } @@ -129,6 +129,13 @@ impl<'a> System<'a> for Sys { stats .health .set_to(stats.health.maximum(), comp::HealthSource::Revive); + if let Some(item::Item { + kind: item::ItemKind::Tool { power, .. }, + .. + }) = &mut stats.equipment.main + { + *power = stats.level.level() * 3; + } server_emitter.emit(ServerEvent::CreateNpc { pos: Pos(npc.pos), stats,