diff --git a/voxygen/anim/src/character/alpha.rs b/voxygen/anim/src/character/alpha.rs index 12bd669cfb..f6b5fd1794 100644 --- a/voxygen/anim/src/character/alpha.rs +++ b/voxygen/anim/src/character/alpha.rs @@ -49,6 +49,9 @@ impl Animation for AlphaAnimation { match ability_info.and_then(|a| a.tool) { Some(ToolKind::Sword | ToolKind::Dagger) => { + if matches!(stage_section, Some(StageSection::Action | StageSection::Recover)) { + next.main_weapon_trail = true; + } next.main.position = Vec3::new(0.0, 0.0, 0.0); next.main.orientation = Quaternion::rotation_x(0.0); diff --git a/voxygen/anim/src/character/mod.rs b/voxygen/anim/src/character/mod.rs index 8c24caa42b..6496126b51 100644 --- a/voxygen/anim/src/character/mod.rs +++ b/voxygen/anim/src/character/mod.rs @@ -78,6 +78,7 @@ skeleton_impls!(struct CharacterSkeleton { control_r, :: // Begin non-bone fields holding_lantern: bool, + main_weapon_trail: bool, }); impl CharacterSkeleton { @@ -156,7 +157,7 @@ impl Skeleton for CharacterSkeleton { .into(), ..Default::default() }, - weapon_trail_mat: Some(main_mat), + weapon_trail_mat: self.main_weapon_trail.then_some(main_mat), } } } diff --git a/voxygen/anim/src/lib.rs b/voxygen/anim/src/lib.rs index b5244f7ce3..009bc080e0 100644 --- a/voxygen/anim/src/lib.rs +++ b/voxygen/anim/src/lib.rs @@ -1,4 +1,7 @@ -#![feature(generic_associated_types)] +#![feature( + generic_associated_types, + bool_to_option, +)] #![allow(incomplete_features)] #[cfg(all(feature = "be-dyn-lib", feature = "use-dyn-lib"))] compile_error!("Can't use both \"be-dyn-lib\" and \"use-dyn-lib\" features at once"); diff --git a/voxygen/src/scene/figure/mod.rs b/voxygen/src/scene/figure/mod.rs index 131e763b5e..480b354c81 100644 --- a/voxygen/src/scene/figure/mod.rs +++ b/voxygen/src/scene/figure/mod.rs @@ -33,7 +33,7 @@ use common::{ comp::{ inventory::slot::EquipSlot, item::{Hands, ItemKind, ToolKind}, - Body, CharacterAbilityType, CharacterState, Collider, Controller, Health, Inventory, Item, + Body, CharacterState, Collider, Controller, Health, Inventory, Item, ItemKey, Last, LightAnimation, LightEmitter, Ori, PhysicsState, PoiseState, Pos, Scale, Vel, }, @@ -864,7 +864,6 @@ impl FigureMgr { mount_transform_pos, body: Some(body), tools: (active_tool_kind, second_tool_kind), - char_ability: character.map(|c| c.into()), col, dt, _lpindex: lpindex, @@ -6249,7 +6248,6 @@ pub struct FigureUpdateCommonParameters<'a> { pub mount_transform_pos: Option<(anim::vek::Transform, anim::vek::Vec3)>, pub body: Option, pub tools: (Option, Option), - pub char_ability: Option, pub col: vek::Rgba, pub dt: f32, // TODO: evaluate unused variable @@ -6304,7 +6302,6 @@ impl FigureState { mount_transform_pos, body, tools, - char_ability, col, dt, _lpindex, @@ -6465,24 +6462,11 @@ impl FigureState { if let (Some((p1, p2)), Some((p4, p3))) = (self.abs_trail_points, offsets_abs_trail_points) { - use StageSection::{Action, Movement, Recover}; - if matches!( - char_ability, - Some( - CharacterAbilityType::BasicMelee(Action) - | CharacterAbilityType::ChargedMelee(Action) - | CharacterAbilityType::DashMelee(Action) - | CharacterAbilityType::ComboMelee(Action | Recover, _) - | CharacterAbilityType::LeapMelee(Movement | Action) - | CharacterAbilityType::SpinMelee(Action) - ) - ) { - let vertex = |p: anim::vek::Vec3| trail::Vertex { - pos: p.into_array(), - }; - let quad = Quad::new(vertex(p1), vertex(p2), vertex(p3), vertex(p4)); - quad_mesh.replace_quad(trail_mgr.offset * 4, quad); - } + let vertex = |p: anim::vek::Vec3| trail::Vertex { + pos: p.into_array(), + }; + let quad = Quad::new(vertex(p1), vertex(p2), vertex(p3), vertex(p4)); + quad_mesh.replace_quad(trail_mgr.offset * 4, quad); } } } diff --git a/voxygen/src/scene/simple.rs b/voxygen/src/scene/simple.rs index 15ba41b144..e8989ac394 100644 --- a/voxygen/src/scene/simple.rs +++ b/voxygen/src/scene/simple.rs @@ -158,7 +158,6 @@ impl Scene { mount_transform_pos: None, body: None, tools: (None, None), - char_ability: None, col: Rgba::broadcast(1.0), dt: 15.0, // Want to get there immediately. _lpindex: 0, @@ -351,7 +350,6 @@ impl Scene { mount_transform_pos: None, body: None, tools: (None, None), - char_ability: None, col: Rgba::broadcast(1.0), dt: scene_data.delta_time, _lpindex: 0,