From 9a6ab28c3d70dbeb4ae32a2c55c0d681ab86a461 Mon Sep 17 00:00:00 2001 From: flo666 Date: Thu, 20 Apr 2023 01:56:10 +0200 Subject: [PATCH] adlet elder tweaks --- .../common/abilities/ability_set_manifest.ron | 3 +- assets/common/abilities/adlet/elder/leap.ron | 27 ++++++++++++ assets/common/abilities/adlet/hunter/stab.ron | 4 +- .../common/abilities/adlet/icepicker/leap.ron | 1 + .../abilities/adlet/icepicker/spike.ron | 2 +- .../common/abilities/adlet/tracker/trap.ron | 2 +- assets/common/abilities/axe/leap.ron | 1 + .../custom/arthropods/hornbeetle/leap.ron | 1 + .../custom/arthropods/tarantula/leap.ron | 1 + .../custom/boreal_warrior/hammer/leap.ron | 1 + .../abilities/custom/quadmedjump/leap.ron | 1 + .../custom/quadmedjump/quickleap.ron | 1 + .../custom/tursus/tusk_bash_leap.ron | 1 + assets/common/abilities/hammer/leap.ron | 1 + assets/voxygen/audio/sfx.ron | 6 +++ assets/voxygen/audio/sfx/abilities/woosh.ogg | 3 ++ common/src/comp/ability.rs | 4 ++ common/src/outcome.rs | 4 ++ common/src/states/leap_melee.rs | 15 +++++++ voxygen/anim/src/biped_large/leapmelee.rs | 43 +++++++++++++++++++ voxygen/anim/src/biped_large/shoot.rs | 36 +++++++++++++++- voxygen/src/audio/sfx/mod.rs | 10 +++++ voxygen/src/scene/particle.rs | 1 + 23 files changed, 163 insertions(+), 6 deletions(-) create mode 100644 assets/common/abilities/adlet/elder/leap.ron create mode 100644 assets/voxygen/audio/sfx/abilities/woosh.ogg diff --git a/assets/common/abilities/ability_set_manifest.ron b/assets/common/abilities/ability_set_manifest.ron index 4a0942dab3..bfd5ef7cd4 100644 --- a/assets/common/abilities/ability_set_manifest.ron +++ b/assets/common/abilities/ability_set_manifest.ron @@ -781,7 +781,8 @@ primary: Simple(None, "common.abilities.adlet.elder.triplestrike"), secondary: Simple(None, "common.abilities.adlet.elder.dash"), abilities: [ - Simple(None, "common.abilities.adlet.elder.trap") + Simple(None, "common.abilities.adlet.elder.trap"), + Simple(None, "common.abilities.adlet.elder.leap"), ], ), }) diff --git a/assets/common/abilities/adlet/elder/leap.ron b/assets/common/abilities/adlet/elder/leap.ron new file mode 100644 index 0000000000..271fd23e91 --- /dev/null +++ b/assets/common/abilities/adlet/elder/leap.ron @@ -0,0 +1,27 @@ +LeapMelee( + energy_cost: 0.0, + buildup_duration: 0.5, + movement_duration: 0.8, + swing_duration: 0.15, + recover_duration: 0.2, + melee_constructor: ( + kind: Bash( + damage: 25.0, + poise: 40.0, + knockback: 25.0, + energy_regen: 0.0, + ), + range: 4.5, + angle: 360.0, + multi_target: Some(Normal), + damage_effect: Some(Buff(( + kind: Frozen, + dur_secs: 2.0, + strength: DamageFraction(0.1), + chance: 1.0, + ))), + ), + forward_leap_strength: 30.0, + vertical_leap_strength: 25.0, + specifier: Some(ElderLeap), +) \ No newline at end of file diff --git a/assets/common/abilities/adlet/hunter/stab.ron b/assets/common/abilities/adlet/hunter/stab.ron index b8900b6d54..472ba9507d 100644 --- a/assets/common/abilities/adlet/hunter/stab.ron +++ b/assets/common/abilities/adlet/hunter/stab.ron @@ -1,7 +1,7 @@ BasicMelee( energy_cost: 0, - buildup_duration: 0.3, - swing_duration: 0.55, + buildup_duration: 0.4, + swing_duration: 0.2, recover_duration: 0.4, melee_constructor: ( kind: Stab( diff --git a/assets/common/abilities/adlet/icepicker/leap.ron b/assets/common/abilities/adlet/icepicker/leap.ron index 9357edf48c..484f3ce0b7 100644 --- a/assets/common/abilities/adlet/icepicker/leap.ron +++ b/assets/common/abilities/adlet/icepicker/leap.ron @@ -16,4 +16,5 @@ LeapMelee( ), forward_leap_strength: 24, vertical_leap_strength: 16, + specifier: None, ) diff --git a/assets/common/abilities/adlet/icepicker/spike.ron b/assets/common/abilities/adlet/icepicker/spike.ron index 4f436c22eb..47e415424e 100644 --- a/assets/common/abilities/adlet/icepicker/spike.ron +++ b/assets/common/abilities/adlet/icepicker/spike.ron @@ -1,7 +1,7 @@ BasicMelee( energy_cost: 0, buildup_duration: 0.4, - swing_duration: 0.2, + swing_duration: 0.25, recover_duration: 0.45, melee_constructor: ( kind: Stab( diff --git a/assets/common/abilities/adlet/tracker/trap.ron b/assets/common/abilities/adlet/tracker/trap.ron index dde2dc002a..cc90b8b842 100644 --- a/assets/common/abilities/adlet/tracker/trap.ron +++ b/assets/common/abilities/adlet/tracker/trap.ron @@ -11,6 +11,6 @@ BasicRanged( projectile_light: None, projectile_speed: 10.0, num_projectiles: 1, - projectile_spread: 0.0, + projectile_spread: 0.2, move_efficiency: 0.3, ) \ No newline at end of file diff --git a/assets/common/abilities/axe/leap.ron b/assets/common/abilities/axe/leap.ron index 500576beab..25119259dc 100644 --- a/assets/common/abilities/axe/leap.ron +++ b/assets/common/abilities/axe/leap.ron @@ -17,4 +17,5 @@ LeapMelee( ), forward_leap_strength: 20.0, vertical_leap_strength: 8.0, + specifier: None, ) diff --git a/assets/common/abilities/custom/arthropods/hornbeetle/leap.ron b/assets/common/abilities/custom/arthropods/hornbeetle/leap.ron index 5e07e4f737..b4f5d192a9 100644 --- a/assets/common/abilities/custom/arthropods/hornbeetle/leap.ron +++ b/assets/common/abilities/custom/arthropods/hornbeetle/leap.ron @@ -17,4 +17,5 @@ LeapMelee( ), forward_leap_strength: 40.0, vertical_leap_strength: 7.5, + specifier: None, ) \ No newline at end of file diff --git a/assets/common/abilities/custom/arthropods/tarantula/leap.ron b/assets/common/abilities/custom/arthropods/tarantula/leap.ron index 054e3da70c..10bb730809 100644 --- a/assets/common/abilities/custom/arthropods/tarantula/leap.ron +++ b/assets/common/abilities/custom/arthropods/tarantula/leap.ron @@ -16,4 +16,5 @@ LeapMelee( ), forward_leap_strength: 25.0, vertical_leap_strength: 10.0, + specifier: None, ) \ No newline at end of file diff --git a/assets/common/abilities/custom/boreal_warrior/hammer/leap.ron b/assets/common/abilities/custom/boreal_warrior/hammer/leap.ron index 935ecc5398..cffca268b7 100644 --- a/assets/common/abilities/custom/boreal_warrior/hammer/leap.ron +++ b/assets/common/abilities/custom/boreal_warrior/hammer/leap.ron @@ -23,4 +23,5 @@ LeapMelee( ), forward_leap_strength: 20.0, vertical_leap_strength: 8.0, + specifier: None, ) \ No newline at end of file diff --git a/assets/common/abilities/custom/quadmedjump/leap.ron b/assets/common/abilities/custom/quadmedjump/leap.ron index 5eab6d153a..5b0114b4c2 100644 --- a/assets/common/abilities/custom/quadmedjump/leap.ron +++ b/assets/common/abilities/custom/quadmedjump/leap.ron @@ -17,4 +17,5 @@ LeapMelee( ), forward_leap_strength: 45.0, vertical_leap_strength: 10.0, + specifier: None, ) diff --git a/assets/common/abilities/custom/quadmedjump/quickleap.ron b/assets/common/abilities/custom/quadmedjump/quickleap.ron index 914646e60c..e9190469a1 100644 --- a/assets/common/abilities/custom/quadmedjump/quickleap.ron +++ b/assets/common/abilities/custom/quadmedjump/quickleap.ron @@ -17,4 +17,5 @@ LeapMelee( ), forward_leap_strength: 20.0, vertical_leap_strength: 5.0, + specifier: None, ) diff --git a/assets/common/abilities/custom/tursus/tusk_bash_leap.ron b/assets/common/abilities/custom/tursus/tusk_bash_leap.ron index 0aaa8b8749..df6adbd18f 100644 --- a/assets/common/abilities/custom/tursus/tusk_bash_leap.ron +++ b/assets/common/abilities/custom/tursus/tusk_bash_leap.ron @@ -17,4 +17,5 @@ LeapMelee( ), forward_leap_strength: 20.0, vertical_leap_strength: 10.0, + specifier: None, ) diff --git a/assets/common/abilities/hammer/leap.ron b/assets/common/abilities/hammer/leap.ron index d9a220b645..b694dd80bf 100644 --- a/assets/common/abilities/hammer/leap.ron +++ b/assets/common/abilities/hammer/leap.ron @@ -17,4 +17,5 @@ LeapMelee( ), forward_leap_strength: 20.0, vertical_leap_strength: 8.0, + specifier: None, ) diff --git a/assets/voxygen/audio/sfx.ron b/assets/voxygen/audio/sfx.ron index 07ffb7f174..7d1fadb5fc 100644 --- a/assets/voxygen/audio/sfx.ron +++ b/assets/voxygen/audio/sfx.ron @@ -1416,6 +1416,12 @@ threshold: 1.25, subtitle: "subtitle-attack-laser_beam", ), + Woosh: ( + files: [ + "voxygen.audio.sfx.abilities.woosh", + ], + threshold: 0.4, + ), CyclopsCharge: ( files: [ "voxygen.audio.sfx.abilities.cyclops_charge", diff --git a/assets/voxygen/audio/sfx/abilities/woosh.ogg b/assets/voxygen/audio/sfx/abilities/woosh.ogg new file mode 100644 index 0000000000..4f228a016d --- /dev/null +++ b/assets/voxygen/audio/sfx/abilities/woosh.ogg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c955d12401c80ef55ca1804185c95b029612afc72edef6524160f3e27f95430d +size 8678 diff --git a/common/src/comp/ability.rs b/common/src/comp/ability.rs index 36483b903c..de5496bf9c 100644 --- a/common/src/comp/ability.rs +++ b/common/src/comp/ability.rs @@ -595,6 +595,7 @@ pub enum CharacterAbility { forward_leap_strength: f32, vertical_leap_strength: f32, damage_effect: Option, + specifier: Option, #[serde(default)] meta: AbilityMeta, }, @@ -1149,6 +1150,7 @@ impl CharacterAbility { forward_leap_strength: _, vertical_leap_strength: _, ref mut damage_effect, + specifier: _, meta: _, } => { *buildup_duration /= stats.speed; @@ -2342,6 +2344,7 @@ impl From<(&CharacterAbility, AbilityInfo, &JoinData<'_>)> for CharacterState { forward_leap_strength, vertical_leap_strength, damage_effect, + specifier, meta: _, } => CharacterState::LeapMelee(leap_melee::Data { static_data: leap_melee::StaticData { @@ -2354,6 +2357,7 @@ impl From<(&CharacterAbility, AbilityInfo, &JoinData<'_>)> for CharacterState { vertical_leap_strength: *vertical_leap_strength, ability_info, damage_effect: *damage_effect, + specifier: *specifier, }, timer: Duration::default(), stage_section: StageSection::Buildup, diff --git a/common/src/outcome.rs b/common/src/outcome.rs index 10a58150de..c486d88b38 100644 --- a/common/src/outcome.rs +++ b/common/src/outcome.rs @@ -122,6 +122,9 @@ pub enum Outcome { FailedSpriteUnlock { pos: Vec3, }, + Woosh { + pos: Vec3, + }, } impl Outcome { @@ -140,6 +143,7 @@ impl Outcome { | Outcome::PoiseChange { pos, .. } | Outcome::GroundSlam { pos } | Outcome::FlashFreeze { pos } + | Outcome::Woosh { pos } | Outcome::IceSpikes { pos } | Outcome::IceCrack { pos } | Outcome::Utterance { pos, .. } diff --git a/common/src/states/leap_melee.rs b/common/src/states/leap_melee.rs index 07cf8ca7c5..2e5802fd67 100644 --- a/common/src/states/leap_melee.rs +++ b/common/src/states/leap_melee.rs @@ -1,6 +1,8 @@ use crate::{ combat::CombatEffect, comp::{character_state::OutputEvents, CharacterState, MeleeConstructor, StateUpdate}, + event::LocalEvent, + outcome::Outcome, states::{ behavior::{CharacterBehavior, JoinData}, utils::{StageSection, *}, @@ -22,6 +24,8 @@ pub struct StaticData { pub recover_duration: Duration, /// Used to construct the Melee attack pub melee_constructor: MeleeConstructor, + /// Used to specify the sfx to the frontend + pub specifier: Option, /// Affects how far forward the player leaps pub forward_leap_strength: f32, /// Affects how high the player leaps @@ -69,6 +73,12 @@ impl CharacterBehavior for Data { stage_section: StageSection::Movement, ..*self }); + if let Some(FrontendSpecifier::ElderLeap) = self.static_data.specifier { + // Send local event used for frontend shenanigans + output_events.emit_local(LocalEvent::CreateOutcome(Outcome::Woosh { + pos: data.pos.0 + *data.ori.look_dir() * (data.body.max_radius()), + })); + } } }, StageSection::Movement => { @@ -157,3 +167,8 @@ impl CharacterBehavior for Data { update } } + +#[derive(Copy, Clone, Debug, Serialize, Deserialize, PartialEq, Eq)] +pub enum FrontendSpecifier { + ElderLeap, +} diff --git a/voxygen/anim/src/biped_large/leapmelee.rs b/voxygen/anim/src/biped_large/leapmelee.rs index 321a899fa3..5ee5a04eb2 100644 --- a/voxygen/anim/src/biped_large/leapmelee.rs +++ b/voxygen/anim/src/biped_large/leapmelee.rs @@ -136,6 +136,49 @@ impl Animation for LeapAnimation { }, _ => {}, }, + Some(ToolKind::Sword) => match ability_id { + Some("common.abilities.adlet.elder.leap") => { + next.hand_l.position = Vec3::new(s_a.hhl.0 * 1.5, -s_a.hhl.1, 5.0); + next.hand_l.orientation = Quaternion::rotation_x(s_a.hhl.3); + next.hand_r.position = Vec3::new(s_a.hhr.0 / 2.0, 12.0, 5.0); + next.hand_r.orientation = Quaternion::rotation_x(s_a.hhr.3); + next.main.position = Vec3::new(-6.0, 18.0, 4.0); + next.main.orientation = + Quaternion::rotation_y(0.0) * Quaternion::rotation_z(0.0); + next.second.position = Vec3::new(-2.0, 20.0, 4.0); + next.second.orientation = + Quaternion::rotation_y(0.0) * Quaternion::rotation_z(0.0); + next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1); + next.control.orientation = + Quaternion::rotation_x(movement2 * PI / 2.5 + movement3 * -2.3); + next.upper_torso.orientation = Quaternion::rotation_x( + movement1 * 0.3 + movement2 * 0.3 + movement3 * -0.9 + movement4 * 0.3, + ) * Quaternion::rotation_z( + movement1 * 0.5 + movement2 * 0.2 + movement3 * -0.7, + ); + + next.head.orientation = Quaternion::rotation_x(movement3 * 0.2) + * Quaternion::rotation_y(0.0 + movement2 * -0.1) + * Quaternion::rotation_z( + movement1 * -0.4 + movement2 * -0.2 + movement3 * 0.6, + ); + + next.foot_l.position = Vec3::new( + -s_a.foot.0, + s_a.foot.1 + movement3 * 13.0, + s_a.foot.2 + movement3 * -2.0, + ); + next.foot_l.orientation = Quaternion::rotation_x(-0.8 + movement3 * 1.7); + + next.foot_r.position = Vec3::new( + s_a.foot.0, + s_a.foot.1 + 8.0 + movement3 * -13.0, + s_a.foot.2 + 5.0 + movement3 * -5.0, + ); + next.foot_r.orientation = Quaternion::rotation_x(0.9 + movement3 * -1.7); + }, + _ => {}, + }, _ => {}, } diff --git a/voxygen/anim/src/biped_large/shoot.rs b/voxygen/anim/src/biped_large/shoot.rs index 72a35e5cd9..ed4e889357 100644 --- a/voxygen/anim/src/biped_large/shoot.rs +++ b/voxygen/anim/src/biped_large/shoot.rs @@ -118,7 +118,7 @@ impl Animation for ShootAnimation { next.foot_l.orientation = Quaternion::rotation_y(move1 * 0.3 + move2 * -0.3); next.foot_r.orientation = Quaternion::rotation_y(move1 * 0.3 + move2 * -0.3); }, - Some("common.abilities.adlet.elder.trap") => { + Some("common.abilities.adlet.elder.air_blade") => { let (move1base, move2base, move3) = match stage_section { Some(StageSection::Buildup) => (anim_time, 0.0, 0.0), Some(StageSection::Action) => (1.0, anim_time.powf(0.25), 0.0), @@ -152,6 +152,40 @@ impl Animation for ShootAnimation { next.head.orientation = Quaternion::rotation_x(move1abs * 0.4 + move2abs * -0.2); }, + Some("common.abilities.adlet.elder.trap") => { + let (move1base, move2base, move3) = match stage_section { + Some(StageSection::Buildup) => (anim_time, 0.0, 0.0), + Some(StageSection::Action) => (1.0, anim_time.powf(0.25), 0.0), + Some(StageSection::Recover) => (1.0, 1.0, anim_time), + _ => (0.0, 0.0, 0.0), + }; + let pullback = 1.0 - move3; + let move1abs = move1base * pullback; + let move2abs = move2base * pullback; + // next.main.position = Vec3::new(-10.0, -8.0, 12.0); + // next.main.orientation = Quaternion::rotation_y(2.5) * + // Quaternion::rotation_z(PI / 2.0); + + next.hand_l.position = + Vec3::new(-s_a.hand.0, s_a.hand.1 + 1.0, s_a.hand.2 + 5.0); + next.hand_r.position = + Vec3::new(s_a.hand.0, s_a.hand.1 + 1.0, s_a.hand.2 + 5.0); + + next.hand_r.orientation = + Quaternion::rotation_x(move1abs * 4.0 + move2abs * -0.7) + * Quaternion::rotation_y(0.0 + move1abs * -0.7); + next.hand_l.orientation = + Quaternion::rotation_x(move1abs * 4.0 + move2abs * -0.7); + next.hand_r.orientation = + Quaternion::rotation_x(move1abs * 4.0 + move2abs * -0.7); + + next.shoulder_l.orientation = + Quaternion::rotation_x(move1abs * 4.0 + move2abs * -0.7); + next.shoulder_r.orientation = + Quaternion::rotation_x(move1abs * 4.0 + move2abs * -0.7); + next.head.orientation = + Quaternion::rotation_x(move1abs * 0.4 + move2abs * -0.2); + }, _ => {}, }, Some(ToolKind::Hammer) => match ability_id { diff --git a/voxygen/src/audio/sfx/mod.rs b/voxygen/src/audio/sfx/mod.rs index 00b6c8656c..565cc0ebb5 100644 --- a/voxygen/src/audio/sfx/mod.rs +++ b/voxygen/src/audio/sfx/mod.rs @@ -177,6 +177,7 @@ pub enum SfxEvent { Yeet, Klonk, SmashKlonk, + Woosh, } #[derive(Copy, Clone, Debug, PartialEq, Deserialize, Hash, Eq)] @@ -696,6 +697,15 @@ impl SfxMgr { _ => {}, }; }, + Outcome::Woosh { pos, .. } => { + let sfx_trigger_item = triggers.get_key_value(&SfxEvent::Woosh); + audio.emit_sfx( + sfx_trigger_item, + pos.map(|e| e + 0.5), + Some(3.0), + underwater, + ); + }, Outcome::ExpChange { .. } | Outcome::ComboChange { .. } => {}, } } diff --git a/voxygen/src/scene/particle.rs b/voxygen/src/scene/particle.rs index 8fa1436428..8a28fa0c79 100644 --- a/voxygen/src/scene/particle.rs +++ b/voxygen/src/scene/particle.rs @@ -391,6 +391,7 @@ impl ParticleMgr { | Outcome::IceSpikes { .. } | Outcome::IceCrack { .. } | Outcome::Glider { .. } + | Outcome::Woosh { .. } | Outcome::LaserBeam { .. } => {}, } }