From e1ce09e0a1f5ece54858f19fa621569295b16ffa Mon Sep 17 00:00:00 2001 From: Sam Date: Mon, 4 Mar 2024 23:24:29 -0500 Subject: [PATCH] Upheaval --- .../common/abilities/ability_set_manifest.ron | 14 ++--- .../common/abilities/hammer/dual_upheaval.ron | 25 +++++++++ assets/common/abilities/hammer/upheaval.ron | 24 ++++++++ .../element/de_buffs/debuff_staggered.png | 3 + .../element/skills/hammer/upheaval.png | 3 + assets/voxygen/i18n/en/buff.ftl | 3 + assets/voxygen/i18n/en/hud/ability.ftl | 6 ++ common/src/cmd.rs | 1 + common/src/comp/buff.rs | 8 ++- server/src/cmd.rs | 3 +- voxygen/anim/src/character/alpha.rs | 56 +++++++++++++++++++ voxygen/i18n-helpers/src/lib.rs | 3 +- voxygen/src/hud/img_ids.rs | 2 + voxygen/src/hud/mod.rs | 1 + voxygen/src/hud/util.rs | 9 ++- 15 files changed, 149 insertions(+), 12 deletions(-) create mode 100644 assets/common/abilities/hammer/dual_upheaval.ron create mode 100644 assets/common/abilities/hammer/upheaval.ron create mode 100644 assets/voxygen/element/de_buffs/debuff_staggered.png create mode 100644 assets/voxygen/element/skills/hammer/upheaval.png diff --git a/assets/common/abilities/ability_set_manifest.ron b/assets/common/abilities/ability_set_manifest.ron index 075d0d17f1..b4d1b67708 100644 --- a/assets/common/abilities/ability_set_manifest.ron +++ b/assets/common/abilities/ability_set_manifest.ron @@ -209,13 +209,13 @@ ((), (Hammer(IronTempest), "common.abilities.hammer.iron_tempest")), ], ), - // Contextualized( - // pseudo_id: "common.abilities.hammer.upheaval", - // abilities: [ - // ((dual_wielding_same_kind: true), (Hammer(Upheaval), "common.abilities.hammer.dual_upheaval")), - // ((), (Hammer(Upheaval), "common.abilities.hammer.upheaval")), - // ], - // ), + Contextualized( + pseudo_id: "common.abilities.hammer.upheaval", + abilities: [ + ((dual_wielding_same_kind: true), (Hammer(Upheaval), "common.abilities.hammer.dual_upheaval")), + ((), (Hammer(Upheaval), "common.abilities.hammer.upheaval")), + ], + ), // Simple(Hammer(Thunderclap), "common.abilities.hammer.thunderclap"), // Simple(Hammer(SeismicShock), "common.abilities.hammer.seismic_shock"), Contextualized( diff --git a/assets/common/abilities/hammer/dual_upheaval.ron b/assets/common/abilities/hammer/dual_upheaval.ron new file mode 100644 index 0000000000..a873225ae6 --- /dev/null +++ b/assets/common/abilities/hammer/dual_upheaval.ron @@ -0,0 +1,25 @@ +BasicMelee( + energy_cost: 10, + buildup_duration: 0.6, + swing_duration: 0.1, + hit_timing: 0.5, + recover_duration: 0.4, + melee_constructor: ( + kind: Bash( + damage: 15, + poise: 15, + knockback: 30, + energy_regen: 0, + ), + range: 3, + angle: 20, + multi_target: Some(Normal), + damage_effect: Some(Buff(( + kind: Staggered, + dur_secs: 10.0, + strength: Value(0.5), + chance: 1.0, + ))), + ), + ori_modifier: 0.2, +) diff --git a/assets/common/abilities/hammer/upheaval.ron b/assets/common/abilities/hammer/upheaval.ron new file mode 100644 index 0000000000..635ce3ebb2 --- /dev/null +++ b/assets/common/abilities/hammer/upheaval.ron @@ -0,0 +1,24 @@ +BasicMelee( + energy_cost: 10, + buildup_duration: 0.6, + swing_duration: 0.1, + hit_timing: 0.5, + recover_duration: 0.4, + melee_constructor: ( + kind: Bash( + damage: 20, + poise: 20, + knockback: 40, + energy_regen: 0, + ), + range: 3, + angle: 20, + damage_effect: Some(Buff(( + kind: Staggered, + dur_secs: 10.0, + strength: Value(0.5), + chance: 1.0, + ))), + ), + ori_modifier: 0.2, +) diff --git a/assets/voxygen/element/de_buffs/debuff_staggered.png b/assets/voxygen/element/de_buffs/debuff_staggered.png new file mode 100644 index 0000000000..f99dad51a8 --- /dev/null +++ b/assets/voxygen/element/de_buffs/debuff_staggered.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:809ba2a3c36cac493fbc2d17e8fe4cf1e64bd83aec52142f26c3822d6a8d4500 +size 985 diff --git a/assets/voxygen/element/skills/hammer/upheaval.png b/assets/voxygen/element/skills/hammer/upheaval.png new file mode 100644 index 0000000000..9c3e0ce001 --- /dev/null +++ b/assets/voxygen/element/skills/hammer/upheaval.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ebae1dfa3f8286530eafbe82013e7713dd8356e8e42334d193683a370084f21e +size 1082 diff --git a/assets/voxygen/i18n/en/buff.ftl b/assets/voxygen/i18n/en/buff.ftl index 292806b7d9..ba20a77bff 100644 --- a/assets/voxygen/i18n/en/buff.ftl +++ b/assets/voxygen/i18n/en/buff.ftl @@ -133,6 +133,9 @@ buff-winded = Winded ## Concussion buff-concussion = Concussion .desc = You have been hit hard on the head and have trouble focusing, preventing you from using some of your more complex attacks. +## Staggered +buff-title-staggered = Staggered +buff-desc-staggered = You are off balance and more susceptible to heavy attacks. ## Util buff-text-over_seconds = over { $dur_secs } seconds buff-text-for_seconds = for { $dur_secs } seconds diff --git a/assets/voxygen/i18n/en/hud/ability.ftl b/assets/voxygen/i18n/en/hud/ability.ftl index 49a85c99e1..82a56c9e20 100644 --- a/assets/voxygen/i18n/en/hud/ability.ftl +++ b/assets/voxygen/i18n/en/hud/ability.ftl @@ -428,3 +428,9 @@ common-abilities-hammer-iron_tempest = Iron Tempest common-abilities-hammer-dual_iron_tempest = Iron Tempest .desc = Swing swiftly enough that your hammers becomes like a storm, scattering your enemies. +common-abilities-hammer-upheaval = Upheaval + .desc = + Slam your hammer into your foe, knocking them into the air and leaving them vulnerable to staggers. +common-abilities-hammer-dual_upheaval = Upheaval + .desc = + Slam your hammers into your foes, knocking them into the air and leaving them vulnerable to staggers. diff --git a/common/src/cmd.rs b/common/src/cmd.rs index 68114a8230..075bc6f181 100644 --- a/common/src/cmd.rs +++ b/common/src/cmd.rs @@ -193,6 +193,7 @@ lazy_static! { BuffKind::Rooted => "rooted", BuffKind::Winded => "winded", BuffKind::Concussion => "concussion", + BuffKind::Staggered => "staggered", }; let mut buff_parser = HashMap::new(); for kind in BuffKind::iter() { diff --git a/common/src/comp/buff.rs b/common/src/comp/buff.rs index 23d2f20493..0a9545fd50 100644 --- a/common/src/comp/buff.rs +++ b/common/src/comp/buff.rs @@ -193,6 +193,10 @@ pub enum BuffKind { /// Prevents use of auxiliary abilities. /// Does not scale with strength Concussion, + /// Increases amount of poise damage received + /// Scales linearly with strength, 1.0 leads to 100% more poise damage + /// received + Staggered, // Complex, non-obvious buffs /// Changed into another body. Polymorphed, @@ -258,7 +262,8 @@ impl BuffKind { | BuffKind::Heatstroke | BuffKind::Rooted | BuffKind::Winded - | BuffKind::Concussion => BuffDescriptor::SimpleNegative, + | BuffKind::Concussion + | BuffKind::Staggered => BuffDescriptor::SimpleNegative, BuffKind::Polymorphed => BuffDescriptor::Complex, } } @@ -507,6 +512,7 @@ impl BuffKind { BuffEffect::EnergyReward(1.0 - nn_scaling(data.strength)), ], BuffKind::Concussion => vec![BuffEffect::DisableAuxiliaryAbilities], + BuffKind::Staggered => vec![BuffEffect::PoiseReduction(-data.strength)], } } diff --git a/server/src/cmd.rs b/server/src/cmd.rs index 5f7edc3aca..c89daddb56 100644 --- a/server/src/cmd.rs +++ b/server/src/cmd.rs @@ -4554,7 +4554,8 @@ fn build_buff( | BuffKind::ScornfulTaunt | BuffKind::Rooted | BuffKind::Winded - | BuffKind::Concussion => { + | BuffKind::Concussion + | BuffKind::Staggered => { if buff_kind.is_simple() { unreachable!("is_simple() above") } else { diff --git a/voxygen/anim/src/character/alpha.rs b/voxygen/anim/src/character/alpha.rs index f0ec60c302..12ebd2e061 100644 --- a/voxygen/anim/src/character/alpha.rs +++ b/voxygen/anim/src/character/alpha.rs @@ -179,6 +179,62 @@ impl Animation for AlphaAnimation { next.control.orientation.rotate_z(move2 * 0.4); next.control.position += Vec3::new(0.0, 0.0, -12.0) * move2; }, + Some("common.abilities.hammer.upheaval") => { + 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 move1base = move1; + let move1 = move1 * pullback; + let move2base = move2; + let move2 = move2 * pullback; + let move1_twist = move1 * (move1 * PI * 1.5).sin(); + + twist_forward(&mut next, move1_twist, 0.8, 0.3, 0.0, 0.4); + let angle1 = 5.0; + let angle2 = 4.0; + next.control + .orientation + .rotate_x(move1base * (2.0 - angle1) + move2base * (2.0 - angle2)); + next.control.orientation.rotate_y(move1 * -0.8); + next.control + .orientation + .rotate_x(move1base * angle1 + move2base * angle2); + next.control.orientation.rotate_z(move1 * 1.0); + next.control.orientation.rotate_x(move2 * 6.0); + next.control.orientation.rotate_z(move2 * -0.6); + next.control.position += Vec3::new(-16.0, 0.0, 0.0) * move1; + next.control.position += Vec3::new(12.0, 0.0, 10.0) * move2; + twist_forward(&mut next, move2, 1.0, 0.9, 0.4, 1.1); + }, + Some("common.abilities.hammer.dual_upheaval") => { + dual_wield_start(&mut next); + 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 move1base = move1; + let move1_return = (3.0 * move1).sin(); + let move1 = move1 * pullback; + let move2base = move2; + let move2 = move2 * pullback; + + next.control.orientation.rotate_x(4.0 * move1base); + next.control_l.orientation.rotate_z(move1 * 0.6); + next.control_r.orientation.rotate_z(move1 * -0.6); + next.control.position += Vec3::new(0.0, 6.0, 8.0) * move1_return; + next.control.orientation.rotate_x(3.5 * move2base); + next.control_l.orientation.rotate_z(move2 * -1.4); + next.control_r.orientation.rotate_z(move2 * 1.4); + next.control.position += Vec3::new(0.0, 12.0, 10.0) * move2; + }, _ => { let (move1, move2, _move3, move2h) = match stage_section { Some(StageSection::Buildup) => (anim_time.powf(0.25), 0.0, 0.0, 0.0), diff --git a/voxygen/i18n-helpers/src/lib.rs b/voxygen/i18n-helpers/src/lib.rs index 63187f9256..66f0c3317a 100644 --- a/voxygen/i18n-helpers/src/lib.rs +++ b/voxygen/i18n-helpers/src/lib.rs @@ -409,7 +409,8 @@ fn get_buff_ident(buff: BuffKind) -> &'static str { | BuffKind::Heatstroke | BuffKind::Rooted | BuffKind::Winded - | BuffKind::Concussion => { + | BuffKind::Concussion + | BuffKind::Staggered => { tracing::error!("Player was killed by a debuff that doesn't do damage!"); "mysterious" }, diff --git a/voxygen/src/hud/img_ids.rs b/voxygen/src/hud/img_ids.rs index beee39f87d..34a40f058d 100644 --- a/voxygen/src/hud/img_ids.rs +++ b/voxygen/src/hud/img_ids.rs @@ -329,6 +329,7 @@ image_ids! { hammer_lung_pummel: "voxygen.element.skills.hammer.lung_pummel", hammer_helm_crusher: "voxygen.element.skills.hammer.helm_crusher", hammer_iron_tempest: "voxygen.element.skills.hammer.iron_tempest", + hammer_upheaval: "voxygen.element.skills.hammer.upheaval", // Skilltree Icons health_plus_skill: "voxygen.element.skills.skilltree.health_plus", energy_plus_skill: "voxygen.element.skills.skilltree.energy_plus", @@ -821,6 +822,7 @@ image_ids! { debuff_rooted: "voxygen.element.de_buffs.debuff_rooted", debuff_winded: "voxygen.element.de_buffs.debuff_winded", debuff_concussion: "voxygen.element.de_buffs.debuff_concussion", + debuff_staggered: "voxygen.element.de_buffs.debuff_staggered", // Animation Frames // Buff Frame diff --git a/voxygen/src/hud/mod.rs b/voxygen/src/hud/mod.rs index e7dd796a75..db7732bf8e 100755 --- a/voxygen/src/hud/mod.rs +++ b/voxygen/src/hud/mod.rs @@ -5280,6 +5280,7 @@ pub fn get_buff_image(buff: BuffKind, imgs: &Imgs) -> conrod_core::image::Id { BuffKind::Rooted => imgs.debuff_rooted, BuffKind::Winded => imgs.debuff_winded, BuffKind::Concussion => imgs.debuff_concussion, + BuffKind::Staggered => imgs.debuff_staggered, } } diff --git a/voxygen/src/hud/util.rs b/voxygen/src/hud/util.rs index a73fc6e801..de89dd3f5a 100644 --- a/voxygen/src/hud/util.rs +++ b/voxygen/src/hud/util.rs @@ -213,6 +213,7 @@ fn buff_key(buff: BuffKind) -> &'static str { BuffKind::Rooted => "buff-rooted", BuffKind::Winded => "buff-winded", BuffKind::Concussion => "buff-concussion", + BuffKind::Staggered => "buff-staggered", // Neutral BuffKind::Polymorphed => "buff-polymorphed", } @@ -326,7 +327,8 @@ pub fn consumable_desc(effects: &Effects, i18n: &Localization) -> Vec { | BuffKind::ScornfulTaunt | BuffKind::Rooted | BuffKind::Winded - | BuffKind::Concussion => Cow::Borrowed(""), + | BuffKind::Concussion + | BuffKind::Staggered => Cow::Borrowed(""), }; write!(&mut description, "{}", buff_desc).unwrap(); @@ -380,7 +382,8 @@ pub fn consumable_desc(effects: &Effects, i18n: &Localization) -> Vec { | BuffKind::ScornfulTaunt | BuffKind::Rooted | BuffKind::Winded - | BuffKind::Concussion => Cow::Borrowed(""), + | BuffKind::Concussion + | BuffKind::Staggered => Cow::Borrowed(""), } } else if let BuffKind::Saturation | BuffKind::Regeneration @@ -648,6 +651,8 @@ pub fn ability_image(imgs: &img_ids::Imgs, ability_id: &str) -> image::Id { "common.abilities.hammer.helm_crusher" => imgs.hammer_helm_crusher, "common.abilities.hammer.iron_tempest" => imgs.hammer_iron_tempest, "common.abilities.hammer.dual_iron_tempest" => imgs.hammer_iron_tempest, + "common.abilities.hammer.upheaval" => imgs.hammer_upheaval, + "common.abilities.hammer.dual_upheaval" => imgs.hammer_upheaval, // Bow "common.abilities.bow.charged" => imgs.bow_m1, "common.abilities.bow.repeater" => imgs.bow_m2,