diff --git a/assets/common/entity/world/traveler.ron b/assets/common/entity/world/traveler.ron index 6d9e0fd1b4..bb8655578c 100644 --- a/assets/common/entity/world/traveler.ron +++ b/assets/common/entity/world/traveler.ron @@ -14,5 +14,6 @@ EntityConfig ( meta: [ LoadoutAsset("common.loadout.world.traveler"), + SkillSetAsset("common.skillset.preset.rank5.fullskill"), ], ) diff --git a/assets/common/items/armor/ferocious/back.ron b/assets/common/items/armor/ferocious/back.ron index 79b8463362..0e3f080cca 100644 --- a/assets/common/items/armor/ferocious/back.ron +++ b/assets/common/items/armor/ferocious/back.ron @@ -4,7 +4,7 @@ ItemDef( kind: Armor(( kind: Back("Ferocious"), stats: ( - protection: Some(Normal(3.0)), + protection: Some(Normal(6.0)), ), )), quality: Epic, diff --git a/assets/common/items/armor/ferocious/belt.ron b/assets/common/items/armor/ferocious/belt.ron index 781e565b92..37f0405c7a 100644 --- a/assets/common/items/armor/ferocious/belt.ron +++ b/assets/common/items/armor/ferocious/belt.ron @@ -4,7 +4,7 @@ ItemDef( kind: Armor(( kind: Belt("Ferocious"), stats: ( - protection: Some(Normal(6.0)), + protection: Some(Normal(12.0)), ), )), quality: Epic, diff --git a/assets/common/items/armor/ferocious/chest.ron b/assets/common/items/armor/ferocious/chest.ron index c03f82d483..a933fe369d 100644 --- a/assets/common/items/armor/ferocious/chest.ron +++ b/assets/common/items/armor/ferocious/chest.ron @@ -4,7 +4,7 @@ ItemDef( kind: Armor(( kind: Chest("Ferocious"), stats: ( - protection: Some(Normal(30.0)), + protection: Some(Normal(60.0)), ), )), quality: Epic, diff --git a/assets/common/items/armor/ferocious/foot.ron b/assets/common/items/armor/ferocious/foot.ron index d0fed386b9..13b14eaba9 100644 --- a/assets/common/items/armor/ferocious/foot.ron +++ b/assets/common/items/armor/ferocious/foot.ron @@ -4,7 +4,7 @@ ItemDef( kind: Armor(( kind: Foot("Ferocious"), stats: ( - protection: Some(Normal(6.0)), + protection: Some(Normal(12.0)), ), )), quality: Epic, diff --git a/assets/common/items/armor/ferocious/hand.ron b/assets/common/items/armor/ferocious/hand.ron index 78ade27847..7ae5e00591 100644 --- a/assets/common/items/armor/ferocious/hand.ron +++ b/assets/common/items/armor/ferocious/hand.ron @@ -4,7 +4,7 @@ ItemDef( kind: Armor(( kind: Hand("Ferocious"), stats: ( - protection: Some(Normal(12.0)), + protection: Some(Normal(24.0)), ), )), quality: Epic, diff --git a/assets/common/items/armor/ferocious/pants.ron b/assets/common/items/armor/ferocious/pants.ron index 84fe31a334..42ca5bc226 100644 --- a/assets/common/items/armor/ferocious/pants.ron +++ b/assets/common/items/armor/ferocious/pants.ron @@ -4,7 +4,7 @@ ItemDef( kind: Armor(( kind: Pants("Ferocious"), stats: ( - protection: Some(Normal(24.0)), + protection: Some(Normal(48.0)), ), )), quality: Epic, diff --git a/assets/common/items/armor/ferocious/shoulder.ron b/assets/common/items/armor/ferocious/shoulder.ron index 4dc1005fb0..58268b09df 100644 --- a/assets/common/items/armor/ferocious/shoulder.ron +++ b/assets/common/items/armor/ferocious/shoulder.ron @@ -4,7 +4,7 @@ ItemDef( kind: Armor(( kind: Shoulder("Ferocious"), stats: ( - protection: Some(Normal(18.0)), + protection: Some(Normal(36.0)), ), )), quality: Epic, diff --git a/common/src/comp/body.rs b/common/src/comp/body.rs index 70c96068ff..dfb79752f9 100644 --- a/common/src/comp/body.rs +++ b/common/src/comp/body.rs @@ -16,7 +16,7 @@ pub mod theropod; use crate::{ assets::{self, Asset}, - consts::{HUMANOID_HP_PER_LEVEL, HUMAN_DENSITY, WATER_DENSITY}, + consts::{HUMAN_DENSITY, WATER_DENSITY}, make_case_elim, npc::NpcKind, }; @@ -593,14 +593,16 @@ impl Body { biped_large::Species::Blueoni => 240, biped_large::Species::Redoni => 240, biped_large::Species::Huskbrute => 800, + biped_large::Species::Cultistwarlord => 250, + biped_large::Species::Cultistwarlock => 250, _ => 120, }, Body::BipedSmall(biped_small) => match biped_small.species { biped_small::Species::Gnarling => 50, - biped_small::Species::Adlet => 60, - biped_small::Species::Sahagin => 80, - biped_small::Species::Haniwa => 90, - biped_small::Species::Myrmidon => 90, + biped_small::Species::Adlet => 65, + biped_small::Species::Sahagin => 85, + biped_small::Species::Haniwa => 100, + biped_small::Species::Myrmidon => 100, biped_small::Species::Husk => 20, _ => 60, }, @@ -642,110 +644,6 @@ impl Body { } } - #[allow(unreachable_patterns)] - pub fn base_health_increase(&self) -> u16 { - match self { - Body::Humanoid(_) => HUMANOID_HP_PER_LEVEL, - Body::QuadrupedSmall(quadruped_small) => match quadruped_small.species { - quadruped_small::Species::Boar => 2, - quadruped_small::Species::Batfox => 1, - quadruped_small::Species::Dodarock => 3, - quadruped_small::Species::Holladon => 3, - quadruped_small::Species::Hyena => 2, - quadruped_small::Species::Truffler => 2, - _ => 1, - }, - Body::QuadrupedMedium(quadruped_medium) => match quadruped_medium.species { - quadruped_medium::Species::Grolgar => 3, - quadruped_medium::Species::Saber => 2, - quadruped_medium::Species::Tiger => 2, - quadruped_medium::Species::Tuskram => 3, - quadruped_medium::Species::Lion => 4, - quadruped_medium::Species::Tarasque => 6, - quadruped_medium::Species::Wolf => 2, - quadruped_medium::Species::Frostfang => 4, - quadruped_medium::Species::Mouflon => 3, - quadruped_medium::Species::Catoblepas => 5, - quadruped_medium::Species::Bonerattler => 3, - quadruped_medium::Species::Deer => 2, - quadruped_medium::Species::Hirdrasil => 3, - quadruped_medium::Species::Roshwalr => 4, - quadruped_medium::Species::Donkey => 3, - quadruped_medium::Species::Camel => 3, - quadruped_medium::Species::Zebra => 3, - quadruped_medium::Species::Antelope => 2, - quadruped_medium::Species::Kelpie => 3, - quadruped_medium::Species::Horse => 3, - quadruped_medium::Species::Barghest => 5, - quadruped_medium::Species::Cattle => 3, - quadruped_medium::Species::Highland => 3, - quadruped_medium::Species::Yak => 5, - quadruped_medium::Species::Panda => 4, - quadruped_medium::Species::Bear => 4, - quadruped_medium::Species::Moose => 3, - quadruped_medium::Species::Dreadhorn => 6, - quadruped_medium::Species::Mammoth => 8, - quadruped_medium::Species::Ngoubou => 7, - _ => 2, - }, - Body::BirdMedium(bird_medium) => match bird_medium.species { - bird_medium::Species::Chicken => 1, - bird_medium::Species::Duck => 1, - bird_medium::Species::Goose => 1, - bird_medium::Species::Parrot => 1, - bird_medium::Species::Penguin => 1, - bird_medium::Species::Peacock => 1, - bird_medium::Species::Eagle => 1, - _ => 2, - }, - Body::FishMedium(_) => 1, - Body::Dragon(_) => 50, - Body::BirdLarge(bird_large) => match bird_large.species { - bird_large::Species::Roc => 11, - _ => 12, - }, - Body::FishSmall(_) => 1, - Body::BipedLarge(biped_large) => match biped_large.species { - biped_large::Species::Ogre => 7, - biped_large::Species::Cyclops => 8, - biped_large::Species::Wendigo => 8, - biped_large::Species::Cavetroll => 6, - biped_large::Species::Mountaintroll => 6, - biped_large::Species::Swamptroll => 6, - biped_large::Species::Dullahan => 12, - biped_large::Species::Huskbrute => 10, - // Boss enemies have their health set, not adjusted by level. - biped_large::Species::Huskbrute => 0, - biped_large::Species::Mindflayer => 0, - biped_large::Species::Minotaur => 0, - biped_large::Species::Tidalwarrior => 0, - biped_large::Species::Yeti => 0, - biped_large::Species::Harvester => 0, - _ => 10, - }, - Body::BipedSmall(_) => 1, - Body::Object(_) => 1, - Body::Golem(_) => 0, - Body::Theropod(_) => 2, - Body::QuadrupedLow(quadruped_low) => match quadruped_low.species { - quadruped_low::Species::Crocodile => 2, - quadruped_low::Species::Alligator => 2, - quadruped_low::Species::Salamander => 1, - quadruped_low::Species::Monitor => 1, - quadruped_low::Species::Asp => 1, - quadruped_low::Species::Tortoise => 2, - quadruped_low::Species::Rocksnapper => 5, - quadruped_low::Species::Pangolin => 1, - quadruped_low::Species::Maneater => 3, - quadruped_low::Species::Sandshark => 5, - quadruped_low::Species::Hakulaq => 1, - quadruped_low::Species::Deadwood => 3, - _ => 2, - }, - Body::Ship(_) => 50, - } - } - pub fn flying_height(&self) -> f32 { match self { Body::BirdLarge(_) => 50.0, diff --git a/common/src/comp/health.rs b/common/src/comp/health.rs index 44bbb2017e..833f6528b1 100644 --- a/common/src/comp/health.rs +++ b/common/src/comp/health.rs @@ -1,6 +1,6 @@ -#[cfg(not(target_arch = "wasm32"))] -use crate::comp; use crate::DamageSource; +#[cfg(not(target_arch = "wasm32"))] +use crate::{comp, consts::HP_PER_LEVEL}; use hashbrown::HashMap; use serde::{Deserialize, Serialize}; use std::convert::TryFrom; @@ -106,7 +106,7 @@ impl Health { pub fn new(body: comp::Body, level: u16) -> Self { let health = u32::from( body.base_health() - .saturating_add(body.base_health_increase().saturating_mul(level)), + .saturating_add(HP_PER_LEVEL.saturating_mul(level)), ) * Self::SCALING_FACTOR_INT; Health { current: health, @@ -129,7 +129,7 @@ impl Health { let old_max = self.base_max; self.base_max = u32::from( body.base_health() - .saturating_add(body.base_health_increase().saturating_mul(level)), + .saturating_add(HP_PER_LEVEL.saturating_mul(level)), ) * Self::SCALING_FACTOR_INT; self.current = (self.current + self.base_max - old_max).min(self.maximum); } diff --git a/common/src/consts.rs b/common/src/consts.rs index 591e068df7..8d3d8dee8f 100644 --- a/common/src/consts.rs +++ b/common/src/consts.rs @@ -30,4 +30,4 @@ pub const SOUND_TRAVEL_DIST_PER_VOLUME: f32 = 3.0; // Stat increase per level (multiplied by 10 compared to what you'll see in UI) pub const ENERGY_PER_LEVEL: u16 = 5; -pub const HUMANOID_HP_PER_LEVEL: u16 = 5; +pub const HP_PER_LEVEL: u16 = 5; diff --git a/common/src/generation.rs b/common/src/generation.rs index f1a0a5f181..4837baa7a1 100644 --- a/common/src/generation.rs +++ b/common/src/generation.rs @@ -166,8 +166,6 @@ pub struct EntityInfo { pub main_tool: Option, pub second_tool: Option, pub scale: f32, - // TODO: Properly give NPCs skills - pub health_scaling: Option, pub loot: LootSpec, pub loadout_asset: Option, pub make_loadout: Option) -> LoadoutBuilder>, @@ -191,7 +189,6 @@ impl EntityInfo { main_tool: None, second_tool: None, scale: 1.0, - health_scaling: None, loot: LootSpec::Nothing, loadout_asset: None, make_loadout: None, @@ -368,12 +365,6 @@ impl EntityInfo { self } - #[must_use] - pub fn with_health_scaling(mut self, level: u16) -> Self { - self.health_scaling = Some(level); - self - } - #[must_use] pub fn with_loadout_asset(mut self, asset: String) -> Self { self.loadout_asset = Some(asset); diff --git a/server/src/rtsim/tick.rs b/server/src/rtsim/tick.rs index 5a12e5a6ab..e97dd6985a 100644 --- a/server/src/rtsim/tick.rs +++ b/server/src/rtsim/tick.rs @@ -137,8 +137,7 @@ impl<'a> System<'a> for Sys { let mut entity_info = EntityInfo::at(pos.0) .with_entity_config(entity_config, Some(entity_config_path)) - .with_lazy_loadout(ad_hoc_loadout) - .with_health_scaling(10); + .with_lazy_loadout(ad_hoc_loadout); // Merchants can be traded with if let Some(economy) = entity.get_trade_info(&world, &index) { entity_info = entity_info diff --git a/server/src/sys/terrain.rs b/server/src/sys/terrain.rs index 4f3f4d0b35..2a4ff94060 100644 --- a/server/src/sys/terrain.rs +++ b/server/src/sys/terrain.rs @@ -16,7 +16,9 @@ use crate::{ }; use common::{ calendar::Calendar, - comp::{self, agent, bird_medium, BehaviorCapability, ForceUpdate, Pos, Waypoint}, + comp::{ + self, agent, bird_medium, skillset::skills, BehaviorCapability, ForceUpdate, Pos, Waypoint, + }, event::{EventBus, ServerEvent}, generation::EntityInfo, lottery::LootSpec, @@ -412,7 +414,6 @@ impl NpcData { name, scale, pos, - health_scaling, loot, // tools and skills skillset_asset, @@ -471,7 +472,10 @@ impl NpcData { loadout_builder.build() }; - let health = Some(comp::Health::new(body, health_scaling.unwrap_or(0))); + let health_level = skill_set + .skill_level(skills::Skill::General(skills::GeneralSkill::HealthIncrease)) + .unwrap_or(0); + let health = Some(comp::Health::new(body, health_level)); let poise = comp::Poise::new(body); // Allow Humanoid, BirdMedium, and Parrot to speak diff --git a/voxygen/src/hud/diary.rs b/voxygen/src/hud/diary.rs index 2eb3c131f7..a9b94ad4fd 100644 --- a/voxygen/src/hud/diary.rs +++ b/voxygen/src/hud/diary.rs @@ -25,7 +25,7 @@ use common::{ }, skillset::{SkillGroupKind, SkillSet}, }, - consts::{ENERGY_PER_LEVEL, HUMANOID_HP_PER_LEVEL}, + consts::{ENERGY_PER_LEVEL, HP_PER_LEVEL}, }; use std::borrow::Cow; @@ -2091,7 +2091,7 @@ fn general_skill_strings(skill: GeneralSkill, i18n: &Localization) -> (&str, Cow i18n, "hud.skill.inc_health_title", "hud.skill.inc_health", - u32::from(HUMANOID_HP_PER_LEVEL), + u32::from(HP_PER_LEVEL), ), GeneralSkill::EnergyIncrease => splice_constant( i18n, diff --git a/world/src/site/settlement/mod.rs b/world/src/site/settlement/mod.rs index a95749655e..c5473bd79b 100644 --- a/world/src/site/settlement/mod.rs +++ b/world/src/site/settlement/mod.rs @@ -1007,13 +1007,11 @@ fn humanoid(pos: Vec3, economy: &SiteInformation, dynamic_rng: &mut impl Rn 0 | 1 => entity .with_agent_mark(agent::Mark::Guard) .with_lazy_loadout(guard_loadout) - .with_health_scaling(dynamic_rng.gen_range(10..15)) .with_asset_expect("common.entity.village.guard"), 2 => entity .with_agent_mark(agent::Mark::Merchant) .with_economy(economy) .with_lazy_loadout(merchant_loadout) - .with_health_scaling(dynamic_rng.gen_range(10..15)) .with_asset_expect("common.entity.village.merchant"), _ => entity .with_lazy_loadout(villager_loadout) diff --git a/world/src/site2/plot/dungeon.rs b/world/src/site2/plot/dungeon.rs index b1f6eabe11..1097c52ef9 100644 --- a/world/src/site2/plot/dungeon.rs +++ b/world/src/site2/plot/dungeon.rs @@ -674,8 +674,7 @@ fn enemy_0(dynamic_rng: &mut impl Rng, tile_wcenter: Vec3) -> Vec entity.with_asset_expect("common.entity.dungeon.tier-0.mugger"), 1 => entity.with_asset_expect("common.entity.dungeon.tier-0.stalker"), @@ -691,8 +690,7 @@ fn enemy_1(dynamic_rng: &mut impl Rng, tile_wcenter: Vec3) -> Vec entity.with_asset_expect("common.entity.dungeon.tier-1.bow"), 1 => entity.with_asset_expect("common.entity.dungeon.tier-1.staff"), @@ -708,8 +706,7 @@ fn enemy_2(dynamic_rng: &mut impl Rng, tile_wcenter: Vec3) -> Vec entity.with_asset_expect("common.entity.dungeon.tier-2.bow"), 1 => entity.with_asset_expect("common.entity.dungeon.tier-2.staff"), @@ -725,8 +722,7 @@ fn enemy_3(dynamic_rng: &mut impl Rng, tile_wcenter: Vec3) -> Vec entity.with_asset_expect("common.entity.dungeon.tier-3.bow"), 1 => entity.with_asset_expect("common.entity.dungeon.tier-3.staff"), @@ -742,8 +738,7 @@ fn enemy_4(dynamic_rng: &mut impl Rng, tile_wcenter: Vec3) -> Vec entity.with_asset_expect("common.entity.dungeon.tier-4.bow"), 1 => entity.with_asset_expect("common.entity.dungeon.tier-4.staff"), @@ -759,8 +754,7 @@ fn enemy_5(dynamic_rng: &mut impl Rng, tile_wcenter: Vec3) -> Vec entity.with_asset_expect("common.entity.dungeon.tier-5.warlock"), 1 => entity.with_asset_expect("common.entity.dungeon.tier-5.warlord"), @@ -888,10 +882,9 @@ fn mini_boss_5(dynamic_rng: &mut impl Rng, tile_wcenter: Vec3) -> Vec { entities.push( EntityInfo::at(tile_wcenter.map(|e| e as f32)) - .with_asset_expect("common.entity.dungeon.tier-5.beastmaster") - .with_health_scaling(dynamic_rng.gen_range(50..75)), + .with_asset_expect("common.entity.dungeon.tier-5.beastmaster"), ); - entities.resize_with(entities.len() + 2, || { + entities.resize_with(entities.len() + 4, || { EntityInfo::at(tile_wcenter.map(|e| e as f32)) .with_asset_expect("common.entity.dungeon.tier-5.hound") });