mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Initial implementation of new staff abilities.
This commit is contained in:
parent
4a90f7c088
commit
256846a669
@ -25,7 +25,7 @@ pub enum CharacterAbilityType {
|
||||
ComboMelee(StageSection, u32),
|
||||
LeapMelee(StageSection),
|
||||
SpinMelee(StageSection),
|
||||
GroundShockwave,
|
||||
Shockwave,
|
||||
BasicBeam,
|
||||
RepeaterRanged,
|
||||
}
|
||||
@ -43,7 +43,7 @@ impl From<&CharacterState> for CharacterAbilityType {
|
||||
CharacterState::SpinMelee(data) => Self::SpinMelee(data.stage_section),
|
||||
CharacterState::ChargedMelee(data) => Self::ChargedMelee(data.stage_section),
|
||||
CharacterState::ChargedRanged(_) => Self::ChargedRanged,
|
||||
CharacterState::GroundShockwave(_) => Self::ChargedRanged,
|
||||
CharacterState::Shockwave(_) => Self::ChargedRanged,
|
||||
CharacterState::BasicBeam(_) => Self::BasicBeam,
|
||||
CharacterState::RepeaterRanged(_) => Self::RepeaterRanged,
|
||||
_ => Self::BasicMelee,
|
||||
@ -175,7 +175,7 @@ pub enum CharacterAbility {
|
||||
initial_projectile_speed: f32,
|
||||
max_projectile_speed: f32,
|
||||
},
|
||||
GroundShockwave {
|
||||
Shockwave {
|
||||
energy_cost: u32,
|
||||
buildup_duration: Duration,
|
||||
recover_duration: Duration,
|
||||
@ -248,7 +248,7 @@ impl CharacterAbility {
|
||||
.energy
|
||||
.try_change_by(-(*energy_cost as i32), EnergySource::Ability)
|
||||
.is_ok(),
|
||||
CharacterAbility::GroundShockwave { energy_cost, .. } => update
|
||||
CharacterAbility::Shockwave { energy_cost, .. } => update
|
||||
.energy
|
||||
.try_change_by(-(*energy_cost as i32), EnergySource::Ability)
|
||||
.is_ok(),
|
||||
@ -618,7 +618,7 @@ impl From<&CharacterAbility> for CharacterState {
|
||||
stage_section: StageSection::Movement,
|
||||
reps_remaining: *reps_remaining,
|
||||
}),
|
||||
CharacterAbility::GroundShockwave {
|
||||
CharacterAbility::Shockwave {
|
||||
energy_cost: _,
|
||||
buildup_duration,
|
||||
recover_duration,
|
||||
@ -628,7 +628,7 @@ impl From<&CharacterAbility> for CharacterState {
|
||||
shockwave_speed,
|
||||
shockwave_duration,
|
||||
requires_ground,
|
||||
} => CharacterState::GroundShockwave(ground_shockwave::Data {
|
||||
} => CharacterState::Shockwave(shockwave::Data {
|
||||
exhausted: false,
|
||||
buildup_duration: *buildup_duration,
|
||||
recover_duration: *recover_duration,
|
||||
|
@ -74,7 +74,7 @@ pub enum CharacterState {
|
||||
/// A repeating ranged attack
|
||||
RepeaterRanged(repeater_ranged::Data),
|
||||
/// A ground shockwave attack
|
||||
GroundShockwave(ground_shockwave::Data),
|
||||
Shockwave(shockwave::Data),
|
||||
/// A continuous attack that affects all creatures in a cone originating
|
||||
/// from the source
|
||||
BasicBeam(basic_beam::Data),
|
||||
@ -94,7 +94,7 @@ impl CharacterState {
|
||||
| CharacterState::ChargedMelee(_)
|
||||
| CharacterState::ChargedRanged(_)
|
||||
| CharacterState::RepeaterRanged(_)
|
||||
| CharacterState::GroundShockwave(_)
|
||||
| CharacterState::Shockwave(_)
|
||||
| CharacterState::BasicBeam(_)
|
||||
)
|
||||
}
|
||||
@ -110,7 +110,7 @@ impl CharacterState {
|
||||
| CharacterState::ChargedMelee(_)
|
||||
| CharacterState::ChargedRanged(_)
|
||||
| CharacterState::RepeaterRanged(_)
|
||||
| CharacterState::GroundShockwave(_)
|
||||
| CharacterState::Shockwave(_)
|
||||
| CharacterState::BasicBeam(_)
|
||||
)
|
||||
}
|
||||
@ -126,7 +126,7 @@ impl CharacterState {
|
||||
| CharacterState::ChargedMelee(_)
|
||||
| CharacterState::ChargedRanged(_)
|
||||
| CharacterState::RepeaterRanged(_)
|
||||
| CharacterState::GroundShockwave(_)
|
||||
| CharacterState::Shockwave(_)
|
||||
| CharacterState::BasicBeam(_)
|
||||
)
|
||||
}
|
||||
|
@ -409,38 +409,19 @@ impl Tool {
|
||||
},
|
||||
],
|
||||
Staff(_) => vec![
|
||||
BasicMelee {
|
||||
BasicBeam {
|
||||
energy_cost: 0,
|
||||
buildup_duration: Duration::from_millis(100),
|
||||
recover_duration: Duration::from_millis(300),
|
||||
base_healthchange: (-40.0 * self.base_power()) as i32,
|
||||
knockback: 0.0,
|
||||
range: 3.5,
|
||||
max_angle: 20.0,
|
||||
},
|
||||
BasicRanged {
|
||||
energy_cost: 0,
|
||||
holdable: false,
|
||||
prepare_duration: Duration::from_millis(250),
|
||||
recover_duration: Duration::from_millis(600),
|
||||
projectile: Projectile {
|
||||
hit_solid: vec![projectile::Effect::Vanish],
|
||||
hit_entity: vec![
|
||||
projectile::Effect::Damage((-40.0 * self.base_power()) as i32),
|
||||
projectile::Effect::RewardEnergy(150),
|
||||
projectile::Effect::Vanish,
|
||||
],
|
||||
time_left: Duration::from_secs(20),
|
||||
owner: None,
|
||||
ignore_group: true,
|
||||
},
|
||||
projectile_body: Body::Object(object::Body::BoltFire),
|
||||
projectile_light: Some(LightEmitter {
|
||||
col: (0.85, 0.5, 0.11).into(),
|
||||
..Default::default()
|
||||
}),
|
||||
projectile_gravity: None,
|
||||
projectile_speed: 100.0,
|
||||
buildup_duration: Duration::from_millis(250),
|
||||
recover_duration: Duration::from_millis(250),
|
||||
beam_duration: Duration::from_secs(1),
|
||||
base_hps: 0,
|
||||
base_dps: (100.0 * self.base_power()) as u32,
|
||||
tick_rate: 2.0,
|
||||
range: 15.0,
|
||||
max_angle: 45.0,
|
||||
lifesteal_eff: 0.0,
|
||||
energy_regen: 50,
|
||||
energy_drain: 0,
|
||||
},
|
||||
BasicRanged {
|
||||
energy_cost: 400,
|
||||
@ -471,8 +452,19 @@ impl Tool {
|
||||
col: (1.0, 0.75, 0.11).into(),
|
||||
..Default::default()
|
||||
}),
|
||||
projectile_gravity: None,
|
||||
projectile_speed: 100.0,
|
||||
projectile_gravity: Some(Gravity(0.5)),
|
||||
projectile_speed: 40.0,
|
||||
},
|
||||
Shockwave {
|
||||
energy_cost: 750,
|
||||
buildup_duration: Duration::from_millis(500),
|
||||
recover_duration: Duration::from_millis(300),
|
||||
damage: 200,
|
||||
knockback: 12.0,
|
||||
shockwave_angle: 360.0,
|
||||
shockwave_speed: 20.0,
|
||||
shockwave_duration: Duration::from_millis(500),
|
||||
requires_ground: false,
|
||||
},
|
||||
],
|
||||
Shield(_) => vec![
|
||||
@ -499,7 +491,7 @@ impl Tool {
|
||||
range: 5.0,
|
||||
max_angle: 120.0,
|
||||
},
|
||||
GroundShockwave {
|
||||
Shockwave {
|
||||
energy_cost: 0,
|
||||
buildup_duration: Duration::from_millis(500),
|
||||
recover_duration: Duration::from_millis(1000),
|
||||
|
@ -12,7 +12,7 @@ pub mod dash_melee;
|
||||
pub mod equipping;
|
||||
pub mod glide;
|
||||
pub mod glide_wield;
|
||||
pub mod ground_shockwave;
|
||||
pub mod shockwave;
|
||||
pub mod idle;
|
||||
pub mod leap_melee;
|
||||
pub mod repeater_ranged;
|
||||
|
@ -37,7 +37,7 @@ impl CharacterBehavior for Data {
|
||||
|
||||
if self.buildup_duration != Duration::default() {
|
||||
// Build up
|
||||
update.character = CharacterState::GroundShockwave(Data {
|
||||
update.character = CharacterState::Shockwave(Data {
|
||||
exhausted: self.exhausted,
|
||||
buildup_duration: self
|
||||
.buildup_duration
|
||||
@ -68,7 +68,7 @@ impl CharacterBehavior for Data {
|
||||
ori: *data.ori,
|
||||
});
|
||||
|
||||
update.character = CharacterState::GroundShockwave(Data {
|
||||
update.character = CharacterState::Shockwave(Data {
|
||||
exhausted: true,
|
||||
buildup_duration: self.buildup_duration,
|
||||
recover_duration: self.recover_duration,
|
||||
@ -81,7 +81,7 @@ impl CharacterBehavior for Data {
|
||||
});
|
||||
} else if self.recover_duration != Duration::default() {
|
||||
// Recovery
|
||||
update.character = CharacterState::GroundShockwave(Data {
|
||||
update.character = CharacterState::Shockwave(Data {
|
||||
exhausted: self.exhausted,
|
||||
buildup_duration: self.buildup_duration,
|
||||
recover_duration: self
|
@ -264,7 +264,7 @@ impl<'a> System<'a> for Sys {
|
||||
CharacterState::ChargedMelee(data) => data.handle_event(&j, action),
|
||||
CharacterState::ChargedRanged(data) => data.handle_event(&j, action),
|
||||
CharacterState::RepeaterRanged(data) => data.handle_event(&j, action),
|
||||
CharacterState::GroundShockwave(data) => data.handle_event(&j, action),
|
||||
CharacterState::Shockwave(data) => data.handle_event(&j, action),
|
||||
CharacterState::BasicBeam(data) => data.handle_event(&j, action),
|
||||
};
|
||||
local_emitter.append(&mut state_update.local_events);
|
||||
@ -296,7 +296,7 @@ impl<'a> System<'a> for Sys {
|
||||
CharacterState::ChargedMelee(data) => data.behavior(&j),
|
||||
CharacterState::ChargedRanged(data) => data.behavior(&j),
|
||||
CharacterState::RepeaterRanged(data) => data.behavior(&j),
|
||||
CharacterState::GroundShockwave(data) => data.behavior(&j),
|
||||
CharacterState::Shockwave(data) => data.behavior(&j),
|
||||
CharacterState::BasicBeam(data) => data.behavior(&j),
|
||||
};
|
||||
|
||||
|
@ -115,7 +115,7 @@ impl<'a> System<'a> for Sys {
|
||||
| CharacterState::ChargedMelee { .. }
|
||||
| CharacterState::ChargedRanged { .. }
|
||||
| CharacterState::RepeaterRanged { .. }
|
||||
| CharacterState::GroundShockwave { .. }
|
||||
| CharacterState::Shockwave { .. }
|
||||
| CharacterState::BasicBeam { .. } => {
|
||||
if energy.get_unchecked().regen_rate != 0.0 {
|
||||
energy.get_mut_unchecked().regen_rate = 0.0
|
||||
|
@ -2322,7 +2322,7 @@ impl FigureMgr {
|
||||
skeleton_attr,
|
||||
)
|
||||
},
|
||||
CharacterState::GroundShockwave(_) => {
|
||||
CharacterState::Shockwave(_) => {
|
||||
anim::golem::ShockwaveAnimation::update_skeleton(
|
||||
&target_base,
|
||||
(vel.0.magnitude(), time),
|
||||
|
Loading…
Reference in New Issue
Block a user