mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Merge branch 'juliancoffee/remove-general-st' into 'master'
Remove health, energy and roll skills See merge request veloren/veloren!4382
This commit is contained in:
commit
fbca6d852b
@ -95,11 +95,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
- Plugin interface based on WASI 0.2 WIT, wasmtime executes these components.
|
||||
- Balance changes; Smoother entity progression consisting of larger variety in (effective) health pools, DPS, entity flee_health alterations, and minor weight distribution changes for entity spawns.
|
||||
- Made power of weapon tiers scale non-linearly.
|
||||
- Sword Changes; Pommel Strike has been nerfed -> increased energy cost, increased _durations, and decreased poise damage. Heavy Sweep has been nerfed -> decreased poise damage and stun vulnerability damage. Pillar Thrust has been altered -> decreased maximum base damage with an increase in stun vulnerability damage.
|
||||
- Sword Changes; Pommel Strike has been nerfed -> increased energy cost, increased durations, and decreased poise damage. Heavy Sweep has been nerfed -> decreased poise damage and stun vulnerability damage. Pillar Thrust has been altered -> decreased maximum base damage with an increase in stun vulnerability damage.
|
||||
- Weapons block are based on poise.
|
||||
- Wooden Shield recipe.
|
||||
- Overhauled the visuals of several cave biomes.
|
||||
- Dropped items now merge dynamically (including non-stackables).
|
||||
- You no longer need to unlock health, energy and roll skills to get to max.
|
||||
- Rolls now don't skip recovery, and instead have increased buildup during ability interrupts.
|
||||
|
||||
### Removed
|
||||
|
||||
|
@ -1,6 +1,4 @@
|
||||
({
|
||||
General(HealthIncrease): 10,
|
||||
General(EnergyIncrease): 5,
|
||||
Hammer(SsKnockback): 2,
|
||||
Hammer(SsDamage): 3,
|
||||
Hammer(SsRegen): 2,
|
||||
@ -50,9 +48,6 @@
|
||||
Sceptre(ADuration): 2,
|
||||
Sceptre(ARange): 2,
|
||||
Sceptre(ACost): 2,
|
||||
Roll(Cost): 2,
|
||||
Roll(Strength): 2,
|
||||
Roll(Duration): 2,
|
||||
Climb(Cost): 2,
|
||||
Climb(Speed): 2,
|
||||
Swim(Speed): 2,
|
||||
|
@ -1,16 +1,11 @@
|
||||
({
|
||||
General: [
|
||||
General(HealthIncrease),
|
||||
General(EnergyIncrease),
|
||||
UnlockGroup(Weapon(Sword)),
|
||||
UnlockGroup(Weapon(Axe)),
|
||||
UnlockGroup(Weapon(Hammer)),
|
||||
UnlockGroup(Weapon(Bow)),
|
||||
UnlockGroup(Weapon(Staff)),
|
||||
UnlockGroup(Weapon(Sceptre)),
|
||||
Roll(Cost),
|
||||
Roll(Strength),
|
||||
Roll(Duration),
|
||||
Climb(Cost),
|
||||
Climb(Speed),
|
||||
Swim(Speed),
|
||||
|
@ -1,4 +1,2 @@
|
||||
([
|
||||
Skill((General(HealthIncrease), 2)),
|
||||
Skill((General(EnergyIncrease), 1)),
|
||||
])
|
||||
|
@ -1,4 +1,2 @@
|
||||
([
|
||||
Skill((General(HealthIncrease), 4)),
|
||||
Skill((General(EnergyIncrease), 2)),
|
||||
])
|
||||
|
@ -1,4 +1,2 @@
|
||||
([
|
||||
Skill((General(HealthIncrease), 6)),
|
||||
Skill((General(EnergyIncrease), 3)),
|
||||
])
|
||||
|
@ -1,4 +1,2 @@
|
||||
([
|
||||
Skill((General(HealthIncrease), 8)),
|
||||
Skill((General(EnergyIncrease), 4)),
|
||||
])
|
||||
|
@ -1,4 +1,2 @@
|
||||
([
|
||||
Skill((General(HealthIncrease), 10)),
|
||||
Skill((General(EnergyIncrease), 5)),
|
||||
])
|
||||
|
@ -3,11 +3,6 @@
|
||||
({
|
||||
"max": [
|
||||
// General skills
|
||||
(General(HealthIncrease), 10),
|
||||
(General(EnergyIncrease), 5),
|
||||
(Roll(Cost), 2),
|
||||
(Roll(Strength), 2),
|
||||
(Roll(Duration), 2),
|
||||
(Climb(Cost), 2),
|
||||
(Climb(Speed), 2),
|
||||
(Swim(Speed), 2),
|
||||
@ -145,13 +140,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),
|
||||
|
||||
// Sword
|
||||
(UnlockGroup(Weapon(Sword)), 1),
|
||||
|
||||
@ -235,8 +223,6 @@
|
||||
],
|
||||
// Basic skill preset to unlock all abilities
|
||||
"basic": [
|
||||
// General skills
|
||||
|
||||
// Sword
|
||||
(UnlockGroup(Weapon(Sword)), 1),
|
||||
|
||||
|
@ -17,10 +17,6 @@ hud-skill-sp_available =
|
||||
hud-skill-not_unlocked = Not yet unlocked
|
||||
hud-skill-req_sp = {"\u000A"}Requires { $number } SP
|
||||
hud-skill-set_as_exp_bar = Track progress on experience bar
|
||||
hud-skill-inc_health_title = Increase health
|
||||
hud-skill-inc_health = Increases your maximum health by { $boost } points.{ $SP }
|
||||
hud-skill-inc_energy_title = Increase energy
|
||||
hud-skill-inc_energy = Increases your maximum energy by { $boost } points.{ $SP }
|
||||
|
||||
hud-skill-unlck_sword_title = Sword proficiency
|
||||
hud-skill-unlck_sword = Unlocks the sword skill tree.{ $SP }
|
||||
@ -34,14 +30,6 @@ hud-skill-unlck_staff_title = Staff proficiency
|
||||
hud-skill-unlck_staff = Unlocks the staff skill tree.{ $SP }
|
||||
hud-skill-unlck_sceptre_title = Sceptre proficiency
|
||||
hud-skill-unlck_sceptre = Unlocks the sceptre skill tree.{ $SP }
|
||||
hud-skill-dodge_title = Dodge
|
||||
hud-skill-dodge = Dodging grants temporary immunity to attacks while you're rolling.
|
||||
hud-skill-roll_energy_title = Roll Energy Cost
|
||||
hud-skill-roll_energy = Rolling uses { $boost } % less energy.{ $SP }
|
||||
hud-skill-roll_speed_title = Rolling Speed
|
||||
hud-skill-roll_speed = Roll { $boost } % faster.{ $SP }
|
||||
hud-skill-roll_dur_title = Rolling Duration
|
||||
hud-skill-roll_dur = Roll for { $boost } % more time.{ $SP }
|
||||
hud-skill-climbing_title = Climbing
|
||||
hud-skill-climbing = Ability to climb surfaces.
|
||||
hud-skill-climbing_cost_title = Climbing Cost
|
||||
|
@ -1240,12 +1240,12 @@ impl CharacterAbility {
|
||||
0.0
|
||||
};
|
||||
CharacterAbility::Roll {
|
||||
energy_cost: 12.0,
|
||||
energy_cost: 10.85,
|
||||
// Remaining recover flows into buildup
|
||||
buildup_duration: 0.05 + remaining_recover,
|
||||
movement_duration: 0.33,
|
||||
movement_duration: 0.36,
|
||||
recover_duration: 0.125,
|
||||
roll_strength: 3.0,
|
||||
roll_strength: 3.3075,
|
||||
attack_immunities: AttackFilters {
|
||||
melee: true,
|
||||
projectiles: false,
|
||||
@ -1917,8 +1917,7 @@ impl CharacterAbility {
|
||||
Some(ToolKind::Staff) => self.adjusted_by_staff_skills(skillset),
|
||||
Some(ToolKind::Sceptre) => self.adjusted_by_sceptre_skills(skillset),
|
||||
Some(ToolKind::Pick) => self.adjusted_by_mining_skills(skillset),
|
||||
None => self.adjusted_by_general_skills(skillset),
|
||||
Some(_) => {},
|
||||
None | Some(_) => {},
|
||||
}
|
||||
self
|
||||
}
|
||||
@ -1944,30 +1943,6 @@ impl CharacterAbility {
|
||||
}
|
||||
}
|
||||
|
||||
fn adjusted_by_general_skills(&mut self, skillset: &SkillSet) {
|
||||
if let CharacterAbility::Roll {
|
||||
ref mut energy_cost,
|
||||
ref mut roll_strength,
|
||||
ref mut movement_duration,
|
||||
..
|
||||
} = self
|
||||
{
|
||||
use skills::RollSkill::{Cost, Duration, Strength};
|
||||
|
||||
let modifiers = SKILL_MODIFIERS.general_tree.roll;
|
||||
|
||||
if let Ok(level) = skillset.skill_level(Skill::Roll(Cost)) {
|
||||
*energy_cost *= modifiers.energy_cost.powi(level.into());
|
||||
}
|
||||
if let Ok(level) = skillset.skill_level(Skill::Roll(Strength)) {
|
||||
*roll_strength *= modifiers.strength.powi(level.into());
|
||||
}
|
||||
if let Ok(level) = skillset.skill_level(Skill::Roll(Duration)) {
|
||||
*movement_duration *= modifiers.duration.powi(level.into());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn adjusted_by_hammer_skills(&mut self, skillset: &SkillSet) {
|
||||
#![allow(clippy::enum_glob_use)]
|
||||
use skills::{HammerSkill::*, Skill::Hammer};
|
||||
|
@ -809,15 +809,14 @@ impl Body {
|
||||
bird_large::Species::SeaWyvern => 600,
|
||||
bird_large::Species::WealdWyvern => 600,
|
||||
},
|
||||
Body::Humanoid(_) => 75,
|
||||
Body::Humanoid(_) => 100,
|
||||
_ => 100,
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unreachable_patterns)]
|
||||
pub fn base_health(&self) -> u16 {
|
||||
match self {
|
||||
Body::Humanoid(_) => 50,
|
||||
Body::Humanoid(_) => 100,
|
||||
Body::QuadrupedSmall(quadruped_small) => match quadruped_small.species {
|
||||
// T1
|
||||
quadruped_small::Species::Boar => 60,
|
||||
@ -1042,7 +1041,6 @@ impl Body {
|
||||
arthropod::Species::Mosscrawler => 600,
|
||||
arthropod::Species::Sandcrawler => 500,
|
||||
arthropod::Species::Stagbeetle => 440,
|
||||
_ => 150,
|
||||
},
|
||||
Body::Ship(_) => 1000,
|
||||
Body::Crustacean(_) => 40,
|
||||
|
@ -1,4 +1,4 @@
|
||||
use crate::{comp, consts::ENERGY_PER_LEVEL};
|
||||
use crate::comp;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use specs::{Component, DerefFlaggedStorage};
|
||||
use std::ops::Mul;
|
||||
@ -82,11 +82,8 @@ impl Energy {
|
||||
self.current = self.current.min(self.maximum);
|
||||
}
|
||||
|
||||
pub fn new(body: comp::Body, level: u16) -> Self {
|
||||
let energy = u32::from(
|
||||
body.base_energy()
|
||||
.saturating_add(ENERGY_PER_LEVEL.saturating_mul(level)),
|
||||
) * Self::SCALING_FACTOR_INT;
|
||||
pub fn new(body: comp::Body) -> Self {
|
||||
let energy = u32::from(body.base_energy()) * Self::SCALING_FACTOR_INT;
|
||||
Energy {
|
||||
current: energy,
|
||||
base_max: energy,
|
||||
@ -130,15 +127,6 @@ impl Energy {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn update_max_energy(&mut self, body: comp::Body, level: u16) {
|
||||
let old_max = self.base_max;
|
||||
self.base_max = u32::from(
|
||||
body.base_energy()
|
||||
.saturating_add(ENERGY_PER_LEVEL.saturating_mul(level)),
|
||||
) * Self::SCALING_FACTOR_INT;
|
||||
self.current = (self.current + self.base_max - old_max).min(self.maximum);
|
||||
}
|
||||
|
||||
pub fn refresh(&mut self) { self.current = self.maximum; }
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,4 @@
|
||||
use crate::{
|
||||
combat::DamageContributor, comp, consts::HP_PER_LEVEL, resources::Time, uid::Uid, DamageSource,
|
||||
};
|
||||
use crate::{combat::DamageContributor, comp, resources::Time, uid::Uid, DamageSource};
|
||||
use hashbrown::HashMap;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use specs::{Component, DerefFlaggedStorage};
|
||||
@ -117,11 +115,8 @@ impl Health {
|
||||
self.current = self.current.min(self.maximum);
|
||||
}
|
||||
|
||||
pub fn new(body: comp::Body, level: u16) -> Self {
|
||||
let health = u32::from(
|
||||
body.base_health()
|
||||
.saturating_add(HP_PER_LEVEL.saturating_mul(level)),
|
||||
) * Self::SCALING_FACTOR_INT;
|
||||
pub fn new(body: comp::Body) -> Self {
|
||||
let health = u32::from(body.base_health()) * Self::SCALING_FACTOR_INT;
|
||||
Health {
|
||||
current: health,
|
||||
base_max: health,
|
||||
@ -139,16 +134,6 @@ impl Health {
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Delete this once stat points will be a thing
|
||||
pub fn update_max_hp(&mut self, body: comp::Body, level: u16) {
|
||||
let old_max = self.base_max;
|
||||
self.base_max = u32::from(
|
||||
body.base_health()
|
||||
.saturating_add(HP_PER_LEVEL.saturating_mul(level)),
|
||||
) * Self::SCALING_FACTOR_INT;
|
||||
self.current = (self.current + self.base_max - old_max).min(self.maximum);
|
||||
}
|
||||
|
||||
/// Returns a boolean if the delta was not zero.
|
||||
pub fn change_by(&mut self, change: HealthChange) -> bool {
|
||||
let prev_health = i64::from(self.current);
|
||||
|
@ -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,8 +253,6 @@ impl SkillGroup {
|
||||
pub struct SkillSet {
|
||||
skill_groups: HashMap<SkillGroupKind, SkillGroup>,
|
||||
skills: HashMap<Skill, u16>,
|
||||
pub modify_health: bool,
|
||||
pub modify_energy: bool,
|
||||
}
|
||||
|
||||
impl Component for SkillSet {
|
||||
@ -273,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
|
||||
@ -306,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;
|
||||
|
||||
@ -526,17 +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(())
|
||||
|
@ -11,14 +11,12 @@ use serde::{Deserialize, Serialize};
|
||||
// SkillTree Modifiers below.
|
||||
#[derive(Clone, Copy, Debug, Hash, PartialEq, Eq, Serialize, Deserialize, Ord, PartialOrd)]
|
||||
pub enum Skill {
|
||||
General(GeneralSkill),
|
||||
Sword(SwordSkill),
|
||||
Axe(AxeSkill),
|
||||
Hammer(HammerSkill),
|
||||
Bow(BowSkill),
|
||||
Staff(StaffSkill),
|
||||
Sceptre(SceptreSkill),
|
||||
Roll(RollSkill),
|
||||
Climb(ClimbSkill),
|
||||
Swim(SwimSkill),
|
||||
Pick(MiningSkill),
|
||||
@ -162,19 +160,6 @@ pub enum SceptreSkill {
|
||||
ACost,
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, Hash, PartialEq, Eq, Serialize, Deserialize, Ord, PartialOrd)]
|
||||
pub enum GeneralSkill {
|
||||
HealthIncrease,
|
||||
EnergyIncrease,
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, Hash, PartialEq, Eq, Serialize, Deserialize, Ord, PartialOrd)]
|
||||
pub enum RollSkill {
|
||||
Cost,
|
||||
Strength,
|
||||
Duration,
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, Hash, PartialEq, Eq, Serialize, Deserialize, Ord, PartialOrd)]
|
||||
pub enum ClimbSkill {
|
||||
Cost,
|
||||
@ -473,17 +458,10 @@ impl MiningTreeModifiers {
|
||||
}
|
||||
|
||||
pub struct GeneralTreeModifiers {
|
||||
pub roll: RollTreeModifiers,
|
||||
pub swim: SwimTreeModifiers,
|
||||
pub climb: ClimbTreeModifiers,
|
||||
}
|
||||
|
||||
pub struct RollTreeModifiers {
|
||||
pub energy_cost: f32,
|
||||
pub strength: f32,
|
||||
pub duration: f32,
|
||||
}
|
||||
|
||||
pub struct SwimTreeModifiers {
|
||||
pub speed: f32,
|
||||
}
|
||||
@ -496,11 +474,6 @@ pub struct ClimbTreeModifiers {
|
||||
impl GeneralTreeModifiers {
|
||||
const fn get() -> Self {
|
||||
Self {
|
||||
roll: RollTreeModifiers {
|
||||
energy_cost: 0.95,
|
||||
strength: 1.05,
|
||||
duration: 1.05,
|
||||
},
|
||||
swim: SwimTreeModifiers { speed: 1.25 },
|
||||
climb: ClimbTreeModifiers {
|
||||
energy_cost: 0.8,
|
||||
|
@ -31,10 +31,6 @@ pub const MIN_RECOMMENDED_TOKIO_THREADS: usize = 2;
|
||||
|
||||
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 HP_PER_LEVEL: u16 = 5;
|
||||
|
||||
pub const TELEPORTER_RADIUS: f32 = 3.;
|
||||
|
||||
// Map settings
|
||||
|
@ -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,14 +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, health_level)
|
||||
});
|
||||
let health = self
|
||||
.static_data
|
||||
.summon_info
|
||||
.has_health
|
||||
.then(|| comp::Health::new(body));
|
||||
|
||||
// Ray cast to check where summon should happen
|
||||
let summon_frac =
|
||||
|
@ -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,31 +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)| {
|
||||
|
@ -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,12 +64,7 @@ mod tests {
|
||||
.with(body.mass())
|
||||
.with(body.density())
|
||||
.with(body)
|
||||
.with(Energy::new(
|
||||
body,
|
||||
skill_set
|
||||
.skill_level(Skill::General(GeneralSkill::EnergyIncrease))
|
||||
.unwrap_or(0),
|
||||
))
|
||||
.with(Energy::new(body))
|
||||
.with(Controller::default())
|
||||
.with(Poise::new(body))
|
||||
.with(skill_set)
|
||||
|
@ -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,13 +128,8 @@ pub fn create_player(state: &mut State) -> Entity {
|
||||
.with(Buffs::default())
|
||||
.with(Combo::default())
|
||||
.with(Auras::default())
|
||||
.with(Energy::new(
|
||||
body,
|
||||
skill_set
|
||||
.skill_level(Skill::General(GeneralSkill::EnergyIncrease))
|
||||
.unwrap_or(0),
|
||||
))
|
||||
.with(Health::new(body, body.base_health()))
|
||||
.with(Energy::new(body))
|
||||
.with(Health::new(body))
|
||||
.with(skill_set)
|
||||
.with(Stats::empty(body))
|
||||
.build()
|
||||
|
@ -1689,7 +1689,7 @@ fn handle_spawn(
|
||||
comp::Ori::default(),
|
||||
comp::Stats::new(get_npc_name(id, npc::BodyType::from_body(body)), body),
|
||||
comp::SkillSet::default(),
|
||||
Some(comp::Health::new(body, 0)),
|
||||
Some(comp::Health::new(body)),
|
||||
comp::Poise::new(body),
|
||||
inventory,
|
||||
body,
|
||||
@ -1778,7 +1778,7 @@ fn handle_spawn_training_dummy(
|
||||
|
||||
let stats = comp::Stats::new("Training Dummy".to_string(), body);
|
||||
let skill_set = comp::SkillSet::default();
|
||||
let health = comp::Health::new(body, 0);
|
||||
let health = comp::Health::new(body);
|
||||
let poise = comp::Poise::new(body);
|
||||
|
||||
server
|
||||
|
@ -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,12 +297,7 @@ impl StateExt for State {
|
||||
.with(body.collider())
|
||||
.with(comp::Controller::default())
|
||||
.with(body)
|
||||
.with(comp::Energy::new(
|
||||
body,
|
||||
skill_set
|
||||
.skill_level(Skill::General(GeneralSkill::EnergyIncrease))
|
||||
.unwrap_or(0),
|
||||
))
|
||||
.with(comp::Energy::new(body))
|
||||
.with(stats)
|
||||
.with(if body.is_humanoid() {
|
||||
comp::ActiveAbilities::default_limited(BASE_ABILITY_LIMIT)
|
||||
@ -435,7 +428,7 @@ impl StateExt for State {
|
||||
.with(comp::CharacterActivity::default())
|
||||
// TODO: some of these are required in order for the character_behavior system to
|
||||
// recognize a possesed airship; that system should be refactored to use `.maybe()`
|
||||
.with(comp::Energy::new(ship.into(), 0))
|
||||
.with(comp::Energy::new(ship.into()))
|
||||
.with(comp::Stats::new("Airship".to_string(), body))
|
||||
.with(comp::SkillSet::default())
|
||||
.with(comp::ActiveAbilities::default())
|
||||
@ -734,16 +727,8 @@ 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, health_level));
|
||||
self.write_component_ignore_entity_dead(entity, comp::Energy::new(body, energy_level));
|
||||
self.write_component_ignore_entity_dead(entity, comp::Health::new(body));
|
||||
self.write_component_ignore_entity_dead(entity, comp::Energy::new(body));
|
||||
self.write_component_ignore_entity_dead(entity, Poise::new(body));
|
||||
self.write_component_ignore_entity_dead(entity, stats);
|
||||
self.write_component_ignore_entity_dead(entity, active_abilities);
|
||||
@ -778,9 +763,6 @@ impl StateExt for State {
|
||||
pets.len(),
|
||||
player_pos
|
||||
);
|
||||
// This is the same as wild creatures naturally spawned in the world
|
||||
const DEFAULT_PET_HEALTH_LEVEL: u16 = 0;
|
||||
|
||||
let mut rng = rand::thread_rng();
|
||||
|
||||
for (pet, body, stats) in pets {
|
||||
@ -791,7 +773,7 @@ impl StateExt for State {
|
||||
ori,
|
||||
stats,
|
||||
comp::SkillSet::default(),
|
||||
Some(comp::Health::new(body, DEFAULT_PET_HEALTH_LEVEL)),
|
||||
Some(comp::Health::new(body)),
|
||||
Poise::new(body),
|
||||
Inventory::with_loadout(
|
||||
LoadoutBuilder::from_default(&body).build(),
|
||||
|
@ -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,10 +498,7 @@ 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, health_level));
|
||||
let health = Some(comp::Health::new(body));
|
||||
let poise = comp::Poise::new(body);
|
||||
|
||||
// Allow Humanoid, BirdMedium, and Parrot to speak
|
||||
|
@ -33,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, 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,
|
||||
@ -1374,9 +1373,9 @@ impl<'a> Diary<'a> {
|
||||
|
||||
// Number of skills per rectangle per weapon, start counting at 0
|
||||
// Maximum of 9 skills/8 indices
|
||||
let skills_top_l = 2;
|
||||
let skills_top_r = 6;
|
||||
let skills_bot_l = 4;
|
||||
let skills_top_l = 6;
|
||||
let skills_top_r = 0;
|
||||
let skills_bot_l = 0;
|
||||
let skills_bot_r = 5;
|
||||
|
||||
self.setup_state_for_skill_icons(
|
||||
@ -1387,7 +1386,7 @@ impl<'a> Diary<'a> {
|
||||
skills_bot_l,
|
||||
skills_bot_r,
|
||||
);
|
||||
use skills::{GeneralSkill::*, RollSkill::*};
|
||||
|
||||
use SkillGroupKind::*;
|
||||
use ToolKind::*;
|
||||
// General Combat
|
||||
@ -1419,81 +1418,43 @@ impl<'a> Diary<'a> {
|
||||
// 5 1 6
|
||||
// 3 0 4
|
||||
// 8 2 7
|
||||
SkillIcon::Unlockable {
|
||||
skill: Skill::General(HealthIncrease),
|
||||
image: self.imgs.health_plus_skill,
|
||||
position: MidTopWithMarginOn(state.ids.skills_top_l[0], 3.0),
|
||||
id: state.ids.skill_general_stat_0,
|
||||
},
|
||||
SkillIcon::Unlockable {
|
||||
skill: Skill::General(EnergyIncrease),
|
||||
image: self.imgs.energy_plus_skill,
|
||||
position: MidTopWithMarginOn(state.ids.skills_top_l[1], 3.0),
|
||||
id: state.ids.skill_general_stat_1,
|
||||
},
|
||||
// Top right skills
|
||||
// Bottom left skills
|
||||
SkillIcon::Unlockable {
|
||||
skill: Skill::UnlockGroup(Weapon(Sword)),
|
||||
image: self.imgs.unlock_sword_skill,
|
||||
position: MidTopWithMarginOn(state.ids.skills_top_r[0], 3.0),
|
||||
position: MidTopWithMarginOn(state.ids.skills_top_l[0], 3.0),
|
||||
id: state.ids.skill_general_tree_0,
|
||||
},
|
||||
SkillIcon::Unlockable {
|
||||
skill: Skill::UnlockGroup(Weapon(Axe)),
|
||||
image: self.imgs.unlock_axe_skill,
|
||||
position: MidTopWithMarginOn(state.ids.skills_top_r[1], 3.0),
|
||||
position: MidTopWithMarginOn(state.ids.skills_top_l[1], 3.0),
|
||||
id: state.ids.skill_general_tree_1,
|
||||
},
|
||||
SkillIcon::Unlockable {
|
||||
skill: Skill::UnlockGroup(Weapon(Hammer)),
|
||||
image: self.imgs.unlock_hammer_skill,
|
||||
position: MidTopWithMarginOn(state.ids.skills_top_r[2], 3.0),
|
||||
position: MidTopWithMarginOn(state.ids.skills_top_l[2], 3.0),
|
||||
id: state.ids.skill_general_tree_2,
|
||||
},
|
||||
SkillIcon::Unlockable {
|
||||
skill: Skill::UnlockGroup(Weapon(Bow)),
|
||||
image: self.imgs.unlock_bow_skill,
|
||||
position: MidTopWithMarginOn(state.ids.skills_top_r[3], 3.0),
|
||||
position: MidTopWithMarginOn(state.ids.skills_top_l[3], 3.0),
|
||||
id: state.ids.skill_general_tree_3,
|
||||
},
|
||||
SkillIcon::Unlockable {
|
||||
skill: Skill::UnlockGroup(Weapon(Staff)),
|
||||
image: self.imgs.unlock_staff_skill0,
|
||||
position: MidTopWithMarginOn(state.ids.skills_top_r[4], 3.0),
|
||||
position: MidTopWithMarginOn(state.ids.skills_top_l[4], 3.0),
|
||||
id: state.ids.skill_general_tree_4,
|
||||
},
|
||||
SkillIcon::Unlockable {
|
||||
skill: Skill::UnlockGroup(Weapon(Sceptre)),
|
||||
image: self.imgs.unlock_sceptre_skill,
|
||||
position: MidTopWithMarginOn(state.ids.skills_top_r[5], 3.0),
|
||||
position: MidTopWithMarginOn(state.ids.skills_top_l[5], 3.0),
|
||||
id: state.ids.skill_general_tree_5,
|
||||
},
|
||||
// Bottom left skills
|
||||
SkillIcon::Descriptive {
|
||||
title: "hud-skill-dodge_title",
|
||||
desc: "hud-skill-dodge",
|
||||
image: self.imgs.skill_dodge_skill,
|
||||
position: MidTopWithMarginOn(state.ids.skills_bot_l[0], 3.0),
|
||||
id: state.ids.skill_general_roll_0,
|
||||
},
|
||||
SkillIcon::Unlockable {
|
||||
skill: Skill::Roll(Cost),
|
||||
image: self.imgs.utility_cost_skill,
|
||||
position: MidTopWithMarginOn(state.ids.skills_bot_l[1], 3.0),
|
||||
id: state.ids.skill_general_roll_1,
|
||||
},
|
||||
SkillIcon::Unlockable {
|
||||
skill: Skill::Roll(Strength),
|
||||
image: self.imgs.utility_speed_skill,
|
||||
position: MidTopWithMarginOn(state.ids.skills_bot_l[2], 3.0),
|
||||
id: state.ids.skill_general_roll_2,
|
||||
},
|
||||
SkillIcon::Unlockable {
|
||||
skill: Skill::Roll(Duration),
|
||||
image: self.imgs.utility_duration_skill,
|
||||
position: MidTopWithMarginOn(state.ids.skills_bot_l[3], 3.0),
|
||||
id: state.ids.skill_general_roll_3,
|
||||
},
|
||||
// Bottom right skills
|
||||
SkillIcon::Descriptive {
|
||||
title: "hud-skill-climbing_title",
|
||||
@ -2849,7 +2810,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),
|
||||
@ -2857,7 +2817,6 @@ fn skill_strings(skill: Skill) -> SkillStrings<'static> {
|
||||
Skill::Staff(s) => staff_skill_strings(s),
|
||||
Skill::Sceptre(s) => sceptre_skill_strings(s),
|
||||
// movement trees
|
||||
Skill::Roll(s) => roll_skill_strings(s),
|
||||
Skill::Climb(s) => climb_skill_strings(s),
|
||||
Skill::Swim(s) => swim_skill_strings(s),
|
||||
// mining
|
||||
@ -2866,21 +2825,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) => {
|
||||
@ -3216,27 +3160,6 @@ fn sceptre_skill_strings(skill: SceptreSkill) -> SkillStrings<'static> {
|
||||
}
|
||||
}
|
||||
|
||||
fn roll_skill_strings(skill: RollSkill) -> SkillStrings<'static> {
|
||||
let modifiers = SKILL_MODIFIERS.general_tree.roll;
|
||||
match skill {
|
||||
RollSkill::Cost => SkillStrings::with_mult(
|
||||
"hud-skill-roll_energy_title",
|
||||
"hud-skill-roll_energy",
|
||||
modifiers.energy_cost,
|
||||
),
|
||||
RollSkill::Strength => SkillStrings::with_mult(
|
||||
"hud-skill-roll_speed_title",
|
||||
"hud-skill-roll_speed",
|
||||
modifiers.strength,
|
||||
),
|
||||
RollSkill::Duration => SkillStrings::with_mult(
|
||||
"hud-skill-roll_dur_title",
|
||||
"hud-skill-roll_dur",
|
||||
modifiers.duration,
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
fn climb_skill_strings(skill: ClimbSkill) -> SkillStrings<'static> {
|
||||
let modifiers = SKILL_MODIFIERS.general_tree.climb;
|
||||
match skill {
|
||||
|
Loading…
Reference in New Issue
Block a user