Remove health/energy increase skills

This commit is contained in:
juliancoffee 2024-03-18 23:45:19 +02:00
parent 1e6e595a87
commit 55ae460d1d
17 changed files with 24 additions and 193 deletions

View File

@ -1,8 +1,4 @@
({ ({
/*
General(HealthIncrease): 10,
General(EnergyIncrease): 5,
*/
Hammer(SsKnockback): 2, Hammer(SsKnockback): 2,
Hammer(SsDamage): 3, Hammer(SsDamage): 3,
Hammer(SsRegen): 2, Hammer(SsRegen): 2,

View File

@ -1,9 +1,5 @@
({ ({
General: [ General: [
/*
General(HealthIncrease),
General(EnergyIncrease),
*/
UnlockGroup(Weapon(Sword)), UnlockGroup(Weapon(Sword)),
UnlockGroup(Weapon(Axe)), UnlockGroup(Weapon(Axe)),
UnlockGroup(Weapon(Hammer)), UnlockGroup(Weapon(Hammer)),

View File

@ -1,6 +1,2 @@
([ ([
/*
Skill((General(HealthIncrease), 2)),
Skill((General(EnergyIncrease), 1)),
*/
]) ])

View File

@ -1,6 +1,2 @@
([ ([
/*
Skill((General(HealthIncrease), 4)),
Skill((General(EnergyIncrease), 2)),
*/
]) ])

View File

@ -1,6 +1,2 @@
([ ([
/*
Skill((General(HealthIncrease), 6)),
Skill((General(EnergyIncrease), 3)),
*/
]) ])

View File

@ -1,6 +1,2 @@
([ ([
/*
Skill((General(HealthIncrease), 8)),
Skill((General(EnergyIncrease), 4)),
*/
]) ])

View File

@ -1,6 +1,2 @@
([ ([
/*
Skill((General(HealthIncrease), 10)),
Skill((General(EnergyIncrease), 5)),
*/
]) ])

View File

@ -3,10 +3,6 @@
({ ({
"max": [ "max": [
// General skills // General skills
/*
(General(HealthIncrease), 10),
(General(EnergyIncrease), 5),
*/
(Roll(Cost), 2), (Roll(Cost), 2),
(Roll(Strength), 2), (Roll(Strength), 2),
(Roll(Duration), 2), (Roll(Duration), 2),
@ -148,10 +144,6 @@
// Just copypasta from max with random reductions // Just copypasta from max with random reductions
"middle": [ "middle": [
// General skills // General skills
/*
(General(HealthIncrease), 6),
(General(EnergyIncrease), 4),
*/
(Roll(Cost), 2), (Roll(Cost), 2),
(Roll(Strength), 1), (Roll(Strength), 1),
(Roll(Duration), 1), (Roll(Duration), 1),

View File

@ -1,9 +1,6 @@
use crate::{ use crate::{
assets::{self, Asset, AssetExt}, assets::{self, Asset, AssetExt},
comp::{ comp::{item::tool::ToolKind, skills::Skill},
item::tool::ToolKind,
skills::{GeneralSkill, Skill},
},
}; };
use core::borrow::{Borrow, BorrowMut}; use core::borrow::{Borrow, BorrowMut};
use hashbrown::HashMap; use hashbrown::HashMap;
@ -256,9 +253,6 @@ impl SkillGroup {
pub struct SkillSet { pub struct SkillSet {
skill_groups: HashMap<SkillGroupKind, SkillGroup>, skill_groups: HashMap<SkillGroupKind, SkillGroup>,
skills: HashMap<Skill, u16>, skills: HashMap<Skill, u16>,
//#[deprecated]
//pub modify_health: bool,
//pub modify_energy: bool,
} }
impl Component for SkillSet { impl Component for SkillSet {
@ -274,8 +268,6 @@ impl Default for SkillSet {
let mut skill_group = Self { let mut skill_group = Self {
skill_groups: HashMap::new(), skill_groups: HashMap::new(),
skills: SkillSet::initial_skills(), skills: SkillSet::initial_skills(),
//modify_health: false,
//modify_energy: false,
}; };
// Insert default skill groups // Insert default skill groups
@ -307,8 +299,6 @@ impl SkillSet {
let mut skillset = SkillSet { let mut skillset = SkillSet {
skill_groups, skill_groups,
skills: SkillSet::initial_skills(), skills: SkillSet::initial_skills(),
//modify_health: true,
//modify_energy: true,
}; };
let mut persistence_load_error = None; let mut persistence_load_error = None;
@ -527,21 +517,8 @@ impl SkillSet {
); );
skill_group.available_sp = new_available_sp; skill_group.available_sp = new_available_sp;
skill_group.ordered_skills.push(skill); skill_group.ordered_skills.push(skill);
match skill { if let Skill::UnlockGroup(group) = skill {
Skill::UnlockGroup(group) => {
this.unlock_skill_group(group); this.unlock_skill_group(group);
},
/*
Skill::General(GeneralSkill::HealthIncrease) => {
this.modify_health = true;
},
*/
/*
Skill::General(GeneralSkill::EnergyIncrease) => {
this.modify_energy = true;
},
*/
_ => {},
} }
this.skills.insert(skill, next_level); this.skills.insert(skill, next_level);
Ok(()) Ok(())

View File

@ -163,12 +163,7 @@ pub enum SceptreSkill {
} }
#[derive(Clone, Copy, Debug, Hash, PartialEq, Eq, Serialize, Deserialize, Ord, PartialOrd)] #[derive(Clone, Copy, Debug, Hash, PartialEq, Eq, Serialize, Deserialize, Ord, PartialOrd)]
pub enum GeneralSkill { pub enum GeneralSkill {}
/*
HealthIncrease,
EnergyIncrease,
*/
}
#[derive(Clone, Copy, Debug, Hash, PartialEq, Eq, Serialize, Deserialize, Ord, PartialOrd)] #[derive(Clone, Copy, Debug, Hash, PartialEq, Eq, Serialize, Deserialize, Ord, PartialOrd)]
pub enum RollSkill { pub enum RollSkill {

View File

@ -4,7 +4,6 @@ use crate::{
character_state::OutputEvents, character_state::OutputEvents,
inventory::loadout_builder::{self, LoadoutBuilder}, inventory::loadout_builder::{self, LoadoutBuilder},
object::Body::FieryTornado, object::Body::FieryTornado,
skillset::skills,
Behavior, BehaviorCapability, Behavior, BehaviorCapability,
Body::Object, Body::Object,
CharacterState, Projectile, StateUpdate, CharacterState, Projectile, StateUpdate,
@ -131,16 +130,11 @@ impl CharacterBehavior for Data {
body, body,
); );
let health = self.static_data.summon_info.has_health.then(|| { let health = self
/* .static_data
let health_level = skill_set .summon_info
.skill_level(skills::Skill::General( .has_health
skills::GeneralSkill::HealthIncrease, .then(|| comp::Health::new(body, 0));
))
.unwrap_or(0);
*/
comp::Health::new(body, 0)
});
// Ray cast to check where summon should happen // Ray cast to check where summon should happen
let summon_frac = let summon_frac =

View File

@ -1,11 +1,8 @@
use common::{ use common::{
combat, combat,
comp::{ comp::{
self, self, item::MaterialStatManifest, CharacterState, Combo, Energy, Health, Inventory, Poise,
item::MaterialStatManifest, Pos, Stats, StatsModifier,
skills::{GeneralSkill, Skill},
Body, CharacterState, Combo, Energy, Health, Inventory, Poise, Pos, SkillSet, Stats,
StatsModifier,
}, },
event::{DestroyEvent, EmitExt}, event::{DestroyEvent, EmitExt},
event_emitters, event_emitters,
@ -33,7 +30,6 @@ pub struct ReadData<'a> {
time: Read<'a, Time>, time: Read<'a, Time>,
events: Events<'a>, events: Events<'a>,
positions: ReadStorage<'a, Pos>, positions: ReadStorage<'a, Pos>,
//bodies: ReadStorage<'a, Body>,
char_states: ReadStorage<'a, CharacterState>, char_states: ReadStorage<'a, CharacterState>,
inventories: ReadStorage<'a, Inventory>, inventories: ReadStorage<'a, Inventory>,
msm: ReadExpect<'a, MaterialStatManifest>, msm: ReadExpect<'a, MaterialStatManifest>,
@ -46,7 +42,6 @@ impl<'a> System<'a> for Sys {
type SystemData = ( type SystemData = (
ReadData<'a>, ReadData<'a>,
WriteStorage<'a, Stats>, WriteStorage<'a, Stats>,
//WriteStorage<'a, SkillSet>,
WriteStorage<'a, Health>, WriteStorage<'a, Health>,
WriteStorage<'a, Poise>, WriteStorage<'a, Poise>,
WriteStorage<'a, Energy>, WriteStorage<'a, Energy>,
@ -63,7 +58,6 @@ impl<'a> System<'a> for Sys {
( (
read_data, read_data,
stats, stats,
//mut skill_sets,
mut healths, mut healths,
mut poises, mut poises,
mut energies, 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 // Update energies and poises
let join = (&read_data.char_states, &mut energies, &mut poises).lend_join(); let join = (&read_data.char_states, &mut energies, &mut poises).lend_join();
join.for_each(|(character_state, mut energy, mut poise)| { join.for_each(|(character_state, mut energy, mut poise)| {

View File

@ -2,8 +2,8 @@
mod tests { mod tests {
use common::{ use common::{
comp::{ comp::{
item::MaterialStatManifest, skills::GeneralSkill, tool::AbilityMap, CharacterActivity, item::MaterialStatManifest, tool::AbilityMap, CharacterActivity, CharacterState,
CharacterState, Controller, Energy, Ori, PhysicsState, Poise, Pos, Skill, Stats, Vel, Controller, Energy, Ori, PhysicsState, Poise, Pos, Stats, Vel,
}, },
resources::{DeltaTime, GameMode, Time}, resources::{DeltaTime, GameMode, Time},
shared_server_config::ServerConstants, shared_server_config::ServerConstants,
@ -64,15 +64,7 @@ mod tests {
.with(body.mass()) .with(body.mass())
.with(body.density()) .with(body.density())
.with(body) .with(body)
.with(Energy::new( .with(Energy::new(body, 0))
body,
0,
/*
skill_set
.skill_level(Skill::General(GeneralSkill::EnergyIncrease))
.unwrap_or(0),
*/
))
.with(Controller::default()) .with(Controller::default())
.with(Poise::new(body)) .with(Poise::new(body))
.with(skill_set) .with(skill_set)

View File

@ -1,10 +1,7 @@
use common::{ use common::{
comp::{ comp::{
inventory::item::MaterialStatManifest, inventory::item::MaterialStatManifest, tool::AbilityMap, Auras, Buffs, CharacterActivity,
skills::{GeneralSkill, Skill}, CharacterState, Collider, Combo, Controller, Energy, Health, Ori, Pos, Stats, Vel,
tool::AbilityMap,
Auras, Buffs, CharacterActivity, CharacterState, Collider, Combo, Controller, Energy,
Health, Ori, Pos, Stats, Vel,
}, },
resources::{DeltaTime, GameMode, Time}, resources::{DeltaTime, GameMode, Time},
shared_server_config::ServerConstants, shared_server_config::ServerConstants,
@ -131,15 +128,7 @@ pub fn create_player(state: &mut State) -> Entity {
.with(Buffs::default()) .with(Buffs::default())
.with(Combo::default()) .with(Combo::default())
.with(Auras::default()) .with(Auras::default())
.with(Energy::new( .with(Energy::new(body, 0))
body,
0,
/*
skill_set
.skill_level(Skill::General(GeneralSkill::EnergyIncrease))
.unwrap_or(0),
*/
))
.with(Health::new(body, body.base_health())) .with(Health::new(body, body.base_health()))
.with(skill_set) .with(skill_set)
.with(Stats::empty(body)) .with(Stats::empty(body))

View File

@ -20,9 +20,7 @@ use common::{
self, self,
item::{ItemKind, MaterialStatManifest}, item::{ItemKind, MaterialStatManifest},
misc::PortalData, misc::PortalData,
object, object, ChatType, Content, Group, Inventory, LootOwner, Object, Player, Poise, Presence,
skills::{GeneralSkill, Skill},
ChatType, Content, Group, Inventory, LootOwner, Object, Player, Poise, Presence,
PresenceKind, BASE_ABILITY_LIMIT, PresenceKind, BASE_ABILITY_LIMIT,
}, },
effect::Effect, effect::Effect,
@ -299,15 +297,7 @@ impl StateExt for State {
.with(body.collider()) .with(body.collider())
.with(comp::Controller::default()) .with(comp::Controller::default())
.with(body) .with(body)
.with(comp::Energy::new( .with(comp::Energy::new(body, 0))
body,
0,
/*
skill_set
.skill_level(Skill::General(GeneralSkill::EnergyIncrease))
.unwrap_or(0),
*/
))
.with(stats) .with(stats)
.with(if body.is_humanoid() { .with(if body.is_humanoid() {
comp::ActiveAbilities::default_limited(BASE_ABILITY_LIMIT) 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);
self.write_component_ignore_entity_dead(entity, body.mass()); self.write_component_ignore_entity_dead(entity, body.mass());
self.write_component_ignore_entity_dead(entity, body.density()); 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::Health::new(body, 0));
self.write_component_ignore_entity_dead(entity, comp::Energy::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)); self.write_component_ignore_entity_dead(entity, Poise::new(body));

View File

@ -13,8 +13,8 @@ use crate::{
use common::{ use common::{
calendar::Calendar, calendar::Calendar,
comp::{ comp::{
self, agent, biped_small, bird_medium, misc::PortalData, skillset::skills, self, agent, biped_small, bird_medium, misc::PortalData, BehaviorCapability, ForceUpdate,
BehaviorCapability, ForceUpdate, Pos, Presence, Waypoint, Pos, Presence, Waypoint,
}, },
event::{ event::{
CreateNpcEvent, CreateTeleporterEvent, CreateWaypointEvent, EmitExt, EventBus, NpcBuilder, CreateNpcEvent, CreateTeleporterEvent, CreateWaypointEvent, EmitExt, EventBus, NpcBuilder,
@ -498,11 +498,6 @@ impl SpawnEntityData {
inventory 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 health = Some(comp::Health::new(body, 0));
let poise = comp::Poise::new(body); let poise = comp::Poise::new(body);

View File

@ -1,4 +1,3 @@
#![allow(deprecated)]
use super::{ use super::{
img_ids::{Imgs, ImgsRot}, img_ids::{Imgs, ImgsRot},
item_imgs::{animate_by_pulse, ItemImgs}, item_imgs::{animate_by_pulse, ItemImgs},
@ -34,13 +33,12 @@ use common::{
slot::EquipSlot, slot::EquipSlot,
}, },
skills::{ skills::{
self, AxeSkill, BowSkill, ClimbSkill, GeneralSkill, HammerSkill, MiningSkill, self, AxeSkill, BowSkill, ClimbSkill, HammerSkill, MiningSkill, RollSkill,
RollSkill, SceptreSkill, Skill, StaffSkill, SwimSkill, SwordSkill, SKILL_MODIFIERS, SceptreSkill, Skill, StaffSkill, SwimSkill, SwordSkill, SKILL_MODIFIERS,
}, },
skillset::{SkillGroupKind, SkillSet}, skillset::{SkillGroupKind, SkillSet},
Body, CharacterState, Energy, Health, Inventory, Poise, Body, CharacterState, Energy, Health, Inventory, Poise,
}, },
consts::{ENERGY_PER_LEVEL, HP_PER_LEVEL},
}; };
use conrod_core::{ use conrod_core::{
color, image, color, image,
@ -1388,7 +1386,7 @@ impl<'a> Diary<'a> {
skills_bot_l, skills_bot_l,
skills_bot_r, skills_bot_r,
); );
use skills::{GeneralSkill::*, RollSkill::*}; use skills::RollSkill::*;
use SkillGroupKind::*; use SkillGroupKind::*;
use ToolKind::*; use ToolKind::*;
// General Combat // General Combat
@ -2853,9 +2851,6 @@ impl<'a> Diary<'a> {
fn skill_strings(skill: Skill) -> SkillStrings<'static> { fn skill_strings(skill: Skill) -> SkillStrings<'static> {
match skill { match skill {
// general tree // general tree
/*
Skill::General(s) => general_skill_strings(s),
*/
Skill::UnlockGroup(s) => unlock_skill_strings(s), Skill::UnlockGroup(s) => unlock_skill_strings(s),
// weapon trees // weapon trees
Skill::Hammer(s) => hammer_skill_strings(s), 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> { fn unlock_skill_strings(group: SkillGroupKind) -> SkillStrings<'static> {
match group { match group {
SkillGroupKind::Weapon(ToolKind::Sword) => { SkillGroupKind::Weapon(ToolKind::Sword) => {