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(SsDamage): 3,
Hammer(SsRegen): 2,

View File

@ -1,9 +1,5 @@
({
General: [
/*
General(HealthIncrease),
General(EnergyIncrease),
*/
UnlockGroup(Weapon(Sword)),
UnlockGroup(Weapon(Axe)),
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": [
// 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),

View File

@ -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<SkillGroupKind, SkillGroup>,
skills: HashMap<Skill, u16>,
//#[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) => {
if let Skill::UnlockGroup(group) = skill {
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);
Ok(())

View File

@ -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 {

View File

@ -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 =

View File

@ -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)| {

View File

@ -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)

View File

@ -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))

View File

@ -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));

View File

@ -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);

View File

@ -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) => {