From 55ae460d1d2267f5117024ba2fb2090c7bccaeaf Mon Sep 17 00:00:00 2001 From: juliancoffee Date: Mon, 18 Mar 2024 23:45:19 +0200 Subject: [PATCH] Remove health/energy increase skills --- .../common/skill_trees/skill_max_levels.ron | 4 -- .../skills_skill-groups_manifest.ron | 4 -- .../common/skillset/preset/rank1/general.ron | 4 -- .../common/skillset/preset/rank2/general.ron | 4 -- .../common/skillset/preset/rank3/general.ron | 4 -- .../common/skillset/preset/rank4/general.ron | 4 -- .../common/skillset/preset/rank5/general.ron | 4 -- assets/server/manifests/presets.ron | 8 ---- common/src/comp/skillset/mod.rs | 29 ++------------- common/src/comp/skillset/skills.rs | 7 +--- common/src/states/basic_summon.rs | 16 +++----- common/systems/src/stats.rs | 37 +------------------ common/systems/tests/character_state.rs | 14 ++----- common/systems/tests/phys/utils.rs | 17 ++------- server/src/state_ext.rs | 24 +----------- server/src/sys/terrain.rs | 9 +---- voxygen/src/hud/diary.rs | 28 ++------------ 17 files changed, 24 insertions(+), 193 deletions(-) diff --git a/assets/common/skill_trees/skill_max_levels.ron b/assets/common/skill_trees/skill_max_levels.ron index f6e8ff7a77..fe94a147aa 100644 --- a/assets/common/skill_trees/skill_max_levels.ron +++ b/assets/common/skill_trees/skill_max_levels.ron @@ -1,8 +1,4 @@ ({ -/* - General(HealthIncrease): 10, - General(EnergyIncrease): 5, -*/ Hammer(SsKnockback): 2, Hammer(SsDamage): 3, Hammer(SsRegen): 2, diff --git a/assets/common/skill_trees/skills_skill-groups_manifest.ron b/assets/common/skill_trees/skills_skill-groups_manifest.ron index 4cf0397e50..4c291a0a56 100644 --- a/assets/common/skill_trees/skills_skill-groups_manifest.ron +++ b/assets/common/skill_trees/skills_skill-groups_manifest.ron @@ -1,9 +1,5 @@ ({ General: [ - /* - General(HealthIncrease), - General(EnergyIncrease), - */ UnlockGroup(Weapon(Sword)), UnlockGroup(Weapon(Axe)), UnlockGroup(Weapon(Hammer)), diff --git a/assets/common/skillset/preset/rank1/general.ron b/assets/common/skillset/preset/rank1/general.ron index 7396393b84..bb86ac7fb9 100644 --- a/assets/common/skillset/preset/rank1/general.ron +++ b/assets/common/skillset/preset/rank1/general.ron @@ -1,6 +1,2 @@ ([ -/* - Skill((General(HealthIncrease), 2)), - Skill((General(EnergyIncrease), 1)), -*/ ]) diff --git a/assets/common/skillset/preset/rank2/general.ron b/assets/common/skillset/preset/rank2/general.ron index a819319949..bb86ac7fb9 100644 --- a/assets/common/skillset/preset/rank2/general.ron +++ b/assets/common/skillset/preset/rank2/general.ron @@ -1,6 +1,2 @@ ([ -/* - Skill((General(HealthIncrease), 4)), - Skill((General(EnergyIncrease), 2)), -*/ ]) diff --git a/assets/common/skillset/preset/rank3/general.ron b/assets/common/skillset/preset/rank3/general.ron index 0fb4c1e0c9..bb86ac7fb9 100644 --- a/assets/common/skillset/preset/rank3/general.ron +++ b/assets/common/skillset/preset/rank3/general.ron @@ -1,6 +1,2 @@ ([ -/* - Skill((General(HealthIncrease), 6)), - Skill((General(EnergyIncrease), 3)), -*/ ]) diff --git a/assets/common/skillset/preset/rank4/general.ron b/assets/common/skillset/preset/rank4/general.ron index 64711792f6..bb86ac7fb9 100644 --- a/assets/common/skillset/preset/rank4/general.ron +++ b/assets/common/skillset/preset/rank4/general.ron @@ -1,6 +1,2 @@ ([ -/* - Skill((General(HealthIncrease), 8)), - Skill((General(EnergyIncrease), 4)), -*/ ]) diff --git a/assets/common/skillset/preset/rank5/general.ron b/assets/common/skillset/preset/rank5/general.ron index 540a161831..bb86ac7fb9 100644 --- a/assets/common/skillset/preset/rank5/general.ron +++ b/assets/common/skillset/preset/rank5/general.ron @@ -1,6 +1,2 @@ ([ -/* - Skill((General(HealthIncrease), 10)), - Skill((General(EnergyIncrease), 5)), -*/ ]) diff --git a/assets/server/manifests/presets.ron b/assets/server/manifests/presets.ron index 91ff31d966..61e78f7570 100644 --- a/assets/server/manifests/presets.ron +++ b/assets/server/manifests/presets.ron @@ -3,10 +3,6 @@ ({ "max": [ // General skills - /* - (General(HealthIncrease), 10), - (General(EnergyIncrease), 5), - */ (Roll(Cost), 2), (Roll(Strength), 2), (Roll(Duration), 2), @@ -148,10 +144,6 @@ // Just copypasta from max with random reductions "middle": [ // General skills - /* - (General(HealthIncrease), 6), - (General(EnergyIncrease), 4), - */ (Roll(Cost), 2), (Roll(Strength), 1), (Roll(Duration), 1), diff --git a/common/src/comp/skillset/mod.rs b/common/src/comp/skillset/mod.rs index 7885b9fd6c..e52e5736e5 100644 --- a/common/src/comp/skillset/mod.rs +++ b/common/src/comp/skillset/mod.rs @@ -1,9 +1,6 @@ use crate::{ assets::{self, Asset, AssetExt}, - comp::{ - item::tool::ToolKind, - skills::{GeneralSkill, Skill}, - }, + comp::{item::tool::ToolKind, skills::Skill}, }; use core::borrow::{Borrow, BorrowMut}; use hashbrown::HashMap; @@ -256,9 +253,6 @@ impl SkillGroup { pub struct SkillSet { skill_groups: HashMap, skills: HashMap, - //#[deprecated] - //pub modify_health: bool, - //pub modify_energy: bool, } impl Component for SkillSet { @@ -274,8 +268,6 @@ impl Default for SkillSet { let mut skill_group = Self { skill_groups: HashMap::new(), skills: SkillSet::initial_skills(), - //modify_health: false, - //modify_energy: false, }; // Insert default skill groups @@ -307,8 +299,6 @@ impl SkillSet { let mut skillset = SkillSet { skill_groups, skills: SkillSet::initial_skills(), - //modify_health: true, - //modify_energy: true, }; let mut persistence_load_error = None; @@ -527,21 +517,8 @@ impl SkillSet { ); skill_group.available_sp = new_available_sp; skill_group.ordered_skills.push(skill); - match skill { - Skill::UnlockGroup(group) => { - this.unlock_skill_group(group); - }, - /* - Skill::General(GeneralSkill::HealthIncrease) => { - this.modify_health = true; - }, - */ - /* - Skill::General(GeneralSkill::EnergyIncrease) => { - this.modify_energy = true; - }, - */ - _ => {}, + if let Skill::UnlockGroup(group) = skill { + this.unlock_skill_group(group); } this.skills.insert(skill, next_level); Ok(()) diff --git a/common/src/comp/skillset/skills.rs b/common/src/comp/skillset/skills.rs index fec7bad183..5dc0ffc562 100644 --- a/common/src/comp/skillset/skills.rs +++ b/common/src/comp/skillset/skills.rs @@ -163,12 +163,7 @@ pub enum SceptreSkill { } #[derive(Clone, Copy, Debug, Hash, PartialEq, Eq, Serialize, Deserialize, Ord, PartialOrd)] -pub enum GeneralSkill { - /* - HealthIncrease, - EnergyIncrease, - */ -} +pub enum GeneralSkill {} #[derive(Clone, Copy, Debug, Hash, PartialEq, Eq, Serialize, Deserialize, Ord, PartialOrd)] pub enum RollSkill { diff --git a/common/src/states/basic_summon.rs b/common/src/states/basic_summon.rs index 3394f040cc..ff5aea216e 100644 --- a/common/src/states/basic_summon.rs +++ b/common/src/states/basic_summon.rs @@ -4,7 +4,6 @@ use crate::{ character_state::OutputEvents, inventory::loadout_builder::{self, LoadoutBuilder}, object::Body::FieryTornado, - skillset::skills, Behavior, BehaviorCapability, Body::Object, CharacterState, Projectile, StateUpdate, @@ -131,16 +130,11 @@ impl CharacterBehavior for Data { body, ); - let health = self.static_data.summon_info.has_health.then(|| { - /* - let health_level = skill_set - .skill_level(skills::Skill::General( - skills::GeneralSkill::HealthIncrease, - )) - .unwrap_or(0); - */ - comp::Health::new(body, 0) - }); + let health = self + .static_data + .summon_info + .has_health + .then(|| comp::Health::new(body, 0)); // Ray cast to check where summon should happen let summon_frac = diff --git a/common/systems/src/stats.rs b/common/systems/src/stats.rs index b4f47000ed..6d1201a153 100644 --- a/common/systems/src/stats.rs +++ b/common/systems/src/stats.rs @@ -1,11 +1,8 @@ use common::{ combat, comp::{ - self, - item::MaterialStatManifest, - skills::{GeneralSkill, Skill}, - Body, CharacterState, Combo, Energy, Health, Inventory, Poise, Pos, SkillSet, Stats, - StatsModifier, + self, item::MaterialStatManifest, CharacterState, Combo, Energy, Health, Inventory, Poise, + Pos, Stats, StatsModifier, }, event::{DestroyEvent, EmitExt}, event_emitters, @@ -33,7 +30,6 @@ pub struct ReadData<'a> { time: Read<'a, Time>, events: Events<'a>, positions: ReadStorage<'a, Pos>, - //bodies: ReadStorage<'a, Body>, char_states: ReadStorage<'a, CharacterState>, inventories: ReadStorage<'a, Inventory>, msm: ReadExpect<'a, MaterialStatManifest>, @@ -46,7 +42,6 @@ impl<'a> System<'a> for Sys { type SystemData = ( ReadData<'a>, WriteStorage<'a, Stats>, - //WriteStorage<'a, SkillSet>, WriteStorage<'a, Health>, WriteStorage<'a, Poise>, WriteStorage<'a, Energy>, @@ -63,7 +58,6 @@ impl<'a> System<'a> for Sys { ( read_data, stats, - //mut skill_sets, mut healths, mut poises, mut energies, @@ -120,33 +114,6 @@ impl<'a> System<'a> for Sys { } }); - /* - // Apply effects from leveling skills - let join = ( - &mut skill_sets, - &mut healths, - &mut energies, - &read_data.bodies, - ) - .lend_join(); - join.for_each(|(mut skill_set, mut health, mut energy, body)| { - if skill_set.modify_health { - let health_level = skill_set - .skill_level(Skill::General(GeneralSkill::HealthIncrease)) - .unwrap_or(0); - health.update_max_hp(*body, health_level); - skill_set.modify_health = false; - } - if skill_set.modify_energy { - let energy_level = skill_set - .skill_level(Skill::General(GeneralSkill::EnergyIncrease)) - .unwrap_or(0); - energy.update_max_energy(*body, energy_level); - skill_set.modify_energy = false; - } - }); - */ - // Update energies and poises let join = (&read_data.char_states, &mut energies, &mut poises).lend_join(); join.for_each(|(character_state, mut energy, mut poise)| { diff --git a/common/systems/tests/character_state.rs b/common/systems/tests/character_state.rs index 3193cb0954..0099c57f05 100644 --- a/common/systems/tests/character_state.rs +++ b/common/systems/tests/character_state.rs @@ -2,8 +2,8 @@ mod tests { use common::{ comp::{ - item::MaterialStatManifest, skills::GeneralSkill, tool::AbilityMap, CharacterActivity, - CharacterState, Controller, Energy, Ori, PhysicsState, Poise, Pos, Skill, Stats, Vel, + item::MaterialStatManifest, tool::AbilityMap, CharacterActivity, CharacterState, + Controller, Energy, Ori, PhysicsState, Poise, Pos, Stats, Vel, }, resources::{DeltaTime, GameMode, Time}, shared_server_config::ServerConstants, @@ -64,15 +64,7 @@ mod tests { .with(body.mass()) .with(body.density()) .with(body) - .with(Energy::new( - body, - 0, - /* - skill_set - .skill_level(Skill::General(GeneralSkill::EnergyIncrease)) - .unwrap_or(0), - */ - )) + .with(Energy::new(body, 0)) .with(Controller::default()) .with(Poise::new(body)) .with(skill_set) diff --git a/common/systems/tests/phys/utils.rs b/common/systems/tests/phys/utils.rs index 05b192e8e3..cac5788f25 100644 --- a/common/systems/tests/phys/utils.rs +++ b/common/systems/tests/phys/utils.rs @@ -1,10 +1,7 @@ use common::{ comp::{ - inventory::item::MaterialStatManifest, - skills::{GeneralSkill, Skill}, - tool::AbilityMap, - Auras, Buffs, CharacterActivity, CharacterState, Collider, Combo, Controller, Energy, - Health, Ori, Pos, Stats, Vel, + inventory::item::MaterialStatManifest, tool::AbilityMap, Auras, Buffs, CharacterActivity, + CharacterState, Collider, Combo, Controller, Energy, Health, Ori, Pos, Stats, Vel, }, resources::{DeltaTime, GameMode, Time}, shared_server_config::ServerConstants, @@ -131,15 +128,7 @@ pub fn create_player(state: &mut State) -> Entity { .with(Buffs::default()) .with(Combo::default()) .with(Auras::default()) - .with(Energy::new( - body, - 0, - /* - skill_set - .skill_level(Skill::General(GeneralSkill::EnergyIncrease)) - .unwrap_or(0), - */ - )) + .with(Energy::new(body, 0)) .with(Health::new(body, body.base_health())) .with(skill_set) .with(Stats::empty(body)) diff --git a/server/src/state_ext.rs b/server/src/state_ext.rs index 5f933a95cd..e0d99c9d31 100644 --- a/server/src/state_ext.rs +++ b/server/src/state_ext.rs @@ -20,9 +20,7 @@ use common::{ self, item::{ItemKind, MaterialStatManifest}, misc::PortalData, - object, - skills::{GeneralSkill, Skill}, - ChatType, Content, Group, Inventory, LootOwner, Object, Player, Poise, Presence, + object, ChatType, Content, Group, Inventory, LootOwner, Object, Player, Poise, Presence, PresenceKind, BASE_ABILITY_LIMIT, }, effect::Effect, @@ -299,15 +297,7 @@ impl StateExt for State { .with(body.collider()) .with(comp::Controller::default()) .with(body) - .with(comp::Energy::new( - body, - 0, - /* - skill_set - .skill_level(Skill::General(GeneralSkill::EnergyIncrease)) - .unwrap_or(0), - */ - )) + .with(comp::Energy::new(body, 0)) .with(stats) .with(if body.is_humanoid() { comp::ActiveAbilities::default_limited(BASE_ABILITY_LIMIT) @@ -737,16 +727,6 @@ impl StateExt for State { self.write_component_ignore_entity_dead(entity, body); self.write_component_ignore_entity_dead(entity, body.mass()); self.write_component_ignore_entity_dead(entity, body.density()); - /* - let (health_level, energy_level) = ( - skill_set - .skill_level(Skill::General(GeneralSkill::HealthIncrease)) - .unwrap_or(0), - skill_set - .skill_level(Skill::General(GeneralSkill::EnergyIncrease)) - .unwrap_or(0), - ); - */ self.write_component_ignore_entity_dead(entity, comp::Health::new(body, 0)); self.write_component_ignore_entity_dead(entity, comp::Energy::new(body, 0)); self.write_component_ignore_entity_dead(entity, Poise::new(body)); diff --git a/server/src/sys/terrain.rs b/server/src/sys/terrain.rs index 8958528ab4..3516d1799d 100644 --- a/server/src/sys/terrain.rs +++ b/server/src/sys/terrain.rs @@ -13,8 +13,8 @@ use crate::{ use common::{ calendar::Calendar, comp::{ - self, agent, biped_small, bird_medium, misc::PortalData, skillset::skills, - BehaviorCapability, ForceUpdate, Pos, Presence, Waypoint, + self, agent, biped_small, bird_medium, misc::PortalData, BehaviorCapability, ForceUpdate, + Pos, Presence, Waypoint, }, event::{ CreateNpcEvent, CreateTeleporterEvent, CreateWaypointEvent, EmitExt, EventBus, NpcBuilder, @@ -498,11 +498,6 @@ impl SpawnEntityData { inventory }; - /* - let health_level = skill_set - .skill_level(skills::Skill::General(skills::GeneralSkill::HealthIncrease)) - .unwrap_or(0); - */ let health = Some(comp::Health::new(body, 0)); let poise = comp::Poise::new(body); diff --git a/voxygen/src/hud/diary.rs b/voxygen/src/hud/diary.rs index 4c8bfb7139..82c102df88 100644 --- a/voxygen/src/hud/diary.rs +++ b/voxygen/src/hud/diary.rs @@ -1,4 +1,3 @@ -#![allow(deprecated)] use super::{ img_ids::{Imgs, ImgsRot}, item_imgs::{animate_by_pulse, ItemImgs}, @@ -34,13 +33,12 @@ use common::{ slot::EquipSlot, }, skills::{ - self, AxeSkill, BowSkill, ClimbSkill, GeneralSkill, HammerSkill, MiningSkill, - RollSkill, SceptreSkill, Skill, StaffSkill, SwimSkill, SwordSkill, SKILL_MODIFIERS, + self, AxeSkill, BowSkill, ClimbSkill, HammerSkill, MiningSkill, RollSkill, + SceptreSkill, Skill, StaffSkill, SwimSkill, SwordSkill, SKILL_MODIFIERS, }, skillset::{SkillGroupKind, SkillSet}, Body, CharacterState, Energy, Health, Inventory, Poise, }, - consts::{ENERGY_PER_LEVEL, HP_PER_LEVEL}, }; use conrod_core::{ color, image, @@ -1388,7 +1386,7 @@ impl<'a> Diary<'a> { skills_bot_l, skills_bot_r, ); - use skills::{GeneralSkill::*, RollSkill::*}; + use skills::RollSkill::*; use SkillGroupKind::*; use ToolKind::*; // General Combat @@ -2853,9 +2851,6 @@ impl<'a> Diary<'a> { fn skill_strings(skill: Skill) -> SkillStrings<'static> { match skill { // general tree - /* - Skill::General(s) => general_skill_strings(s), - */ Skill::UnlockGroup(s) => unlock_skill_strings(s), // weapon trees Skill::Hammer(s) => hammer_skill_strings(s), @@ -2872,23 +2867,6 @@ fn skill_strings(skill: Skill) -> SkillStrings<'static> { } } -/* -fn general_skill_strings(skill: GeneralSkill) -> SkillStrings<'static> { - match skill { - GeneralSkill::HealthIncrease => SkillStrings::with_const( - "hud-skill-inc_health_title", - "hud-skill-inc_health", - u32::from(HP_PER_LEVEL), - ), - GeneralSkill::EnergyIncrease => SkillStrings::with_const( - "hud-skill-inc_energy_title", - "hud-skill-inc_energy", - u32::from(ENERGY_PER_LEVEL), - ), - } -} -*/ - fn unlock_skill_strings(group: SkillGroupKind) -> SkillStrings<'static> { match group { SkillGroupKind::Weapon(ToolKind::Sword) => {