mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Added healing beam character state.
This was done as there was a lot of special casing in basic beam to account for healing.
This commit is contained in:
parent
a1bbc136fc
commit
43874a4aa5
@ -1,15 +1,11 @@
|
||||
BasicBeam(
|
||||
HealingBeam(
|
||||
buildup_duration: 0.25,
|
||||
recover_duration: 0.25,
|
||||
beam_duration: 1.0,
|
||||
base_hps: 80,
|
||||
base_dps: 0,
|
||||
heal: 80,
|
||||
tick_rate: 2.0,
|
||||
range: 25.0,
|
||||
max_angle: 1.0,
|
||||
lifesteal_eff: 0.0,
|
||||
energy_regen: 0,
|
||||
energy_cost: 50,
|
||||
energy_drain: 0,
|
||||
orientation_behavior: Normal,
|
||||
)
|
@ -2,14 +2,12 @@ BasicBeam(
|
||||
buildup_duration: 0.25,
|
||||
recover_duration: 0.25,
|
||||
beam_duration: 1.0,
|
||||
base_hps: 0,
|
||||
base_dps: 80,
|
||||
damage: 80,
|
||||
tick_rate: 2.0,
|
||||
range: 25.0,
|
||||
max_angle: 1.0,
|
||||
lifesteal_eff: 0.15,
|
||||
energy_regen: 25,
|
||||
energy_cost: 0,
|
||||
energy_drain: 0,
|
||||
orientation_behavior: Normal,
|
||||
)
|
@ -2,14 +2,12 @@ BasicBeam(
|
||||
buildup_duration: 0.25,
|
||||
recover_duration: 0.25,
|
||||
beam_duration: 1.0,
|
||||
base_hps: 0,
|
||||
base_dps: 150,
|
||||
damage: 150,
|
||||
tick_rate: 3.0,
|
||||
range: 20.0,
|
||||
max_angle: 10.0,
|
||||
lifesteal_eff: 0.0,
|
||||
energy_regen: 0,
|
||||
energy_cost: 1,
|
||||
energy_drain: 350,
|
||||
orientation_behavior: Normal,
|
||||
)
|
||||
)
|
@ -2,14 +2,12 @@ BasicBeam(
|
||||
buildup_duration: 0.5,
|
||||
recover_duration: 0.5,
|
||||
beam_duration: 1.0,
|
||||
base_hps: 0,
|
||||
base_dps: 150,
|
||||
damage: 150,
|
||||
tick_rate: 3.0,
|
||||
range: 20.0,
|
||||
max_angle: 0.1,
|
||||
lifesteal_eff: 0.0,
|
||||
energy_regen: 0,
|
||||
energy_cost: 1,
|
||||
energy_drain: 350,
|
||||
orientation_behavior: Normal,
|
||||
)
|
||||
|
@ -2,14 +2,14 @@ BasicBeam(
|
||||
buildup_duration: 0.25,
|
||||
recover_duration: 0.25,
|
||||
beam_duration: 1.0,
|
||||
base_hps: 60,
|
||||
base_dps: 60,
|
||||
damage: 60,
|
||||
//base_hps: 60, Don't merge until this comment is removed
|
||||
tick_rate: 2.0,
|
||||
range: 25.0,
|
||||
max_angle: 1.0,
|
||||
lifesteal_eff: 0.15,
|
||||
energy_regen: 25,
|
||||
energy_cost: 50,
|
||||
//energy_cost: 50,
|
||||
energy_drain: 0,
|
||||
orientation_behavior: Normal,
|
||||
)
|
@ -2,14 +2,12 @@ BasicBeam(
|
||||
buildup_duration: 0.4,
|
||||
recover_duration: 0.25,
|
||||
beam_duration: 0.5,
|
||||
base_hps: 0,
|
||||
base_dps: 150,
|
||||
damage: 150,
|
||||
tick_rate: 3.0,
|
||||
range: 15.0,
|
||||
max_angle: 22.5,
|
||||
lifesteal_eff: 0.0,
|
||||
energy_regen: 0,
|
||||
energy_cost: 0,
|
||||
energy_drain: 0,
|
||||
orientation_behavior: Normal,
|
||||
)
|
@ -2,14 +2,12 @@ BasicBeam(
|
||||
buildup_duration: 0.25,
|
||||
recover_duration: 0.25,
|
||||
beam_duration: 0.5,
|
||||
base_hps: 0,
|
||||
base_dps: 9001,
|
||||
damage: 9001,
|
||||
tick_rate: 3.0,
|
||||
range: 30.0,
|
||||
max_angle: 1.0,
|
||||
lifesteal_eff: 0.0,
|
||||
energy_regen: 0,
|
||||
energy_cost: 0,
|
||||
energy_drain: 0,
|
||||
orientation_behavior: Turret,
|
||||
)
|
@ -14,7 +14,6 @@ use crate::{
|
||||
};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::time::Duration;
|
||||
use vek::Vec3;
|
||||
|
||||
#[derive(Copy, Clone, Hash, Eq, PartialEq, Debug, Serialize, Deserialize)]
|
||||
pub enum CharacterAbilityType {
|
||||
@ -217,14 +216,12 @@ pub enum CharacterAbility {
|
||||
buildup_duration: f32,
|
||||
recover_duration: f32,
|
||||
beam_duration: f32,
|
||||
base_hps: f32,
|
||||
base_dps: f32,
|
||||
damage: f32,
|
||||
tick_rate: f32,
|
||||
range: f32,
|
||||
max_angle: f32,
|
||||
lifesteal_eff: f32,
|
||||
energy_regen: f32,
|
||||
energy_cost: f32,
|
||||
energy_drain: f32,
|
||||
orientation_behavior: basic_beam::MovementBehavior,
|
||||
},
|
||||
@ -237,6 +234,16 @@ pub enum CharacterAbility {
|
||||
range: f32,
|
||||
energy_cost: f32,
|
||||
},
|
||||
HealingBeam {
|
||||
buildup_duration: f32,
|
||||
recover_duration: f32,
|
||||
beam_duration: f32,
|
||||
heal: f32,
|
||||
tick_rate: f32,
|
||||
range: f32,
|
||||
max_angle: f32,
|
||||
energy_cost: f32,
|
||||
},
|
||||
}
|
||||
|
||||
impl Default for CharacterAbility {
|
||||
@ -481,16 +488,13 @@ impl CharacterAbility {
|
||||
BasicBeam {
|
||||
ref mut buildup_duration,
|
||||
ref mut recover_duration,
|
||||
ref mut base_hps,
|
||||
ref mut base_dps,
|
||||
ref mut damage,
|
||||
ref mut tick_rate,
|
||||
..
|
||||
} => {
|
||||
*buildup_duration /= speed;
|
||||
*recover_duration /= speed;
|
||||
// hps and dps adjusted by speed as they are normalized by tick rate already
|
||||
*base_hps *= power * speed;
|
||||
*base_dps *= power * speed;
|
||||
*damage *= power;
|
||||
*tick_rate *= speed;
|
||||
},
|
||||
CastAura {
|
||||
@ -504,6 +508,18 @@ impl CharacterAbility {
|
||||
*recover_duration /= speed;
|
||||
aura.strength *= power;
|
||||
},
|
||||
HealingBeam {
|
||||
ref mut buildup_duration,
|
||||
ref mut recover_duration,
|
||||
ref mut heal,
|
||||
ref mut tick_rate,
|
||||
..
|
||||
} => {
|
||||
*buildup_duration /= speed;
|
||||
*recover_duration /= speed;
|
||||
*heal *= power;
|
||||
*tick_rate *= speed;
|
||||
},
|
||||
}
|
||||
self
|
||||
}
|
||||
@ -521,8 +537,15 @@ impl CharacterAbility {
|
||||
| ChargedMelee { energy_cost, .. }
|
||||
| ChargedRanged { energy_cost, .. }
|
||||
| Shockwave { energy_cost, .. }
|
||||
| BasicBeam { energy_cost, .. }
|
||||
| HealingBeam { energy_cost, .. }
|
||||
| CastAura { energy_cost, .. } => *energy_cost as u32,
|
||||
BasicBeam { energy_drain, .. } => {
|
||||
if *energy_drain > f32::EPSILON {
|
||||
1
|
||||
} else {
|
||||
0
|
||||
}
|
||||
},
|
||||
BasicBlock | Boost { .. } | ComboMelee { .. } => 0,
|
||||
}
|
||||
}
|
||||
@ -922,14 +945,14 @@ impl CharacterAbility {
|
||||
*projectile = projectile.modified_projectile(power, regen, range, 1_f32);
|
||||
},
|
||||
BasicBeam {
|
||||
ref mut base_dps,
|
||||
ref mut damage,
|
||||
ref mut range,
|
||||
ref mut energy_drain,
|
||||
ref mut beam_duration,
|
||||
..
|
||||
} => {
|
||||
if let Ok(Some(level)) = skillset.skill_level(Staff(FDamage)) {
|
||||
*base_dps *= 1.3_f32.powi(level.into());
|
||||
*damage *= 1.3_f32.powi(level.into());
|
||||
}
|
||||
if let Ok(Some(level)) = skillset.skill_level(Staff(FRange)) {
|
||||
let range_mod = 1.25_f32.powi(level.into());
|
||||
@ -970,8 +993,8 @@ impl CharacterAbility {
|
||||
}
|
||||
},
|
||||
Some(ToolKind::Sceptre) => {
|
||||
use skills::SceptreSkill::*;
|
||||
match self {
|
||||
//use skills::SceptreSkill::*;
|
||||
/*match self {
|
||||
BasicBeam {
|
||||
ref mut base_hps,
|
||||
ref mut base_dps,
|
||||
@ -1036,7 +1059,7 @@ impl CharacterAbility {
|
||||
}
|
||||
},
|
||||
_ => {},
|
||||
}
|
||||
}*/
|
||||
},
|
||||
None => {
|
||||
use skills::RollSkill::*;
|
||||
@ -1441,14 +1464,12 @@ impl From<(&CharacterAbility, AbilityInfo)> for CharacterState {
|
||||
buildup_duration,
|
||||
recover_duration,
|
||||
beam_duration,
|
||||
base_hps,
|
||||
base_dps,
|
||||
damage,
|
||||
tick_rate,
|
||||
range,
|
||||
max_angle,
|
||||
lifesteal_eff,
|
||||
energy_regen,
|
||||
energy_cost,
|
||||
energy_drain,
|
||||
orientation_behavior,
|
||||
} => CharacterState::BasicBeam(basic_beam::Data {
|
||||
@ -1456,21 +1477,18 @@ impl From<(&CharacterAbility, AbilityInfo)> for CharacterState {
|
||||
buildup_duration: Duration::from_secs_f32(*buildup_duration),
|
||||
recover_duration: Duration::from_secs_f32(*recover_duration),
|
||||
beam_duration: Duration::from_secs_f32(*beam_duration),
|
||||
base_hps: *base_hps,
|
||||
base_dps: *base_dps,
|
||||
damage: *damage,
|
||||
tick_rate: *tick_rate,
|
||||
range: *range,
|
||||
max_angle: *max_angle,
|
||||
lifesteal_eff: *lifesteal_eff,
|
||||
energy_regen: *energy_regen,
|
||||
energy_cost: *energy_cost,
|
||||
energy_drain: *energy_drain,
|
||||
ability_info,
|
||||
orientation_behavior: *orientation_behavior,
|
||||
},
|
||||
timer: Duration::default(),
|
||||
stage_section: StageSection::Buildup,
|
||||
offset: Vec3::zero(),
|
||||
}),
|
||||
CharacterAbility::CastAura {
|
||||
buildup_duration,
|
||||
@ -1493,6 +1511,30 @@ impl From<(&CharacterAbility, AbilityInfo)> for CharacterState {
|
||||
timer: Duration::default(),
|
||||
stage_section: StageSection::Buildup,
|
||||
}),
|
||||
CharacterAbility::HealingBeam {
|
||||
buildup_duration,
|
||||
recover_duration,
|
||||
beam_duration,
|
||||
heal,
|
||||
tick_rate,
|
||||
range,
|
||||
max_angle,
|
||||
energy_cost,
|
||||
} => CharacterState::HealingBeam(healing_beam::Data {
|
||||
static_data: healing_beam::StaticData {
|
||||
buildup_duration: Duration::from_secs_f32(*buildup_duration),
|
||||
recover_duration: Duration::from_secs_f32(*recover_duration),
|
||||
beam_duration: Duration::from_secs_f32(*beam_duration),
|
||||
heal: *heal,
|
||||
tick_rate: *tick_rate,
|
||||
range: *range,
|
||||
max_angle: *max_angle,
|
||||
energy_cost: *energy_cost,
|
||||
ability_info,
|
||||
},
|
||||
timer: Duration::default(),
|
||||
stage_section: StageSection::Buildup,
|
||||
}),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -83,6 +83,8 @@ pub enum CharacterState {
|
||||
BasicBeam(basic_beam::Data),
|
||||
/// Creates an aura that persists as long as you are actively casting
|
||||
CastAura(cast_aura::Data),
|
||||
/// A directed beam that heals targets in range
|
||||
HealingBeam(healing_beam::Data),
|
||||
}
|
||||
|
||||
impl CharacterState {
|
||||
@ -103,6 +105,7 @@ impl CharacterState {
|
||||
| CharacterState::Shockwave(_)
|
||||
| CharacterState::BasicBeam(_)
|
||||
| CharacterState::CastAura(_)
|
||||
| CharacterState::HealingBeam(_)
|
||||
)
|
||||
}
|
||||
|
||||
@ -125,6 +128,7 @@ impl CharacterState {
|
||||
| CharacterState::Shockwave(_)
|
||||
| CharacterState::BasicBeam(_)
|
||||
| CharacterState::CastAura(_)
|
||||
| CharacterState::HealingBeam(_)
|
||||
)
|
||||
}
|
||||
|
||||
@ -145,6 +149,7 @@ impl CharacterState {
|
||||
| CharacterState::Stunned(_)
|
||||
| CharacterState::Wielding
|
||||
| CharacterState::Talk
|
||||
| CharacterState::HealingBeam(_)
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -24,11 +24,9 @@ pub struct StaticData {
|
||||
pub recover_duration: Duration,
|
||||
/// How long each beam segment persists for
|
||||
pub beam_duration: Duration,
|
||||
/// Base healing per second
|
||||
pub base_hps: f32,
|
||||
/// Base damage per second
|
||||
pub base_dps: f32,
|
||||
/// Ticks of damage/healing per second
|
||||
/// Base damage per tick
|
||||
pub damage: f32,
|
||||
/// Ticks per second
|
||||
pub tick_rate: f32,
|
||||
/// Max range
|
||||
pub range: f32,
|
||||
@ -37,11 +35,9 @@ pub struct StaticData {
|
||||
/// Lifesteal efficiency (0 gives 0% conversion of damage to health, 1 gives
|
||||
/// 100% conversion of damage to health)
|
||||
pub lifesteal_eff: f32,
|
||||
/// Energy regened per second for damage ticks
|
||||
/// Energy regenerated per tick
|
||||
pub energy_regen: f32,
|
||||
/// Energy consumed per second for heal ticks
|
||||
pub energy_cost: f32,
|
||||
/// Energy drained per
|
||||
/// Energy drained per second
|
||||
pub energy_drain: f32,
|
||||
/// Used to dictate how orientation functions in this state
|
||||
pub orientation_behavior: MovementBehavior,
|
||||
@ -58,8 +54,6 @@ pub struct Data {
|
||||
pub timer: Duration,
|
||||
/// What section the character stage is in
|
||||
pub stage_section: StageSection,
|
||||
/// Used to offset beam and particles
|
||||
pub offset: Vec3<f32>,
|
||||
}
|
||||
|
||||
impl CharacterBehavior for Data {
|
||||
@ -103,17 +97,10 @@ impl CharacterBehavior for Data {
|
||||
tick_dur: Duration::from_secs_f32(1.0 / self.static_data.tick_rate),
|
||||
timer: Duration::default(),
|
||||
});
|
||||
// Gets offsets
|
||||
let body_offsets = Vec3::new(
|
||||
(data.body.radius() + 1.0) * data.inputs.look_dir.x,
|
||||
(data.body.radius() + 1.0) * data.inputs.look_dir.y,
|
||||
data.body.eye_height(),
|
||||
) * 0.55;
|
||||
// Build up
|
||||
update.character = CharacterState::BasicBeam(Data {
|
||||
timer: Duration::default(),
|
||||
stage_section: StageSection::Cast,
|
||||
offset: body_offsets,
|
||||
..*self
|
||||
});
|
||||
}
|
||||
@ -135,27 +122,17 @@ impl CharacterBehavior for Data {
|
||||
let damage = AttackDamage::new(
|
||||
Damage {
|
||||
source: DamageSource::Energy,
|
||||
value: self.static_data.base_dps as f32 / self.static_data.tick_rate,
|
||||
value: self.static_data.damage,
|
||||
},
|
||||
Some(GroupTarget::OutOfGroup),
|
||||
)
|
||||
.with_effect(lifesteal);
|
||||
let heal = AttackEffect::new(
|
||||
Some(GroupTarget::InGroup),
|
||||
CombatEffect::Heal(
|
||||
self.static_data.base_hps as f32 / self.static_data.tick_rate,
|
||||
),
|
||||
)
|
||||
.with_requirement(CombatRequirement::SufficientEnergy(
|
||||
self.static_data.energy_cost,
|
||||
));
|
||||
let (crit_chance, crit_mult) =
|
||||
get_crit_data(data, self.static_data.ability_info);
|
||||
let attack = Attack::default()
|
||||
.with_damage(damage)
|
||||
.with_crit(crit_chance, crit_mult)
|
||||
.with_effect(energy)
|
||||
.with_effect(heal);
|
||||
.with_effect(energy);
|
||||
|
||||
let properties = beam::Properties {
|
||||
attack,
|
||||
@ -189,7 +166,6 @@ impl CharacterBehavior for Data {
|
||||
.timer
|
||||
.checked_add(Duration::from_secs_f32(data.dt.0))
|
||||
.unwrap_or_default(),
|
||||
offset: body_offsets,
|
||||
..*self
|
||||
});
|
||||
|
||||
|
172
common/src/states/healing_beam.rs
Normal file
172
common/src/states/healing_beam.rs
Normal file
@ -0,0 +1,172 @@
|
||||
use crate::{
|
||||
combat::{Attack, AttackEffect, CombatEffect, CombatRequirement, GroupTarget},
|
||||
comp::{beam, Body, CharacterState, Ori, Pos, StateUpdate},
|
||||
event::ServerEvent,
|
||||
states::{
|
||||
behavior::{CharacterBehavior, JoinData},
|
||||
utils::*,
|
||||
},
|
||||
uid::Uid,
|
||||
};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::time::Duration;
|
||||
use vek::*;
|
||||
|
||||
/// Separated out to condense update portions of character state
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct StaticData {
|
||||
/// How long until state should deal damage or heal
|
||||
pub buildup_duration: Duration,
|
||||
/// How long the state has until exiting
|
||||
pub recover_duration: Duration,
|
||||
/// How long each beam segment persists for
|
||||
pub beam_duration: Duration,
|
||||
/// Base healing per tick
|
||||
pub heal: f32,
|
||||
/// Ticks of healing per second
|
||||
pub tick_rate: f32,
|
||||
/// Max range
|
||||
pub range: f32,
|
||||
/// Max angle (45.0 will give you a 90.0 angle window)
|
||||
pub max_angle: f32,
|
||||
/// Energy consumed per second for heal ticks
|
||||
pub energy_cost: f32,
|
||||
/// What key is used to press ability
|
||||
pub ability_info: AbilityInfo,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct Data {
|
||||
/// Struct containing data that does not change over the course of the
|
||||
/// character state
|
||||
pub static_data: StaticData,
|
||||
/// Timer for each stage
|
||||
pub timer: Duration,
|
||||
/// What section the character stage is in
|
||||
pub stage_section: StageSection,
|
||||
}
|
||||
|
||||
impl CharacterBehavior for Data {
|
||||
fn behavior(&self, data: &JoinData) -> StateUpdate {
|
||||
let mut update = StateUpdate::from(data);
|
||||
|
||||
handle_move(data, &mut update, 0.4);
|
||||
handle_jump(data, &mut update);
|
||||
if !ability_key_is_pressed(data, self.static_data.ability_info.key) {
|
||||
handle_interrupt(data, &mut update, false);
|
||||
match update.character {
|
||||
CharacterState::HealingBeam(_) => {},
|
||||
_ => {
|
||||
return update;
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
match self.stage_section {
|
||||
StageSection::Buildup => {
|
||||
if self.timer < self.static_data.buildup_duration {
|
||||
// Build up
|
||||
update.character = CharacterState::HealingBeam(Data {
|
||||
timer: self
|
||||
.timer
|
||||
.checked_add(Duration::from_secs_f32(data.dt.0))
|
||||
.unwrap_or_default(),
|
||||
..*self
|
||||
});
|
||||
} else {
|
||||
// Creates beam
|
||||
data.updater.insert(data.entity, beam::Beam {
|
||||
hit_entities: Vec::<Uid>::new(),
|
||||
tick_dur: Duration::from_secs_f32(1.0 / self.static_data.tick_rate),
|
||||
timer: Duration::default(),
|
||||
});
|
||||
// Build up
|
||||
update.character = CharacterState::HealingBeam(Data {
|
||||
timer: Duration::default(),
|
||||
stage_section: StageSection::Cast,
|
||||
..*self
|
||||
});
|
||||
}
|
||||
},
|
||||
StageSection::Cast => {
|
||||
if ability_key_is_pressed(data, self.static_data.ability_info.key) {
|
||||
let speed =
|
||||
self.static_data.range / self.static_data.beam_duration.as_secs_f32();
|
||||
let heal = AttackEffect::new(
|
||||
Some(GroupTarget::InGroup),
|
||||
CombatEffect::Heal(self.static_data.heal),
|
||||
)
|
||||
.with_requirement(CombatRequirement::SufficientEnergy(
|
||||
self.static_data.energy_cost,
|
||||
));
|
||||
let attack = Attack::default().with_effect(heal);
|
||||
|
||||
let properties = beam::Properties {
|
||||
attack,
|
||||
angle: self.static_data.max_angle.to_radians(),
|
||||
speed,
|
||||
duration: self.static_data.beam_duration,
|
||||
owner: Some(*data.uid),
|
||||
};
|
||||
// Gets offsets
|
||||
let body_offsets = match data.body {
|
||||
Body::Humanoid(_) => Vec3::new(
|
||||
(data.body.radius() + 2.0) * data.inputs.look_dir.x,
|
||||
(data.body.radius() + 2.0) * data.inputs.look_dir.y,
|
||||
data.body.eye_height() * 0.55,
|
||||
),
|
||||
_ => Vec3::new(
|
||||
(data.body.radius() + 3.0) * data.inputs.look_dir.x,
|
||||
(data.body.radius() + 3.0) * data.inputs.look_dir.y,
|
||||
data.body.eye_height() * 0.55,
|
||||
),
|
||||
};
|
||||
let pos = Pos(data.pos.0 + body_offsets);
|
||||
// Create beam segment
|
||||
update.server_events.push_front(ServerEvent::BeamSegment {
|
||||
properties,
|
||||
pos,
|
||||
ori: Ori::from(data.inputs.look_dir),
|
||||
});
|
||||
update.character = CharacterState::HealingBeam(Data {
|
||||
timer: self
|
||||
.timer
|
||||
.checked_add(Duration::from_secs_f32(data.dt.0))
|
||||
.unwrap_or_default(),
|
||||
..*self
|
||||
});
|
||||
} else {
|
||||
update.character = CharacterState::HealingBeam(Data {
|
||||
timer: Duration::default(),
|
||||
stage_section: StageSection::Recover,
|
||||
..*self
|
||||
});
|
||||
}
|
||||
},
|
||||
StageSection::Recover => {
|
||||
if self.timer < self.static_data.recover_duration {
|
||||
update.character = CharacterState::HealingBeam(Data {
|
||||
timer: self
|
||||
.timer
|
||||
.checked_add(Duration::from_secs_f32(data.dt.0))
|
||||
.unwrap_or_default(),
|
||||
..*self
|
||||
});
|
||||
} else {
|
||||
// Done
|
||||
update.character = CharacterState::Wielding;
|
||||
// Make sure attack component is removed
|
||||
data.updater.remove::<beam::Beam>(data.entity);
|
||||
}
|
||||
},
|
||||
_ => {
|
||||
// If it somehow ends up in an incorrect stage section
|
||||
update.character = CharacterState::Wielding;
|
||||
// Make sure attack component is removed
|
||||
data.updater.remove::<beam::Beam>(data.entity);
|
||||
},
|
||||
}
|
||||
|
||||
update
|
||||
}
|
||||
}
|
@ -14,6 +14,7 @@ pub mod dash_melee;
|
||||
pub mod equipping;
|
||||
pub mod glide;
|
||||
pub mod glide_wield;
|
||||
pub mod healing_beam;
|
||||
pub mod idle;
|
||||
pub mod leap_melee;
|
||||
pub mod repeater_ranged;
|
||||
|
@ -304,6 +304,7 @@ impl<'a> System<'a> for Sys {
|
||||
CharacterState::Shockwave(data) => data.handle_event(&j, action),
|
||||
CharacterState::BasicBeam(data) => data.handle_event(&j, action),
|
||||
CharacterState::CastAura(data) => data.handle_event(&j, action),
|
||||
CharacterState::HealingBeam(data) => data.handle_event(&j, action),
|
||||
};
|
||||
local_emitter.append(&mut state_update.local_events);
|
||||
server_emitter.append(&mut state_update.server_events);
|
||||
@ -344,6 +345,7 @@ impl<'a> System<'a> for Sys {
|
||||
CharacterState::Shockwave(data) => data.behavior(&j),
|
||||
CharacterState::BasicBeam(data) => data.behavior(&j),
|
||||
CharacterState::CastAura(data) => data.behavior(&j),
|
||||
CharacterState::HealingBeam(data) => data.behavior(&j),
|
||||
};
|
||||
|
||||
local_emitter.append(&mut state_update.local_events);
|
||||
|
@ -233,7 +233,8 @@ impl<'a> System<'a> for Sys {
|
||||
| CharacterState::RepeaterRanged { .. }
|
||||
| CharacterState::Shockwave { .. }
|
||||
| CharacterState::BasicBeam { .. }
|
||||
| CharacterState::CastAura { .. } => {
|
||||
| CharacterState::CastAura { .. }
|
||||
| CharacterState::HealingBeam { .. } => {
|
||||
if energy.get_unchecked().regen_rate != 0.0 {
|
||||
energy.get_mut_unchecked().regen_rate = 0.0
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user