From 171125e73ed4e01ae26681b123d055cd2142fee4 Mon Sep 17 00:00:00 2001 From: Sam Date: Fri, 29 Mar 2024 15:05:30 -0400 Subject: [PATCH] Seismic shock --- .../common/abilities/ability_set_manifest.ron | 2 +- .../common/abilities/hammer/seismic_shock.ron | 22 +++++++++++++++ .../common/abilities/hammer/thunderclap.ron | 1 + .../element/skills/hammer/seismic_shock.png | 3 +++ assets/voxygen/i18n/en/hud/ability.ftl | 3 +++ common/src/comp/ability.rs | 22 +++++++++++++-- common/src/states/shockwave.rs | 9 +++++++ voxygen/anim/src/character/shockwave.rs | 27 +++++++++++++++++++ voxygen/src/hud/img_ids.rs | 1 + voxygen/src/hud/util.rs | 1 + 10 files changed, 88 insertions(+), 3 deletions(-) create mode 100644 assets/common/abilities/hammer/seismic_shock.ron create mode 100644 assets/voxygen/element/skills/hammer/seismic_shock.png diff --git a/assets/common/abilities/ability_set_manifest.ron b/assets/common/abilities/ability_set_manifest.ron index 927b09376d..eefe2e0aea 100644 --- a/assets/common/abilities/ability_set_manifest.ron +++ b/assets/common/abilities/ability_set_manifest.ron @@ -217,7 +217,7 @@ ], ), Simple(Hammer(Thunderclap), "common.abilities.hammer.thunderclap"), - // Simple(Hammer(SeismicShock), "common.abilities.hammer.seismic_shock"), + Simple(Hammer(SeismicShock), "common.abilities.hammer.seismic_shock"), Contextualized( pseudo_id: "common.abilities.hammer.heavy_whorl", abilities: [ diff --git a/assets/common/abilities/hammer/seismic_shock.ron b/assets/common/abilities/hammer/seismic_shock.ron new file mode 100644 index 0000000000..9dc3155cc4 --- /dev/null +++ b/assets/common/abilities/hammer/seismic_shock.ron @@ -0,0 +1,22 @@ +Shockwave( + energy_cost: 0, + buildup_duration: 0.6, + swing_duration: 0.2, + recover_duration: 0.6, + damage: 60, + poise_damage: 80, + knockback: (strength: 25.0, direction: Up), + shockwave_angle: 360.0, + shockwave_vertical_angle: 45.0, + shockwave_speed: 8.0, + shockwave_duration: 2.5, + dodgeable: Jump, + move_efficiency: 0.0, + damage_kind: Crushing, + specifier: Ground, + ori_rate: 0.0, + timing: PostAction, + emit_outcome: false, + minimum_combo: 20, + combo_consumption: Cost, +) \ No newline at end of file diff --git a/assets/common/abilities/hammer/thunderclap.ron b/assets/common/abilities/hammer/thunderclap.ron index a689dab6c1..a3d16cefa8 100644 --- a/assets/common/abilities/hammer/thunderclap.ron +++ b/assets/common/abilities/hammer/thunderclap.ron @@ -14,4 +14,5 @@ FinisherMelee( angle: 15.0, ), minimum_combo: 20, + combo_consumption: Cost, ) \ No newline at end of file diff --git a/assets/voxygen/element/skills/hammer/seismic_shock.png b/assets/voxygen/element/skills/hammer/seismic_shock.png new file mode 100644 index 0000000000..7d288bf13c --- /dev/null +++ b/assets/voxygen/element/skills/hammer/seismic_shock.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5577b90220e65d5b2cba68207ba1ced360c5505ceb8f83cfed0423bbadba2566 +size 1160 diff --git a/assets/voxygen/i18n/en/hud/ability.ftl b/assets/voxygen/i18n/en/hud/ability.ftl index 93ffe53a36..47d129df27 100644 --- a/assets/voxygen/i18n/en/hud/ability.ftl +++ b/assets/voxygen/i18n/en/hud/ability.ftl @@ -443,3 +443,6 @@ common-abilities-hammer-tenacity = Tenacity common-abilities-hammer-thunderclap = Thunderclap .desc = Unleash a devastating, adrenaline-fueled overhead strike against your foe. +common-abilities-hammer-seismic_shock = Seismic Shock + .desc = + After buildup up enough momentum in your hammer, strike the ground with enough force that it erupts outward, throwing your foes into the air. diff --git a/common/src/comp/ability.rs b/common/src/comp/ability.rs index be625a5649..c3c4f0a6f7 100644 --- a/common/src/comp/ability.rs +++ b/common/src/comp/ability.rs @@ -943,6 +943,10 @@ pub enum CharacterAbility { timing: shockwave::Timing, emit_outcome: bool, #[serde(default)] + minimum_combo: u32, + #[serde(default)] + combo_consumption: ComboConsumption, + #[serde(default)] meta: AbilityMeta, }, BasicBeam { @@ -1174,7 +1178,6 @@ impl CharacterAbility { | CharacterAbility::BasicRanged { energy_cost, .. } | CharacterAbility::ChargedRanged { energy_cost, .. } | CharacterAbility::ChargedMelee { energy_cost, .. } - | CharacterAbility::Shockwave { energy_cost, .. } | CharacterAbility::BasicBlock { energy_cost, .. } | CharacterAbility::RiposteMelee { energy_cost, .. } | CharacterAbility::ComboMelee2 { @@ -1217,6 +1220,11 @@ impl CharacterAbility { energy_cost, combo_cost: minimum_combo, .. + } + | CharacterAbility::Shockwave { + energy_cost, + minimum_combo, + .. } => { data.combo.map_or(false, |c| c.counter() >= *minimum_combo) && update.energy.try_change_by(-*energy_cost).is_ok() @@ -1569,6 +1577,8 @@ impl CharacterAbility { ref mut damage_effect, timing: _, emit_outcome: _, + minimum_combo: _, + combo_consumption: _, meta: _, } => { *buildup_duration /= stats.speed; @@ -1892,6 +1902,10 @@ impl CharacterAbility { } | SelfBuff { combo_cost: combo, .. + } + | Shockwave { + minimum_combo: combo, + .. } => *combo, BasicMelee { .. } | BasicRanged { .. } @@ -1902,7 +1916,6 @@ impl CharacterAbility { | LeapShockwave { .. } | ChargedMelee { .. } | ChargedRanged { .. } - | Shockwave { .. } | BasicBlock { .. } | ComboMelee2 { .. } | DiveMelee { .. } @@ -2645,6 +2658,8 @@ impl From<(&CharacterAbility, AbilityInfo, &JoinData<'_>)> for CharacterState { damage_effect, timing, emit_outcome, + minimum_combo, + combo_consumption, meta: _, } => CharacterState::Shockwave(shockwave::Data { static_data: shockwave::StaticData { @@ -2667,6 +2682,9 @@ impl From<(&CharacterAbility, AbilityInfo, &JoinData<'_>)> for CharacterState { ori_rate: *ori_rate, timing: *timing, emit_outcome: *emit_outcome, + minimum_combo: *minimum_combo, + combo_on_use: data.combo.map_or(0, |c| c.counter()), + combo_consumption: *combo_consumption, }, timer: Duration::default(), stage_section: StageSection::Buildup, diff --git a/common/src/states/shockwave.rs b/common/src/states/shockwave.rs index fd79076a8e..7a9b2cd3d2 100644 --- a/common/src/states/shockwave.rs +++ b/common/src/states/shockwave.rs @@ -59,6 +59,9 @@ pub struct StaticData { pub ori_rate: f32, /// Timing of shockwave pub timing: Timing, + pub minimum_combo: u32, + pub combo_on_use: u32, + pub combo_consumption: ComboConsumption, } #[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize)] @@ -194,6 +197,12 @@ impl CharacterBehavior for Data { impl Data { fn attack(&self, data: &JoinData, output_events: &mut OutputEvents) { + self.static_data.combo_consumption.consume( + data, + output_events, + self.static_data.minimum_combo, + ); + let poise = AttackEffect::new( Some(GroupTarget::OutOfGroup), CombatEffect::Poise(self.static_data.poise_damage), diff --git a/voxygen/anim/src/character/shockwave.rs b/voxygen/anim/src/character/shockwave.rs index 9ac451a538..04a697761c 100644 --- a/voxygen/anim/src/character/shockwave.rs +++ b/voxygen/anim/src/character/shockwave.rs @@ -159,6 +159,33 @@ impl Animation for ShockwaveAnimation { next.torso.orientation.rotate_x(move2 * -0.6); next.control.orientation.rotate_x(move2 * 0.6); }, + Some("common.abilities.hammer.seismic_shock") => { + hammer_start(&mut next, s_a); + let (move1, move2, move3) = match stage_section { + Some(StageSection::Buildup) => (anim_time, 0.0, 0.0), + Some(StageSection::Action) => (1.0, anim_time, 0.0), + Some(StageSection::Recover) => (1.0, 1.0, anim_time), + _ => (0.0, 0.0, 0.0), + }; + let pullback = 1.0 - move3; + let move1 = move1 * pullback; + let move2 = move2 * pullback; + + next.control.orientation.rotate_x(move1 * 2.5); + next.control.position += Vec3::new(0.0, 0.0, 28.0) * move1; + next.head.orientation.rotate_x(move1 * 0.3); + next.chest.orientation.rotate_x(move1 * 0.3); + next.belt.orientation.rotate_x(move1 * -0.2); + next.shorts.orientation.rotate_x(move1 * -0.3); + + next.control.orientation.rotate_z(move2 * 2.0); + next.control.orientation.rotate_x(move2 * -4.0); + next.control.position += Vec3::new(-6.0, 0.0, -30.0) * move2; + next.head.orientation.rotate_x(move2 * -0.9); + next.chest.orientation.rotate_x(move2 * -0.5); + next.belt.orientation.rotate_x(move2 * 0.2); + next.shorts.orientation.rotate_x(move2 * 0.4); + }, _ => {}, } diff --git a/voxygen/src/hud/img_ids.rs b/voxygen/src/hud/img_ids.rs index 29b2e62e3a..91b2abdce2 100644 --- a/voxygen/src/hud/img_ids.rs +++ b/voxygen/src/hud/img_ids.rs @@ -333,6 +333,7 @@ image_ids! { hammer_rampart: "voxygen.element.skills.hammer.rampart", hammer_tenacity: "voxygen.element.skills.hammer.tenacity", hammer_thunderclap: "voxygen.element.skills.hammer.thunderclap", + hammer_seismic_shock: "voxygen.element.skills.hammer.seismic_shock", // Skilltree Icons health_plus_skill: "voxygen.element.skills.skilltree.health_plus", energy_plus_skill: "voxygen.element.skills.skilltree.energy_plus", diff --git a/voxygen/src/hud/util.rs b/voxygen/src/hud/util.rs index 4bca948bf4..6dc7fc85fc 100644 --- a/voxygen/src/hud/util.rs +++ b/voxygen/src/hud/util.rs @@ -659,6 +659,7 @@ pub fn ability_image(imgs: &img_ids::Imgs, ability_id: &str) -> image::Id { "common.abilities.hammer.rampart" => imgs.hammer_rampart, "common.abilities.hammer.tenacity" => imgs.hammer_tenacity, "common.abilities.hammer.thunderclap" => imgs.hammer_thunderclap, + "common.abilities.hammer.seismic_shock" => imgs.hammer_seismic_shock, // Bow "common.abilities.bow.charged" => imgs.bow_m1, "common.abilities.bow.repeater" => imgs.bow_m2,