veloren_voxygen_anim/character/
basic.rs

1use super::{
2    super::{Animation, vek::*},
3    CharacterSkeleton, SkeletonAttr, bow_draw, bow_start, dual_wield_start, hammer_start,
4    twist_back, twist_forward,
5};
6use common::{
7    comp::item::Hands,
8    states::utils::{AbilityInfo, HandInfo, StageSection},
9    util::Dir,
10};
11use core::f32::consts::{PI, TAU};
12
13pub struct BasicAction;
14
15pub struct BasicActionDependency<'a> {
16    pub ability_id: Option<&'a str>,
17    pub hands: (Option<Hands>, Option<Hands>),
18    pub stage_section: Option<StageSection>,
19    pub ability_info: Option<AbilityInfo>,
20    pub velocity: Vec3<f32>,
21    pub last_ori: Vec3<f32>,
22    pub orientation: Vec3<f32>,
23    pub look_dir: Dir,
24    pub look_dir_override: Option<Dir>,
25    pub is_riding: bool,
26}
27
28impl Animation for BasicAction {
29    type Dependency<'a> = BasicActionDependency<'a>;
30    type Skeleton = CharacterSkeleton;
31
32    #[cfg(feature = "use-dyn-lib")]
33    const UPDATE_FN: &'static [u8] = b"character_basic\0";
34
35    #[cfg_attr(feature = "be-dyn-lib", unsafe(export_name = "character_basic"))]
36    fn update_skeleton_inner(
37        skeleton: &Self::Skeleton,
38        d: Self::Dependency<'_>,
39        anim_time: f32,
40        rate: &mut f32,
41        s_a: &SkeletonAttr,
42    ) -> Self::Skeleton {
43        *rate = 1.0;
44        let mut next = (*skeleton).clone();
45
46        // Don't use this for future animations
47        let mut legacy_initialize = || {
48            next.main.position = Vec3::new(0.0, 0.0, 0.0);
49            next.main.orientation = Quaternion::rotation_z(0.0);
50            next.second.position = Vec3::new(0.0, 0.0, 0.0);
51            next.second.orientation = Quaternion::rotation_z(0.0);
52        };
53
54        if matches!(d.stage_section, Some(StageSection::Action)) {
55            next.main_weapon_trail = true;
56            next.off_weapon_trail = true;
57        }
58        let (move1base, chargebase, movementbase, move2base, move3base) = match d.stage_section {
59            Some(StageSection::Buildup) => (anim_time, 0.0, 0.0, 0.0, 0.0),
60            Some(StageSection::Charge) => (1.0, anim_time, 0.0, 0.0, 0.0),
61            Some(StageSection::Movement) => (1.0, 1.0, anim_time, 0.0, 0.0),
62            Some(StageSection::Action) => (1.0, 1.0, 1.0, anim_time, 0.0),
63            Some(StageSection::Recover) => (1.0, 1.0, 1.0, 1.0, anim_time),
64            _ => (0.0, 0.0, 0.0, 0.0, 0.0),
65        };
66        let pullback = 1.0 - move3base;
67        let move1 = move1base * pullback;
68        let move2 = move2base * pullback;
69
70        match d.ability_id {
71            // ==================================
72            //               SWORD
73            // ==================================
74            Some(
75                "common.abilities.sword.basic_guard" | "common.abilities.sword.defensive_guard",
76            ) => {
77                legacy_initialize();
78                let pullback = 1.0 - move3base.powi(4);
79                let move1 = move1base.powf(0.25) * pullback;
80                let move2 = (move2base * 10.0).sin();
81
82                if d.velocity.xy().magnitude_squared() < 0.5_f32.powi(2) {
83                    next.chest.position =
84                        Vec3::new(0.0, s_a.chest.0, s_a.chest.1 + move1 * -1.0 + move2 * 0.2);
85                    next.chest.orientation = Quaternion::rotation_x(move1 * -0.15);
86                    next.head.orientation = Quaternion::rotation_x(move1 * 0.25);
87
88                    next.belt.position =
89                        Vec3::new(0.0, s_a.belt.0 + move1 * 0.5, s_a.belt.1 + move1 * 0.5);
90                    next.shorts.position =
91                        Vec3::new(0.0, s_a.shorts.0 + move1 * 1.3, s_a.shorts.1 + move1 * 1.0);
92
93                    next.belt.orientation = Quaternion::rotation_x(move1 * 0.15);
94                    next.shorts.orientation = Quaternion::rotation_x(move1 * 0.25);
95
96                    if !d.is_riding {
97                        next.foot_l.position =
98                            Vec3::new(-s_a.foot.0, s_a.foot.1 + move1 * 2.0, s_a.foot.2);
99                        next.foot_l.orientation = Quaternion::rotation_z(move1 * -0.5);
100
101                        next.foot_r.position =
102                            Vec3::new(s_a.foot.0, s_a.foot.1 + move1 * -2.0, s_a.foot.2);
103                        next.foot_r.orientation = Quaternion::rotation_x(move1 * -0.5);
104                    }
105                }
106
107                match d.hands {
108                    (Some(Hands::Two), _) => {
109                        next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
110                        next.hand_l.orientation =
111                            Quaternion::rotation_x(s_a.shl.3) * Quaternion::rotation_y(s_a.shl.4);
112                        next.hand_r.position = Vec3::new(
113                            s_a.shr.0 + move1 * -2.0,
114                            s_a.shr.1,
115                            s_a.shr.2 + move1 * 20.0,
116                        );
117                        next.hand_r.orientation = Quaternion::rotation_x(s_a.shr.3)
118                            * Quaternion::rotation_y(s_a.shr.4)
119                            * Quaternion::rotation_z(move1 * 1.5);
120
121                        next.control.position =
122                            Vec3::new(s_a.sc.0 + move1 * -3.0, s_a.sc.1, s_a.sc.2 + move1 * 4.0);
123                        next.control.orientation = Quaternion::rotation_x(s_a.sc.3)
124                            * Quaternion::rotation_y(move1 * 1.1)
125                            * Quaternion::rotation_z(move1 * 1.7);
126                    },
127                    (Some(Hands::One), offhand) => {
128                        next.control_l.position =
129                            Vec3::new(-7.0, 8.0 + move1 * 3.0, 2.0 + move1 * 3.0);
130                        next.control_l.orientation =
131                            Quaternion::rotation_x(-0.3) * Quaternion::rotation_y(move1 * 1.0);
132                        next.hand_l.position = Vec3::new(0.0, -0.5, 0.0);
133                        next.hand_l.orientation = Quaternion::rotation_x(PI / 2.0);
134                        if offhand.is_some() {
135                            next.control_r.position =
136                                Vec3::new(7.0, 8.0 + move1 * 3.0, 2.0 + move1 * 3.0);
137                            next.control_r.orientation =
138                                Quaternion::rotation_x(-0.3) * Quaternion::rotation_y(move1 * -1.0);
139                            next.hand_r.position = Vec3::new(0.0, -0.5, 0.0);
140                            next.hand_r.orientation = Quaternion::rotation_x(PI / 2.0)
141                        } else {
142                            next.hand_r.position = Vec3::new(4.5, 8.0, 5.0);
143                            next.hand_r.orientation =
144                                Quaternion::rotation_x(1.9) * Quaternion::rotation_y(0.5)
145                        }
146                    },
147                    (_, _) => {},
148                }
149            },
150            Some("common.abilities.sword.defensive_deflect") => {
151                legacy_initialize();
152                let move1 = move1base.powi(2);
153                let move2 = (move2base * 20.0).sin();
154                let move3 = move3base.powf(0.5);
155
156                next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
157                next.hand_l.orientation =
158                    Quaternion::rotation_x(s_a.shl.3) * Quaternion::rotation_y(s_a.shl.4);
159                next.hand_r.position =
160                    Vec3::new(-s_a.sc.0 + 6.0 + move1 * -12.0, -4.0 + move1 * 3.0, -2.0);
161                next.hand_r.orientation = Quaternion::rotation_x(0.9 + move1 * 0.5);
162                next.control.position = Vec3::new(s_a.sc.0, s_a.sc.1, s_a.sc.2);
163                next.control.orientation =
164                    Quaternion::rotation_x(s_a.sc.3) * Quaternion::rotation_z(move1 * -0.9);
165
166                next.chest.orientation = Quaternion::rotation_z(move1 * -0.6);
167                next.head.orientation = Quaternion::rotation_z(move1 * 0.2);
168                next.belt.orientation = Quaternion::rotation_z(move1 * -0.1);
169                next.shorts.orientation = Quaternion::rotation_z(move1 * 0.1);
170                next.control.orientation.rotate_y(move1 * -1.7);
171                next.control.orientation.rotate_z(move1 * 0.6);
172                next.control.position += Vec3::new(move1 * 11.0, move1 * 2.0, move1 * 5.0);
173
174                next.control.orientation.rotate_y(move2 / 50.0);
175
176                next.chest.orientation.rotate_z(move3 * -0.6);
177                next.head.orientation.rotate_z(move3 * 0.4);
178                next.belt.orientation.rotate_z(move3 * 0.2);
179                next.shorts.orientation.rotate_z(move3 * 0.6);
180                next.control.position += Vec3::new(move3 * 6.0, 0.0, move3 * 9.0);
181                next.control.orientation.rotate_z(move3 * -0.5);
182                next.control.orientation.rotate_y(move3 * 0.6);
183            },
184            Some(
185                "common.abilities.sword.basic_thrust"
186                | "common.abilities.sword.defensive_vital_jab",
187            ) => {
188                legacy_initialize();
189                let pullback = 1.0 - move3base.powi(4);
190                let move1 = chargebase.powf(0.25).min(1.0) * pullback;
191                let move2 = move2base.powi(2) * pullback;
192                let tension = (chargebase * 20.0).sin();
193
194                next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
195                next.hand_l.orientation =
196                    Quaternion::rotation_x(s_a.shl.3) * Quaternion::rotation_y(s_a.shl.4);
197                next.hand_r.position =
198                    Vec3::new(-s_a.sc.0 + 6.0 + move1 * -13.2, -4.0 + move1 * 3.3, 1.0);
199                next.hand_r.orientation = Quaternion::rotation_x(PI * 0.5);
200                next.chest.position += Vec3::new(0.0, move1 * -0.55, 0.0);
201                next.control.position =
202                    Vec3::new(s_a.sc.0, s_a.sc.1 + move2 * 3.3, s_a.sc.2 + move2 * 5.5);
203                next.control.orientation = Quaternion::rotation_x(s_a.sc.3 + move1 * -0.99)
204                    * Quaternion::rotation_y(move1 * 1.1 + move2 * -1.1)
205                    * Quaternion::rotation_z(move1 * 1.43 + move2 * -1.43);
206
207                next.chest.position += Vec3::new(0.0, move2 * 2.2, 0.0);
208                next.chest.orientation =
209                    Quaternion::rotation_z(move1 * 1.1 + tension * 0.02 + move2 * -1.32);
210                next.head.position += Vec3::new(0.0, move2 * 1.1, 0.0);
211                next.head.orientation = Quaternion::rotation_x(move1 * 0.055 + move2 * -0.055)
212                    * Quaternion::rotation_y(move1 * 0.055 + move2 * -0.055)
213                    * Quaternion::rotation_z(move1 * -0.44 + move2 * 0.33);
214                next.belt.orientation = Quaternion::rotation_z(move1 * -0.275 + move2 * 0.22);
215                next.shorts.orientation = Quaternion::rotation_z(move1 * -0.66 + move2 * 0.33);
216            },
217            Some("common.abilities.sword.heavy_slam") => {
218                legacy_initialize();
219                let pullback = 1.0 - move3base.powi(4);
220                let move1 = chargebase.powf(0.25).min(1.0) * pullback;
221                let move2 = move2base.powi(2) * pullback;
222                let tension = (chargebase * 20.0).sin();
223
224                next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
225                next.hand_l.orientation =
226                    Quaternion::rotation_x(s_a.shl.3) * Quaternion::rotation_y(s_a.shl.4);
227                next.hand_r.position =
228                    Vec3::new(-s_a.sc.0 + 7.0 + move1 * -13.2, -5.0 + move1 * 3.3, -1.0);
229                next.chest.position += Vec3::new(0.0, move1 * -0.55, 0.0);
230                next.control.position = Vec3::new(s_a.sc.0, s_a.sc.1, s_a.sc.2);
231                next.control.orientation = Quaternion::rotation_x(s_a.sc.3)
232                    * Quaternion::rotation_z(move1 * 0.33 + move2 * -0.77);
233
234                next.control
235                    .orientation
236                    .rotate_x(move1 * 1.54 + tension / 50.0);
237                next.control.position +=
238                    Vec3::new(move1 * -2.2, 0.0, move1 * 9.9) + Vec3::one() * tension / 4.0;
239                next.chest.position += Vec3::new(0.0, move2 * 1.65, 0.0);
240                next.chest.orientation = Quaternion::rotation_z(move1 * 0.44 + tension / 50.0);
241                next.head.position += Vec3::new(0.0, move2 * 1.1, 0.0);
242                next.head.orientation = Quaternion::rotation_x(move2 * -0.22)
243                    * Quaternion::rotation_y(move1 * 0.055 + move2 * 0.055)
244                    * Quaternion::rotation_z(move2 * -0.165);
245                next.belt.orientation = Quaternion::rotation_z(move1 * -0.055 + move2 * 0.165);
246                next.shorts.orientation = Quaternion::rotation_z(move1 * -0.11 + move2 * 0.22);
247
248                if move2 < f32::EPSILON {
249                    next.main_weapon_trail = false;
250                    next.off_weapon_trail = false;
251                }
252                next.control.orientation.rotate_x(move2 * -3.3);
253                next.control.orientation.rotate_z(move2 * -0.44);
254                next.control.position += Vec3::new(move2 * 11.0, move2 * 5.5, move2 * -11.0);
255                next.chest.orientation.rotate_z(move2 * -0.66);
256            },
257            Some("common.abilities.sword.crippling_deep_rend") => {
258                legacy_initialize();
259                let pullback = 1.0 - move3base;
260                let move1pre = move1base.min(0.5) * 2.0 * pullback;
261                let move1post = (move1base.max(0.5) * 2.0 - 1.0) * pullback;
262                let move2 = chargebase.min(1.0) * pullback;
263                let move3 = move2base * pullback;
264                let tension = (chargebase * 20.0).sin();
265
266                next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
267                next.hand_l.orientation =
268                    Quaternion::rotation_x(s_a.shl.3) * Quaternion::rotation_y(s_a.shl.4);
269                next.hand_r.position =
270                    Vec3::new(-s_a.sc.0 + 3.0 + move1 * -9.0, -4.0 + move1 * 3.0, 0.0);
271                next.hand_r.orientation = Quaternion::rotation_x(0.9 + move1pre * 0.5);
272                next.control.position = Vec3::new(s_a.sc.0, s_a.sc.1, s_a.sc.2);
273                next.control.orientation =
274                    Quaternion::rotation_x(s_a.sc.3) * Quaternion::rotation_z(move1pre * PI / 2.0);
275
276                next.foot_r.position += Vec3::new(0.0, move1pre * -2.5, 0.0);
277                next.foot_r.orientation.rotate_z(move1pre * -1.2);
278                next.chest.position += Vec3::new(0.0, move1pre * -2.0, 0.0);
279                next.chest.orientation = Quaternion::rotation_z(move1pre * -1.3);
280                next.head.orientation = Quaternion::rotation_x(move1pre * -0.05)
281                    * Quaternion::rotation_y(move1pre * -0.05)
282                    * Quaternion::rotation_z(move1pre * 0.7);
283                next.belt.orientation = Quaternion::rotation_z(move1pre * 0.4);
284                next.shorts.orientation = Quaternion::rotation_z(move1pre * 0.8);
285                next.control.orientation.rotate_y(move1pre * -1.5);
286                next.control.orientation.rotate_z(move1pre * 0.0);
287                next.control.position += Vec3::new(move1pre * 9.0, move1pre * -1.5, 0.0);
288
289                next.chest.position += Vec3::new(0.0, move1post * 2.0, 0.0);
290                next.chest.orientation.rotate_z(move1post * 1.2);
291                next.head.position += Vec3::new(0.0, move1post * 1.0, 0.0);
292                next.head.orientation.rotate_z(move1post * -0.7);
293                next.belt.orientation.rotate_z(move1post * -0.3);
294                next.shorts.orientation.rotate_z(move1post * -0.8);
295                next.foot_r.orientation.rotate_z(move1post * 1.2);
296                next.foot_r.orientation.rotate_x(move1post * -0.4);
297                next.control.orientation.rotate_z(move1post * -1.2);
298                next.control.position += Vec3::new(0.0, move1post * 8.0, move1post * 3.0);
299
300                next.control
301                    .orientation
302                    .rotate_y(move2 * -2.0 + tension / 10.0);
303                next.chest.orientation.rotate_z(move2 * -0.4 + move3 * -1.4);
304                next.control
305                    .orientation
306                    .rotate_z(move2 * 0.3 + move3 * -1.3);
307                next.head.orientation.rotate_z(move2 * 0.2 + move3 * 0.7);
308                next.belt.orientation.rotate_z(move3 * 0.3);
309                next.shorts.orientation.rotate_z(move2 * 0.2 + move3 * 0.6);
310                next.chest
311                    .orientation
312                    .rotate_y(move2 * -0.3 - tension / 100.0);
313                next.foot_r.orientation.rotate_z(move3 * -1.2);
314            },
315            Some(
316                "common.abilities.sword.cleaving_spiral_slash"
317                | "common.abilities.sword.cleaving_dual_spiral_slash",
318            ) => {
319                legacy_initialize();
320                let move1 = chargebase.powf(0.25).min(1.0) * pullback;
321                let move2_pre = move2base.min(0.3) * 10.0 / 3.0 * pullback;
322                let tension = (chargebase * 15.0).sin();
323
324                next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
325                next.hand_l.orientation =
326                    Quaternion::rotation_x(s_a.shl.3) * Quaternion::rotation_y(s_a.shl.4);
327                next.hand_r.position =
328                    Vec3::new(-s_a.sc.0 + 6.0 + move1 * -12.0, -4.0 + move1 * 3.0, -1.0);
329                next.hand_r.orientation = Quaternion::rotation_x(0.9 + move1 * 0.5);
330                next.control.position = Vec3::new(s_a.sc.0, s_a.sc.1, s_a.sc.2);
331                next.control.orientation = Quaternion::rotation_x(s_a.sc.3);
332
333                next.chest.orientation = Quaternion::rotation_z(move1 * 1.2 + tension / 70.0);
334                next.head.orientation =
335                    Quaternion::rotation_y(move1 * 0.05) * Quaternion::rotation_z(move1 * -0.5);
336                next.belt.orientation = Quaternion::rotation_z(move1 * -0.3);
337                next.shorts.orientation = Quaternion::rotation_z(move1 * -0.6);
338                next.control.position += Vec3::new(0.0, move1 * 1.0, move1 * 1.0);
339                next.control.orientation.rotate_x(move1 * 0.2);
340                next.control.orientation.rotate_y(move1 * -1.0);
341
342                next.control.orientation.rotate_y(move2_pre * -1.6);
343                next.control.position += Vec3::new(0.0, 0.0, move2_pre * 4.0);
344                next.torso.orientation.rotate_z(move2base * -TAU);
345                next.chest.orientation.rotate_z(move2 * -2.0);
346                next.head.orientation.rotate_z(move2 * 1.3);
347                next.belt.orientation.rotate_z(move2 * 0.6);
348                next.shorts.orientation.rotate_z(move2 * 1.5);
349                next.control.orientation.rotate_y(move2 * 1.6);
350                next.control.orientation.rotate_z(move2 * -1.8);
351                next.control.position += Vec3::new(move2 * 14.0, 0.0, 0.0);
352            },
353            Some("common.abilities.sword.cleaving_earth_splitter") => {
354                legacy_initialize();
355
356                let pullback = 1.0 - move3base.powi(4);
357                let move1 = movementbase.min(1.0).powi(2) * pullback;
358                let move1alt = movementbase.min(1.0).powf(0.5);
359                let move2 = move2base;
360                let move3 = move2base.powf(0.25) * pullback;
361
362                next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
363                next.hand_l.orientation =
364                    Quaternion::rotation_x(s_a.shl.3) * Quaternion::rotation_y(s_a.shl.4);
365                next.hand_r.position =
366                    Vec3::new(-s_a.sc.0 + 6.0 + move1 * -12.0, -4.0 + move1 * 3.0, -2.0);
367                next.hand_r.orientation = Quaternion::rotation_x(0.9 + move1 * 0.5);
368                next.control.position = Vec3::new(s_a.sc.0, s_a.sc.1, s_a.sc.2);
369                next.control.orientation = Quaternion::rotation_x(s_a.sc.3);
370                next.torso.orientation.rotate_x(move1alt * -TAU);
371
372                next.torso.orientation.rotate_x(move1 * -0.8);
373                next.control.orientation.rotate_x(move1 * 1.5);
374                next.control.position += Vec3::new(move1 * 7.0, move1.powi(4) * -6.0, move1 * 20.0);
375
376                next.torso.orientation.rotate_x(move2 * 0.8);
377                next.chest.orientation = Quaternion::rotation_x(move2 * -0.4);
378                next.control.orientation.rotate_x(move2 * -1.2);
379                next.control.position += Vec3::new(0.0, move2 * 12.0, move2 * -8.0);
380
381                next.control.orientation.rotate_x(move3 * -1.2);
382                next.control.position += Vec3::new(0.0, move3 * 4.0, move3 * -8.0);
383            },
384            Some("common.abilities.sword.heavy_pillar_thrust") => {
385                legacy_initialize();
386                let pullback = 1.0 - move3base.powi(4);
387                let move1 = move1base.powf(0.5) * pullback;
388                let move1alt1 = move1base.powf(0.5).min(0.5) * 2.0 * pullback;
389                let move1alt2 = (move1base.powf(0.5).max(0.5) - 0.5) * 2.0 * pullback;
390                let move2 = move2base.powi(2) * pullback;
391
392                next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
393                next.hand_l.orientation = Quaternion::rotation_x(s_a.shl.3 + move1alt2 * PI)
394                    * Quaternion::rotation_y(s_a.shl.4);
395                next.hand_r.position = Vec3::new(
396                    -s_a.sc.0 + 6.0 + move1alt1 * -12.0,
397                    -4.0 + move1alt1 * 3.0,
398                    -2.0,
399                );
400                next.hand_r.orientation =
401                    Quaternion::rotation_x(0.9 + move1 * 0.5 + move1alt1 * PI);
402                next.control.position = Vec3::new(s_a.sc.0, s_a.sc.1, s_a.sc.2);
403                next.control.orientation = Quaternion::rotation_x(s_a.sc.3);
404
405                next.control.position += Vec3::new(
406                    move1 * 6.0,
407                    (1.0 - (move1 - 0.5).abs() * 2.0) * 3.0,
408                    move1 * 22.0,
409                );
410                next.control.orientation.rotate_x(move1 * -1.5);
411
412                next.chest.orientation = Quaternion::rotation_x(move2 * -0.4);
413                next.head.orientation = Quaternion::rotation_x(move2 * 0.2);
414                next.belt.orientation = Quaternion::rotation_x(move2 * 0.4);
415                next.shorts.orientation = Quaternion::rotation_x(move2 * 0.8);
416                next.control.orientation.rotate_x(move2 * -0.4);
417                next.control.position += Vec3::new(0.0, 0.0, move2 * -10.0);
418                next.belt.position += Vec3::new(0.0, move2 * 2.0, move2 * 0.0);
419                next.shorts.position += Vec3::new(0.0, move2 * 4.0, move2 * 1.0);
420                next.chest.position += Vec3::new(0.0, move2 * -2.5, 0.0);
421            },
422            Some("common.abilities.sword.basic_mighty_strike") => {
423                legacy_initialize();
424                let pullback = 1.0 - move3base.powi(4);
425                let move1 = move1base.powf(0.25) * pullback;
426                let move2 = move2base.powf(0.1) * pullback;
427
428                next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
429                next.hand_l.orientation =
430                    Quaternion::rotation_x(s_a.shl.3) * Quaternion::rotation_y(s_a.shl.4);
431                next.hand_r.position =
432                    Vec3::new(-s_a.sc.0 + 6.0 + move1 * -12.0, -4.0 + move1 * 3.0, -2.0);
433                next.hand_r.orientation = Quaternion::rotation_x(0.9 + move1 * 0.5);
434                next.control.position = Vec3::new(
435                    s_a.sc.0 + move1 * -2.0 + move2 * 14.0,
436                    s_a.sc.1 + move2 * 4.0,
437                    s_a.sc.2 + move1 * 10.0 - move2 * 12.0,
438                );
439                next.control.orientation =
440                    Quaternion::rotation_x(s_a.sc.3 + move1 * 1.6 + move2 * -2.6)
441                        * Quaternion::rotation_y(move1 * -0.4 + move2 * 0.6)
442                        * Quaternion::rotation_z(move1 * -0.2 + move2 * -0.2);
443
444                next.chest.position += Vec3::new(0.0, move1 * -1.0 + move2 * 2.0, 0.0);
445                next.chest.orientation = Quaternion::rotation_z(move1 * 1.0 + move2 * -1.2);
446                next.head.position += Vec3::new(0.0, move2 * 1.0, 0.0);
447                next.head.orientation = Quaternion::rotation_x(move1 * 0.05 + move2 * -0.25)
448                    * Quaternion::rotation_y(move1 * -0.05 + move2 * 0.05)
449                    * Quaternion::rotation_z(move1 * -0.5 + move2 * 0.4);
450                next.belt.orientation = Quaternion::rotation_z(move1 * -0.25 + move2 * 0.2);
451                next.shorts.orientation = Quaternion::rotation_z(move1 * -0.5 + move2 * 0.4);
452            },
453            Some("common.abilities.sword.heavy_guillotine") => {
454                legacy_initialize();
455                let pullback = 1.0 - move3base.powi(4);
456                let move1 = move1base.powf(0.25) * pullback;
457                let move2 = move2base.powi(2) * pullback;
458
459                next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
460                next.hand_l.orientation =
461                    Quaternion::rotation_x(s_a.shl.3) * Quaternion::rotation_y(s_a.shl.4);
462                next.hand_r.position =
463                    Vec3::new(-s_a.sc.0 + 6.0 + move1 * -12.0, -4.0 + move1 * 3.0, -1.0);
464                next.control.position = Vec3::new(s_a.sc.0, s_a.sc.1, s_a.sc.2);
465                next.control.orientation = Quaternion::rotation_x(s_a.sc.3)
466                    * Quaternion::rotation_z(move1 * 0.3 + move2 * -0.7);
467
468                next.control.orientation.rotate_x(move1 * 1.4);
469                next.control.position += Vec3::new(move1 * -2.0, move1 * -2.0, move1 * 10.0);
470                next.chest.position += Vec3::new(0.0, move1 * -1.0 + move2 * 2.0, 0.0);
471                next.chest.orientation = Quaternion::rotation_z(move1 * 0.4 + move2 * -0.6);
472                next.head.position += Vec3::new(0.0, move2 * 1.0, 0.0);
473                next.head.orientation = Quaternion::rotation_x(move1 * 0.05 + move2 * -0.25)
474                    * Quaternion::rotation_y(move1 * 0.1 + move2 * -0.05)
475                    * Quaternion::rotation_z(move1 * 0.1 + move2 * -0.25);
476
477                next.control.orientation.rotate_x(move2 * -3.0);
478                next.control.orientation.rotate_z(move2 * -0.4);
479                next.control.position += Vec3::new(move2 * 12.0, move2 * 6.0, move2 * -11.0);
480            },
481            Some("common.abilities.sword.defensive_counter") => {
482                legacy_initialize();
483                let pullback = 1.0 - move3base.powi(4);
484                let move1 = move1base.powf(0.5) * pullback;
485                let move2 = (move2base.min(2.0 / 3.0) * 1.5).powi(2) * pullback;
486
487                next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
488                next.hand_l.orientation =
489                    Quaternion::rotation_x(s_a.shl.3) * Quaternion::rotation_y(s_a.shl.4);
490                next.hand_r.position =
491                    Vec3::new(-s_a.sc.0 + 6.0 + move1 * -12.0, -4.0 + move1 * 3.0, -2.0);
492                next.hand_r.orientation = Quaternion::rotation_x(0.9 + move1 * 0.5);
493                next.control.position = Vec3::new(s_a.sc.0, s_a.sc.1, s_a.sc.2);
494                next.control.orientation =
495                    Quaternion::rotation_x(s_a.sc.3) * Quaternion::rotation_z(move2 * -PI / 4.0);
496
497                if !d.is_riding {
498                    next.foot_l.position = Vec3::new(-s_a.foot.0, s_a.foot.1, s_a.foot.2);
499                    next.foot_r.position = Vec3::new(s_a.foot.0, s_a.foot.1, s_a.foot.2);
500                    next.foot_l.orientation = Quaternion::identity();
501                    next.foot_r.orientation = Quaternion::identity();
502                }
503
504                next.foot_l.position += Vec3::new(0.0, move1 * 4.0, 1.0 - (move1 - 0.5) * 2.0);
505                next.torso.position += Vec3::new(0.0, move1 * -2.0, 0.0);
506                next.chest.position += Vec3::new(0.0, move1 * 2.0, move1 * -3.0);
507                next.head.position += Vec3::new(0.0, move1 * 1.0, 0.0);
508                next.shorts.orientation = Quaternion::rotation_x(move1 * 0.3);
509                next.shorts.position += Vec3::new(0.0, move1 * 1.5, 0.0);
510                next.control.orientation.rotate_y(move1 * -1.5);
511                next.control.orientation.rotate_z(move1 * 0.8);
512
513                next.chest.orientation = Quaternion::rotation_z(move2 * -0.8);
514                next.head.orientation =
515                    Quaternion::rotation_x(move2 * 0.05) * Quaternion::rotation_z(move2 * 0.35);
516                next.shorts.orientation.rotate_z(move2 * 0.5);
517                next.belt.orientation = Quaternion::rotation_z(move2 * 0.3);
518                next.control.orientation.rotate_z(move2 * -1.8);
519                next.control.orientation.rotate_x(move2 * 0.3);
520                next.control.position += Vec3::new(move2 * 7.0, move2 * 7.0, move2 * 6.0);
521            },
522            Some("common.abilities.sword.defensive_riposte") => {
523                legacy_initialize();
524                let pullback = 1.0 - move3base.powi(4);
525                let move1 = move1base.powf(0.25) * pullback;
526                let move2_slow = move2base.powi(8) * pullback;
527                let move2 = move2base.powi(2) * pullback;
528
529                next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
530                next.hand_l.orientation =
531                    Quaternion::rotation_x(s_a.shl.3) * Quaternion::rotation_y(s_a.shl.4);
532                next.hand_r.position =
533                    Vec3::new(-s_a.sc.0 + 6.0 + move1 * -12.0, -4.0 + move1 * 3.0, -2.0);
534                next.hand_r.orientation = Quaternion::rotation_x(0.9 + move1 * 0.5);
535                next.control.position = Vec3::new(s_a.sc.0, s_a.sc.1, s_a.sc.2);
536                next.control.orientation = Quaternion::rotation_x(s_a.sc.3)
537                    * Quaternion::rotation_z(move1 * 1.3 + move2 * -0.7);
538
539                next.chest.position += Vec3::new(0.0, move1 * -1.0, 0.0);
540                next.chest.orientation = Quaternion::rotation_z(move1 * 0.8);
541                next.head.orientation = Quaternion::rotation_x(move1 * 0.05)
542                    * Quaternion::rotation_y(move1 * 0.05)
543                    * Quaternion::rotation_z(move1 * -0.4);
544                next.belt.orientation = Quaternion::rotation_z(move1 * -0.2);
545                next.shorts.orientation = Quaternion::rotation_z(move1 * -0.5);
546                next.control.orientation.rotate_x(move1 * 0.5);
547                next.control.orientation.rotate_y(move1 * 2.1);
548                next.control.orientation.rotate_z(move1 * -0.5);
549                next.control.position += Vec3::new(0.0, move1 * 5.0, move1 * 8.0);
550
551                next.chest.position += Vec3::new(0.0, move2 * 2.0, 0.0);
552                next.chest.orientation.rotate_z(move2 * -1.4);
553                next.head.position += Vec3::new(0.0, move2 * 1.0, 0.0);
554                next.head.orientation.rotate_x(move2 * -0.1);
555                next.head.orientation.rotate_y(move2 * -0.1);
556                next.head.orientation.rotate_z(move2 * 0.8);
557                next.belt.orientation.rotate_z(move2 * -0.3);
558                next.shorts.orientation.rotate_z(move2 * 0.6);
559                next.control.orientation.rotate_y(move2 * -4.0);
560                next.control
561                    .orientation
562                    .rotate_z(move2_slow * -3.0 + move2 * 1.0);
563                next.control.position +=
564                    Vec3::new(move2_slow * 14.0, move2_slow * -2.0, move2_slow * -7.0);
565            },
566            Some("common.abilities.sword.heavy_fortitude") => {
567                legacy_initialize();
568                let pullback = 1.0 - move3base.powi(4);
569                let move1 = move1base.powf(0.25) * pullback;
570                let move2 = move2base.powi(2) * pullback;
571
572                next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
573                next.hand_l.orientation =
574                    Quaternion::rotation_x(s_a.shl.3) * Quaternion::rotation_y(s_a.shl.4);
575                next.hand_r.position =
576                    Vec3::new(-s_a.sc.0 + 6.0 + move1 * -12.0, -4.0 + move1 * 3.0, -2.0);
577                next.hand_r.orientation = Quaternion::rotation_x(0.9 + move1 * 0.5);
578                next.control.position = Vec3::new(s_a.sc.0, s_a.sc.1, s_a.sc.2);
579                next.control.orientation = Quaternion::rotation_x(s_a.sc.3);
580
581                next.foot_l.position += Vec3::new(move1 * 1.0, move1 * 2.0, 0.0);
582                next.chest.orientation = Quaternion::rotation_z(move1 * -0.4);
583                next.head.orientation = Quaternion::rotation_z(move1 * 0.2);
584                next.shorts.orientation = Quaternion::rotation_z(move1 * 0.3);
585                next.belt.orientation = Quaternion::rotation_z(move1 * 0.1);
586                next.control.orientation.rotate_x(move1 * 0.4 + move2 * 0.6);
587                next.control.orientation.rotate_z(move1 * 0.4);
588
589                next.foot_r.position += Vec3::new(move2 * -1.0, move2 * -2.0, 0.0);
590                next.control.position += Vec3::new(move2 * 5.0, move2 * 7.0, move2 * 5.0);
591                next.chest.position += Vec3::new(0.0, 0.0, move2 * -1.0);
592                next.shorts.orientation.rotate_x(move2 * 0.2);
593                next.shorts.position += Vec3::new(0.0, move2 * 1.0, 0.0);
594            },
595            Some("common.abilities.sword.defensive_stalwart_sword") => {
596                legacy_initialize();
597                let pullback = 1.0 - move3base.powi(4);
598                let move1 = move1base.powf(0.25) * pullback;
599                let move2 = move2base.powi(2) * pullback;
600
601                next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
602                next.hand_l.orientation =
603                    Quaternion::rotation_x(s_a.shl.3) * Quaternion::rotation_y(s_a.shl.4);
604                next.hand_r.position =
605                    Vec3::new(-s_a.sc.0 + 6.0 + move1 * -12.0, -4.0 + move1 * 3.0, -2.0);
606                next.hand_r.orientation = Quaternion::rotation_x(0.9 + move1 * 0.5);
607                next.control.position = Vec3::new(s_a.sc.0, s_a.sc.1, s_a.sc.2);
608                next.control.orientation =
609                    Quaternion::rotation_x(s_a.sc.3) * Quaternion::rotation_z(move2 * -0.5);
610
611                next.foot_r.position += Vec3::new(move1 * 1.0, move1 * -2.0, 0.0);
612                next.foot_r.orientation.rotate_z(move1 * -0.9);
613                next.chest.orientation = Quaternion::rotation_z(move1 * -0.5);
614                next.head.orientation = Quaternion::rotation_z(move1 * 0.3);
615                next.shorts.orientation = Quaternion::rotation_z(move1 * 0.1);
616                next.control.orientation.rotate_x(move1 * 0.4);
617                next.control.orientation.rotate_z(move1 * 0.5);
618                next.control.position += Vec3::new(0.0, 0.0, move1 * 4.0);
619
620                next.control.position += Vec3::new(move2 * 8.0, 0.0, move2 * -1.0);
621                next.control.orientation.rotate_x(move2 * -0.6);
622                next.chest.position += Vec3::new(0.0, 0.0, move2 * -2.0);
623                next.belt.position += Vec3::new(0.0, 0.0, move2 * 1.0);
624                next.shorts.position += Vec3::new(0.0, 0.0, move2 * 1.0);
625                next.shorts.orientation.rotate_x(move2 * 0.2);
626                next.control.orientation.rotate_z(move2 * 0.4);
627            },
628            Some("common.abilities.sword.agile_dancing_edge") => {
629                legacy_initialize();
630                let pullback = 1.0 - move3base.powi(4);
631                let move1 = move1base.powf(0.25) * pullback;
632                let move2 = move2base.powi(2) * pullback;
633
634                next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
635                next.hand_l.orientation =
636                    Quaternion::rotation_x(s_a.shl.3) * Quaternion::rotation_y(s_a.shl.4);
637                next.hand_r.position =
638                    Vec3::new(-s_a.sc.0 + 6.0 + move1 * -12.0, -4.0 + move1 * 3.0, -2.0);
639                next.hand_r.orientation = Quaternion::rotation_x(0.9 + move1 * 0.5);
640                next.control.position = Vec3::new(s_a.sc.0, s_a.sc.1, s_a.sc.2);
641                next.control.orientation = Quaternion::rotation_x(s_a.sc.3);
642
643                next.head.orientation = Quaternion::rotation_x(move1 * 0.3);
644                next.head.position += Vec3::new(0.0, 0.0, move1 * -1.0);
645                next.control.position += Vec3::new(move1 * 8.0, move1 * 5.0, 0.0);
646
647                next.head.orientation.rotate_x(move2 * 0.2);
648                next.head.position += Vec3::new(0.0, 0.0, move2 * -1.0);
649                next.control.position += Vec3::new(0.0, move2 * -2.0, move2 * 12.0);
650                next.control.orientation.rotate_x(move2 * 1.1);
651            },
652            Some("common.abilities.sword.cleaving_blade_fever") => {
653                legacy_initialize();
654                let pullback = 1.0 - move3base.powi(4);
655                let move1 = move1base.powf(0.25) * pullback;
656                let move2 = move2base.powi(2) * pullback;
657
658                next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
659                next.hand_l.orientation =
660                    Quaternion::rotation_x(s_a.shl.3) * Quaternion::rotation_y(s_a.shl.4);
661                next.hand_r.position =
662                    Vec3::new(-s_a.sc.0 + 6.0 + move1 * -12.0, -4.0 + move1 * 3.0, -2.0);
663                next.hand_r.orientation = Quaternion::rotation_x(0.9 + move1 * 0.5);
664                next.control.position = Vec3::new(s_a.sc.0, s_a.sc.1, s_a.sc.2);
665                next.control.orientation = Quaternion::rotation_x(s_a.sc.3);
666
667                next.foot_l.position += Vec3::new(move1 * 1.0, move1 * 2.0, 0.0);
668                next.chest.orientation = Quaternion::rotation_z(move1 * -0.4);
669                next.head.orientation = Quaternion::rotation_z(move1 * 0.2);
670                next.shorts.orientation = Quaternion::rotation_z(move1 * 0.3);
671                next.belt.orientation = Quaternion::rotation_z(move1 * 0.1);
672                next.control.orientation.rotate_x(move1 * 0.4 + move2 * 0.6);
673                next.control.orientation.rotate_z(move1 * 0.4);
674
675                next.foot_r.position += Vec3::new(move2 * -1.0, move2 * -2.0, 0.0);
676                next.control.position += Vec3::new(move2 * 5.0, move2 * 7.0, move2 * 5.0);
677                next.chest.position += Vec3::new(0.0, 0.0, move2 * -1.0);
678                next.shorts.orientation.rotate_x(move2 * 0.2);
679                next.shorts.position += Vec3::new(0.0, move2 * 1.0, 0.0);
680            },
681            // ==================================
682            //                AXE
683            // ==================================
684            Some("common.abilities.axe.basic_guard") => {
685                let pullback = 1.0 - move3base.powi(4);
686                let move1 = move1base.powf(0.25) * pullback;
687                let move2 = (move2base * 10.0).sin();
688
689                if d.velocity.xy().magnitude_squared() < 0.5_f32.powi(2) {
690                    next.chest.position =
691                        Vec3::new(0.0, s_a.chest.0, s_a.chest.1 + move1 * -1.0 + move2 * 0.2);
692                    next.chest.orientation = Quaternion::rotation_x(move1 * -0.15);
693                    next.head.orientation = Quaternion::rotation_x(move1 * 0.25);
694
695                    next.belt.position =
696                        Vec3::new(0.0, s_a.belt.0 + move1 * 0.5, s_a.belt.1 + move1 * 0.5);
697                    next.shorts.position =
698                        Vec3::new(0.0, s_a.shorts.0 + move1 * 1.3, s_a.shorts.1 + move1 * 1.0);
699
700                    next.belt.orientation = Quaternion::rotation_x(move1 * 0.15);
701                    next.shorts.orientation = Quaternion::rotation_x(move1 * 0.25);
702
703                    if !d.is_riding {
704                        next.foot_l.position =
705                            Vec3::new(-s_a.foot.0, s_a.foot.1 + move1 * 2.0, s_a.foot.2);
706                        next.foot_l.orientation = Quaternion::rotation_z(move1 * -0.5);
707
708                        next.foot_r.position =
709                            Vec3::new(s_a.foot.0, s_a.foot.1 + move1 * -2.0, s_a.foot.2);
710                        next.foot_r.orientation = Quaternion::rotation_x(move1 * -0.5);
711                    }
712                }
713
714                match d.hands {
715                    (Some(Hands::Two), _) => {
716                        next.main.position = Vec3::new(0.0, 0.0, 0.0);
717                        next.main.orientation = Quaternion::rotation_x(0.0);
718
719                        next.hand_l.position = Vec3::new(s_a.ahl.0, s_a.ahl.1, s_a.ahl.2);
720                        next.hand_l.orientation =
721                            Quaternion::rotation_x(s_a.ahl.3) * Quaternion::rotation_y(s_a.ahl.4);
722                        next.hand_r.position = Vec3::new(s_a.ahr.0, s_a.ahr.1, s_a.ahr.2);
723                        next.hand_r.orientation =
724                            Quaternion::rotation_x(s_a.ahr.3) * Quaternion::rotation_z(s_a.ahr.5);
725
726                        next.control.position = Vec3::new(
727                            s_a.ac.0 + 0.5 + move1 * 13.0,
728                            s_a.ac.1 + 9.0 + move1 * -3.0,
729                            s_a.ac.2 + 2.5 + move1 * 8.0,
730                        );
731                        next.control.orientation =
732                            Quaternion::rotation_x(s_a.ac.3 - 2.25 + move1 * -2.0)
733                                * Quaternion::rotation_y(s_a.ac.4 - PI + move1 * -1.8)
734                                * Quaternion::rotation_z(s_a.ac.5 - 0.2 + move1 * 4.0);
735                    },
736                    (Some(Hands::One), offhand) => {
737                        next.main.position = Vec3::new(0.0, 0.0, 0.0);
738                        next.main.orientation = Quaternion::rotation_x(0.0);
739
740                        next.control_l.position =
741                            Vec3::new(-7.0, 8.0 + move1 * 3.0, 2.0 + move1 * 3.0);
742                        next.control_l.orientation =
743                            Quaternion::rotation_x(-0.3) * Quaternion::rotation_y(move1 * 1.0);
744                        next.hand_l.position = Vec3::new(0.0, -0.5, 0.0);
745                        next.hand_l.orientation = Quaternion::rotation_x(PI / 2.0);
746                        if offhand.is_some() {
747                            next.second.position = Vec3::new(0.0, 0.0, 0.0);
748                            next.second.orientation = Quaternion::rotation_x(0.0);
749                            next.control_r.position =
750                                Vec3::new(7.0, 8.0 + move1 * 3.0, 2.0 + move1 * 3.0);
751                            next.control_r.orientation =
752                                Quaternion::rotation_x(-0.3) * Quaternion::rotation_y(move1 * -1.0);
753                            next.hand_r.position = Vec3::new(0.0, -0.5, 0.0);
754                            next.hand_r.orientation = Quaternion::rotation_x(PI / 2.0)
755                        } else {
756                            next.hand_r.position = Vec3::new(4.5, 8.0, 5.0);
757                            next.hand_r.orientation =
758                                Quaternion::rotation_x(1.9) * Quaternion::rotation_y(0.5)
759                        }
760                    },
761                    (_, _) => {},
762                }
763            },
764            Some("common.abilities.axe.cleave") => {
765                legacy_initialize();
766                let move1 = chargebase.min(1.0) * pullback;
767                let move2 = move2base.powi(2) * pullback;
768                let tension = (chargebase * 20.0).sin();
769
770                next.hand_l.position = Vec3::new(s_a.ahl.0, s_a.ahl.1, s_a.ahl.2);
771                next.hand_l.orientation =
772                    Quaternion::rotation_x(s_a.ahl.3) * Quaternion::rotation_y(s_a.ahl.4);
773                next.hand_r.position = Vec3::new(s_a.ahr.0, s_a.ahr.1, s_a.ahr.2);
774                next.hand_r.orientation =
775                    Quaternion::rotation_x(s_a.ahr.3) * Quaternion::rotation_z(s_a.ahr.5);
776
777                next.control.position = Vec3::new(
778                    s_a.ac.0 + 0.5 + move1 * 7.0,
779                    s_a.ac.1 + 9.0 + move1 * -4.0,
780                    s_a.ac.2 + 2.5 + move1 * 18.0 + tension / 5.0,
781                );
782                next.control.orientation =
783                    Quaternion::rotation_x(s_a.ac.3 - 2.25 + move1 * -1.0 + tension / 30.0)
784                        * Quaternion::rotation_y(s_a.ac.4 - PI)
785                        * Quaternion::rotation_z(s_a.ac.5 - 0.2 - move1 * PI);
786
787                next.control.orientation.rotate_x(move2 * -3.0);
788                next.control.position += Vec3::new(0.0, move2 * 8.0, move2 * -30.0);
789            },
790            Some("common.abilities.axe.execute") => {
791                legacy_initialize();
792                next.hand_l.position = Vec3::new(s_a.ahl.0, s_a.ahl.1, s_a.ahl.2);
793                next.hand_l.orientation =
794                    Quaternion::rotation_x(s_a.ahl.3) * Quaternion::rotation_y(s_a.ahl.4);
795                next.hand_r.position = Vec3::new(s_a.ahr.0, s_a.ahr.1, s_a.ahr.2);
796                next.hand_r.orientation =
797                    Quaternion::rotation_x(s_a.ahr.3) * Quaternion::rotation_z(s_a.ahr.5);
798
799                next.control.position = Vec3::new(s_a.ac.0 + 0.5, s_a.ac.1 + 9.0, s_a.ac.2 + 2.5);
800                next.control.orientation = Quaternion::rotation_x(s_a.ac.3 - 2.25)
801                    * Quaternion::rotation_y(s_a.ac.4 - PI)
802                    * Quaternion::rotation_z(s_a.ac.5 - 0.2 - move1 * PI);
803
804                next.control.orientation.rotate_x(move1 * 0.9);
805                next.chest.orientation.rotate_z(move1 * 1.2);
806                next.head.orientation.rotate_z(move1 * -0.5);
807                next.belt.orientation.rotate_z(move1 * -0.3);
808                next.shorts.orientation.rotate_z(move1 * -0.7);
809                next.control.position += Vec3::new(move1 * 4.0, move1 * -12.0, move1 * 11.0);
810
811                next.chest.orientation.rotate_z(move2 * -2.0);
812                next.head.orientation.rotate_z(move2 * 0.9);
813                next.belt.orientation.rotate_z(move2 * 0.4);
814                next.shorts.orientation.rotate_z(move2 * 1.1);
815                next.control.orientation.rotate_x(move2 * -5.0);
816                next.control.position += Vec3::new(move2 * -3.0, move2 * 12.0, move2 * -17.0);
817                next.control.orientation.rotate_z(move2 * 0.7);
818            },
819            Some("common.abilities.axe.maelstrom") => {
820                legacy_initialize();
821                next.hand_l.position = Vec3::new(s_a.ahl.0, s_a.ahl.1, s_a.ahl.2);
822                next.hand_l.orientation =
823                    Quaternion::rotation_x(s_a.ahl.3) * Quaternion::rotation_y(s_a.ahl.4);
824                next.hand_r.position = Vec3::new(s_a.ahr.0, s_a.ahr.1, s_a.ahr.2);
825                next.hand_r.orientation =
826                    Quaternion::rotation_x(s_a.ahr.3) * Quaternion::rotation_z(s_a.ahr.5);
827
828                next.control.position = Vec3::new(s_a.ac.0 + 0.5, s_a.ac.1 + 9.0, s_a.ac.2 + 2.5);
829                next.control.orientation = Quaternion::rotation_x(s_a.ac.3 - 2.25)
830                    * Quaternion::rotation_y(s_a.ac.4 - PI)
831                    * Quaternion::rotation_z(s_a.ac.5 - 0.2 - move1 * PI);
832
833                next.control.orientation.rotate_x(move1 * 0.9);
834                next.chest.orientation.rotate_z(move1 * 1.2);
835                next.head.orientation.rotate_z(move1 * -0.5);
836                next.belt.orientation.rotate_z(move1 * -0.3);
837                next.shorts.orientation.rotate_z(move1 * -0.7);
838                next.control.position += Vec3::new(move1 * 4.0, move1 * -12.0, move1 * 11.0);
839
840                next.chest.orientation.rotate_z(move2 * -2.0);
841                next.head.orientation.rotate_z(move2 * 0.9);
842                next.belt.orientation.rotate_z(move2 * 0.4);
843                next.shorts.orientation.rotate_z(move2 * 1.1);
844                next.control.orientation.rotate_x(move2 * -5.0);
845                next.control.position += Vec3::new(move2 * 5.0, move2 * 12.0, move2 * -17.0);
846                next.control.orientation.rotate_y(move2 * -2.0);
847                next.control.orientation.rotate_z(move2 * -1.0);
848                next.torso.orientation.rotate_z(move2base * -4.0 * PI);
849            },
850            Some("common.abilities.axe.lacerate") => {
851                legacy_initialize();
852                let move2_reset = ((move2base - 0.5).abs() - 0.5).abs() * 2.0;
853
854                next.hand_l.position = Vec3::new(s_a.ahl.0, s_a.ahl.1, s_a.ahl.2 + 10.0);
855                next.hand_l.orientation =
856                    Quaternion::rotation_x(s_a.ahl.3) * Quaternion::rotation_y(s_a.ahl.4);
857                next.hand_r.position = Vec3::new(s_a.ahr.0, s_a.ahr.1, s_a.ahr.2);
858                next.hand_r.orientation =
859                    Quaternion::rotation_x(s_a.ahr.3) * Quaternion::rotation_z(s_a.ahr.5);
860
861                next.control.position = Vec3::new(s_a.ac.0 + 0.5, s_a.ac.1 + 9.0, s_a.ac.2 + 2.5);
862                next.control.orientation = Quaternion::rotation_x(s_a.ac.3 - 2.25)
863                    * Quaternion::rotation_y(s_a.ac.4 - PI)
864                    * Quaternion::rotation_z(s_a.ac.5 - 0.2 - move1 * PI * 0.75);
865
866                next.chest.orientation.rotate_z(move1 * 1.2);
867                next.head.orientation.rotate_z(move1 * -0.7);
868                next.shorts.orientation.rotate_z(move1 * -0.9);
869                next.belt.orientation.rotate_z(move1 * -0.3);
870
871                next.chest.orientation.rotate_z(move2 * -2.9);
872                next.head.orientation.rotate_z(move2 * 1.2);
873                next.shorts.orientation.rotate_z(move2 * 2.0);
874                next.belt.orientation.rotate_z(move2 * 0.7);
875                next.control.orientation.rotate_x(move2_reset * -1.0);
876                next.control.orientation.rotate_z(move2 * -5.0);
877                next.control.position += Vec3::new(move2 * 17.0, move2 * 3.0, 0.0);
878            },
879            Some("common.abilities.axe.riptide") => {
880                legacy_initialize();
881                let move2_reset = ((move2base - 0.5).abs() - 0.5).abs() * 2.0;
882
883                next.hand_l.position = Vec3::new(s_a.ahl.0, s_a.ahl.1, s_a.ahl.2);
884                next.hand_l.orientation =
885                    Quaternion::rotation_x(s_a.ahl.3) * Quaternion::rotation_y(s_a.ahl.4);
886                next.hand_r.position = Vec3::new(s_a.ahr.0, s_a.ahr.1, s_a.ahr.2);
887                next.hand_r.orientation =
888                    Quaternion::rotation_x(s_a.ahr.3) * Quaternion::rotation_z(s_a.ahr.5);
889
890                next.control.position = Vec3::new(s_a.ac.0 + 0.5, s_a.ac.1 + 9.0, s_a.ac.2 + 2.5);
891                next.control.orientation = Quaternion::rotation_x(s_a.ac.3 - 2.25)
892                    * Quaternion::rotation_y(s_a.ac.4 - PI)
893                    * Quaternion::rotation_z(s_a.ac.5 - 0.2 - move1 * PI * 0.75);
894
895                next.chest.orientation.rotate_z(move1 * 1.2);
896                next.head.orientation.rotate_z(move1 * -0.7);
897                next.shorts.orientation.rotate_z(move1 * -0.9);
898                next.belt.orientation.rotate_z(move1 * -0.3);
899
900                next.chest.orientation.rotate_z(move2 * -2.9);
901                next.head.orientation.rotate_z(move2 * 1.2);
902                next.shorts.orientation.rotate_z(move2 * 2.0);
903                next.belt.orientation.rotate_z(move2 * 0.7);
904                next.control.orientation.rotate_x(move2_reset * -1.0);
905                next.control.orientation.rotate_z(move2 * -5.0);
906                next.control.position += Vec3::new(move2 * 17.0, move2 * 3.0, 0.0);
907                next.torso.orientation.rotate_z(move2base * -TAU)
908            },
909            Some("common.abilities.axe.keelhaul") => {
910                legacy_initialize();
911                next.hand_l.position = Vec3::new(s_a.ahl.0, s_a.ahl.1, s_a.ahl.2);
912                next.hand_l.orientation =
913                    Quaternion::rotation_x(s_a.ahl.3) * Quaternion::rotation_y(s_a.ahl.4);
914                next.hand_r.position = Vec3::new(s_a.ahr.0, s_a.ahr.1, s_a.ahr.2);
915                next.hand_r.orientation =
916                    Quaternion::rotation_x(s_a.ahr.3) * Quaternion::rotation_z(s_a.ahr.5);
917
918                next.control.position = Vec3::new(s_a.ac.0 + 0.5, s_a.ac.1 + 9.0, s_a.ac.2 + 2.5);
919                next.control.orientation = Quaternion::rotation_x(s_a.ac.3 - 2.25)
920                    * Quaternion::rotation_y(s_a.ac.4 - PI)
921                    * Quaternion::rotation_z(s_a.ac.5 - 0.2);
922
923                next.control.orientation.rotate_z(move1 * -3.3);
924                next.control.orientation.rotate_x(move1 * 0.8);
925                next.control.position +=
926                    Vec3::new(move1 * 4.0, move1 * 4.0 - move2 * 6.0, move1 * 10.0);
927
928                next.chest.orientation.rotate_z(move2 * 1.2);
929                next.head.orientation.rotate_z(move2 * -0.5);
930                next.belt.orientation.rotate_z(move2 * -0.3);
931                next.shorts.orientation.rotate_z(move2 * -0.9);
932                next.control.orientation.rotate_z(move2 * -1.2);
933            },
934            Some("common.abilities.axe.bulkhead") => {
935                legacy_initialize();
936                next.hand_l.position = Vec3::new(s_a.ahl.0, s_a.ahl.1, s_a.ahl.2);
937                next.hand_l.orientation =
938                    Quaternion::rotation_x(s_a.ahl.3) * Quaternion::rotation_y(s_a.ahl.4);
939                next.hand_r.position = Vec3::new(s_a.ahr.0, s_a.ahr.1, s_a.ahr.2);
940                next.hand_r.orientation =
941                    Quaternion::rotation_x(s_a.ahr.3) * Quaternion::rotation_z(s_a.ahr.5);
942
943                next.control.position = Vec3::new(s_a.ac.0 + 0.5, s_a.ac.1 + 9.0, s_a.ac.2 + 2.5);
944                next.control.orientation = Quaternion::rotation_x(s_a.ac.3 - 2.25)
945                    * Quaternion::rotation_y(s_a.ac.4 - PI)
946                    * Quaternion::rotation_z(
947                        s_a.ac.5 - 0.2 + move1 * -PI * 0.75 + move2 * PI * 0.25,
948                    );
949
950                next.chest.orientation.rotate_z(move1 * 1.8);
951                next.head.orientation.rotate_z(move1 * -0.6);
952                next.belt.orientation.rotate_z(move1 * -0.4);
953                next.shorts.orientation.rotate_z(move1 * -1.3);
954                next.control.orientation.rotate_x(move1 * -0.8);
955
956                next.chest.orientation.rotate_z(move2 * -3.8);
957                next.head.orientation.rotate_z(move2 * 1.2);
958                next.belt.orientation.rotate_z(move2 * 0.8);
959                next.shorts.orientation.rotate_z(move2 * 2.1);
960                next.control.orientation.rotate_x(move2 * 0.6);
961                next.control.orientation.rotate_z(move2 * -4.0);
962                next.control.position += Vec3::new(move2 * 12.0, move2 * -6.0, 0.0);
963            },
964            Some("common.abilities.axe.capsize") => {
965                legacy_initialize();
966                next.hand_l.position = Vec3::new(s_a.ahl.0, s_a.ahl.1, s_a.ahl.2);
967                next.hand_l.orientation =
968                    Quaternion::rotation_x(s_a.ahl.3) * Quaternion::rotation_y(s_a.ahl.4);
969                next.hand_r.position = Vec3::new(s_a.ahr.0, s_a.ahr.1, s_a.ahr.2);
970                next.hand_r.orientation =
971                    Quaternion::rotation_x(s_a.ahr.3) * Quaternion::rotation_z(s_a.ahr.5);
972
973                next.control.position = Vec3::new(s_a.ac.0 + 0.5, s_a.ac.1 + 9.0, s_a.ac.2 + 2.5);
974                next.control.orientation = Quaternion::rotation_x(s_a.ac.3 - 2.25)
975                    * Quaternion::rotation_y(s_a.ac.4 - PI)
976                    * Quaternion::rotation_z(
977                        s_a.ac.5 - 0.2 + move1 * -PI * 0.75 + move2 * PI * 0.25,
978                    );
979
980                next.chest.orientation.rotate_z(move1 * 1.8);
981                next.head.orientation.rotate_z(move1 * -0.6);
982                next.belt.orientation.rotate_z(move1 * -0.4);
983                next.shorts.orientation.rotate_z(move1 * -1.3);
984                next.control.orientation.rotate_x(move1 * -0.8);
985
986                next.chest.orientation.rotate_z(move2 * -3.8);
987                next.head.orientation.rotate_z(move2 * 1.2);
988                next.belt.orientation.rotate_z(move2 * 0.8);
989                next.shorts.orientation.rotate_z(move2 * 2.1);
990                next.control.orientation.rotate_x(move2 * 0.6);
991                next.control.orientation.rotate_z(move2 * -4.0);
992                next.control.position += Vec3::new(move2 * 12.0, move2 * -6.0, 0.0);
993                next.torso.orientation.rotate_z(move2base * -TAU);
994            },
995            Some("common.abilities.axe.fracture") => {
996                legacy_initialize();
997                next.hand_l.position = Vec3::new(s_a.ahl.0, s_a.ahl.1, s_a.ahl.2);
998                next.hand_l.orientation =
999                    Quaternion::rotation_x(s_a.ahl.3) * Quaternion::rotation_y(s_a.ahl.4);
1000                next.hand_r.position = Vec3::new(s_a.ahr.0, s_a.ahr.1, s_a.ahr.2);
1001                next.hand_r.orientation =
1002                    Quaternion::rotation_x(s_a.ahr.3) * Quaternion::rotation_z(s_a.ahr.5);
1003
1004                next.control.position = Vec3::new(s_a.ac.0 + 0.5, s_a.ac.1 + 9.0, s_a.ac.2 + 2.5);
1005                next.control.orientation = Quaternion::rotation_x(s_a.ac.3 - 2.25)
1006                    * Quaternion::rotation_y(s_a.ac.4 - PI)
1007                    * Quaternion::rotation_z(s_a.ac.5 - 0.2 + move1 * -PI / 2.0 + move2 * -0.5);
1008
1009                next.control.orientation.rotate_x(move1 * 0.0);
1010                next.chest.orientation.rotate_x(move1 * -0.5);
1011                next.chest.orientation.rotate_z(move1 * 0.7);
1012                next.head.orientation.rotate_z(move1 * -0.3);
1013                next.belt.orientation.rotate_z(move1 * -0.1);
1014                next.shorts.orientation.rotate_z(move1 * -0.4);
1015
1016                next.chest.orientation.rotate_z(move2 * -1.8);
1017                next.head.orientation.rotate_z(move2 * 0.9);
1018                next.shorts.orientation.rotate_z(move2 * 1.3);
1019                next.belt.orientation.rotate_z(move2 * 0.6);
1020                next.control.orientation.rotate_x(move2 * -0.9);
1021                next.control.orientation.rotate_z(move2 * -3.5);
1022                next.control.position += Vec3::new(move2 * 14.0, move2 * 6.0, 0.0);
1023            },
1024            Some("common.abilities.axe.berserk") => {
1025                legacy_initialize();
1026                next.hand_l.position = Vec3::new(s_a.ahl.0, s_a.ahl.1, s_a.ahl.2);
1027                next.hand_l.orientation =
1028                    Quaternion::rotation_x(s_a.ahl.3) * Quaternion::rotation_y(s_a.ahl.4);
1029                next.hand_r.position = Vec3::new(s_a.ahr.0, s_a.ahr.1, s_a.ahr.2);
1030                next.hand_r.orientation =
1031                    Quaternion::rotation_x(s_a.ahr.3) * Quaternion::rotation_z(s_a.ahr.5);
1032
1033                next.control.position = Vec3::new(s_a.ac.0 + 0.5, s_a.ac.1 + 9.0, s_a.ac.2 + 2.5);
1034                next.control.orientation = Quaternion::rotation_x(s_a.ac.3 - 2.25)
1035                    * Quaternion::rotation_y(s_a.ac.4 - PI)
1036                    * Quaternion::rotation_z(s_a.ac.5 - 0.2);
1037
1038                next.control.orientation.rotate_z(move1 * -2.0);
1039                next.control.orientation.rotate_x(move1 * 3.5);
1040                next.control.position += Vec3::new(move1 * 14.0, move1 * -6.0, move1 * 15.0);
1041
1042                next.head.orientation.rotate_x(move2 * 0.6);
1043                next.chest.orientation.rotate_x(move2 * 0.4);
1044            },
1045            Some("common.abilities.axe.savage_sense") => {
1046                legacy_initialize();
1047                next.hand_l.position = Vec3::new(s_a.ahl.0, s_a.ahl.1, s_a.ahl.2);
1048                next.hand_l.orientation =
1049                    Quaternion::rotation_x(s_a.ahl.3) * Quaternion::rotation_y(s_a.ahl.4);
1050                next.hand_r.position = Vec3::new(s_a.ahr.0, s_a.ahr.1, s_a.ahr.2);
1051                next.hand_r.orientation =
1052                    Quaternion::rotation_x(s_a.ahr.3) * Quaternion::rotation_z(s_a.ahr.5);
1053
1054                next.control.position = Vec3::new(s_a.ac.0 + 0.5, s_a.ac.1 + 9.0, s_a.ac.2 + 2.5);
1055                next.control.orientation = Quaternion::rotation_x(s_a.ac.3 - 2.25)
1056                    * Quaternion::rotation_y(s_a.ac.4 - PI)
1057                    * Quaternion::rotation_z(s_a.ac.5 - 0.2);
1058
1059                next.chest.orientation = Quaternion::rotation_z(move1 * 0.6);
1060                next.head.orientation = Quaternion::rotation_z(move1 * -0.2);
1061                next.belt.orientation = Quaternion::rotation_z(move1 * -0.3);
1062                next.shorts.orientation = Quaternion::rotation_z(move1 * -0.1);
1063                next.foot_r.position += Vec3::new(0.0, move1 * 4.0, move1 * 4.0);
1064                next.foot_r.orientation.rotate_x(move1 * 1.2);
1065
1066                next.foot_r.position += Vec3::new(0.0, move2 * 4.0, move2 * -4.0);
1067                next.foot_r.orientation.rotate_x(move2 * -1.2);
1068            },
1069            Some("common.abilities.axe.adrenaline_rush") => {
1070                legacy_initialize();
1071                next.hand_l.position = Vec3::new(s_a.ahl.0, s_a.ahl.1, s_a.ahl.2);
1072                next.hand_l.orientation =
1073                    Quaternion::rotation_x(s_a.ahl.3) * Quaternion::rotation_y(s_a.ahl.4);
1074                next.hand_r.position = Vec3::new(s_a.ahr.0, s_a.ahr.1, s_a.ahr.2);
1075                next.hand_r.orientation =
1076                    Quaternion::rotation_x(s_a.ahr.3) * Quaternion::rotation_z(s_a.ahr.5);
1077
1078                next.control.position = Vec3::new(s_a.ac.0 + 0.5, s_a.ac.1 + 9.0, s_a.ac.2 + 2.5);
1079                next.control.orientation = Quaternion::rotation_x(s_a.ac.3 - 2.25)
1080                    * Quaternion::rotation_y(s_a.ac.4 - PI)
1081                    * Quaternion::rotation_z(s_a.ac.5 - 0.2 - move1 * PI);
1082
1083                next.control.orientation.rotate_z(move1 * -1.8);
1084                next.control.orientation.rotate_y(move1 * 1.5);
1085                next.control.position += Vec3::new(move1 * 11.0, 0.0, 0.0);
1086
1087                next.control.orientation.rotate_y(move2 * 0.7);
1088                next.control.orientation.rotate_z(move2 * 1.6);
1089                next.control.position += Vec3::new(move2 * -8.0, 0.0, move2 * -3.0);
1090            },
1091            Some("common.abilities.axe.bloodfeast") => {
1092                legacy_initialize();
1093                next.hand_l.position = Vec3::new(s_a.ahl.0, s_a.ahl.1, s_a.ahl.2);
1094                next.hand_l.orientation =
1095                    Quaternion::rotation_x(s_a.ahl.3) * Quaternion::rotation_y(s_a.ahl.4);
1096                next.hand_r.position = Vec3::new(s_a.ahr.0, s_a.ahr.1, s_a.ahr.2);
1097                next.hand_r.orientation =
1098                    Quaternion::rotation_x(s_a.ahr.3) * Quaternion::rotation_z(s_a.ahr.5);
1099
1100                next.control.position = Vec3::new(s_a.ac.0 + 0.5, s_a.ac.1 + 9.0, s_a.ac.2 + 2.5);
1101                next.control.orientation = Quaternion::rotation_x(s_a.ac.3 - 2.25)
1102                    * Quaternion::rotation_y(s_a.ac.4 - PI)
1103                    * Quaternion::rotation_z(s_a.ac.5 - 0.2);
1104
1105                next.control.orientation.rotate_z(move1 * -3.4);
1106                next.control.orientation.rotate_x(move1 * 1.1);
1107                next.control.position += Vec3::new(move1 * 14.0, move1 * -3.0, 0.0);
1108
1109                next.control.orientation.rotate_x(move2 * 1.7);
1110                next.control.orientation.rotate_z(move2 * -1.3);
1111                next.control.orientation.rotate_y(move2 * 0.8);
1112            },
1113            Some("common.abilities.axe.furor") => {
1114                legacy_initialize();
1115                next.hand_l.position = Vec3::new(s_a.ahl.0, s_a.ahl.1, s_a.ahl.2);
1116                next.hand_l.orientation =
1117                    Quaternion::rotation_x(s_a.ahl.3) * Quaternion::rotation_y(s_a.ahl.4);
1118                next.hand_r.position = Vec3::new(s_a.ahr.0, s_a.ahr.1, s_a.ahr.2);
1119                next.hand_r.orientation =
1120                    Quaternion::rotation_x(s_a.ahr.3) * Quaternion::rotation_z(s_a.ahr.5);
1121
1122                next.control.position = Vec3::new(s_a.ac.0 + 0.5, s_a.ac.1 + 9.0, s_a.ac.2 + 2.5);
1123                next.control.orientation = Quaternion::rotation_x(s_a.ac.3 - 2.25)
1124                    * Quaternion::rotation_y(s_a.ac.4 - PI)
1125                    * Quaternion::rotation_z(s_a.ac.5 - 0.2 - move1 * PI);
1126
1127                next.control.orientation.rotate_x(move1 * -1.0);
1128                next.control.position += Vec3::new(move1 * 3.0, move1 * -2.0, move1 * 14.0);
1129                next.control.orientation.rotate_z(move1 * 1.5);
1130
1131                next.control.orientation.rotate_y(move2 * -1.0);
1132                next.control.orientation.rotate_z(move2 * -1.6);
1133                next.control.orientation.rotate_y(move2 * 0.7);
1134                next.control.orientation.rotate_x(move2 * -0.5);
1135                next.control.position += Vec3::new(move2 * 9.0, move2 * -3.0, move2 * -14.0);
1136            },
1137            Some("common.abilities.axe.sunder") => {
1138                legacy_initialize();
1139                next.hand_l.position = Vec3::new(s_a.ahl.0, s_a.ahl.1, s_a.ahl.2);
1140                next.hand_l.orientation =
1141                    Quaternion::rotation_x(s_a.ahl.3) * Quaternion::rotation_y(s_a.ahl.4);
1142                next.hand_r.position = Vec3::new(s_a.ahr.0, s_a.ahr.1, s_a.ahr.2);
1143                next.hand_r.orientation =
1144                    Quaternion::rotation_x(s_a.ahr.3) * Quaternion::rotation_z(s_a.ahr.5);
1145
1146                next.control.position = Vec3::new(s_a.ac.0 + 0.5, s_a.ac.1 + 9.0, s_a.ac.2 + 2.5);
1147                next.control.orientation = Quaternion::rotation_x(s_a.ac.3 - 2.25)
1148                    * Quaternion::rotation_y(s_a.ac.4 - PI)
1149                    * Quaternion::rotation_z(s_a.ac.5 - 0.2);
1150
1151                next.control.orientation.rotate_z(move1 * -1.5);
1152                next.control.position += Vec3::new(move1 * 12.0, 0.0, move1 * 5.0);
1153                next.control.orientation.rotate_y(move1 * 0.5);
1154                next.main.position += Vec3::new(0.0, move1 * 10.0, 0.0);
1155                next.main.orientation.rotate_z(move1base * TAU);
1156                next.second.position += Vec3::new(0.0, move1 * 10.0, 0.0);
1157                next.second.orientation.rotate_z(move1base * -TAU);
1158
1159                next.main.orientation.rotate_z(move2base * TAU);
1160                next.main.position += Vec3::new(0.0, move2 * -10.0, 0.0);
1161                next.second.orientation.rotate_z(move2base * -TAU);
1162                next.second.position += Vec3::new(0.0, move2 * -10.0, 0.0);
1163                next.control.position += Vec3::new(0.0, 0.0, move2 * -5.0);
1164            },
1165            Some("common.abilities.axe.defiance") => {
1166                legacy_initialize();
1167                let tension = (move2base * 20.0).sin();
1168
1169                next.hand_l.position = Vec3::new(s_a.ahl.0, s_a.ahl.1, s_a.ahl.2);
1170                next.hand_l.orientation =
1171                    Quaternion::rotation_x(s_a.ahl.3) * Quaternion::rotation_y(s_a.ahl.4);
1172                next.hand_r.position = Vec3::new(s_a.ahr.0, s_a.ahr.1, s_a.ahr.2);
1173                next.hand_r.orientation =
1174                    Quaternion::rotation_x(s_a.ahr.3) * Quaternion::rotation_z(s_a.ahr.5);
1175
1176                next.control.position = Vec3::new(s_a.ac.0 + 0.5, s_a.ac.1 + 9.0, s_a.ac.2 + 2.5);
1177                next.control.orientation = Quaternion::rotation_x(s_a.ac.3 - 2.25)
1178                    * Quaternion::rotation_y(s_a.ac.4 - PI)
1179                    * Quaternion::rotation_z(s_a.ac.5 - 0.2);
1180
1181                next.control.orientation.rotate_z(move1 * -1.6);
1182                next.control.orientation.rotate_x(move1 * 1.7);
1183                next.control.position += Vec3::new(move1 * 12.0, move1 * -10.0, move1 * 18.0);
1184                next.head.orientation.rotate_x(move1 * 0.6);
1185                next.head.position += Vec3::new(0.0, 0.0, move1 * -3.0);
1186                next.control.orientation.rotate_z(move1 * 0.4);
1187
1188                next.head.orientation.rotate_x(tension * 0.3);
1189                next.control.position += Vec3::new(0.0, 0.0, tension * 2.0);
1190            },
1191            // ==================================
1192            //               HAMMER
1193            // ==================================
1194            Some("common.abilities.hammer.basic_guard") => {
1195                let pullback = 1.0 - move3base.powi(4);
1196                let move1 = move1base.powf(0.25) * pullback;
1197                let move2 = (move2base * 10.0).sin();
1198
1199                if d.velocity.xy().magnitude_squared() < 0.5_f32.powi(2) {
1200                    next.chest.position =
1201                        Vec3::new(0.0, s_a.chest.0, s_a.chest.1 + move1 * -1.0 + move2 * 0.2);
1202                    next.chest.orientation = Quaternion::rotation_x(move1 * -0.15);
1203                    next.head.orientation = Quaternion::rotation_x(move1 * 0.25);
1204
1205                    next.belt.position =
1206                        Vec3::new(0.0, s_a.belt.0 + move1 * 0.5, s_a.belt.1 + move1 * 0.5);
1207                    next.shorts.position =
1208                        Vec3::new(0.0, s_a.shorts.0 + move1 * 1.3, s_a.shorts.1 + move1 * 1.0);
1209
1210                    next.belt.orientation = Quaternion::rotation_x(move1 * 0.15);
1211                    next.shorts.orientation = Quaternion::rotation_x(move1 * 0.25);
1212
1213                    if !d.is_riding {
1214                        next.foot_l.position =
1215                            Vec3::new(-s_a.foot.0, s_a.foot.1 + move1 * 2.0, s_a.foot.2);
1216                        next.foot_l.orientation = Quaternion::rotation_z(move1 * -0.5);
1217
1218                        next.foot_r.position =
1219                            Vec3::new(s_a.foot.0, s_a.foot.1 + move1 * -2.0, s_a.foot.2);
1220                        next.foot_r.orientation = Quaternion::rotation_x(move1 * -0.5);
1221                    }
1222                }
1223
1224                match d.hands {
1225                    (Some(Hands::Two), _) => {
1226                        next.hand_l.position = Vec3::new(s_a.hhl.0, s_a.hhl.1, s_a.hhl.2);
1227                        next.hand_l.orientation = Quaternion::rotation_x(s_a.hhl.3)
1228                            * Quaternion::rotation_y(s_a.hhl.4)
1229                            * Quaternion::rotation_z(s_a.hhl.5);
1230                        next.hand_r.position = Vec3::new(s_a.hhr.0, s_a.hhr.1, s_a.hhr.2);
1231                        next.hand_r.orientation = Quaternion::rotation_x(s_a.hhr.3)
1232                            * Quaternion::rotation_y(s_a.hhr.4)
1233                            * Quaternion::rotation_z(s_a.hhr.5);
1234
1235                        next.main.position = Vec3::new(0.0, 0.0, 0.0);
1236                        next.main.orientation = Quaternion::rotation_x(0.0);
1237                        next.control.position = Vec3::new(
1238                            s_a.hc.0 + move1 * 3.0,
1239                            s_a.hc.1 + move1 * 3.0,
1240                            s_a.hc.2 + move1 * 10.0,
1241                        );
1242                        next.control.orientation = Quaternion::rotation_x(s_a.hc.3)
1243                            * Quaternion::rotation_y(s_a.hc.4)
1244                            * Quaternion::rotation_z(s_a.hc.5 + move1 * -1.0);
1245                    },
1246                    (Some(Hands::One), offhand) => {
1247                        next.control_l.position =
1248                            Vec3::new(-7.0, 8.0 + move1 * 3.0, 2.0 + move1 * 3.0);
1249                        next.control_l.orientation =
1250                            Quaternion::rotation_x(-0.3) * Quaternion::rotation_y(move1 * 1.0);
1251                        next.hand_l.position = Vec3::new(0.0, -0.5, 0.0);
1252                        next.hand_l.orientation = Quaternion::rotation_x(PI / 2.0);
1253
1254                        next.main.position = Vec3::new(0.0, 0.0, 0.0);
1255                        next.main.orientation = Quaternion::rotation_x(0.0);
1256
1257                        if offhand.is_some() {
1258                            next.control_r.position =
1259                                Vec3::new(7.0, 8.0 + move1 * 3.0, 2.0 + move1 * 3.0);
1260                            next.control_r.orientation =
1261                                Quaternion::rotation_x(-0.3) * Quaternion::rotation_y(move1 * -1.0);
1262                            next.hand_r.position = Vec3::new(0.0, -0.5, 0.0);
1263                            next.hand_r.orientation = Quaternion::rotation_x(PI / 2.0);
1264                            next.second.position = Vec3::new(0.0, 0.0, 0.0);
1265                            next.second.orientation = Quaternion::rotation_x(0.0);
1266                        } else {
1267                            next.hand_r.position = Vec3::new(4.5, 8.0, 5.0);
1268                            next.hand_r.orientation =
1269                                Quaternion::rotation_x(1.9) * Quaternion::rotation_y(0.5)
1270                        }
1271                    },
1272                    (_, _) => {},
1273                }
1274            },
1275            Some("common.abilities.hammer.solid_smash") => {
1276                hammer_start(&mut next, s_a);
1277
1278                next.control.orientation.rotate_x(move1 * 2.7);
1279                next.control.orientation.rotate_z(move1 * 1.4);
1280                next.control.position += Vec3::new(-12.0, 0.0, 0.0) * move1;
1281                next.control.orientation.rotate_x(move1 * -1.2);
1282                twist_back(&mut next, move1, 0.8, 0.3, 0.1, 0.5);
1283
1284                twist_forward(&mut next, move2, 1.4, 0.5, 0.3, 1.0);
1285                next.control.orientation.rotate_x(move2 * -1.9);
1286                next.control.orientation.rotate_z(move2 * 0.6);
1287            },
1288            Some("common.abilities.hammer.scornful_swipe") => {
1289                hammer_start(&mut next, s_a);
1290                let move1_pre = move1.min(0.5) * 2.0;
1291                let move1_shake = ((move1.max(0.3) - 0.3) * 15.0).sin();
1292                let move1_late = move1.powi(4);
1293
1294                next.control.orientation.rotate_x(move1_pre * 2.3);
1295                next.control.position += Vec3::new(0.0, 2.0, 16.0) * move1_pre;
1296                next.control.position += Vec3::new(0.0, 0.0, 4.0) * move1_shake;
1297                next.control.orientation.rotate_y(move1_late * 1.6);
1298                next.control.position += Vec3::new(-8.0, 0.0, -8.0) * move1_late;
1299                twist_back(&mut next, move1_late, 1.0, 0.4, 0.2, 0.7);
1300                next.control.orientation.rotate_z(move1_late * 1.2);
1301
1302                twist_forward(&mut next, move2, 1.9, 0.9, 0.6, 1.1);
1303                next.control.orientation.rotate_y(move2 * -1.7);
1304                next.control.orientation.rotate_z(move2 * -2.7);
1305            },
1306            Some("common.abilities.hammer.heavy_whorl") => {
1307                hammer_start(&mut next, s_a);
1308
1309                twist_back(&mut next, move1, 2.0, 0.8, 0.4, 1.4);
1310                next.control.orientation.rotate_x(move1 * 0.6);
1311
1312                next.torso.orientation.rotate_z(move2base * -2.0 * PI);
1313                twist_forward(&mut next, move2, 3.4, 1.2, 0.8, 1.8);
1314                next.control.orientation.rotate_z(move2 * -2.3);
1315                next.control.position += Vec3::new(6.0, 0.0, 6.0) * move2;
1316            },
1317            Some("common.abilities.hammer.dual_heavy_whorl") => {
1318                dual_wield_start(&mut next);
1319
1320                twist_back(&mut next, move1, 2.0, 0.8, 0.4, 1.4);
1321                next.control_l.orientation.rotate_y(move1 * -PI / 2.0);
1322                next.control_r.orientation.rotate_y(move1 * -PI / 2.0);
1323                next.control.position += Vec3::new(0.0, 0.0, 4.0) * move1;
1324
1325                next.torso.orientation.rotate_z(move2base * -2.0 * PI);
1326                twist_forward(&mut next, move2, 3.4, 1.2, 0.8, 1.8);
1327                next.control_l.orientation.rotate_z(move2 * -2.3);
1328                next.control_r.orientation.rotate_z(move2 * -2.3);
1329            },
1330            Some("common.abilities.hammer.breach") => {
1331                hammer_start(&mut next, s_a);
1332
1333                next.control.orientation.rotate_x(move1 * 2.5);
1334                next.control.orientation.rotate_z(move1 * -4.8);
1335                next.control.position += Vec3::new(-12.0, 0.0, 22.0) * move1;
1336                twist_back(&mut next, move1, 0.6, 0.2, 0.0, 0.3);
1337
1338                twist_forward(&mut next, move2, 1.6, 0.4, 0.2, 0.7);
1339                next.control.orientation.rotate_x(move2 * -4.5);
1340                next.control.position += Vec3::new(0.0, 0.0, -20.0) * move2;
1341            },
1342            Some("common.abilities.hammer.pile_driver") => {
1343                hammer_start(&mut next, s_a);
1344                let shake = (move1base * 15.0).sin();
1345                let move1 = (move1base * 2.0).min(1.0) * pullback;
1346
1347                twist_back(&mut next, move1, 0.9, 0.3, 0.1, 0.5);
1348                next.control.orientation.rotate_x(move1 * 2.4);
1349                next.control.position += Vec3::new(-14.0, 0.0, 14.0) * move1;
1350                next.control.orientation.rotate_z(move1 * 1.8);
1351
1352                next.control.orientation.rotate_x(shake * 0.15);
1353
1354                twist_forward(&mut next, move2, 1.6, 0.5, 0.2, 0.9);
1355                next.control.orientation.rotate_x(move2 * -4.0);
1356                next.control.orientation.rotate_z(move2 * 0.4);
1357                next.control.position += Vec3::new(0.0, 0.0, -12.0) * move2;
1358            },
1359            Some("common.abilities.hammer.upheaval") => {
1360                hammer_start(&mut next, s_a);
1361                let move1_twist = move1 * (move1 * PI * 1.5).sin();
1362
1363                twist_forward(&mut next, move1_twist, 0.8, 0.3, 0.0, 0.4);
1364                let angle1 = 5.0;
1365                let angle2 = 4.0;
1366                next.control
1367                    .orientation
1368                    .rotate_x(move1base * (2.0 - angle1) + move2base * (2.0 - angle2));
1369                next.control.orientation.rotate_y(move1 * -0.8);
1370                next.control
1371                    .orientation
1372                    .rotate_x(move1base * angle1 + move2base * angle2);
1373                next.control.orientation.rotate_z(move1 * 1.0);
1374                next.control.orientation.rotate_x(move2 * 6.0);
1375                next.control.orientation.rotate_z(move2 * -0.6);
1376                next.control.position += Vec3::new(-16.0, 0.0, 0.0) * move1;
1377                next.control.position += Vec3::new(12.0, 0.0, 10.0) * move2;
1378                twist_forward(&mut next, move2, 1.0, 0.9, 0.4, 1.1);
1379            },
1380            Some("common.abilities.hammer.dual_upheaval") => {
1381                dual_wield_start(&mut next);
1382                let move1_return = (3.0 * move1base).sin();
1383
1384                next.control.orientation.rotate_x(4.0 * move1base);
1385                next.control_l.orientation.rotate_z(move1 * 0.6);
1386                next.control_r.orientation.rotate_z(move1 * -0.6);
1387                next.control.position += Vec3::new(0.0, 6.0, 8.0) * move1_return;
1388                next.control.orientation.rotate_x(3.5 * move2base);
1389                next.control_l.orientation.rotate_z(move2 * -1.4);
1390                next.control_r.orientation.rotate_z(move2 * 1.4);
1391                next.control.position += Vec3::new(0.0, 12.0, 10.0) * move2;
1392            },
1393            Some("common.abilities.hammer.wide_wallop") => {
1394                hammer_start(&mut next, s_a);
1395                let move1 = chargebase.min(1.0) * pullback;
1396                let tension = (chargebase * 7.0).sin();
1397
1398                next.control.orientation.rotate_x(move1 * 1.1 + move2 * 0.6);
1399                twist_back(&mut next, move1 + tension / 25.0, 1.7, 0.7, 0.3, 1.1);
1400                next.control.orientation.rotate_y(move1 * -0.8);
1401                next.control.position += Vec3::new(0.0, 0.0, 6.0) * move1;
1402
1403                twist_forward(&mut next, move2, 4.8, 1.7, 0.7, 3.2);
1404                next.control.orientation.rotate_y(move2 * 2.0);
1405                next.control.orientation.rotate_z(move2 * -1.8);
1406            },
1407            Some("common.abilities.hammer.intercept") => {
1408                hammer_start(&mut next, s_a);
1409                twist_back(&mut next, move1, 1.6, 0.7, 0.3, 1.1);
1410                next.control.orientation.rotate_x(move1 * 1.8);
1411
1412                twist_forward(&mut next, move2, 2.4, 0.9, 0.5, 1.4);
1413                next.control.orientation.rotate_z(move2 * -2.7);
1414                next.control.orientation.rotate_x(move2 * 2.0);
1415                next.control.position += Vec3::new(5.0, 0.0, 11.0) * move2;
1416            },
1417            Some("common.abilities.hammer.dual_intercept") => {
1418                dual_wield_start(&mut next);
1419                next.control_l.orientation.rotate_x(move1 * -1.4);
1420                next.control_l.orientation.rotate_z(move1 * 0.8);
1421                next.control_r.orientation.rotate_x(move1 * -1.4);
1422                next.control_r.orientation.rotate_z(move1 * -0.8);
1423                next.control.position += Vec3::new(0.0, 0.0, -6.0) * move1;
1424
1425                next.control_l.orientation.rotate_z(move2 * -2.6);
1426                next.control_l.orientation.rotate_x(move2 * 4.0);
1427                next.control_r.orientation.rotate_z(move2 * 2.6);
1428                next.control_r.orientation.rotate_x(move2 * 4.0);
1429                next.control.position += Vec3::new(0.0, 0.0, 20.0) * move2;
1430            },
1431            Some("common.abilities.hammer.spine_cracker") => {
1432                hammer_start(&mut next, s_a);
1433
1434                twist_back(&mut next, move1, 1.9, 1.5, 0.5, 1.2);
1435                next.head.position += Vec3::new(-2.0, 2.0, 0.0) * move1;
1436                next.control.orientation.rotate_x(move1 * 1.8);
1437                next.control.position += Vec3::new(0.0, 0.0, 8.0) * move1;
1438                next.control.orientation.rotate_y(move1 * 0.4);
1439
1440                twist_forward(&mut next, move2, 2.1, 1.6, 0.4, 1.3);
1441                next.control.orientation.rotate_z(move2 * 1.6);
1442                next.control.position += Vec3::new(-16.0, 12.0, -8.0) * move2;
1443            },
1444            Some("common.abilities.hammer.lung_pummel") => {
1445                hammer_start(&mut next, s_a);
1446
1447                twist_back(&mut next, move1, 1.9, 0.7, 0.3, 1.2);
1448                next.control.orientation.rotate_x(move1 * 1.2);
1449                next.control.orientation.rotate_z(move1 * 1.0);
1450                next.control.position += Vec3::new(-12.0, 0.0, 0.0) * move1;
1451
1452                twist_forward(&mut next, move2, 3.4, 1.4, 0.9, 2.1);
1453                next.control.orientation.rotate_z(move2 * -4.0);
1454                next.control.position += Vec3::new(12.0, 0.0, 14.0) * move2;
1455            },
1456            Some("common.abilities.hammer.helm_crusher") => {
1457                hammer_start(&mut next, s_a);
1458
1459                twist_back(&mut next, move1, 0.8, 0.3, 0.1, 0.5);
1460                next.control.orientation.rotate_x(move1 * -0.8);
1461                next.control.orientation.rotate_z(move1 * -1.6);
1462                next.control.orientation.rotate_x(move1 * 2.8);
1463                next.control.position += Vec3::new(-9.0, 0.0, 8.0) * move1;
1464                next.control.orientation.rotate_z(move1 * -0.4);
1465
1466                twist_forward(&mut next, move2, 1.8, 0.7, 0.4, 1.1);
1467                next.control.orientation.rotate_x(move2 * -5.0);
1468                next.control.orientation.rotate_z(move2 * -1.0);
1469                next.control.position += Vec3::new(-12.0, 0.0, -8.0) * move2;
1470            },
1471            Some("common.abilities.hammer.thunderclap") => {
1472                hammer_start(&mut next, s_a);
1473
1474                twist_back(&mut next, move1, 1.8, 0.9, 0.5, 1.1);
1475                next.control.orientation.rotate_x(move1 * 2.4);
1476                next.control.position += Vec3::new(-16.0, -8.0, 12.0) * move1;
1477                next.control.orientation.rotate_z(move1 * PI / 2.0);
1478                next.control.orientation.rotate_x(move1 * 0.6);
1479
1480                twist_forward(&mut next, move2, 2.4, 1.1, 0.6, 1.4);
1481                next.control.orientation.rotate_x(move2 * -5.0);
1482                next.control.position += Vec3::new(4.0, 12.0, -12.0) * move2;
1483                next.control.orientation.rotate_z(move2 * 0.6);
1484            },
1485            Some("common.abilities.hammer.earthshaker") => {
1486                hammer_start(&mut next, s_a);
1487
1488                next.hand_l.orientation.rotate_y(move1 * -PI);
1489                next.hand_r.orientation.rotate_y(move1 * -PI);
1490                next.control.orientation.rotate_x(2.4 * move1);
1491                next.control.orientation.rotate_z(move1 * -PI / 2.0);
1492                next.control.orientation.rotate_x(-0.6 * move1);
1493                next.control.position += Vec3::new(-8.0, 0.0, 24.0) * move1;
1494                next.chest.orientation.rotate_x(move1 * 0.5);
1495                next.torso.position += Vec3::new(0.0, 0.0, 8.0) * move1;
1496
1497                next.torso.position += Vec3::new(0.0, 0.0, -8.0) * move2;
1498                next.control.orientation.rotate_x(move2 * -0.8);
1499                next.control.position += Vec3::new(0.0, 0.0, -10.0) * move2;
1500                next.chest.orientation.rotate_x(move2 * -0.8);
1501            },
1502            Some("common.abilities.hammer.judgement") => {
1503                hammer_start(&mut next, s_a);
1504
1505                next.control.orientation.rotate_x(2.4 * move1);
1506                next.control.orientation.rotate_z(move1 * PI / 2.0);
1507                next.control.orientation.rotate_x(-0.6 * move1);
1508                next.control.position += Vec3::new(-8.0, 6.0, 24.0) * move1;
1509                next.chest.orientation.rotate_x(move1 * 0.5);
1510                next.torso.position += Vec3::new(0.0, 0.0, 8.0) * move1;
1511
1512                next.torso.position += Vec3::new(0.0, 0.0, -8.0) * move2;
1513                next.chest.orientation.rotate_x(-1.5 * move2);
1514                next.belt.orientation.rotate_x(0.3 * move2);
1515                next.shorts.orientation.rotate_x(0.6 * move2);
1516                next.control.orientation.rotate_x(-3.0 * move2);
1517                next.control.position += Vec3::new(0.0, 0.0, -16.0) * move2;
1518            },
1519            Some("common.abilities.hammer.retaliate") => {
1520                hammer_start(&mut next, s_a);
1521
1522                twist_back(&mut next, move1, 0.6, 0.2, 0.0, 0.3);
1523                next.control.orientation.rotate_x(move1 * 1.5);
1524                next.control.orientation.rotate_y(move1 * 0.4);
1525                next.control.position += Vec3::new(0.0, 0.0, 16.0) * move1;
1526
1527                twist_forward(&mut next, move2, 2.1, 0.6, 0.4, 0.9);
1528                next.control.orientation.rotate_y(move2 * 2.0);
1529                next.control.orientation.rotate_x(move2 * -2.5);
1530                next.control.orientation.rotate_z(move2 * -0.6);
1531                next.control.position += Vec3::new(6.0, -10.0, -14.0) * move2;
1532            },
1533            Some("common.abilities.hammer.tenacity") => {
1534                hammer_start(&mut next, s_a);
1535
1536                next.control.orientation.rotate_x(move1 * 0.6);
1537                next.control.orientation.rotate_y(move1 * 0.9);
1538                next.control.orientation.rotate_x(move1 * -0.6);
1539                next.chest.orientation.rotate_x(move1 * 0.4);
1540                next.control.position += Vec3::new(0.0, 4.0, 3.0) * move1;
1541
1542                next.control.position += Vec3::new(
1543                    (move2 * 50.0).sin(),
1544                    (move2 * 67.0).sin(),
1545                    (move2 * 83.0).sin(),
1546                );
1547            },
1548            Some("common.abilities.hammer.tremor") => {
1549                hammer_start(&mut next, s_a);
1550
1551                twist_back(&mut next, move1, 1.4, 0.7, 0.5, 0.9);
1552                next.foot_l.orientation.rotate_z(move1 * 1.4);
1553                next.foot_l.position += Vec3::new(-1.0, -3.0, 0.0) * move1;
1554                next.control.orientation.rotate_x(move1 * 2.6);
1555                next.control.orientation.rotate_y(move1 * 0.8);
1556
1557                twist_forward(&mut next, move2, 2.1, 1.2, 0.9, 1.6);
1558                next.foot_l.orientation.rotate_z(move2 * -1.4);
1559                next.foot_l.position += Vec3::new(2.0, 7.0, 0.0) * move2;
1560                next.control.orientation.rotate_z(move2 * 2.1);
1561                next.control.orientation.rotate_x(move2 * -2.0);
1562                next.control.orientation.rotate_z(move2 * 1.2);
1563                next.control.position += Vec3::new(-16.0, 0.0, 0.0) * move2;
1564                next.chest.orientation.rotate_x(-0.8 * move2);
1565            },
1566            Some("common.abilities.hammer.rampart") => {
1567                hammer_start(&mut next, s_a);
1568
1569                next.control.orientation.rotate_x(move1 * 0.6);
1570                next.control.orientation.rotate_y(move1 * -PI / 2.0);
1571                next.hand_l.orientation.rotate_y(move1 * -PI);
1572                next.hand_r.orientation.rotate_y(move1 * -PI);
1573                next.control.position += Vec3::new(-5.0, 0.0, 30.0) * move1;
1574
1575                next.control.position += Vec3::new(0.0, 0.0, -10.0) * move2;
1576                next.torso.orientation.rotate_x(move2 * -0.6);
1577                next.control.orientation.rotate_x(move2 * 0.6);
1578            },
1579            Some("common.abilities.hammer.seismic_shock") => {
1580                hammer_start(&mut next, s_a);
1581
1582                next.control.orientation.rotate_x(move1 * 2.5);
1583                next.control.position += Vec3::new(0.0, 0.0, 28.0) * move1;
1584                next.head.orientation.rotate_x(move1 * 0.3);
1585                next.chest.orientation.rotate_x(move1 * 0.3);
1586                next.belt.orientation.rotate_x(move1 * -0.2);
1587                next.shorts.orientation.rotate_x(move1 * -0.3);
1588
1589                next.control.orientation.rotate_z(move2 * 2.0);
1590                next.control.orientation.rotate_x(move2 * -4.0);
1591                next.control.position += Vec3::new(-6.0, 0.0, -30.0) * move2;
1592                next.head.orientation.rotate_x(move2 * -0.9);
1593                next.chest.orientation.rotate_x(move2 * -0.5);
1594                next.belt.orientation.rotate_x(move2 * 0.2);
1595                next.shorts.orientation.rotate_x(move2 * 0.4);
1596            },
1597            // ==================================
1598            //                BOW
1599            // ==================================
1600            Some(
1601                "common.abilities.bow.arrow_shot"
1602                | "common.abilities.bow.lesser_scatterburst"
1603                | "common.abilities.bow.burning_arrow"
1604                | "common.abilities.bow.poison_arrow"
1605                | "common.abilities.bow.freezing_arrow"
1606                | "common.abilities.bow.lightning_arrow",
1607            ) => {
1608                bow_start(&mut next, s_a);
1609
1610                let charge = chargebase.min(1.0);
1611                let tension = (chargebase * 15.0).sin();
1612
1613                bow_draw(&mut next, move1base, d.look_dir.z);
1614
1615                next.hand_l.position +=
1616                    Vec3::new(0.0, charge * -3.0, 0.0) + Vec3::one() * tension * 0.05;
1617            },
1618            Some(
1619                "common.abilities.bow.broadhead"
1620                | "common.abilities.bow.greater_scatterburst"
1621                | "common.abilities.bow.burning_broadhead"
1622                | "common.abilities.bow.poison_broadhead"
1623                | "common.abilities.bow.freezing_broadhead"
1624                | "common.abilities.bow.lightning_broadhead",
1625            ) => {
1626                bow_start(&mut next, s_a);
1627
1628                let charge = chargebase.min(1.0);
1629                let tension = (chargebase * 50.0).sin();
1630
1631                next.hold.scale *= 1.3;
1632                bow_draw(&mut next, move1base, d.look_dir.z);
1633
1634                next.hand_l.position +=
1635                    Vec3::new(0.0, charge * -5.0, 0.0) + Vec3::one() * tension * 0.05;
1636            },
1637            Some("common.abilities.bow.foothold") => {
1638                bow_start(&mut next, s_a);
1639
1640                let move1a = (move1base * 1.5).min(1.0);
1641                let move1b = (move1base * 3.0 - 2.0).max(0.0).powi(4);
1642                let move1a_reta = move1a - move1b;
1643                let move2 = movementbase.min(1.0);
1644                let move1a_retb = move1a - move2;
1645                let move1b_ret = move1b - move2;
1646
1647                twist_back(&mut next, move1a_reta, 1.1, 0.7, 0.5, 0.8);
1648                next.foot_l.orientation.rotate_z(move1a_retb * 1.4);
1649                next.foot_l.position += Vec3::new(-2.0, -3.0, 0.0) * move1a_retb;
1650                next.control.orientation.rotate_z(move1a_reta * -0.9);
1651                next.control.position += Vec3::new(8.0, 3.0, 0.0) * move1a_reta;
1652
1653                twist_forward(&mut next, move1b_ret, 1.8, 1.1, 0.6, 1.0);
1654                next.foot_l.orientation.rotate_z(move1b_ret * -2.4);
1655                next.foot_l.orientation.rotate_x(move1b_ret * 1.2);
1656                next.foot_l.position += Vec3::new(11.0, 10.0, 6.0) * move1b_ret;
1657
1658                bow_draw(&mut next, move2, d.look_dir.z);
1659            },
1660            Some("common.abilities.bow.barrage") => {
1661                bow_start(&mut next, s_a);
1662
1663                next.hand_l.position += Vec3::new(4.0, -6.0, -6.0) * move1;
1664                next.hand_l.orientation.rotate_z(move1 * 2.0);
1665            },
1666            Some("common.abilities.bow.owl_talon") => {
1667                bow_start(&mut next, s_a);
1668
1669                next.hand_l.position += Vec3::new(-4.0, 0.0, 4.0) * move1;
1670                next.hand_l.orientation.rotate_x(1.6 * move1);
1671
1672                next.hand_l.position += Vec3::new(0.0, 0.0, -10.0) * move2;
1673            },
1674            Some("common.abilities.bow.heavy_nock") => {
1675                bow_start(&mut next, s_a);
1676
1677                next.hold.scale *= 1.0 + move1base / 2.0;
1678                next.hold.position += Vec3::new(0.0, 0.0, -2.5) * move1;
1679            },
1680            Some("common.abilities.bow.heartseeker") => {
1681                bow_start(&mut next, s_a);
1682
1683                next.control.orientation.rotate_y(move1 * 0.4);
1684                next.control.orientation.rotate_x(move1 * 0.6);
1685                next.control.position += Vec3::new(4.0, 0.0, 6.0) * move1;
1686            },
1687            Some("common.abilities.bow.scatterburst") => {
1688                bow_start(&mut next, s_a);
1689
1690                next.hand_l.position += Vec3::new(0.0, 5.0, 0.0) * ((move1 + move2) * 10.0).sin();
1691            },
1692            Some("common.abilities.bow.eagle_eye") => {
1693                bow_start(&mut next, s_a);
1694
1695                next.control.orientation.rotate_x(move1 * 0.8);
1696                next.control.position += Vec3::new(5.0, 0.0, 7.0) * move1;
1697            },
1698            Some(
1699                "common.abilities.bow.ignite_arrow"
1700                | "common.abilities.bow.drench_arrow"
1701                | "common.abilities.bow.freeze_arrow"
1702                | "common.abilities.bow.jolt_arrow"
1703                | "common.abilities.bow.septic_shot",
1704            ) => {
1705                bow_start(&mut next, s_a);
1706            },
1707            Some("common.abilities.bow.ardent_hunt") => {
1708                bow_start(&mut next, s_a);
1709
1710                next.foot_l.position += Vec3::new(0.0, 2.0, 0.0) * move1;
1711                next.control.position += Vec3::new(6.0, 3.0, 5.0) * move1;
1712                next.control.orientation.rotate_y(move1 * -1.0);
1713            },
1714            Some("common.abilities.bow.piercing_gale") => {
1715                bow_start(&mut next, s_a);
1716
1717                next.control.orientation.rotate_y(move1 * -PI + move2 * -PI);
1718            },
1719            Some("common.abilities.bow.piercing_gale_shot") => {
1720                bow_start(&mut next, s_a);
1721
1722                bow_draw(&mut next, move1base, d.look_dir.z);
1723
1724                let charge = chargebase.min(2.0);
1725                let rate = 2.5;
1726                next.control.orientation.rotate_x(charge * -rate * 0.3);
1727                next.control.orientation.rotate_z(charge * rate * 0.3);
1728                next.control.orientation.rotate_y(charge * -rate);
1729                next.control.orientation.rotate_z(charge * rate * -0.3);
1730            },
1731            Some("common.abilities.bow.hawkstrike") => {
1732                bow_start(&mut next, s_a);
1733
1734                bow_draw(&mut next, move1base * 2.0, d.look_dir.z);
1735            },
1736            Some("common.abilities.bow.hawkstrike_shot") => {
1737                bow_start(&mut next, s_a);
1738
1739                let charge = chargebase.min(1.0);
1740
1741                bow_draw(&mut next, move1base, d.look_dir.z);
1742
1743                next.hand_l.position += Vec3::new(0.0, charge * -5.0, 0.0);
1744                next.hand_l.orientation.rotate_y(charge * PI / 2.0);
1745            },
1746            Some("common.abilities.bow.fusillade") => {
1747                bow_start(&mut next, s_a);
1748
1749                let move_rep = ((move1 + move2) * 20.0).sin();
1750                next.hand_l.position += Vec3::new(0.0, 5.0, 0.0) * move_rep;
1751            },
1752            Some("common.abilities.bow.death_volley") => {
1753                bow_start(&mut next, s_a);
1754
1755                next.hand_l.position += Vec3::new(0.0, 8.0, 0.0) * (-move1 + move2);
1756                next.hold.scale *= 1.0 + move1;
1757            },
1758            Some(
1759                "common.abilities.bow.death_volley_shot"
1760                | "common.abilities.bow.death_volley_heavy_shot",
1761            ) => {
1762                bow_start(&mut next, s_a);
1763                let look_z = d.look_dir_override.map_or(d.look_dir.z, |ldo| ldo.z);
1764                bow_draw(&mut next, move1base, look_z);
1765
1766                next.hold.scale *= 1.5;
1767                next.torso.position += Vec3::new(0.0, 0.0, -3.0) * move1;
1768                next.foot_l.orientation.rotate_x(-1.7 * move1);
1769                next.foot_l.position += Vec3::new(0.0, -8.0, 3.0) * move1;
1770                next.foot_r.position += Vec3::new(0.0, 6.0, 3.0) * move1;
1771            },
1772            // ==================================
1773            //             FIRE STAFF
1774            // ==================================
1775            Some("common.abilities.staff.flamethrower") => {
1776                let move1 = move1base;
1777                let move2 = move2base;
1778                let move3 = move3base;
1779
1780                next.hand_l.position = Vec3::new(s_a.sthl.0, s_a.sthl.1, s_a.sthl.2);
1781                next.hand_l.orientation =
1782                    Quaternion::rotation_x(s_a.sthl.3) * Quaternion::rotation_y(s_a.sthl.4);
1783                next.hand_r.position = Vec3::new(s_a.sthr.0, s_a.sthr.1, s_a.sthl.2);
1784                next.hand_r.orientation =
1785                    Quaternion::rotation_x(s_a.sthr.3) * Quaternion::rotation_y(s_a.sthr.4);
1786                next.main.position = Vec3::new(0.0, 0.0, 0.0);
1787                next.main.orientation = Quaternion::rotation_x(0.0);
1788
1789                next.control.position = Vec3::new(-4.0, 7.0, 4.0);
1790                next.control.orientation = Quaternion::rotation_x(-0.3)
1791                    * Quaternion::rotation_y(0.15)
1792                    * Quaternion::rotation_z(0.0);
1793
1794                next.control.position = Vec3::new(
1795                    s_a.stc.0 + (move1 * 16.0) * (1.0 - move3),
1796                    s_a.stc.1 + (move1 + (move2 * 8.0).sin() * 2.0) * (1.0 - move3),
1797                    s_a.stc.2 + (move1 * 10.0) * (1.0 - move3),
1798                );
1799                next.control.orientation =
1800                    Quaternion::rotation_x(s_a.stc.3 + (move1 * -1.2) * (1.0 - move3))
1801                        * Quaternion::rotation_y(
1802                            s_a.stc.4
1803                                + (move1 * -1.4 + (move2 * 16.0).sin() * 0.07) * (1.0 - move3),
1804                        )
1805                        * Quaternion::rotation_z(
1806                            (move1 * -1.7 + (move2 * 8.0 + PI / 4.0).sin() * 0.3) * (1.0 - move3),
1807                        );
1808                next.head.orientation = Quaternion::rotation_x(0.0);
1809
1810                next.hand_l.position = Vec3::new(
1811                    0.0 + (move1 * -1.0 + (move2 * 8.0).sin() * 3.5) * (1.0 - move3),
1812                    0.0 + (move1 * -5.0 + (move2 * 8.0).sin() * -2.0 + (move2 * 16.0).sin() * -1.5)
1813                        * (1.0 - move3),
1814                    -4.0 + (move1 * 19.0 + (move2 * 8.0 + PI / 2.0).sin() * 3.5) * (1.0 - move3),
1815                );
1816                next.hand_l.orientation =
1817                    Quaternion::rotation_x(s_a.sthr.3 + (move1 * -0.3) * (1.0 - move3))
1818                        * Quaternion::rotation_y(
1819                            (move1 * -1.1 + (move2 * 8.0 + PI / 2.0).sin() * -0.3) * (1.0 - move3),
1820                        )
1821                        * Quaternion::rotation_z((move1 * -2.8) * (1.0 - move3));
1822
1823                if d.velocity.magnitude_squared() < 0.5_f32.powi(2) {
1824                    next.head.orientation =
1825                        Quaternion::rotation_z(move1 * -0.5 + (move2 * 16.0).sin() * 0.05);
1826
1827                    if !d.is_riding {
1828                        next.foot_l.position =
1829                            Vec3::new(-s_a.foot.0, s_a.foot.1 + move1 * -3.0, s_a.foot.2);
1830                        next.foot_l.orientation = Quaternion::rotation_x(move1 * -0.5)
1831                            * Quaternion::rotation_z(move1 * 0.5);
1832
1833                        next.foot_r.position =
1834                            Vec3::new(s_a.foot.0, s_a.foot.1 + move1 * 4.0, s_a.foot.2);
1835                        next.foot_r.orientation = Quaternion::rotation_z(move1 * 0.5);
1836                    }
1837
1838                    next.chest.orientation =
1839                        Quaternion::rotation_x(move1 * -0.2 + (move2 * 8.0).sin() * 0.05)
1840                            * Quaternion::rotation_z(move1 * 0.5);
1841                    next.belt.orientation =
1842                        Quaternion::rotation_x(move1 * 0.1) * Quaternion::rotation_z(move1 * -0.1);
1843                    next.shorts.orientation =
1844                        Quaternion::rotation_x(move1 * 0.2) * Quaternion::rotation_z(move1 * -0.2);
1845                };
1846            },
1847            Some("common.abilities.staff.fireshockwave") => {
1848                let move1 = move1base;
1849                let move2 = move2base;
1850                let move3 = move3base;
1851
1852                next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1);
1853
1854                next.hand_l.position = Vec3::new(s_a.sthl.0, s_a.sthl.1, s_a.sthl.2);
1855                next.hand_l.orientation =
1856                    Quaternion::rotation_x(s_a.sthl.3) * Quaternion::rotation_y(s_a.sthl.4);
1857                next.hand_r.position = Vec3::new(s_a.sthr.0, s_a.sthr.1, s_a.sthr.2);
1858                next.hand_r.orientation =
1859                    Quaternion::rotation_x(s_a.sthr.3) * Quaternion::rotation_y(s_a.sthr.4);
1860                next.main.position = Vec3::new(0.0, 0.0, 0.0);
1861                next.main.orientation = Quaternion::rotation_x(0.0);
1862
1863                next.control.position = Vec3::new(s_a.stc.0, s_a.stc.1, s_a.stc.2);
1864                next.control.orientation =
1865                    Quaternion::rotation_x(s_a.stc.3) * Quaternion::rotation_y(s_a.stc.4);
1866
1867                let twist = move1 * 0.8;
1868
1869                next.control.position = Vec3::new(
1870                    s_a.stc.0 + (move1 * 5.0) * (1.0 - move3),
1871                    s_a.stc.1 + (move1 * 5.0) * (1.0 - move3),
1872                    s_a.stc.2 + (move1 * 10.0 + move2 * -10.0) * (1.0 - move3),
1873                );
1874                next.control.orientation =
1875                    Quaternion::rotation_x(s_a.stc.3 + (move1 * 0.8) * (1.0 - move3))
1876                        * Quaternion::rotation_y(
1877                            s_a.stc.4 + (move1 * -0.15 + move2 * -0.15) * (1.0 - move3),
1878                        )
1879                        * Quaternion::rotation_z((move1 * 0.8 + move2 * -0.8) * (1.0 - move3));
1880
1881                next.head.orientation = Quaternion::rotation_x((move1 * 0.4) * (1.0 - move3))
1882                    * Quaternion::rotation_z((twist * 0.2 + move2 * -0.8) * (1.0 - move3));
1883
1884                next.chest.position = Vec3::new(
1885                    0.0,
1886                    s_a.chest.0,
1887                    s_a.chest.1 + (move1 * 2.0 + move2 * -4.0) * (1.0 - move3),
1888                );
1889                next.chest.orientation = Quaternion::rotation_x((move2 * -0.8) * (1.0 - move3))
1890                    * Quaternion::rotation_z(twist * -0.2 + move2 * -0.1 + (1.0 - move3));
1891
1892                next.belt.orientation = Quaternion::rotation_x((move2 * 0.2) * (1.0 - move3))
1893                    * Quaternion::rotation_z((twist * 0.6 + move2 * -0.48) * (1.0 - move3));
1894
1895                next.shorts.orientation = Quaternion::rotation_x((move2 * 0.3) * (1.0 - move3))
1896                    * Quaternion::rotation_z((twist + move2 * -0.8) * (1.0 - move3));
1897
1898                if d.velocity.magnitude() < 0.5 && !d.is_riding {
1899                    next.foot_l.position = Vec3::new(
1900                        -s_a.foot.0,
1901                        s_a.foot.1 + move1 * -7.0 + move2 * 7.0,
1902                        s_a.foot.2,
1903                    );
1904                    next.foot_l.orientation = Quaternion::rotation_x(move1 * -0.8 + move2 * 0.8)
1905                        * Quaternion::rotation_z(move1 * 0.3 + move2 * -0.3);
1906
1907                    next.foot_r.position = Vec3::new(
1908                        s_a.foot.0,
1909                        s_a.foot.1 + move1 * 5.0 + move2 * -5.0,
1910                        s_a.foot.2,
1911                    );
1912                    next.foot_r.orientation = Quaternion::rotation_y(move1 * -0.3 + move2 * 0.3)
1913                        * Quaternion::rotation_z(move1 * 0.4 + move2 * -0.4);
1914                }
1915            },
1916            Some("common.abilities.staff.firebomb") => {
1917                let move1 = move1base;
1918                let move2 = move2base.powf(0.25);
1919                let move3 = move3base;
1920
1921                let ori: Vec2<f32> = Vec2::from(d.orientation);
1922                let last_ori = Vec2::from(d.last_ori);
1923                let tilt = if vek::Vec2::new(ori, last_ori)
1924                    .map(|o| o.magnitude_squared())
1925                    .map(|m| m > 0.001 && m.is_finite())
1926                    .reduce_and()
1927                    && ori.angle_between(last_ori).is_finite()
1928                {
1929                    ori.angle_between(last_ori).min(0.2)
1930                        * last_ori.determine_side(Vec2::zero(), ori).signum()
1931                } else {
1932                    0.0
1933                } * 1.3;
1934                let ori_angle = d.orientation.y.atan2(d.orientation.x);
1935                let lookdir_angle = d.look_dir.y.atan2(d.look_dir.x);
1936                let swivel = lookdir_angle - ori_angle;
1937                let xmove = (move1 * 6.0 + PI).sin();
1938                let ymove = (move1 * 6.0 + PI * (0.5)).sin();
1939
1940                next.hand_l.position = Vec3::new(s_a.sthl.0, s_a.sthl.1, s_a.sthl.2);
1941                next.hand_l.orientation = Quaternion::rotation_x(s_a.sthl.3);
1942
1943                next.hand_r.position = Vec3::new(s_a.sthr.0, s_a.sthr.1, s_a.sthr.2);
1944                next.hand_r.orientation =
1945                    Quaternion::rotation_x(s_a.sthr.3) * Quaternion::rotation_y(s_a.sthr.4);
1946
1947                next.main.position = Vec3::new(0.0, 0.0, 0.0);
1948                next.main.orientation = Quaternion::rotation_y(0.0);
1949
1950                next.control.position = Vec3::new(
1951                    s_a.stc.0 + (xmove * 3.0 + move1 * -4.0) * (1.0 - move3),
1952                    s_a.stc.1 + (2.0 + ymove * 3.0 + move2 * 3.0) * (1.0 - move3),
1953                    s_a.stc.2 + d.look_dir.z * 4.0,
1954                );
1955                next.control.orientation = Quaternion::rotation_x(
1956                    d.look_dir.z + s_a.stc.3 + (move2 * 0.6) * (1.0 - move3),
1957                ) * Quaternion::rotation_y(
1958                    s_a.stc.4 + (move1 * 0.5 + move2 * -0.5),
1959                ) * Quaternion::rotation_z(
1960                    s_a.stc.5 - (0.2 + move1 * -0.5 + move2 * 0.8) * (1.0 - move3),
1961                );
1962
1963                next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1);
1964                next.head.orientation = Quaternion::rotation_x(d.look_dir.z * 0.7)
1965                    * Quaternion::rotation_z(
1966                        tilt * -2.5 + (move1 * -0.2 + move2 * -0.4) * (1.0 - move3),
1967                    );
1968                next.chest.orientation = Quaternion::rotation_z(swivel * 0.8);
1969                next.torso.orientation = Quaternion::rotation_z(swivel * 0.2);
1970            },
1971            // ==================================
1972            //           NATURE SCEPTRE
1973            // ==================================
1974            Some(
1975                "common.abilities.sceptre.lifestealbeam"
1976                | "common.abilities.custom.cardinal.steambeam",
1977            ) => {
1978                let move1 = move1base;
1979                let move2 = move2base;
1980                let move3 = move3base;
1981
1982                next.hand_l.position = Vec3::new(s_a.sthl.0, s_a.sthl.1, s_a.sthl.2);
1983                next.hand_l.orientation =
1984                    Quaternion::rotation_x(s_a.sthl.3) * Quaternion::rotation_y(s_a.sthl.4);
1985                next.hand_r.position = Vec3::new(s_a.sthr.0, s_a.sthr.1, s_a.sthl.2);
1986                next.hand_r.orientation =
1987                    Quaternion::rotation_x(s_a.sthr.3) * Quaternion::rotation_y(s_a.sthr.4);
1988                next.main.position = Vec3::new(0.0, 0.0, 0.0);
1989                next.main.orientation = Quaternion::rotation_x(0.0);
1990
1991                next.control.position = Vec3::new(-4.0, 7.0, 4.0);
1992                next.control.orientation = Quaternion::rotation_x(-0.3)
1993                    * Quaternion::rotation_y(0.15)
1994                    * Quaternion::rotation_z(0.0);
1995
1996                next.control.position = Vec3::new(
1997                    s_a.stc.0 + (move1 * 16.0) * (1.0 - move3),
1998                    s_a.stc.1 + (move1 + (move2 * 8.0).sin() * 2.0) * (1.0 - move3),
1999                    s_a.stc.2 + (move1 * 10.0) * (1.0 - move3),
2000                );
2001                next.control.orientation =
2002                    Quaternion::rotation_x(s_a.stc.3 + (move1 * -1.2) * (1.0 - move3))
2003                        * Quaternion::rotation_y(
2004                            s_a.stc.4
2005                                + (move1 * -1.4 + (move2 * 16.0).sin() * 0.07) * (1.0 - move3),
2006                        )
2007                        * Quaternion::rotation_z(
2008                            (move1 * -1.7 + (move2 * 8.0 + PI / 4.0).sin() * 0.3) * (1.0 - move3),
2009                        );
2010                next.head.orientation = Quaternion::rotation_x(0.0);
2011
2012                next.hand_l.position = Vec3::new(
2013                    0.0 + (move1 * -1.0 + (move2 * 8.0).sin() * 3.5) * (1.0 - move3),
2014                    0.0 + (move1 * -5.0 + (move2 * 8.0).sin() * -2.0 + (move2 * 16.0).sin() * -1.5)
2015                        * (1.0 - move3),
2016                    -4.0 + (move1 * 19.0 + (move2 * 8.0 + PI / 2.0).sin() * 3.5) * (1.0 - move3),
2017                );
2018                next.hand_l.orientation =
2019                    Quaternion::rotation_x(s_a.sthr.3 + (move1 * -0.3) * (1.0 - move3))
2020                        * Quaternion::rotation_y(
2021                            (move1 * -1.1 + (move2 * 8.0 + PI / 2.0).sin() * -0.3) * (1.0 - move3),
2022                        )
2023                        * Quaternion::rotation_z((move1 * -2.8) * (1.0 - move3));
2024
2025                if d.velocity.magnitude_squared() < 0.5_f32.powi(2) {
2026                    next.head.orientation =
2027                        Quaternion::rotation_z(move1 * -0.5 + (move2 * 16.0).sin() * 0.05);
2028
2029                    if !d.is_riding {
2030                        next.foot_l.position =
2031                            Vec3::new(-s_a.foot.0, s_a.foot.1 + move1 * -3.0, s_a.foot.2);
2032                        next.foot_l.orientation = Quaternion::rotation_x(move1 * -0.5)
2033                            * Quaternion::rotation_z(move1 * 0.5);
2034
2035                        next.foot_r.position =
2036                            Vec3::new(s_a.foot.0, s_a.foot.1 + move1 * 4.0, s_a.foot.2);
2037                        next.foot_r.orientation = Quaternion::rotation_z(move1 * 0.5);
2038                    }
2039
2040                    next.chest.orientation =
2041                        Quaternion::rotation_x(move1 * -0.2 + (move2 * 8.0).sin() * 0.05)
2042                            * Quaternion::rotation_z(move1 * 0.5);
2043                    next.belt.orientation =
2044                        Quaternion::rotation_x(move1 * 0.1) * Quaternion::rotation_z(move1 * -0.1);
2045                    next.shorts.orientation =
2046                        Quaternion::rotation_x(move1 * 0.2) * Quaternion::rotation_z(move1 * -0.2);
2047                };
2048            },
2049            Some(
2050                "common.abilities.sceptre.healingaura" | "common.abilities.sceptre.wardingaura",
2051            ) => {
2052                let move1 = move1base;
2053                let move2 = move2base;
2054                let move3 = move3base;
2055
2056                next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1);
2057
2058                next.hand_l.position = Vec3::new(s_a.sthl.0, s_a.sthl.1, s_a.sthl.2);
2059                next.hand_l.orientation =
2060                    Quaternion::rotation_x(s_a.sthl.3) * Quaternion::rotation_y(s_a.sthl.4);
2061                next.hand_r.position = Vec3::new(s_a.sthr.0, s_a.sthr.1, s_a.sthr.2);
2062                next.hand_r.orientation =
2063                    Quaternion::rotation_x(s_a.sthr.3) * Quaternion::rotation_y(s_a.sthr.4);
2064                next.main.position = Vec3::new(0.0, 0.0, 0.0);
2065                next.main.orientation = Quaternion::rotation_x(0.0);
2066
2067                next.control.position = Vec3::new(s_a.stc.0, s_a.stc.1, s_a.stc.2);
2068                next.control.orientation =
2069                    Quaternion::rotation_x(s_a.stc.3) * Quaternion::rotation_y(s_a.stc.4);
2070
2071                let twist = move1 * 0.8;
2072
2073                next.control.position = Vec3::new(
2074                    s_a.stc.0 + (move1 * 5.0) * (1.0 - move3),
2075                    s_a.stc.1 + (move1 * 5.0) * (1.0 - move3),
2076                    s_a.stc.2 + (move1 * 10.0 + move2 * -10.0) * (1.0 - move3),
2077                );
2078                next.control.orientation =
2079                    Quaternion::rotation_x(s_a.stc.3 + (move1 * 0.8) * (1.0 - move3))
2080                        * Quaternion::rotation_y(
2081                            s_a.stc.4 + (move1 * -0.15 + move2 * -0.15) * (1.0 - move3),
2082                        )
2083                        * Quaternion::rotation_z((move1 * 0.8 + move2 * -0.8) * (1.0 - move3));
2084
2085                next.head.orientation = Quaternion::rotation_x((move1 * 0.4) * (1.0 - move3))
2086                    * Quaternion::rotation_z((twist * 0.2 + move2 * -0.8) * (1.0 - move3));
2087
2088                next.chest.position = Vec3::new(
2089                    0.0,
2090                    s_a.chest.0,
2091                    s_a.chest.1 + (move1 * 2.0 + move2 * -4.0) * (1.0 - move3),
2092                );
2093                next.chest.orientation = Quaternion::rotation_x((move2 * -0.8) * (1.0 - move3))
2094                    * Quaternion::rotation_z(twist * -0.2 + move2 * -0.1 + (1.0 - move3));
2095
2096                next.belt.orientation = Quaternion::rotation_x((move2 * 0.2) * (1.0 - move3))
2097                    * Quaternion::rotation_z((twist * 0.6 + move2 * -0.48) * (1.0 - move3));
2098
2099                next.shorts.orientation = Quaternion::rotation_x((move2 * 0.3) * (1.0 - move3))
2100                    * Quaternion::rotation_z((twist + move2 * -0.8) * (1.0 - move3));
2101
2102                if d.velocity.magnitude() < 0.5 && !d.is_riding {
2103                    next.foot_l.position = Vec3::new(
2104                        -s_a.foot.0,
2105                        s_a.foot.1 + move1 * -7.0 + move2 * 7.0,
2106                        s_a.foot.2,
2107                    );
2108                    next.foot_l.orientation = Quaternion::rotation_x(move1 * -0.8 + move2 * 0.8)
2109                        * Quaternion::rotation_z(move1 * 0.3 + move2 * -0.3);
2110
2111                    next.foot_r.position = Vec3::new(
2112                        s_a.foot.0,
2113                        s_a.foot.1 + move1 * 5.0 + move2 * -5.0,
2114                        s_a.foot.2,
2115                    );
2116                    next.foot_r.orientation = Quaternion::rotation_y(move1 * -0.3 + move2 * 0.3)
2117                        * Quaternion::rotation_z(move1 * 0.4 + move2 * -0.4);
2118                }
2119            },
2120            // ==================================
2121            //               SHIELD
2122            // ==================================
2123            Some("common.abilities.shield.basic_guard" | "common.abilities.shield.power_guard") => {
2124                legacy_initialize();
2125                let pullback = 1.0 - move3base.powi(4);
2126                let move1 = move1base.powf(0.25) * pullback;
2127                let move2 = (move2base * 10.0).sin();
2128
2129                if d.velocity.xy().magnitude_squared() < 0.5_f32.powi(2) {
2130                    next.chest.position =
2131                        Vec3::new(0.0, s_a.chest.0, s_a.chest.1 + move1 * -1.0 + move2 * 0.2);
2132                    next.chest.orientation = Quaternion::rotation_x(move1 * -0.15);
2133                    next.head.orientation = Quaternion::rotation_x(move1 * 0.25);
2134
2135                    next.belt.position =
2136                        Vec3::new(0.0, s_a.belt.0 + move1 * 0.5, s_a.belt.1 + move1 * 0.5);
2137                    next.shorts.position =
2138                        Vec3::new(0.0, s_a.shorts.0 + move1 * 1.3, s_a.shorts.1 + move1 * 1.0);
2139
2140                    next.belt.orientation = Quaternion::rotation_x(move1 * 0.15);
2141                    next.shorts.orientation = Quaternion::rotation_x(move1 * 0.25);
2142
2143                    if !d.is_riding {
2144                        next.foot_l.position =
2145                            Vec3::new(-s_a.foot.0, s_a.foot.1 + move1 * 2.0, s_a.foot.2);
2146                        next.foot_l.orientation = Quaternion::rotation_z(move1 * -0.5);
2147
2148                        next.foot_r.position =
2149                            Vec3::new(s_a.foot.0, s_a.foot.1 + move1 * -2.0, s_a.foot.2);
2150                        next.foot_r.orientation = Quaternion::rotation_x(move1 * -0.5);
2151                    }
2152                }
2153
2154                if let Some(info) = d.ability_info {
2155                    match info.hand {
2156                        Some(HandInfo::MainHand) => {
2157                            next.control_l.position = Vec3::new(1.5, 8.0, 4.0 + move1 * 3.0);
2158                            next.control_l.orientation = Quaternion::rotation_x(0.25)
2159                                * Quaternion::rotation_y(0.0)
2160                                * Quaternion::rotation_z(-1.5);
2161                            next.hand_l.position = Vec3::new(0.0, -2.0, 0.0);
2162                            next.hand_l.orientation = Quaternion::rotation_x(PI / 2.0);
2163
2164                            next.control_r.position = Vec3::new(9.0, -5.0, 0.0);
2165                            next.control_r.orientation =
2166                                Quaternion::rotation_x(-1.75) * Quaternion::rotation_y(0.3);
2167                            next.hand_r.position = Vec3::new(0.0, -0.5, 0.0);
2168                            next.hand_r.orientation = Quaternion::rotation_x(PI / 2.0);
2169                        },
2170                        Some(HandInfo::OffHand) => {
2171                            next.control_r.position = Vec3::new(-1.5, 8.0, 4.0 + move1 * 3.0);
2172                            next.control_r.orientation = Quaternion::rotation_x(0.25)
2173                                * Quaternion::rotation_y(0.0)
2174                                * Quaternion::rotation_z(1.5);
2175                            next.hand_r.position = Vec3::new(0.0, -2.0, 0.0);
2176                            next.hand_r.orientation = Quaternion::rotation_x(PI / 2.0);
2177
2178                            next.control_l.position = Vec3::new(-9.0, -5.0, 0.0);
2179                            next.control_l.orientation =
2180                                Quaternion::rotation_x(-1.75) * Quaternion::rotation_y(-0.3);
2181                            next.hand_l.position = Vec3::new(0.0, -0.5, 0.0);
2182                            next.hand_l.orientation = Quaternion::rotation_x(PI / 2.0);
2183                        },
2184                        Some(HandInfo::TwoHanded) | None => {},
2185                    }
2186                }
2187            },
2188            // ==================================
2189            //            MISCELLANEOUS
2190            // ==================================
2191            Some("common.abilities.pick.swing") => {
2192                next.main.position = Vec3::new(0.0, 0.0, 0.0);
2193                next.main.orientation = Quaternion::rotation_x(0.0);
2194                next.second.position = Vec3::new(0.0, 0.0, 0.0);
2195                next.second.orientation = Quaternion::rotation_z(0.0);
2196                next.torso.position = Vec3::new(0.0, 0.0, 1.1);
2197                next.torso.orientation = Quaternion::rotation_z(0.0);
2198
2199                let move1 = move1base.powf(0.25);
2200                let move3 = move3base.powi(4);
2201                let pullback = 1.0 - move3;
2202                let moveret1 = move1base * pullback;
2203                let moveret2 = move2base * pullback;
2204
2205                next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1);
2206                next.head.orientation = Quaternion::rotation_x(moveret1 * 0.1 + moveret2 * 0.3)
2207                    * Quaternion::rotation_z(move1 * -0.2 + moveret2 * 0.2);
2208                next.chest.position = Vec3::new(0.0, s_a.chest.0, s_a.chest.1 + moveret2 * -2.0);
2209                next.chest.orientation = Quaternion::rotation_x(moveret1 * 0.4 + moveret2 * -0.7)
2210                    * Quaternion::rotation_y(moveret1 * 0.3 + moveret2 * -0.4)
2211                    * Quaternion::rotation_z(moveret1 * 0.5 + moveret2 * -0.5);
2212
2213                next.hand_l.position = Vec3::new(s_a.hhl.0, s_a.hhl.1, s_a.hhl.2 + moveret2 * -7.0);
2214                next.hand_l.orientation = Quaternion::rotation_x(s_a.hhl.3)
2215                    * Quaternion::rotation_y(s_a.hhl.4)
2216                    * Quaternion::rotation_z(s_a.hhl.5);
2217                next.hand_r.position = Vec3::new(s_a.hhr.0, s_a.hhr.1, s_a.hhr.2);
2218                next.hand_r.orientation = Quaternion::rotation_x(s_a.hhr.3)
2219                    * Quaternion::rotation_y(s_a.hhr.4)
2220                    * Quaternion::rotation_z(s_a.hhr.5);
2221
2222                next.control.position = Vec3::new(
2223                    s_a.hc.0 + moveret1 * -13.0 + moveret2 * 3.0,
2224                    s_a.hc.1 + (moveret2 * 5.0),
2225                    s_a.hc.2 + moveret1 * 8.0 + moveret2 * -6.0,
2226                );
2227                next.control.orientation =
2228                    Quaternion::rotation_x(s_a.hc.3 + (moveret1 * 1.5 + moveret2 * -2.55))
2229                        * Quaternion::rotation_y(s_a.hc.4 + moveret1 * PI / 2.0 + moveret2 * 0.5)
2230                        * Quaternion::rotation_z(s_a.hc.5 + (moveret2 * -0.5));
2231
2232                if skeleton.holding_lantern {
2233                    next.hand_r.position =
2234                        Vec3::new(s_a.hand.0, s_a.hand.1 + 5.0, s_a.hand.2 + 12.0);
2235                    next.hand_r.orientation =
2236                        Quaternion::rotation_x(2.25) * Quaternion::rotation_z(0.9);
2237
2238                    next.lantern.position = Vec3::new(-0.5, -0.5, -1.5);
2239                    next.lantern.orientation = next.hand_r.orientation.inverse();
2240                }
2241            },
2242            Some("common.abilities.shovel.dig") => {
2243                next.main.position = Vec3::new(0.0, 0.0, 0.0);
2244                next.main.orientation = Quaternion::rotation_x(0.0);
2245                next.second.position = Vec3::new(0.0, 0.0, 0.0);
2246                next.second.orientation = Quaternion::rotation_z(0.0);
2247                next.torso.position = Vec3::new(0.0, 0.0, 1.1);
2248                next.torso.orientation = Quaternion::rotation_z(0.0);
2249
2250                let move1 = move1base.powf(0.25);
2251                let move3 = move3base.powi(4);
2252                let pullback = 1.0 - move3;
2253                let moveret1 = move1base * pullback;
2254                let moveret2 = move2base * pullback;
2255
2256                next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1);
2257                next.head.orientation = Quaternion::rotation_x(moveret1 * 0.1 + moveret2 * 0.3)
2258                    * Quaternion::rotation_z(move1 * -0.2 + moveret2 * 0.2);
2259                next.chest.position = Vec3::new(0.0, s_a.chest.0, s_a.chest.1 + moveret2 * -2.0);
2260                next.chest.orientation = Quaternion::rotation_x(moveret1 * 0.4 + moveret2 * -0.7)
2261                    * Quaternion::rotation_y(moveret1 * 0.3 + moveret2 * -0.4)
2262                    * Quaternion::rotation_z(moveret1 * 0.5 + moveret2 * -0.5);
2263
2264                next.hand_l.position = Vec3::new(8.0, 6.0, 3.0);
2265                next.hand_l.orientation = Quaternion::rotation_x(PI / 2.0);
2266                next.hand_r.position = Vec3::new(8.0, 6.0, 15.0);
2267                next.hand_r.orientation = Quaternion::rotation_x(PI / 2.0);
2268                next.main.position = Vec3::new(7.5, 7.5, 13.2);
2269                next.main.orientation = Quaternion::rotation_y(PI);
2270
2271                next.control.position = Vec3::new(-11.0 + moveret1 * 8.0, 1.8, 4.0);
2272                next.control.orientation = Quaternion::rotation_x(moveret1 * 0.3 + moveret2 * 0.2)
2273                    * Quaternion::rotation_y(0.8 - moveret1 * 0.7 + moveret2 * 0.7)
2274                    * Quaternion::rotation_z(moveret2 * 0.1 - moveret1 * 0.4);
2275
2276                if skeleton.holding_lantern {
2277                    next.hand_r.position =
2278                        Vec3::new(s_a.hand.0, s_a.hand.1 + 5.0, s_a.hand.2 + 12.0);
2279                    next.hand_r.orientation =
2280                        Quaternion::rotation_x(2.25) * Quaternion::rotation_z(0.9);
2281
2282                    next.lantern.position = Vec3::new(-0.5, -0.5, -1.5);
2283                    next.lantern.orientation = next.hand_r.orientation.inverse();
2284                }
2285            },
2286            _ => {},
2287        }
2288
2289        next
2290    }
2291}