diff --git a/voxygen/anim/src/character/block.rs b/voxygen/anim/src/character/block.rs index b54b780a5d..30d12eeab4 100644 --- a/voxygen/anim/src/character/block.rs +++ b/voxygen/anim/src/character/block.rs @@ -4,7 +4,7 @@ use super::{ }; use common::{ comp::item::{Hands, ToolKind}, - states::utils::StageSection, + states::utils::{AbilityInfo, StageSection}, }; use core::f32::consts::PI; @@ -17,6 +17,7 @@ type BlockAnimationDependency<'a> = ( Vec3, Option<&'a str>, Option, + Option, ); impl Animation for BlockAnimation { type Dependency<'a> = BlockAnimationDependency<'a>; @@ -28,7 +29,15 @@ impl Animation for BlockAnimation { #[cfg_attr(feature = "be-dyn-lib", export_name = "character_block")] fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (hands, active_tool_kind, second_tool_kind, velocity, ability_id, stage_section): Self::Dependency<'a>, + ( + hands, + active_tool_kind, + second_tool_kind, + velocity, + ability_id, + stage_section, + _ability_info, + ): Self::Dependency<'a>, anim_time: f32, rate: &mut f32, s_a: &SkeletonAttr, diff --git a/voxygen/anim/src/character/chargeswing.rs b/voxygen/anim/src/character/chargeswing.rs index 313802d10d..85053a3731 100644 --- a/voxygen/anim/src/character/chargeswing.rs +++ b/voxygen/anim/src/character/chargeswing.rs @@ -38,6 +38,9 @@ impl Animation for ChargeswingAnimation { next.main.position = Vec3::new(0.0, 0.0, 0.0); next.main.orientation = Quaternion::rotation_z(0.0); next.main_weapon_trail = true; + next.second.position = Vec3::new(0.0, 0.0, 0.0); + next.second.orientation = Quaternion::rotation_z(0.0); + next.off_weapon_trail = true; match ability_id { Some("common.abilities.sword.balanced_thrust") => { diff --git a/voxygen/anim/src/character/combomelee.rs b/voxygen/anim/src/character/combomelee.rs index 7decfb2cdb..dc58fe5596 100644 --- a/voxygen/anim/src/character/combomelee.rs +++ b/voxygen/anim/src/character/combomelee.rs @@ -2,16 +2,12 @@ use super::{ super::{vek::*, Animation}, CharacterSkeleton, SkeletonAttr, }; -use common::{ - comp::item::Hands, - states::utils::{AbilityInfo, StageSection}, -}; +use common::states::utils::{AbilityInfo, StageSection}; use core::f32::consts::PI; pub struct ComboAnimation; impl Animation for ComboAnimation { type Dependency<'a> = ( - (Option, Option), Option<&'a str>, Option, Option, @@ -26,7 +22,7 @@ impl Animation for ComboAnimation { #[cfg_attr(feature = "be-dyn-lib", export_name = "character_combo")] fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (_hands, ability_id, stage_section, _ability_info, current_strike, move_dir): Self::Dependency<'a>, + (ability_id, stage_section, _ability_info, current_strike, move_dir): Self::Dependency<'a>, anim_time: f32, rate: &mut f32, s_a: &SkeletonAttr, @@ -37,6 +33,9 @@ impl Animation for ComboAnimation { next.main.position = Vec3::new(0.0, 0.0, 0.0); next.main.orientation = Quaternion::rotation_z(0.0); next.main_weapon_trail = true; + next.second.position = Vec3::new(0.0, 0.0, 0.0); + next.second.orientation = Quaternion::rotation_z(0.0); + next.off_weapon_trail = true; let multi_strike_pullback = 1.0 - if matches!(stage_section, Some(StageSection::Recover)) { anim_time.powi(4) diff --git a/voxygen/anim/src/character/dash.rs b/voxygen/anim/src/character/dash.rs index 580bb07e46..b7d42802a2 100644 --- a/voxygen/anim/src/character/dash.rs +++ b/voxygen/anim/src/character/dash.rs @@ -38,6 +38,9 @@ impl Animation for DashAnimation { next.main.position = Vec3::new(0.0, 0.0, 0.0); next.main.orientation = Quaternion::rotation_z(0.0); next.main_weapon_trail = true; + next.second.position = Vec3::new(0.0, 0.0, 0.0); + next.second.orientation = Quaternion::rotation_z(0.0); + next.off_weapon_trail = true; match ability_id { Some("common.abilities.sword.reaching_charge") => { diff --git a/voxygen/anim/src/character/divemelee.rs b/voxygen/anim/src/character/divemelee.rs index 43a69309e8..0e631d38d1 100644 --- a/voxygen/anim/src/character/divemelee.rs +++ b/voxygen/anim/src/character/divemelee.rs @@ -2,11 +2,16 @@ use super::{ super::{vek::*, Animation}, CharacterSkeleton, SkeletonAttr, }; -use common::states::utils::StageSection; +use common::states::utils::{AbilityInfo, StageSection}; pub struct DiveMeleeAnimation; impl Animation for DiveMeleeAnimation { - type Dependency<'a> = (Option<&'a str>, Option, f32); + type Dependency<'a> = ( + Option<&'a str>, + Option, + f32, + Option, + ); type Skeleton = CharacterSkeleton; #[cfg(feature = "use-dyn-lib")] @@ -15,7 +20,7 @@ impl Animation for DiveMeleeAnimation { #[cfg_attr(feature = "be-dyn-lib", export_name = "character_dive_melee")] fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (ability_id, stage_section, ground_dist): Self::Dependency<'a>, + (ability_id, stage_section, ground_dist, _ability_info): Self::Dependency<'a>, anim_time: f32, rate: &mut f32, s_a: &SkeletonAttr, @@ -26,6 +31,9 @@ impl Animation for DiveMeleeAnimation { next.main.position = Vec3::new(0.0, 0.0, 0.0); next.main.orientation = Quaternion::rotation_z(0.0); next.main_weapon_trail = true; + next.second.position = Vec3::new(0.0, 0.0, 0.0); + next.second.orientation = Quaternion::rotation_z(0.0); + next.off_weapon_trail = true; let ground_dist = ground_dist.clamp(0.0, 0.5) * 2.0; let ground_dist = if ground_dist.is_nan() { diff --git a/voxygen/anim/src/character/finishermelee.rs b/voxygen/anim/src/character/finishermelee.rs index 0bd282ad3b..83e424e2c2 100644 --- a/voxygen/anim/src/character/finishermelee.rs +++ b/voxygen/anim/src/character/finishermelee.rs @@ -2,12 +2,12 @@ use super::{ super::{vek::*, Animation}, CharacterSkeleton, SkeletonAttr, }; -use common::states::utils::StageSection; +use common::states::utils::{AbilityInfo, StageSection}; use core::f32::consts::PI; pub struct FinisherMeleeAnimation; impl Animation for FinisherMeleeAnimation { - type Dependency<'a> = (Option<&'a str>, Option); + type Dependency<'a> = (Option<&'a str>, Option, Option); type Skeleton = CharacterSkeleton; #[cfg(feature = "use-dyn-lib")] @@ -16,19 +16,20 @@ impl Animation for FinisherMeleeAnimation { #[cfg_attr(feature = "be-dyn-lib", export_name = "character_finisher_melee")] fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (ability_id, stage_section): Self::Dependency<'a>, + (ability_id, stage_section, _ability_info): Self::Dependency<'a>, anim_time: f32, rate: &mut f32, s_a: &SkeletonAttr, ) -> Self::Skeleton { *rate = 1.0; let mut next = (*skeleton).clone(); - next.main_weapon_trail = true; - next.off_weapon_trail = true; next.main.position = Vec3::new(0.0, 0.0, 0.0); next.main.orientation = Quaternion::rotation_z(0.0); next.main_weapon_trail = true; + next.second.position = Vec3::new(0.0, 0.0, 0.0); + next.second.orientation = Quaternion::rotation_z(0.0); + next.off_weapon_trail = true; match ability_id { Some("common.abilities.sword.balanced_finisher") => { diff --git a/voxygen/anim/src/character/rapidmelee.rs b/voxygen/anim/src/character/rapidmelee.rs index 86e82cada0..ae0ac0fefe 100644 --- a/voxygen/anim/src/character/rapidmelee.rs +++ b/voxygen/anim/src/character/rapidmelee.rs @@ -2,12 +2,17 @@ use super::{ super::{vek::*, Animation}, CharacterSkeleton, SkeletonAttr, }; -use common::states::utils::StageSection; +use common::states::utils::{AbilityInfo, StageSection}; use std::ops::{Mul, Sub}; pub struct RapidMeleeAnimation; impl Animation for RapidMeleeAnimation { - type Dependency<'a> = (Option<&'a str>, Option, (u32, u32)); + type Dependency<'a> = ( + Option<&'a str>, + Option, + (u32, u32), + Option, + ); type Skeleton = CharacterSkeleton; #[cfg(feature = "use-dyn-lib")] @@ -16,7 +21,9 @@ impl Animation for RapidMeleeAnimation { #[cfg_attr(feature = "be-dyn-lib", export_name = "character_rapid_melee")] fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (ability_id, stage_section, (current_strike, max_strikes)): Self::Dependency<'a>, + (ability_id, stage_section, (current_strike, max_strikes), _ability_info): Self::Dependency< + 'a, + >, anim_time: f32, rate: &mut f32, s_a: &SkeletonAttr, @@ -27,6 +34,9 @@ impl Animation for RapidMeleeAnimation { next.main.position = Vec3::new(0.0, 0.0, 0.0); next.main.orientation = Quaternion::rotation_z(0.0); next.main_weapon_trail = true; + next.second.position = Vec3::new(0.0, 0.0, 0.0); + next.second.orientation = Quaternion::rotation_z(0.0); + next.off_weapon_trail = true; match ability_id { Some("common.abilities.sword.reaching_flurry") => { diff --git a/voxygen/anim/src/character/ripostemelee.rs b/voxygen/anim/src/character/ripostemelee.rs index 58404b6cb2..754de94667 100644 --- a/voxygen/anim/src/character/ripostemelee.rs +++ b/voxygen/anim/src/character/ripostemelee.rs @@ -2,11 +2,11 @@ use super::{ super::{vek::*, Animation}, CharacterSkeleton, SkeletonAttr, }; -use common::states::utils::StageSection; +use common::states::utils::{AbilityInfo, StageSection}; pub struct RiposteMeleeAnimation; impl Animation for RiposteMeleeAnimation { - type Dependency<'a> = (Option<&'a str>, Option); + type Dependency<'a> = (Option<&'a str>, Option, Option); type Skeleton = CharacterSkeleton; #[cfg(feature = "use-dyn-lib")] @@ -15,7 +15,7 @@ impl Animation for RiposteMeleeAnimation { #[cfg_attr(feature = "be-dyn-lib", export_name = "character_riposte_melee")] fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (ability_id, stage_section): Self::Dependency<'a>, + (ability_id, stage_section, _ability_info): Self::Dependency<'a>, anim_time: f32, rate: &mut f32, s_a: &SkeletonAttr, @@ -26,6 +26,9 @@ impl Animation for RiposteMeleeAnimation { next.main.position = Vec3::new(0.0, 0.0, 0.0); next.main.orientation = Quaternion::rotation_z(0.0); next.main_weapon_trail = true; + next.second.position = Vec3::new(0.0, 0.0, 0.0); + next.second.orientation = Quaternion::rotation_z(0.0); + next.off_weapon_trail = true; match ability_id { Some("common.abilities.sword.parrying_riposte") => { diff --git a/voxygen/anim/src/character/selfbuff.rs b/voxygen/anim/src/character/selfbuff.rs index b5bc02586f..e8f1aad539 100644 --- a/voxygen/anim/src/character/selfbuff.rs +++ b/voxygen/anim/src/character/selfbuff.rs @@ -2,11 +2,11 @@ use super::{ super::{vek::*, Animation}, CharacterSkeleton, SkeletonAttr, }; -use common::states::utils::StageSection; +use common::states::utils::{AbilityInfo, StageSection}; pub struct SelfBuffAnimation; impl Animation for SelfBuffAnimation { - type Dependency<'a> = (Option<&'a str>, Option); + type Dependency<'a> = (Option<&'a str>, Option, Option); type Skeleton = CharacterSkeleton; #[cfg(feature = "use-dyn-lib")] @@ -15,7 +15,7 @@ impl Animation for SelfBuffAnimation { #[cfg_attr(feature = "be-dyn-lib", export_name = "character_self_buff")] fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (ability_id, stage_section): Self::Dependency<'a>, + (ability_id, stage_section, _ability_info): Self::Dependency<'a>, anim_time: f32, rate: &mut f32, s_a: &SkeletonAttr, @@ -25,6 +25,8 @@ impl Animation for SelfBuffAnimation { next.main.position = Vec3::new(0.0, 0.0, 0.0); next.main.orientation = Quaternion::rotation_z(0.0); + next.second.position = Vec3::new(0.0, 0.0, 0.0); + next.second.orientation = Quaternion::rotation_z(0.0); match ability_id { Some("common.abilities.sword.defensive_bulwark") => { diff --git a/voxygen/src/scene/figure/mod.rs b/voxygen/src/scene/figure/mod.rs index 399197c975..81dee8c903 100644 --- a/voxygen/src/scene/figure/mod.rs +++ b/voxygen/src/scene/figure/mod.rs @@ -1189,7 +1189,11 @@ impl FigureMgr { }; anim::character::FinisherMeleeAnimation::update_skeleton( &target_base, - (ability_id, Some(s.stage_section)), + ( + ability_id, + Some(s.stage_section), + Some(s.static_data.ability_info), + ), stage_progress, &mut state_animation_rate, skeleton_attr, @@ -1218,7 +1222,12 @@ impl FigureMgr { / vel.0.magnitude_squared(); anim::character::DiveMeleeAnimation::update_skeleton( &target_base, - (ability_id, Some(s.stage_section), ground_dist), + ( + ability_id, + Some(s.stage_section), + ground_dist, + Some(s.static_data.ability_info), + ), stage_progress, &mut state_animation_rate, skeleton_attr, @@ -1240,7 +1249,11 @@ impl FigureMgr { }; anim::character::SelfBuffAnimation::update_skeleton( &target_base, - (ability_id, Some(s.stage_section)), + ( + ability_id, + Some(s.stage_section), + Some(s.static_data.ability_info), + ), stage_progress, &mut state_animation_rate, skeleton_attr, @@ -1593,6 +1606,7 @@ impl FigureMgr { ability_id, Some(s.stage_section), (s.current_strike, s.static_data.max_strikes), + Some(s.static_data.ability_info), ), stage_progress, &mut state_animation_rate, @@ -1761,7 +1775,6 @@ impl FigureMgr { anim::character::ComboAnimation::update_skeleton( &target_base, ( - hands, ability_id, Some(stage_section), Some(s.static_data.ability_info), @@ -1846,6 +1859,7 @@ impl FigureMgr { rel_vel, ability_id, Some(s.stage_section), + Some(s.static_data.ability_info), ), stage_progress, &mut state_animation_rate, @@ -2064,7 +2078,11 @@ impl FigureMgr { anim::character::RiposteMeleeAnimation::update_skeleton( &target_base, - (ability_id, Some(s.stage_section)), + ( + ability_id, + Some(s.stage_section), + Some(s.static_data.ability_info), + ), stage_progress, &mut state_animation_rate, skeleton_attr,