Skip to main content

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        let speed = Vec2::<f32>::from(d.velocity).magnitude();
46        let speednorm = speed / 9.5;
47        let ori: Vec2<f32> = Vec2::from(d.orientation);
48        let last_ori = d.last_ori;
49        let last_ori_xy = Vec2::from(d.last_ori);
50        let tilt = if vek::Vec2::new(ori, last_ori_xy)
51            .map(|o| o.magnitude_squared())
52            .map(|m| m > 0.001 && m.is_finite())
53            .reduce_and()
54            && ori.angle_between(last_ori_xy).is_finite()
55        {
56            ori.angle_between(last_ori_xy).min(0.2)
57                * last_ori_xy.determine_side(Vec2::zero(), ori).signum()
58        } else {
59            0.0
60        } * 1.3;
61
62        // Don't use this for future animations
63        let mut legacy_initialize = || {
64            next.main.position = Vec3::new(0.0, 0.0, 0.0);
65            next.main.orientation = Quaternion::rotation_z(0.0);
66            next.second.position = Vec3::new(0.0, 0.0, 0.0);
67            next.second.orientation = Quaternion::rotation_z(0.0);
68        };
69
70        if matches!(d.stage_section, Some(StageSection::Action)) {
71            next.main_weapon_trail = true;
72            next.off_weapon_trail = true;
73        }
74        let (move1base, chargebase, movementbase, move2base, move3base) = match d.stage_section {
75            Some(StageSection::Buildup) => (anim_time, 0.0, 0.0, 0.0, 0.0),
76            Some(StageSection::Charge) => (1.0, anim_time, 0.0, 0.0, 0.0),
77            Some(StageSection::Movement) => (1.0, 1.0, anim_time, 0.0, 0.0),
78            Some(StageSection::Action) => (1.0, 1.0, 1.0, anim_time, 0.0),
79            Some(StageSection::Recover) => (1.0, 1.0, 1.0, 1.0, anim_time),
80            _ => (0.0, 0.0, 0.0, 0.0, 0.0),
81        };
82        let pullback = 1.0 - move3base;
83        let move1 = move1base * pullback;
84        let move2 = move2base * pullback;
85
86        match d.ability_id {
87            // ==================================
88            //               SWORD
89            // ==================================
90            Some(
91                "common.abilities.sword.basic_guard" | "common.abilities.sword.defensive_guard",
92            ) => {
93                legacy_initialize();
94                let pullback = 1.0 - move3base.powi(4);
95                let move1 = move1base.powf(0.25) * pullback;
96                let move2 = (move2base * 10.0).sin();
97
98                if d.velocity.xy().magnitude_squared() < 0.5_f32.powi(2) {
99                    next.chest.position =
100                        Vec3::new(0.0, s_a.chest.0, s_a.chest.1 + move1 * -1.0 + move2 * 0.2);
101                    next.chest.orientation = Quaternion::rotation_x(move1 * -0.15);
102                    next.head.orientation = Quaternion::rotation_x(move1 * 0.25);
103
104                    next.belt.position =
105                        Vec3::new(0.0, s_a.belt.0 + move1 * 0.5, s_a.belt.1 + move1 * 0.5);
106                    next.shorts.position =
107                        Vec3::new(0.0, s_a.shorts.0 + move1 * 1.3, s_a.shorts.1 + move1 * 1.0);
108
109                    next.belt.orientation = Quaternion::rotation_x(move1 * 0.15);
110                    next.shorts.orientation = Quaternion::rotation_x(move1 * 0.25);
111
112                    if !d.is_riding {
113                        next.foot_l.position =
114                            Vec3::new(-s_a.foot.0, s_a.foot.1 + move1 * 2.0, s_a.foot.2);
115                        next.foot_l.orientation = Quaternion::rotation_z(move1 * -0.5);
116
117                        next.foot_r.position =
118                            Vec3::new(s_a.foot.0, s_a.foot.1 + move1 * -2.0, s_a.foot.2);
119                        next.foot_r.orientation = Quaternion::rotation_x(move1 * -0.5);
120                    }
121                }
122
123                match d.hands {
124                    (Some(Hands::Two), _) => {
125                        next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
126                        next.hand_l.orientation =
127                            Quaternion::rotation_x(s_a.shl.3) * Quaternion::rotation_y(s_a.shl.4);
128                        next.hand_r.position = Vec3::new(
129                            s_a.shr.0 + move1 * -2.0,
130                            s_a.shr.1,
131                            s_a.shr.2 + move1 * 20.0,
132                        );
133                        next.hand_r.orientation = Quaternion::rotation_x(s_a.shr.3)
134                            * Quaternion::rotation_y(s_a.shr.4)
135                            * Quaternion::rotation_z(move1 * 1.5);
136
137                        next.control.position =
138                            Vec3::new(s_a.sc.0 + move1 * -3.0, s_a.sc.1, s_a.sc.2 + move1 * 4.0);
139                        next.control.orientation = Quaternion::rotation_x(s_a.sc.3)
140                            * Quaternion::rotation_y(move1 * 1.1)
141                            * Quaternion::rotation_z(move1 * 1.7);
142                    },
143                    (Some(Hands::One), offhand) => {
144                        next.control_l.position =
145                            Vec3::new(-7.0, 8.0 + move1 * 3.0, 2.0 + move1 * 3.0);
146                        next.control_l.orientation =
147                            Quaternion::rotation_x(-0.3) * Quaternion::rotation_y(move1 * 1.0);
148                        next.hand_l.position = Vec3::new(0.0, -0.5, 0.0);
149                        next.hand_l.orientation = Quaternion::rotation_x(PI / 2.0);
150                        if offhand.is_some() {
151                            next.control_r.position =
152                                Vec3::new(7.0, 8.0 + move1 * 3.0, 2.0 + move1 * 3.0);
153                            next.control_r.orientation =
154                                Quaternion::rotation_x(-0.3) * Quaternion::rotation_y(move1 * -1.0);
155                            next.hand_r.position = Vec3::new(0.0, -0.5, 0.0);
156                            next.hand_r.orientation = Quaternion::rotation_x(PI / 2.0)
157                        } else {
158                            next.hand_r.position = Vec3::new(4.5, 8.0, 5.0);
159                            next.hand_r.orientation =
160                                Quaternion::rotation_x(1.9) * Quaternion::rotation_y(0.5)
161                        }
162                    },
163                    (_, _) => {},
164                }
165            },
166            Some("common.abilities.sword.defensive_deflect") => {
167                legacy_initialize();
168                let move1 = move1base.powi(2);
169                let move2 = (move2base * 20.0).sin();
170                let move3 = move3base.powf(0.5);
171
172                if let Some(ability_info) = d.ability_info {
173                    match ability_info.hand {
174                        Some(HandInfo::TwoHanded) => {
175                            next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
176                            next.hand_l.orientation = Quaternion::rotation_x(s_a.shl.3)
177                                * Quaternion::rotation_y(s_a.shl.4);
178                            next.hand_r.position = Vec3::new(
179                                -s_a.sc.0 + 6.0 + move1 * -12.0,
180                                -4.0 + move1 * 3.0,
181                                -2.0,
182                            );
183                            next.hand_r.orientation = Quaternion::rotation_x(0.9 + move1 * 0.5);
184                            next.control.position = Vec3::new(s_a.sc.0, s_a.sc.1, s_a.sc.2);
185                            next.control.orientation = Quaternion::rotation_x(s_a.sc.3)
186                                * Quaternion::rotation_z(move1 * -0.9);
187
188                            next.chest.orientation = Quaternion::rotation_z(move1 * -0.6);
189                            next.head.orientation = Quaternion::rotation_z(move1 * 0.2);
190                            next.belt.orientation = Quaternion::rotation_z(move1 * -0.1);
191                            next.shorts.orientation = Quaternion::rotation_z(move1 * 0.1);
192                            next.control.orientation.rotate_y(move1 * -1.7);
193                            next.control.orientation.rotate_z(move1 * 0.6);
194                            next.control.position +=
195                                Vec3::new(move1 * 11.0, move1 * 2.0, move1 * 5.0);
196
197                            next.control.orientation.rotate_y(move2 / 50.0);
198
199                            next.chest.orientation.rotate_z(move3 * -0.6);
200                            next.head.orientation.rotate_z(move3 * 0.4);
201                            next.belt.orientation.rotate_z(move3 * 0.2);
202                            next.shorts.orientation.rotate_z(move3 * 0.6);
203                            next.control.position += Vec3::new(move3 * 6.0, 0.0, move3 * 9.0);
204                            next.control.orientation.rotate_z(move3 * -0.5);
205                            next.control.orientation.rotate_y(move3 * 0.6);
206                        },
207                        Some(HandInfo::MainHand) => {
208                            next.control_r.position =
209                                Vec3::new(-s_a.sc.0 + move1, s_a.sc.1 - 7.0, s_a.sc.2);
210                            next.control_r.orientation = Quaternion::rotation_x(s_a.sc.3 - 1.0)
211                                * Quaternion::rotation_y(s_a.sc.4 + move1 * 0.5);
212
213                            next.hand_r.position = Vec3::new(-s_a.shl.0, s_a.shl.1, s_a.shl.2);
214                            next.hand_r.orientation = Quaternion::rotation_x(s_a.shl.3)
215                                * Quaternion::rotation_y(s_a.shl.4);
216
217                            next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
218                            next.hand_l.orientation = Quaternion::rotation_x(s_a.shl.3)
219                                * Quaternion::rotation_y(s_a.shl.4);
220
221                            next.control_l.position = Vec3::new(s_a.sc.0, s_a.sc.1, s_a.sc.2);
222                            next.control_l.orientation = Quaternion::rotation_x(s_a.sc.3)
223                                * Quaternion::rotation_z(move1 * -0.9);
224
225                            next.chest.orientation = Quaternion::rotation_z(move1 * -0.6);
226                            next.head.orientation = Quaternion::rotation_z(move1 * 0.2);
227                            next.belt.orientation = Quaternion::rotation_z(move1 * -0.1);
228                            next.shorts.orientation = Quaternion::rotation_z(move1 * 0.1);
229                            next.control_l.orientation.rotate_y(move1 * -1.7);
230                            next.control_l.orientation.rotate_z(move1 * 0.6);
231                            next.control_l.position +=
232                                Vec3::new(move1 * 11.0, move1 * 2.0, move1 * 5.0);
233
234                            next.control_l.orientation.rotate_y(move2 / 50.0);
235
236                            next.chest.orientation.rotate_z(move3 * -0.6);
237                            next.head.orientation.rotate_z(move3 * 0.4);
238                            next.belt.orientation.rotate_z(move3 * 0.2);
239                            next.shorts.orientation.rotate_z(move3 * 0.6);
240                            next.control_l.position += Vec3::new(move3 * 6.0, 0.0, move3 * 9.0);
241                            next.control_l.orientation.rotate_z(move3 * -0.5);
242                            next.control_l.orientation.rotate_y(move3 * 0.6);
243
244                            next.off_weapon_trail = false;
245
246                            next.do_hold_lantern(
247                                s_a,
248                                anim_time,
249                                anim_time,
250                                speednorm,
251                                0.0,
252                                tilt,
253                                Some(d.last_ori),
254                                Some(*d.look_dir),
255                            );
256                        },
257                        Some(HandInfo::OffHand) => {
258                            next.control_l.position =
259                                Vec3::new(s_a.sc.0 + move1, s_a.sc.1 - 7.0, s_a.sc.2);
260                            next.control_l.orientation = Quaternion::rotation_x(s_a.sc.3 - 1.0)
261                                * Quaternion::rotation_y(s_a.sc.4 + move1 * -0.5);
262
263                            next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
264                            next.hand_l.orientation = Quaternion::rotation_x(s_a.shl.3)
265                                * Quaternion::rotation_y(s_a.shl.4);
266
267                            next.hand_r.position = Vec3::new(-s_a.shl.0, s_a.shl.1, s_a.shl.2);
268                            next.hand_r.orientation = Quaternion::rotation_x(s_a.shl.3)
269                                * Quaternion::rotation_y(s_a.shl.4);
270
271                            next.control_r.position = Vec3::new(-s_a.sc.0, s_a.sc.1, s_a.sc.2);
272                            next.control_r.orientation = Quaternion::rotation_x(s_a.sc.3)
273                                * Quaternion::rotation_z(move1 * 0.9);
274
275                            next.chest.orientation = Quaternion::rotation_z(move1 * 0.6);
276                            next.head.orientation = Quaternion::rotation_z(move1 * -0.2);
277                            next.belt.orientation = Quaternion::rotation_z(move1 * 0.1);
278                            next.shorts.orientation = Quaternion::rotation_z(move1 * -0.1);
279                            next.control_r.orientation.rotate_y(move1 * 1.7);
280                            next.control_r.orientation.rotate_z(move1 * -0.6);
281                            next.control_r.position +=
282                                Vec3::new(move1 * -11.0, move1 * 2.0, move1 * 5.0);
283
284                            next.control_r.orientation.rotate_y(move2 / -50.0);
285
286                            next.chest.orientation.rotate_z(move3 * 0.6);
287                            next.head.orientation.rotate_z(move3 * -0.4);
288                            next.belt.orientation.rotate_z(move3 * -0.2);
289                            next.shorts.orientation.rotate_z(move3 * -0.6);
290                            next.control_r.position += Vec3::new(move3 * -6.0, 0.0, move3 * 9.0);
291                            next.control_r.orientation.rotate_z(move3 * 0.5);
292                            next.control_r.orientation.rotate_y(move3 * -0.6);
293
294                            next.main_weapon_trail = false;
295                        },
296                        _ => {},
297                    }
298                }
299            },
300            Some(
301                "common.abilities.sword.basic_thrust"
302                | "common.abilities.sword.defensive_vital_jab",
303            ) => {
304                legacy_initialize();
305                let pullback = 1.0 - move3base.powi(4);
306                let move1 = chargebase.powf(0.25).min(1.0) * pullback;
307                let move2 = move2base.powi(2) * pullback;
308                let tension = (chargebase * 20.0).sin();
309
310                if let Some(ability_info) = d.ability_info {
311                    match ability_info.hand {
312                        Some(HandInfo::TwoHanded) | Some(HandInfo::MainHand) => {
313                            next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
314                            next.hand_l.orientation = Quaternion::rotation_x(s_a.shl.3)
315                                * Quaternion::rotation_y(s_a.shl.4);
316                            next.hand_r.position =
317                                Vec3::new(-s_a.sc.0 + 6.0 + move1 * -13.2, -4.0 + move1 * 3.3, 1.0);
318                            next.hand_r.orientation = Quaternion::rotation_x(PI * 0.5);
319                            next.chest.position += Vec3::new(0.0, move1 * -0.55, 0.0);
320                            next.control.position =
321                                Vec3::new(s_a.sc.0, s_a.sc.1 + move2 * 3.3, s_a.sc.2 + move2 * 5.5);
322                            next.control.orientation =
323                                Quaternion::rotation_x(s_a.sc.3 + move1 * -0.99)
324                                    * Quaternion::rotation_y(move1 * 1.1 + move2 * -1.1)
325                                    * Quaternion::rotation_z(move1 * 1.43 + move2 * -1.43);
326
327                            next.chest.position += Vec3::new(0.0, move2 * 2.2, 0.0);
328                            next.chest.orientation = Quaternion::rotation_z(
329                                move1 * 1.1 + tension * 0.02 + move2 * -1.32,
330                            );
331                            next.head.position += Vec3::new(0.0, move2 * 1.1, 0.0);
332                            next.head.orientation =
333                                Quaternion::rotation_x(move1 * 0.055 + move2 * -0.055)
334                                    * Quaternion::rotation_y(move1 * 0.055 + move2 * -0.055)
335                                    * Quaternion::rotation_z(move1 * -0.44 + move2 * 0.33);
336                            next.belt.orientation =
337                                Quaternion::rotation_z(move1 * -0.275 + move2 * 0.22);
338                            next.shorts.orientation =
339                                Quaternion::rotation_z(move1 * -0.66 + move2 * 0.33);
340                        },
341                        Some(HandInfo::OffHand) => {
342                            next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
343                            next.hand_l.orientation = Quaternion::rotation_x(s_a.shr.3);
344                            next.control_l.position = Vec3::new(s_a.sc.0, s_a.sc.1, s_a.sc.2);
345                            next.control_l.orientation = Quaternion::rotation_x(s_a.sc.3)
346                                * Quaternion::rotation_y(s_a.sc.4)
347                                * Quaternion::rotation_z(s_a.sc.5);
348
349                            next.hand_r.position = Vec3::new(-s_a.shl.0, s_a.shl.1, s_a.shl.2);
350                            next.hand_r.orientation = Quaternion::rotation_x(s_a.shr.3);
351                            next.control_r.position = Vec3::new(
352                                -s_a.sc.0 + 3.0 + move2 * -6.0,
353                                s_a.sc.1 + move2 * 10.0,
354                                s_a.sc.2,
355                            );
356                            next.control_r.orientation =
357                                Quaternion::rotation_x(s_a.sc.3 + move1 * -1.0)
358                                    * Quaternion::rotation_y(s_a.sc.4 + move1 * -1.0 + move2)
359                                    * Quaternion::rotation_z(s_a.sc.5 - 1.5 + move2 * 1.5);
360
361                            next.chest.position += Vec3::new(0.0, move1 * 0.55, 0.0);
362                            next.chest.position += Vec3::new(0.0, move2 * -2.2, 0.0);
363                            next.chest.orientation = Quaternion::rotation_z(
364                                move1 * -1.1 + tension * -0.02 + move2 * 1.32,
365                            );
366                            next.head.position += Vec3::new(0.0, move2 * -1.1, 0.0);
367                            next.head.orientation =
368                                Quaternion::rotation_x(move1 * -0.055 + move2 * 0.055)
369                                    * Quaternion::rotation_y(move1 * -0.055 + move2 * 0.055)
370                                    * Quaternion::rotation_z(move1 * 0.44 + move2 * -0.33);
371                            next.belt.orientation =
372                                Quaternion::rotation_z(move1 * 0.275 + move2 * -0.22);
373                            next.shorts.orientation =
374                                Quaternion::rotation_z(move1 * 0.66 + move2 * -0.33);
375
376                            next.main_weapon_trail = false;
377                        },
378                        _ => {},
379                    }
380                }
381            },
382            Some("common.abilities.sword.heavy_slam") => {
383                legacy_initialize();
384                let pullback = 1.0 - move3base.powi(4);
385                let move1 = chargebase.powf(0.25).min(1.0) * pullback;
386                let move2 = move2base.powi(2) * pullback;
387                let tension = (chargebase * 20.0).sin();
388
389                if let Some(ability_info) = d.ability_info {
390                    match ability_info.hand {
391                        Some(HandInfo::TwoHanded) | Some(HandInfo::MainHand) => {
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)
394                                * Quaternion::rotation_y(s_a.shl.4);
395                            next.hand_r.position = Vec3::new(
396                                -s_a.sc.0 + 7.0 + move1 * -13.2,
397                                -5.0 + move1 * 3.3,
398                                -1.0,
399                            );
400                            next.chest.position += Vec3::new(0.0, move1 * -0.55, 0.0);
401                            next.control.position = Vec3::new(s_a.sc.0, s_a.sc.1, s_a.sc.2);
402                            next.control.orientation = Quaternion::rotation_x(s_a.sc.3)
403                                * Quaternion::rotation_z(move1 * 0.33 + move2 * -0.77);
404
405                            next.control
406                                .orientation
407                                .rotate_x(move1 * 1.54 + tension / 50.0);
408                            next.control.position += Vec3::new(move1 * -2.2, 0.0, move1 * 9.9)
409                                + Vec3::one() * tension / 4.0;
410                            next.chest.position += Vec3::new(0.0, move2 * 1.65, 0.0);
411                            next.chest.orientation =
412                                Quaternion::rotation_z(move1 * 0.44 + tension / 50.0);
413                            next.head.position += Vec3::new(0.0, move2 * 1.1, 0.0);
414                            next.head.orientation = Quaternion::rotation_x(move2 * -0.22)
415                                * Quaternion::rotation_y(move1 * 0.055 + move2 * 0.055)
416                                * Quaternion::rotation_z(move2 * -0.165);
417                            next.belt.orientation =
418                                Quaternion::rotation_z(move1 * -0.055 + move2 * 0.165);
419                            next.shorts.orientation =
420                                Quaternion::rotation_z(move1 * -0.11 + move2 * 0.22);
421
422                            if move2 < f32::EPSILON {
423                                next.main_weapon_trail = false;
424                                next.off_weapon_trail = false;
425                            }
426                            next.control.orientation.rotate_x(move2 * -3.3);
427                            next.control.orientation.rotate_z(move2 * -0.44);
428                            next.control.position +=
429                                Vec3::new(move2 * 11.0, move2 * 5.5, move2 * -11.0);
430                            next.chest.orientation.rotate_z(move2 * -0.66);
431                        },
432                        Some(HandInfo::OffHand) => {
433                            next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
434                            next.hand_l.orientation = Quaternion::rotation_x(s_a.shl.3)
435                                * Quaternion::rotation_y(s_a.shl.4);
436
437                            next.control_l.position =
438                                Vec3::new(s_a.sc.0 + move1, s_a.sc.1 - 7.0, s_a.sc.2);
439                            next.control_l.orientation = Quaternion::rotation_x(s_a.sc.3 - 1.0)
440                                * Quaternion::rotation_y(s_a.sc.4 + move1 * -0.5);
441
442                            next.hand_r.position = Vec3::new(-s_a.shl.0, s_a.shl.1, s_a.shl.2);
443                            next.hand_r.orientation = Quaternion::rotation_x(s_a.shl.3)
444                                * Quaternion::rotation_y(s_a.shl.4);
445
446                            next.chest.position += Vec3::new(0.0, move1 * -0.55, 0.0);
447                            next.control_r.position = Vec3::new(-s_a.sc.0, s_a.sc.1, s_a.sc.2);
448                            next.control_r.orientation = Quaternion::rotation_x(s_a.sc.3)
449                                * Quaternion::rotation_z(move1 * -0.33 + move2 * 0.77);
450
451                            next.control_r
452                                .orientation
453                                .rotate_x(move1 * 1.54 + tension / 50.0);
454                            next.control_r.position += Vec3::new(move1 * 2.2, 0.0, move1 * 9.9)
455                                + Vec3::one() * tension / 4.0;
456                            next.chest.position += Vec3::new(0.0, move2 * 1.65, 0.0);
457                            next.chest.orientation =
458                                Quaternion::rotation_z(move1 * -0.44 + tension / -50.0);
459                            next.head.position += Vec3::new(0.0, move2 * 1.1, 0.0);
460                            next.head.orientation = Quaternion::rotation_x(move2 * -0.22)
461                                * Quaternion::rotation_y(move1 * -0.055 + move2 * -0.055)
462                                * Quaternion::rotation_z(move2 * 0.165);
463                            next.belt.orientation =
464                                Quaternion::rotation_z(move1 * 0.055 + move2 * -0.165);
465                            next.shorts.orientation =
466                                Quaternion::rotation_z(move1 * 0.11 + move2 * -0.22);
467
468                            if move2 < f32::EPSILON {
469                                next.off_weapon_trail = false;
470                            }
471                            next.control_r.orientation.rotate_x(move2 * -3.3);
472                            next.control_r.orientation.rotate_z(move2 * 0.44);
473                            next.control_r.position +=
474                                Vec3::new(move2 * -11.0, move2 * 5.5, move2 * -11.0);
475                            next.chest.orientation.rotate_z(move2 * 0.66);
476
477                            next.main_weapon_trail = false;
478                        },
479                        _ => {},
480                    }
481                }
482            },
483            Some("common.abilities.sword.crippling_deep_rend") => {
484                legacy_initialize();
485                let pullback = 1.0 - move3base;
486                let move1pre = move1base.min(0.5) * 2.0 * pullback;
487                let move1post = (move1base.max(0.5) * 2.0 - 1.0) * pullback;
488                let move2 = chargebase.min(1.0) * pullback;
489                let move3 = move2base * pullback;
490                let tension = (chargebase * 20.0).sin();
491
492                if let Some(ability_info) = d.ability_info {
493                    match ability_info.hand {
494                        Some(HandInfo::TwoHanded) | Some(HandInfo::MainHand) => {
495                            next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
496                            next.hand_l.orientation = Quaternion::rotation_x(s_a.shl.3)
497                                * Quaternion::rotation_y(s_a.shl.4);
498                            next.hand_r.position =
499                                Vec3::new(-s_a.sc.0 + 3.0 + move1 * -9.0, -4.0 + move1 * 3.0, 0.0);
500                            next.hand_r.orientation = Quaternion::rotation_x(0.9 + move1pre * 0.5);
501                            next.control.position = Vec3::new(s_a.sc.0, s_a.sc.1, s_a.sc.2);
502                            next.control.orientation = Quaternion::rotation_x(s_a.sc.3)
503                                * Quaternion::rotation_z(move1pre * PI / 2.0);
504
505                            next.foot_r.position += Vec3::new(0.0, move1pre * -2.5, 0.0);
506                            next.foot_r.orientation.rotate_z(move1pre * -1.2);
507                            next.chest.position += Vec3::new(0.0, move1pre * -2.0, 0.0);
508                            next.chest.orientation = Quaternion::rotation_z(move1pre * -1.3);
509                            next.head.orientation = Quaternion::rotation_x(move1pre * -0.05)
510                                * Quaternion::rotation_y(move1pre * -0.05)
511                                * Quaternion::rotation_z(move1pre * 0.7);
512                            next.belt.orientation = Quaternion::rotation_z(move1pre * 0.4);
513                            next.shorts.orientation = Quaternion::rotation_z(move1pre * 0.8);
514                            next.control.orientation.rotate_y(move1pre * -1.5);
515                            next.control.orientation.rotate_z(move1pre * 0.0);
516                            next.control.position +=
517                                Vec3::new(move1pre * 9.0, move1pre * -1.5, 0.0);
518
519                            next.chest.position += Vec3::new(0.0, move1post * 2.0, 0.0);
520                            next.chest.orientation.rotate_z(move1post * 1.2);
521                            next.head.position += Vec3::new(0.0, move1post * 1.0, 0.0);
522                            next.head.orientation.rotate_z(move1post * -0.7);
523                            next.belt.orientation.rotate_z(move1post * -0.3);
524                            next.shorts.orientation.rotate_z(move1post * -0.8);
525                            next.foot_r.orientation.rotate_z(move1post * 1.2);
526                            next.foot_r.orientation.rotate_x(move1post * -0.4);
527                            next.control.orientation.rotate_z(move1post * -1.2);
528                            next.control.position +=
529                                Vec3::new(0.0, move1post * 8.0, move1post * 3.0);
530
531                            next.control
532                                .orientation
533                                .rotate_y(move2 * -2.0 + tension / 10.0);
534                            next.chest.orientation.rotate_z(move2 * -0.4 + move3 * -1.4);
535                            next.control
536                                .orientation
537                                .rotate_z(move2 * 0.3 + move3 * -1.3);
538                            next.head.orientation.rotate_z(move2 * 0.2 + move3 * 0.7);
539                            next.belt.orientation.rotate_z(move3 * 0.3);
540                            next.shorts.orientation.rotate_z(move2 * 0.2 + move3 * 0.6);
541                            next.chest
542                                .orientation
543                                .rotate_y(move2 * -0.3 - tension / 100.0);
544                            next.foot_r.orientation.rotate_z(move3 * -1.2);
545                        },
546                        Some(HandInfo::OffHand) => {
547                            next.control_l.position =
548                                Vec3::new(s_a.sc.0 + move1, s_a.sc.1 - 7.0, s_a.sc.2);
549                            next.control_l.orientation = Quaternion::rotation_x(s_a.sc.3 - 1.0)
550                                * Quaternion::rotation_y(s_a.sc.4 + move1 * -0.5);
551
552                            next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
553                            next.hand_l.orientation = Quaternion::rotation_x(s_a.shl.3)
554                                * Quaternion::rotation_y(s_a.shl.4);
555
556                            next.hand_r.position =
557                                Vec3::new(-s_a.sc.0 + 3.0 + move1 * -9.0, -4.0 + move1 * 3.0, 0.0);
558                            next.hand_r.orientation = Quaternion::rotation_x(0.9 + move1pre * 0.5);
559                            next.control_r.position = Vec3::new(s_a.sc.0, s_a.sc.1, s_a.sc.2);
560                            next.control_r.orientation = Quaternion::rotation_x(s_a.sc.3)
561                                * Quaternion::rotation_z(move1pre * PI / 2.0);
562
563                            next.foot_r.position += Vec3::new(0.0, move1pre * -2.5, 0.0);
564                            next.foot_r.orientation.rotate_z(move1pre * -1.2);
565                            next.chest.position += Vec3::new(0.0, move1pre * -2.0, 0.0);
566                            next.chest.orientation = Quaternion::rotation_z(move1pre * -1.3);
567                            next.head.orientation = Quaternion::rotation_x(move1pre * -0.05)
568                                * Quaternion::rotation_y(move1pre * -0.05)
569                                * Quaternion::rotation_z(move1pre * 0.7);
570                            next.belt.orientation = Quaternion::rotation_z(move1pre * 0.4);
571                            next.shorts.orientation = Quaternion::rotation_z(move1pre * 0.8);
572                            next.control_r.orientation.rotate_y(move1pre * -1.5);
573                            next.control_r.orientation.rotate_z(move1pre * 0.0);
574                            next.control_r.position +=
575                                Vec3::new(move1pre * 9.0, move1pre * -1.5, 0.0);
576
577                            next.chest.position += Vec3::new(0.0, move1post * 2.0, 0.0);
578                            next.chest.orientation.rotate_z(move1post * 1.2);
579                            next.head.position += Vec3::new(0.0, move1post * 1.0, 0.0);
580                            next.head.orientation.rotate_z(move1post * -0.7);
581                            next.belt.orientation.rotate_z(move1post * -0.3);
582                            next.shorts.orientation.rotate_z(move1post * -0.8);
583                            next.foot_r.orientation.rotate_z(move1post * 1.2);
584                            next.foot_r.orientation.rotate_x(move1post * -0.4);
585                            next.control_r.orientation.rotate_z(move1post * -1.2);
586                            next.control_r.position +=
587                                Vec3::new(0.0, move1post * 8.0, move1post * 3.0);
588
589                            next.control_r
590                                .orientation
591                                .rotate_y(move2 * -2.0 + tension / 10.0);
592                            next.chest.orientation.rotate_z(move2 * -0.4 + move3 * -1.4);
593                            next.control_r
594                                .orientation
595                                .rotate_z(move2 * 0.3 + move3 * -1.3);
596                            next.head.orientation.rotate_z(move2 * 0.2 + move3 * 0.7);
597                            next.belt.orientation.rotate_z(move3 * 0.3);
598                            next.shorts.orientation.rotate_z(move2 * 0.2 + move3 * 0.6);
599                            next.chest
600                                .orientation
601                                .rotate_y(move2 * -0.3 - tension / 100.0);
602                            next.foot_r.orientation.rotate_z(move3 * -1.2);
603
604                            next.main_weapon_trail = false;
605                        },
606                        _ => {},
607                    }
608                }
609            },
610            Some("common.abilities.sword.cleaving_spiral_slash") => {
611                legacy_initialize();
612                let move1 = chargebase.powf(0.25).min(1.0) * pullback;
613                let move2_pre = move2base.min(0.3) * 10.0 / 3.0 * pullback;
614                let tension = (chargebase * 15.0).sin();
615
616                if let Some(ability_info) = d.ability_info {
617                    match ability_info.hand {
618                        Some(HandInfo::TwoHanded) | Some(HandInfo::MainHand) => {
619                            next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
620                            next.hand_l.orientation = Quaternion::rotation_x(s_a.shl.3)
621                                * Quaternion::rotation_y(s_a.shl.4);
622                            next.hand_r.position = Vec3::new(
623                                -s_a.sc.0 + 6.0 + move1 * -12.0,
624                                -4.0 + move1 * 3.0,
625                                -1.0,
626                            );
627                            next.hand_r.orientation = Quaternion::rotation_x(0.9 + move1 * 0.5);
628                            next.control.position = Vec3::new(s_a.sc.0, s_a.sc.1, s_a.sc.2);
629                            next.control.orientation = Quaternion::rotation_x(s_a.sc.3);
630
631                            next.chest.orientation =
632                                Quaternion::rotation_z(move1 * 1.2 + tension / 70.0);
633                            next.head.orientation = Quaternion::rotation_y(move1 * 0.05)
634                                * Quaternion::rotation_z(move1 * -0.5);
635                            next.belt.orientation = Quaternion::rotation_z(move1 * -0.3);
636                            next.shorts.orientation = Quaternion::rotation_z(move1 * -0.6);
637                            next.control.position += Vec3::new(0.0, move1 * 1.0, move1 * 1.0);
638                            next.control.orientation.rotate_x(move1 * 0.2);
639                            next.control.orientation.rotate_y(move1 * -1.0);
640
641                            next.control.orientation.rotate_y(move2_pre * -1.6);
642                            next.control.position += Vec3::new(0.0, 0.0, move2_pre * 4.0);
643                            next.torso.orientation.rotate_z(move2base * -TAU);
644                            next.chest.orientation.rotate_z(move2 * -2.0);
645                            next.head.orientation.rotate_z(move2 * 1.3);
646                            next.belt.orientation.rotate_z(move2 * 0.6);
647                            next.shorts.orientation.rotate_z(move2 * 1.5);
648                            next.control.orientation.rotate_y(move2 * 1.6);
649                            next.control.orientation.rotate_z(move2 * -1.8);
650                            next.control.position += Vec3::new(move2 * 14.0, 0.0, 0.0);
651                        },
652                        Some(HandInfo::OffHand) => {
653                            next.control_l.position =
654                                Vec3::new(s_a.sc.0 + move1, s_a.sc.1 - 7.0, s_a.sc.2);
655                            next.control_l.orientation = Quaternion::rotation_x(s_a.sc.3 - 1.0)
656                                * Quaternion::rotation_y(s_a.sc.4 + move1 * -0.5);
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 = Quaternion::rotation_x(s_a.shl.3)
660                                * Quaternion::rotation_y(s_a.shl.4);
661
662                            next.hand_r.position = Vec3::new(-s_a.shl.0, s_a.shl.1, s_a.shl.2);
663                            next.hand_r.orientation = Quaternion::rotation_x(s_a.shl.3)
664                                * Quaternion::rotation_y(s_a.shl.4);
665
666                            next.control_r.position = Vec3::new(-s_a.sc.0, s_a.sc.1, s_a.sc.2);
667                            next.control_r.orientation = Quaternion::rotation_x(s_a.sc.3);
668
669                            next.chest.orientation =
670                                Quaternion::rotation_z(move1 * -1.2 + tension / -70.0);
671                            next.head.orientation = Quaternion::rotation_y(move1 * -0.05)
672                                * Quaternion::rotation_z(move1 * 0.5);
673                            next.belt.orientation = Quaternion::rotation_z(move1 * 0.3);
674                            next.shorts.orientation = Quaternion::rotation_z(move1 * 0.6);
675                            next.control_r.position += Vec3::new(0.0, move1 * 1.0, move1 * 1.0);
676                            next.control_r.orientation.rotate_x(move1 * 0.2);
677                            next.control_r.orientation.rotate_y(move1 * 1.0);
678
679                            next.control_r.orientation.rotate_y(move2_pre * 1.6);
680                            next.control_r.position += Vec3::new(0.0, 0.0, move2_pre * 4.0);
681                            next.torso.orientation.rotate_z(move2base * TAU);
682                            next.chest.orientation.rotate_z(move2 * 2.0);
683                            next.head.orientation.rotate_z(move2 * -1.3);
684                            next.belt.orientation.rotate_z(move2 * -0.6);
685                            next.shorts.orientation.rotate_z(move2 * -1.5);
686                            next.control_r.orientation.rotate_y(move2 * -1.6);
687                            next.control_r.orientation.rotate_z(move2 * 1.8);
688                            next.control_r.position += Vec3::new(move2 * -14.0, 0.0, 0.0);
689
690                            next.main_weapon_trail = false;
691                        },
692                        _ => {},
693                    }
694                }
695            },
696            Some("common.abilities.sword.cleaving_dual_spiral_slash") => {
697                legacy_initialize();
698                let move1 = chargebase.powf(0.25).min(1.0) * pullback;
699                let move2_pre = move2base.min(0.3) * 10.0 / 3.0 * pullback;
700                let tension = (chargebase * 15.0).sin();
701
702                next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
703                next.hand_l.orientation =
704                    Quaternion::rotation_x(s_a.shl.3) * Quaternion::rotation_y(s_a.shl.4);
705
706                next.hand_r.position = Vec3::new(-s_a.shl.0, s_a.shl.1, s_a.shl.2);
707                next.hand_r.orientation =
708                    Quaternion::rotation_x(s_a.shl.3) * Quaternion::rotation_y(s_a.shl.4);
709
710                next.control_l.position = Vec3::new(s_a.sc.0, s_a.sc.1, s_a.sc.2);
711                next.control_l.orientation = Quaternion::rotation_x(s_a.sc.3);
712
713                next.control_r.position = Vec3::new(-s_a.sc.0, s_a.sc.1, s_a.sc.2);
714                next.control_r.orientation = Quaternion::rotation_x(s_a.sc.3);
715
716                next.chest.orientation = Quaternion::rotation_z(move1 * 1.2 + tension / 70.0);
717                next.head.orientation =
718                    Quaternion::rotation_y(move1 * 0.05) * Quaternion::rotation_z(move1 * -0.5);
719                next.belt.orientation = Quaternion::rotation_z(move1 * -0.3);
720                next.shorts.orientation = Quaternion::rotation_z(move1 * -0.6);
721                next.control_l.position += Vec3::new(0.0, move1 * 1.0, move1 * 1.0);
722                next.control_l.orientation.rotate_x(move1 * 0.2);
723                next.control_l.orientation.rotate_y(move1 * -1.0);
724
725                next.control_r.position += Vec3::new(0.0, move1 * 1.0, move1 * 1.0);
726                next.control_r.orientation.rotate_x(move1 * 0.2);
727                next.control_r.orientation.rotate_y(move1 * -1.0);
728
729                next.control_l.orientation.rotate_y(move2_pre * -1.6);
730                next.control_l.position += Vec3::new(0.0, 0.0, move2_pre * 4.0);
731
732                next.control_r.orientation.rotate_y(move2_pre * -1.6);
733                next.control_r.position += Vec3::new(0.0, 0.0, move2_pre * 4.0);
734
735                next.torso.orientation.rotate_z(move2base * -TAU);
736                next.chest.orientation.rotate_z(move2 * -2.0);
737                next.head.orientation.rotate_z(move2 * 1.3);
738                next.belt.orientation.rotate_z(move2 * 0.6);
739                next.shorts.orientation.rotate_z(move2 * 1.5);
740
741                next.control_l.orientation.rotate_y(move2 * 1.6);
742                next.control_l.orientation.rotate_z(move2 * -1.8);
743                next.control_l.position += Vec3::new(move2 * 14.0, 0.0, 0.0);
744
745                next.control_r.orientation.rotate_y(move2 * 1.6);
746                next.control_r.orientation.rotate_z(move2 * -1.8);
747                next.control_r.position += Vec3::new(move2 * 14.0, 0.0, 0.0);
748            },
749            Some("common.abilities.sword.cleaving_earth_splitter") => {
750                legacy_initialize();
751
752                let pullback = 1.0 - move3base.powi(4);
753                let move1 = movementbase.min(1.0).powi(2) * pullback;
754                let move1alt = movementbase.min(1.0).powf(0.5);
755                let move2 = move2base;
756                let move3 = move2base.powf(0.25) * pullback;
757
758                if let Some(ability_info) = d.ability_info {
759                    match ability_info.hand {
760                        Some(HandInfo::TwoHanded) => {
761                            next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
762                            next.hand_l.orientation = Quaternion::rotation_x(s_a.shl.3)
763                                * Quaternion::rotation_y(s_a.shl.4);
764                            next.hand_r.position = Vec3::new(
765                                -s_a.sc.0 + 6.0 + move1 * -12.0,
766                                -4.0 + move1 * 3.0,
767                                -2.0,
768                            );
769                            next.hand_r.orientation = Quaternion::rotation_x(0.9 + move1 * 0.5);
770                            next.control.position = Vec3::new(s_a.sc.0, s_a.sc.1, s_a.sc.2);
771                            next.control.orientation = Quaternion::rotation_x(s_a.sc.3);
772                            next.torso.orientation.rotate_x(move1alt * -TAU);
773
774                            next.torso.orientation.rotate_x(move1 * -0.8);
775                            next.control.orientation.rotate_x(move1 * 1.5);
776                            next.control.position +=
777                                Vec3::new(move1 * 7.0, move1.powi(4) * -6.0, move1 * 20.0);
778
779                            next.torso.orientation.rotate_x(move2 * 0.8);
780                            next.chest.orientation = Quaternion::rotation_x(move2 * -0.4);
781                            next.control.orientation.rotate_x(move2 * -1.2);
782                            next.control.position += Vec3::new(0.0, move2 * 12.0, move2 * -8.0);
783
784                            next.control.orientation.rotate_x(move3 * -1.2);
785                            next.control.position += Vec3::new(0.0, move3 * 4.0, move3 * -8.0);
786                        },
787                        Some(HandInfo::MainHand) => {
788                            next.control_r.position =
789                                Vec3::new(-s_a.sc.0 + move1, s_a.sc.1 - 7.0, s_a.sc.2);
790                            next.control_r.orientation = Quaternion::rotation_x(s_a.sc.3 - 1.0)
791                                * Quaternion::rotation_y(s_a.sc.4 + move1 * 0.5);
792
793                            next.hand_r.position = Vec3::new(-s_a.shl.0, s_a.shl.1, s_a.shl.2);
794                            next.hand_r.orientation = Quaternion::rotation_x(s_a.shl.3)
795                                * Quaternion::rotation_y(s_a.shl.4);
796
797                            next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
798                            next.hand_l.orientation = Quaternion::rotation_x(s_a.shl.3)
799                                * Quaternion::rotation_y(s_a.shl.4);
800                            next.control_l.position = Vec3::new(s_a.sc.0, s_a.sc.1, s_a.sc.2);
801                            next.control_l.orientation = Quaternion::rotation_x(s_a.sc.3);
802                            next.torso.orientation.rotate_x(move1alt * -TAU);
803
804                            next.torso.orientation.rotate_x(move1 * -0.8);
805                            next.control_l.orientation.rotate_x(move1 * 1.5);
806                            next.control_l.position +=
807                                Vec3::new(move1 * 7.0, move1.powi(4) * -6.0, move1 * 20.0);
808
809                            next.torso.orientation.rotate_x(move2 * 0.8);
810                            next.chest.orientation = Quaternion::rotation_x(move2 * -0.4);
811                            next.control_l.orientation.rotate_x(move2 * -1.2);
812                            next.control_l.position += Vec3::new(0.0, move2 * 12.0, move2 * -8.0);
813
814                            next.control_l.orientation.rotate_x(move3 * -1.2);
815                            next.control_l.position += Vec3::new(0.0, move3 * 4.0, move3 * -8.0);
816
817                            next.off_weapon_trail = false;
818
819                            next.do_hold_lantern(
820                                s_a,
821                                anim_time,
822                                anim_time,
823                                speednorm,
824                                0.0,
825                                tilt,
826                                Some(d.last_ori),
827                                Some(*d.look_dir),
828                            );
829                        },
830                        Some(HandInfo::OffHand) => {
831                            next.control_l.position =
832                                Vec3::new(s_a.sc.0 + move1, s_a.sc.1 - 7.0, s_a.sc.2);
833                            next.control_l.orientation = Quaternion::rotation_x(s_a.sc.3 - 1.0)
834                                * Quaternion::rotation_y(s_a.sc.4 + move1 * -0.5);
835
836                            next.hand_l.position = Vec3::new(-s_a.shl.0, s_a.shl.1, s_a.shl.2);
837                            next.hand_l.orientation = Quaternion::rotation_x(s_a.shl.3)
838                                * Quaternion::rotation_y(s_a.shl.4);
839
840                            next.hand_r.position = Vec3::new(-s_a.shl.0, s_a.shl.1, s_a.shl.2);
841                            next.hand_r.orientation = Quaternion::rotation_x(s_a.shl.3)
842                                * Quaternion::rotation_y(s_a.shl.4);
843                            next.control_r.position = Vec3::new(-s_a.sc.0, s_a.sc.1, s_a.sc.2);
844                            next.control_r.orientation = Quaternion::rotation_x(s_a.sc.3);
845                            next.torso.orientation.rotate_x(move1alt * -TAU);
846
847                            next.torso.orientation.rotate_x(move1 * -0.8);
848                            next.control_r.orientation.rotate_x(move1 * 1.5);
849                            next.control_r.position +=
850                                Vec3::new(move1 * -7.0, move1.powi(4) * -6.0, move1 * 20.0);
851
852                            next.torso.orientation.rotate_x(move2 * 0.8);
853                            next.chest.orientation = Quaternion::rotation_x(move2 * -0.4);
854                            next.control_r.orientation.rotate_x(move2 * -1.2);
855                            next.control_r.position += Vec3::new(0.0, move2 * 12.0, move2 * -8.0);
856
857                            next.control_r.orientation.rotate_x(move3 * -1.2);
858                            next.control_r.position += Vec3::new(0.0, move3 * 4.0, move3 * -8.0);
859
860                            next.main_weapon_trail = false;
861                        },
862                        _ => {},
863                    }
864                }
865            },
866            Some("common.abilities.sword.heavy_pillar_thrust") => {
867                legacy_initialize();
868                let pullback = 1.0 - move3base.powi(4);
869                let move1 = move1base.powf(0.5) * pullback;
870                let move1alt1 = move1base.powf(0.5).min(0.5) * 2.0 * pullback;
871                let move1alt2 = (move1base.powf(0.5).max(0.5) - 0.5) * 2.0 * pullback;
872                let move2 = move2base.powi(2) * pullback;
873
874                if let Some(ability_info) = d.ability_info {
875                    match ability_info.hand {
876                        Some(HandInfo::TwoHanded) => {
877                            next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
878                            next.hand_l.orientation =
879                                Quaternion::rotation_x(s_a.shl.3 + move1alt2 * PI)
880                                    * Quaternion::rotation_y(s_a.shl.4);
881                            next.hand_r.position = Vec3::new(
882                                -s_a.sc.0 + 6.0 + move1alt1 * -12.0,
883                                -4.0 + move1alt1 * 3.0,
884                                -2.0,
885                            );
886                            next.hand_r.orientation =
887                                Quaternion::rotation_x(0.9 + move1 * 0.5 + move1alt1 * PI);
888                            next.control.position = Vec3::new(s_a.sc.0, s_a.sc.1, s_a.sc.2);
889                            next.control.orientation = Quaternion::rotation_x(s_a.sc.3);
890
891                            next.control.position += Vec3::new(
892                                move1 * 6.0,
893                                (1.0 - (move1 - 0.5).abs() * 2.0) * 3.0,
894                                move1 * 22.0,
895                            );
896                            next.control.orientation.rotate_x(move1 * -1.5);
897
898                            next.chest.orientation = Quaternion::rotation_x(move2 * -0.4);
899                            next.head.orientation = Quaternion::rotation_x(move2 * 0.2);
900                            next.belt.orientation = Quaternion::rotation_x(move2 * 0.4);
901                            next.shorts.orientation = Quaternion::rotation_x(move2 * 0.8);
902                            next.control.orientation.rotate_x(move2 * -0.4);
903                            next.control.position += Vec3::new(0.0, 0.0, move2 * -10.0);
904                            next.belt.position += Vec3::new(0.0, move2 * 2.0, move2 * 0.0);
905                            next.shorts.position += Vec3::new(0.0, move2 * 4.0, move2 * 1.0);
906                            next.chest.position += Vec3::new(0.0, move2 * -2.5, 0.0);
907                        },
908                        Some(HandInfo::MainHand) => {
909                            next.hand_r.position = Vec3::new(-s_a.shl.0, s_a.shl.1, s_a.shl.2);
910                            next.hand_r.orientation = Quaternion::rotation_x(s_a.shl.3)
911                                * Quaternion::rotation_y(s_a.shl.4);
912
913                            next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
914                            next.hand_l.orientation =
915                                Quaternion::rotation_x(s_a.shl.3 + move1alt2 * PI)
916                                    * Quaternion::rotation_y(s_a.shl.4);
917                            next.control_l.position = Vec3::new(s_a.sc.0, s_a.sc.1, s_a.sc.2);
918                            next.control_r.position = Vec3::new(-s_a.sc.0, s_a.sc.1, s_a.sc.2);
919                            next.control_l.orientation = Quaternion::rotation_x(s_a.sc.3);
920                            next.control_r.orientation = Quaternion::rotation_x(s_a.sc.3);
921
922                            next.control_l.position += Vec3::new(
923                                move1 * 6.0,
924                                (1.0 - (move1 - 0.5).abs() * 2.0) * 3.0,
925                                move1 * 22.0,
926                            );
927                            next.control_r.position += Vec3::new(
928                                move1 * -7.0,
929                                (1.0 - (move1 - 0.5).abs() * 2.0) * 4.0,
930                                move1 * 24.0,
931                            );
932                            next.control_l.orientation.rotate_x(move1 * -1.5);
933                            next.control_r.orientation.rotate_x(move1 * -0.75);
934                            next.control_r.orientation.rotate_y(move1 * -2.5);
935                            next.control_r.orientation.rotate_z(move1 * 1.5);
936
937                            next.chest.orientation = Quaternion::rotation_x(move2 * -0.4);
938                            next.head.orientation = Quaternion::rotation_x(move2 * 0.2);
939                            next.belt.orientation = Quaternion::rotation_x(move2 * 0.4);
940                            next.shorts.orientation = Quaternion::rotation_x(move2 * 0.8);
941                            next.control_l.orientation.rotate_x(move2 * -0.4);
942                            next.control_r.orientation.rotate_x(move2 * -0.4);
943                            next.control_l.position += Vec3::new(0.0, 0.0, move2 * -10.0);
944                            next.control_r.position += Vec3::new(0.0, 0.0, move2 * -10.0);
945                            next.belt.position += Vec3::new(0.0, move2 * 2.0, move2 * 0.0);
946                            next.shorts.position += Vec3::new(0.0, move2 * 4.0, move2 * 1.0);
947                            next.chest.position += Vec3::new(0.0, move2 * -2.5, 0.0);
948
949                            next.off_weapon_trail = false;
950
951                            next.do_hold_lantern(
952                                s_a,
953                                anim_time,
954                                anim_time,
955                                speednorm,
956                                0.0,
957                                tilt,
958                                Some(d.last_ori),
959                                Some(*d.look_dir),
960                            );
961                        },
962                        Some(HandInfo::OffHand) => {
963                            next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
964                            next.hand_l.orientation = Quaternion::rotation_x(s_a.shl.3)
965                                * Quaternion::rotation_y(s_a.shl.4);
966
967                            next.hand_r.position = Vec3::new(-s_a.shl.0, s_a.shl.1, s_a.shl.2);
968                            next.hand_r.orientation =
969                                Quaternion::rotation_x(s_a.shl.3 + move1alt2 * PI)
970                                    * Quaternion::rotation_y(s_a.shl.4);
971
972                            next.control_r.position = Vec3::new(-s_a.sc.0, s_a.sc.1, s_a.sc.2);
973                            next.control_l.position = Vec3::new(s_a.sc.0, s_a.sc.1, s_a.sc.2);
974                            next.control_r.orientation = Quaternion::rotation_x(s_a.sc.3);
975                            next.control_l.orientation = Quaternion::rotation_x(s_a.sc.3);
976
977                            next.control_r.position += Vec3::new(
978                                move1 * -6.0,
979                                (1.0 - (move1 - 0.5).abs() * 2.0) * 3.0,
980                                move1 * 22.0,
981                            );
982                            next.control_l.position += Vec3::new(
983                                move1 * 7.0,
984                                (1.0 - (move1 - 0.5).abs() * 2.0) * 4.0,
985                                move1 * 24.0,
986                            );
987                            next.control_r.orientation.rotate_x(move1 * -1.5);
988                            next.control_l.orientation.rotate_x(move1 * -0.75);
989                            next.control_l.orientation.rotate_y(move1 * 2.5);
990                            next.control_l.orientation.rotate_z(move1 * -1.5);
991
992                            next.chest.orientation = Quaternion::rotation_x(move2 * -0.4);
993                            next.head.orientation = Quaternion::rotation_x(move2 * 0.2);
994                            next.belt.orientation = Quaternion::rotation_x(move2 * 0.4);
995                            next.shorts.orientation = Quaternion::rotation_x(move2 * 0.8);
996                            next.control_r.orientation.rotate_x(move2 * -0.4);
997                            next.control_l.orientation.rotate_x(move2 * -0.4);
998                            next.control_r.position += Vec3::new(0.0, 0.0, move2 * -10.0);
999                            next.control_l.position += Vec3::new(0.0, 0.0, move2 * -10.0);
1000                            next.belt.position += Vec3::new(0.0, move2 * 2.0, move2 * 0.0);
1001                            next.shorts.position += Vec3::new(0.0, move2 * 4.0, move2 * 1.0);
1002                            next.chest.position += Vec3::new(0.0, move2 * -2.5, 0.0);
1003
1004                            next.main_weapon_trail = false;
1005                        },
1006                        _ => {},
1007                    }
1008                }
1009            },
1010            Some("common.abilities.sword.basic_mighty_strike")
1011            | Some("common.abilities.sword.heavy_guillotine") => {
1012                legacy_initialize();
1013                let pullback = 1.0 - move3base.powi(4);
1014                let move1 = move1base.powf(0.25) * pullback;
1015                let move2 = move2base.powf(0.1) * pullback;
1016
1017                if let Some(ability_info) = d.ability_info {
1018                    match ability_info.hand {
1019                        Some(HandInfo::TwoHanded) => {
1020                            next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
1021                            next.hand_l.orientation = Quaternion::rotation_x(s_a.shl.3)
1022                                * Quaternion::rotation_y(s_a.shl.4);
1023                            next.hand_r.position = Vec3::new(
1024                                -s_a.sc.0 + 6.0 + move1 * -12.0,
1025                                -4.0 + move1 * 3.0,
1026                                -2.0,
1027                            );
1028                            next.hand_r.orientation = Quaternion::rotation_x(0.9 + move1 * 0.5);
1029                            next.control.position = Vec3::new(
1030                                s_a.sc.0 + move1 * -2.0 + move2 * 14.0,
1031                                s_a.sc.1 + move2 * 4.0,
1032                                s_a.sc.2 + move1 * 10.0 - move2 * 12.0,
1033                            );
1034                            next.control.orientation =
1035                                Quaternion::rotation_x(s_a.sc.3 + move1 * 1.6 + move2 * -2.6)
1036                                    * Quaternion::rotation_y(move1 * -0.4 + move2 * 0.6)
1037                                    * Quaternion::rotation_z(move1 * -0.2 + move2 * -0.2);
1038
1039                            next.chest.position += Vec3::new(0.0, move1 * -1.0 + move2 * 2.0, 0.0);
1040                            next.chest.orientation =
1041                                Quaternion::rotation_z(move1 * 1.0 + move2 * -1.2);
1042                            next.head.position += Vec3::new(0.0, move2 * 1.0, 0.0);
1043                            next.head.orientation =
1044                                Quaternion::rotation_x(move1 * 0.05 + move2 * -0.25)
1045                                    * Quaternion::rotation_y(move1 * -0.05 + move2 * 0.05)
1046                                    * Quaternion::rotation_z(move1 * -0.5 + move2 * 0.4);
1047                            next.belt.orientation =
1048                                Quaternion::rotation_z(move1 * -0.25 + move2 * 0.2);
1049                            next.shorts.orientation =
1050                                Quaternion::rotation_z(move1 * -0.5 + move2 * 0.4);
1051                        },
1052                        Some(HandInfo::MainHand) => {
1053                            next.hand_r.position = Vec3::new(-s_a.shl.0, s_a.shl.1, s_a.shl.2);
1054                            next.hand_r.orientation = Quaternion::rotation_x(s_a.shl.3)
1055                                * Quaternion::rotation_y(s_a.shl.4);
1056
1057                            next.control_r.position =
1058                                Vec3::new(-s_a.sc.0 + move1, s_a.sc.1 - 7.0, s_a.sc.2);
1059                            next.control_r.orientation = Quaternion::rotation_x(s_a.sc.3 - 1.0)
1060                                * Quaternion::rotation_y(s_a.sc.4 + move1 * 0.5);
1061
1062                            next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
1063                            next.hand_l.orientation = Quaternion::rotation_x(s_a.shl.3)
1064                                * Quaternion::rotation_y(s_a.shl.4);
1065
1066                            next.control_l.position = Vec3::new(
1067                                s_a.sc.0 + move1 * -2.0 + move2 * 14.0,
1068                                s_a.sc.1 + move2 * 4.0,
1069                                s_a.sc.2 + move1 * 10.0 - move2 * 12.0,
1070                            );
1071                            next.control_l.orientation =
1072                                Quaternion::rotation_x(s_a.sc.3 + move1 * 1.6 + move2 * -2.6)
1073                                    * Quaternion::rotation_y(move1 * -0.4 + move2 * 0.6)
1074                                    * Quaternion::rotation_z(move1 * -0.2 + move2 * -0.2);
1075
1076                            next.chest.position += Vec3::new(0.0, move1 * -1.0 + move2 * 2.0, 0.0);
1077                            next.chest.orientation =
1078                                Quaternion::rotation_z(move1 * 1.0 + move2 * -1.2);
1079                            next.head.position += Vec3::new(0.0, move2 * 1.0, 0.0);
1080                            next.head.orientation =
1081                                Quaternion::rotation_x(move1 * 0.05 + move2 * -0.25)
1082                                    * Quaternion::rotation_y(move1 * -0.05 + move2 * 0.05)
1083                                    * Quaternion::rotation_z(move1 * -0.5 + move2 * 0.4);
1084                            next.belt.orientation =
1085                                Quaternion::rotation_z(move1 * -0.25 + move2 * 0.2);
1086                            next.shorts.orientation =
1087                                Quaternion::rotation_z(move1 * -0.5 + move2 * 0.4);
1088                        },
1089                        Some(HandInfo::OffHand) => {
1090                            next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
1091                            next.hand_l.orientation = Quaternion::rotation_x(s_a.shl.3)
1092                                * Quaternion::rotation_y(s_a.shl.4);
1093
1094                            next.control_l.position =
1095                                Vec3::new(s_a.sc.0 + move1, s_a.sc.1 - 7.0, s_a.sc.2);
1096                            next.control_l.orientation = Quaternion::rotation_x(s_a.sc.3 - 1.0)
1097                                * Quaternion::rotation_y(s_a.sc.4 + move1 * -0.5);
1098
1099                            next.hand_r.position = Vec3::new(-s_a.shl.0, s_a.shl.1, s_a.shl.2);
1100                            next.hand_r.orientation = Quaternion::rotation_x(s_a.shl.3)
1101                                * Quaternion::rotation_y(s_a.shl.4);
1102
1103                            next.control_r.position = Vec3::new(
1104                                -s_a.sc.0 + move1 * 2.0 + move2 * -14.0,
1105                                s_a.sc.1 + move2 * 4.0,
1106                                s_a.sc.2 + move1 * 10.0 - move2 * 12.0,
1107                            );
1108                            next.control_r.orientation =
1109                                Quaternion::rotation_x(s_a.sc.3 + move1 * 1.6 + move2 * -2.6)
1110                                    * Quaternion::rotation_y(move1 * 0.4 + move2 * -0.6)
1111                                    * Quaternion::rotation_z(move1 * 0.2 + move2 * 0.2);
1112
1113                            next.chest.position += Vec3::new(0.0, move1 * -1.0 + move2 * 2.0, 0.0);
1114                            next.chest.orientation =
1115                                Quaternion::rotation_z(move1 * -1.0 + move2 * 1.2);
1116                            next.head.position += Vec3::new(0.0, move2 * 1.0, 0.0);
1117                            next.head.orientation =
1118                                Quaternion::rotation_x(move1 * 0.05 + move2 * -0.25)
1119                                    * Quaternion::rotation_y(move1 * 0.05 + move2 * -0.05)
1120                                    * Quaternion::rotation_z(move1 * 0.5 + move2 * -0.4);
1121                            next.belt.orientation =
1122                                Quaternion::rotation_z(move1 * 0.25 + move2 * -0.2);
1123                            next.shorts.orientation =
1124                                Quaternion::rotation_z(move1 * 0.5 + move2 * -0.4);
1125                        },
1126                        _ => {},
1127                    }
1128                }
1129            },
1130            Some("common.abilities.sword.defensive_counter") => {
1131                legacy_initialize();
1132                let pullback = 1.0 - move3base.powi(4);
1133                let move1 = move1base.powf(0.5) * pullback;
1134                let move2 = (move2base.min(2.0 / 3.0) * 1.5).powi(2) * pullback;
1135
1136                if let Some(ability_info) = d.ability_info {
1137                    match ability_info.hand {
1138                        Some(HandInfo::TwoHanded) => {
1139                            next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
1140                            next.hand_l.orientation = Quaternion::rotation_x(s_a.shl.3)
1141                                * Quaternion::rotation_y(s_a.shl.4);
1142                            next.hand_r.position = Vec3::new(
1143                                -s_a.sc.0 + 6.0 + move1 * -12.0,
1144                                -4.0 + move1 * 3.0,
1145                                -2.0,
1146                            );
1147                            next.hand_r.orientation = Quaternion::rotation_x(0.9 + move1 * 0.5);
1148                            next.control.position = Vec3::new(s_a.sc.0, s_a.sc.1, s_a.sc.2);
1149                            next.control.orientation = Quaternion::rotation_x(s_a.sc.3)
1150                                * Quaternion::rotation_z(move2 * -PI / 4.0);
1151
1152                            next.foot_l.position +=
1153                                Vec3::new(0.0, move1 * 4.0, 1.0 - (move1 - 0.5) * 2.0);
1154                            next.torso.position += Vec3::new(0.0, move1 * -2.0, 0.0);
1155                            next.chest.position += Vec3::new(0.0, move1 * 2.0, move1 * -3.0);
1156                            next.head.position += Vec3::new(0.0, move1 * 1.0, 0.0);
1157                            next.shorts.orientation = Quaternion::rotation_x(move1 * 0.3);
1158                            next.shorts.position += Vec3::new(0.0, move1 * 1.5, 0.0);
1159                            next.control.orientation.rotate_y(move1 * -1.5);
1160                            next.control.orientation.rotate_z(move1 * 0.8);
1161
1162                            next.chest.orientation = Quaternion::rotation_z(move2 * -0.8);
1163                            next.head.orientation = Quaternion::rotation_x(move2 * 0.05)
1164                                * Quaternion::rotation_z(move2 * 0.35);
1165                            next.shorts.orientation.rotate_z(move2 * 0.5);
1166                            next.belt.orientation = Quaternion::rotation_z(move2 * 0.3);
1167                            next.control.orientation.rotate_z(move2 * -1.8);
1168                            next.control.orientation.rotate_x(move2 * 0.3);
1169                            next.control.position +=
1170                                Vec3::new(move2 * 7.0, move2 * 7.0, move2 * 6.0);
1171                        },
1172                        Some(HandInfo::MainHand) => {
1173                            next.hand_r.position = Vec3::new(-s_a.shl.0, s_a.shl.1, s_a.shl.2);
1174                            next.hand_r.orientation = Quaternion::rotation_x(s_a.shl.3)
1175                                * Quaternion::rotation_y(s_a.shl.4);
1176
1177                            next.control_r.position =
1178                                Vec3::new(-s_a.sc.0 + move1, s_a.sc.1 - 7.0, s_a.sc.2);
1179                            next.control_r.orientation = Quaternion::rotation_x(s_a.sc.3 - 1.0)
1180                                * Quaternion::rotation_y(s_a.sc.4 + move1 * 0.5);
1181
1182                            next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
1183                            next.hand_l.orientation = Quaternion::rotation_x(s_a.shl.3)
1184                                * Quaternion::rotation_y(s_a.shl.4);
1185
1186                            next.control_l.position = Vec3::new(s_a.sc.0, s_a.sc.1, s_a.sc.2);
1187                            next.control_l.orientation = Quaternion::rotation_x(s_a.sc.3)
1188                                * Quaternion::rotation_z(move2 * -PI / 4.0);
1189
1190                            next.foot_l.position +=
1191                                Vec3::new(0.0, move1 * 4.0, 1.0 - (move1 - 0.5) * 2.0);
1192                            next.torso.position += Vec3::new(0.0, move1 * -2.0, 0.0);
1193                            next.chest.position += Vec3::new(0.0, move1 * 2.0, move1 * -3.0);
1194                            next.head.position += Vec3::new(0.0, move1 * 1.0, 0.0);
1195                            next.shorts.orientation = Quaternion::rotation_x(move1 * 0.3);
1196                            next.shorts.position += Vec3::new(0.0, move1 * 1.5, 0.0);
1197                            next.control_l.orientation.rotate_y(move1 * -1.5);
1198                            next.control_l.orientation.rotate_z(move1 * 0.8);
1199
1200                            next.chest.orientation = Quaternion::rotation_z(move2 * -0.8);
1201                            next.head.orientation = Quaternion::rotation_x(move2 * 0.05)
1202                                * Quaternion::rotation_z(move2 * 0.35);
1203                            next.shorts.orientation.rotate_z(move2 * 0.5);
1204                            next.belt.orientation = Quaternion::rotation_z(move2 * 0.3);
1205                            next.control_l.orientation.rotate_z(move2 * -1.8);
1206                            next.control_l.orientation.rotate_x(move2 * 0.3);
1207                            next.control_l.position +=
1208                                Vec3::new(move2 * 7.0, move2 * 7.0, move2 * 6.0);
1209
1210                            next.off_weapon_trail = false;
1211
1212                            next.do_hold_lantern(
1213                                s_a,
1214                                anim_time,
1215                                anim_time,
1216                                speednorm,
1217                                0.0,
1218                                tilt,
1219                                Some(d.last_ori),
1220                                Some(*d.look_dir),
1221                            );
1222                        },
1223                        Some(HandInfo::OffHand) => {
1224                            next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
1225                            next.hand_l.orientation = Quaternion::rotation_x(s_a.shl.3)
1226                                * Quaternion::rotation_y(s_a.shl.4);
1227
1228                            next.control_l.position =
1229                                Vec3::new(s_a.sc.0 + move1, s_a.sc.1 - 7.0, s_a.sc.2);
1230                            next.control_l.orientation = Quaternion::rotation_x(s_a.sc.3 - 1.0)
1231                                * Quaternion::rotation_y(s_a.sc.4 + move1 * -0.5);
1232
1233                            next.hand_r.position = Vec3::new(-s_a.shl.0, s_a.shl.1, s_a.shl.2);
1234                            next.hand_r.orientation = Quaternion::rotation_x(s_a.shl.3)
1235                                * Quaternion::rotation_y(s_a.shl.4);
1236
1237                            next.control_r.position = Vec3::new(-s_a.sc.0, s_a.sc.1, s_a.sc.2);
1238                            next.control_r.orientation = Quaternion::rotation_x(s_a.sc.3)
1239                                * Quaternion::rotation_z(move2 * PI / 4.0);
1240
1241                            next.foot_r.position +=
1242                                Vec3::new(0.0, move1 * 4.0, 1.0 - (move1 - 0.5) * 2.0);
1243                            next.torso.position += Vec3::new(0.0, move1 * -2.0, 0.0);
1244                            next.chest.position += Vec3::new(0.0, move1 * 2.0, move1 * -3.0);
1245                            next.head.position += Vec3::new(0.0, move1 * 1.0, 0.0);
1246                            next.shorts.orientation = Quaternion::rotation_x(move1 * 0.3);
1247                            next.shorts.position += Vec3::new(0.0, move1 * 1.5, 0.0);
1248                            next.control_r.orientation.rotate_y(move1 * 1.5);
1249                            next.control_r.orientation.rotate_z(move1 * -0.8);
1250
1251                            next.chest.orientation = Quaternion::rotation_z(move2 * 0.8);
1252                            next.head.orientation = Quaternion::rotation_x(move2 * 0.05)
1253                                * Quaternion::rotation_z(move2 * -0.35);
1254                            next.shorts.orientation.rotate_z(move2 * -0.5);
1255                            next.belt.orientation = Quaternion::rotation_z(move2 * -0.3);
1256                            next.control_r.orientation.rotate_z(move2 * 1.8);
1257                            next.control_r.orientation.rotate_x(move2 * 0.3);
1258                            next.control_r.position +=
1259                                Vec3::new(move2 * -7.0, move2 * 7.0, move2 * 6.0);
1260
1261                            next.main_weapon_trail = false;
1262                        },
1263                        _ => {},
1264                    }
1265                }
1266            },
1267            Some("common.abilities.sword.defensive_riposte") => {
1268                legacy_initialize();
1269                let pullback = 1.0 - move3base.powi(4);
1270                let move1 = move1base.powf(0.25) * pullback;
1271                let move2_slow = move2base.powi(8) * pullback;
1272                let move2 = move2base.powi(2) * pullback;
1273
1274                if let Some(ability_info) = d.ability_info {
1275                    match ability_info.hand {
1276                        Some(HandInfo::TwoHanded) => {
1277                            next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
1278                            next.hand_l.orientation = Quaternion::rotation_x(s_a.shl.3)
1279                                * Quaternion::rotation_y(s_a.shl.4);
1280                            next.hand_r.position = Vec3::new(
1281                                -s_a.sc.0 + 6.0 + move1 * -12.0,
1282                                -4.0 + move1 * 3.0,
1283                                -2.0,
1284                            );
1285                            next.hand_r.orientation = Quaternion::rotation_x(0.9 + move1 * 0.5);
1286                            next.control.position = Vec3::new(s_a.sc.0, s_a.sc.1, s_a.sc.2);
1287                            next.control.orientation = Quaternion::rotation_x(s_a.sc.3)
1288                                * Quaternion::rotation_z(move1 * 1.3 + move2 * -0.7);
1289
1290                            next.chest.position += Vec3::new(0.0, move1 * -1.0, 0.0);
1291                            next.chest.orientation = Quaternion::rotation_z(move1 * 0.8);
1292                            next.head.orientation = Quaternion::rotation_x(move1 * 0.05)
1293                                * Quaternion::rotation_y(move1 * 0.05)
1294                                * Quaternion::rotation_z(move1 * -0.4);
1295                            next.belt.orientation = Quaternion::rotation_z(move1 * -0.2);
1296                            next.shorts.orientation = Quaternion::rotation_z(move1 * -0.5);
1297                            next.control.orientation.rotate_x(move1 * 0.5);
1298                            next.control.orientation.rotate_y(move1 * 2.1);
1299                            next.control.orientation.rotate_z(move1 * -0.5);
1300                            next.control.position += Vec3::new(0.0, move1 * 5.0, move1 * 8.0);
1301
1302                            next.chest.position += Vec3::new(0.0, move2 * 2.0, 0.0);
1303                            next.chest.orientation.rotate_z(move2 * -1.4);
1304                            next.head.position += Vec3::new(0.0, move2 * 1.0, 0.0);
1305                            next.head.orientation.rotate_x(move2 * -0.1);
1306                            next.head.orientation.rotate_y(move2 * -0.1);
1307                            next.head.orientation.rotate_z(move2 * 0.8);
1308                            next.belt.orientation.rotate_z(move2 * -0.3);
1309                            next.shorts.orientation.rotate_z(move2 * 0.6);
1310                            next.control.orientation.rotate_y(move2 * -4.0);
1311                            next.control
1312                                .orientation
1313                                .rotate_z(move2_slow * -3.0 + move2 * 1.0);
1314                            next.control.position +=
1315                                Vec3::new(move2_slow * 14.0, move2_slow * -2.0, move2_slow * -7.0);
1316                        },
1317                        Some(HandInfo::MainHand) => {
1318                            next.control_r.position =
1319                                Vec3::new(-s_a.sc.0 + move1, s_a.sc.1 - 7.0, s_a.sc.2);
1320                            next.control_r.orientation = Quaternion::rotation_x(s_a.sc.3 - 1.0)
1321                                * Quaternion::rotation_y(s_a.sc.4 + move1 * 0.5);
1322
1323                            next.hand_r.position = Vec3::new(-s_a.shl.0, s_a.shl.1, s_a.shl.2);
1324                            next.hand_r.orientation = Quaternion::rotation_x(s_a.shl.3)
1325                                * Quaternion::rotation_y(s_a.shl.4);
1326
1327                            next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
1328                            next.hand_l.orientation = Quaternion::rotation_x(s_a.shl.3)
1329                                * Quaternion::rotation_y(s_a.shl.4);
1330
1331                            next.control_l.position = Vec3::new(s_a.sc.0, s_a.sc.1, s_a.sc.2);
1332                            next.control_l.orientation = Quaternion::rotation_x(s_a.sc.3)
1333                                * Quaternion::rotation_z(move1 * 1.3 + move2 * -0.7);
1334
1335                            next.chest.position += Vec3::new(0.0, move1 * -1.0, 0.0);
1336                            next.chest.orientation = Quaternion::rotation_z(move1 * 0.8);
1337                            next.head.orientation = Quaternion::rotation_x(move1 * 0.05)
1338                                * Quaternion::rotation_y(move1 * 0.05)
1339                                * Quaternion::rotation_z(move1 * -0.4);
1340                            next.belt.orientation = Quaternion::rotation_z(move1 * -0.2);
1341                            next.shorts.orientation = Quaternion::rotation_z(move1 * -0.5);
1342                            next.control_l.orientation.rotate_x(move1 * 0.5);
1343                            next.control_l.orientation.rotate_y(move1 * 2.1);
1344                            next.control_l.orientation.rotate_z(move1 * -0.5);
1345                            next.control_l.position += Vec3::new(0.0, move1 * 5.0, move1 * 8.0);
1346
1347                            next.chest.position += Vec3::new(0.0, move2 * 2.0, 0.0);
1348                            next.chest.orientation.rotate_z(move2 * -1.4);
1349                            next.head.position += Vec3::new(0.0, move2 * 1.0, 0.0);
1350                            next.head.orientation.rotate_x(move2 * -0.1);
1351                            next.head.orientation.rotate_y(move2 * -0.1);
1352                            next.head.orientation.rotate_z(move2 * 0.8);
1353                            next.belt.orientation.rotate_z(move2 * -0.3);
1354                            next.shorts.orientation.rotate_z(move2 * 0.6);
1355                            next.control_l.orientation.rotate_y(move2 * -4.0);
1356                            next.control_l
1357                                .orientation
1358                                .rotate_z(move2_slow * -3.0 + move2 * 1.0);
1359                            next.control_l.position +=
1360                                Vec3::new(move2_slow * 14.0, move2_slow * -2.0, move2_slow * -7.0);
1361
1362                            next.do_hold_lantern(
1363                                s_a,
1364                                anim_time,
1365                                anim_time,
1366                                speednorm,
1367                                0.0,
1368                                tilt,
1369                                Some(last_ori),
1370                                Some(*d.look_dir),
1371                            );
1372                        },
1373                        Some(HandInfo::OffHand) => {
1374                            next.control_l.position =
1375                                Vec3::new(s_a.sc.0 + move1, s_a.sc.1 - 7.0, s_a.sc.2);
1376                            next.control_l.orientation = Quaternion::rotation_x(s_a.sc.3 - 1.0)
1377                                * Quaternion::rotation_y(s_a.sc.4 + move1 * -0.5);
1378
1379                            next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
1380                            next.hand_l.orientation = Quaternion::rotation_x(s_a.shl.3)
1381                                * Quaternion::rotation_y(s_a.shl.4);
1382
1383                            next.hand_r.position = Vec3::new(-s_a.shl.0, s_a.shl.1, s_a.shl.2);
1384                            next.hand_r.orientation = Quaternion::rotation_x(s_a.shl.3)
1385                                * Quaternion::rotation_y(s_a.shl.4);
1386
1387                            next.control_r.position = Vec3::new(-s_a.sc.0, s_a.sc.1, s_a.sc.2);
1388                            next.control_r.orientation = Quaternion::rotation_x(s_a.sc.3)
1389                                * Quaternion::rotation_z(move1 * -1.3 + move2 * 0.7);
1390
1391                            next.chest.position += Vec3::new(0.0, move1 * -1.0, 0.0);
1392                            next.chest.orientation = Quaternion::rotation_z(move1 * -0.8);
1393                            next.head.orientation = Quaternion::rotation_x(move1 * 0.05)
1394                                * Quaternion::rotation_y(move1 * -0.05)
1395                                * Quaternion::rotation_z(move1 * 0.4);
1396                            next.belt.orientation = Quaternion::rotation_z(move1 * 0.2);
1397                            next.shorts.orientation = Quaternion::rotation_z(move1 * 0.5);
1398                            next.control_r.orientation.rotate_x(move1 * 0.5);
1399                            next.control_r.orientation.rotate_y(move1 * -2.1);
1400                            next.control_r.orientation.rotate_z(move1 * 0.5);
1401                            next.control_r.position += Vec3::new(0.0, move1 * 5.0, move1 * 8.0);
1402
1403                            next.chest.position += Vec3::new(0.0, move2 * 2.0, 0.0);
1404                            next.chest.orientation.rotate_z(move2 * 1.4);
1405                            next.head.position += Vec3::new(0.0, move2 * 1.0, 0.0);
1406                            next.head.orientation.rotate_x(move2 * -0.1);
1407                            next.head.orientation.rotate_y(move2 * 0.1);
1408                            next.head.orientation.rotate_z(move2 * -0.8);
1409                            next.belt.orientation.rotate_z(move2 * 0.3);
1410                            next.shorts.orientation.rotate_z(move2 * -0.6);
1411                            next.control_r.orientation.rotate_y(move2 * 4.0);
1412                            next.control_r
1413                                .orientation
1414                                .rotate_z(move2_slow * 3.0 + move2 * -1.0);
1415                            next.control_r.position +=
1416                                Vec3::new(move2_slow * -14.0, move2_slow * -2.0, move2_slow * -7.0);
1417                        },
1418                        _ => {},
1419                    }
1420                }
1421            },
1422            Some("common.abilities.sword.heavy_fortitude") => {
1423                legacy_initialize();
1424                let pullback = 1.0 - move3base.powi(4);
1425                let move1 = move1base.powf(0.25) * pullback;
1426                let move2 = move2base.powi(2) * pullback;
1427
1428                if let Some(ability_info) = d.ability_info {
1429                    match ability_info.hand {
1430                        Some(HandInfo::TwoHanded) => {
1431                            next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
1432                            next.hand_l.orientation = Quaternion::rotation_x(s_a.shl.3)
1433                                * Quaternion::rotation_y(s_a.shl.4);
1434                            next.hand_r.position = Vec3::new(
1435                                -s_a.sc.0 + 6.0 + move1 * -12.0,
1436                                -4.0 + move1 * 3.0,
1437                                -2.0,
1438                            );
1439                            next.hand_r.orientation = Quaternion::rotation_x(0.9 + move1 * 0.5);
1440                            next.control.position = Vec3::new(s_a.sc.0, s_a.sc.1, s_a.sc.2);
1441                            next.control.orientation = Quaternion::rotation_x(s_a.sc.3);
1442
1443                            next.foot_l.position += Vec3::new(move1 * 1.0, move1 * 2.0, 0.0);
1444                            next.chest.orientation = Quaternion::rotation_z(move1 * -0.4);
1445                            next.head.orientation = Quaternion::rotation_z(move1 * 0.2);
1446                            next.shorts.orientation = Quaternion::rotation_z(move1 * 0.3);
1447                            next.belt.orientation = Quaternion::rotation_z(move1 * 0.1);
1448                            next.control.orientation.rotate_x(move1 * 0.4 + move2 * 0.6);
1449                            next.control.orientation.rotate_z(move1 * 0.4);
1450
1451                            next.foot_r.position += Vec3::new(move2 * -1.0, move2 * -2.0, 0.0);
1452                            next.control.position +=
1453                                Vec3::new(move2 * 5.0, move2 * 7.0, move2 * 5.0);
1454                            next.chest.position += Vec3::new(0.0, 0.0, move2 * -1.0);
1455                            next.shorts.orientation.rotate_x(move2 * 0.2);
1456                            next.shorts.position += Vec3::new(0.0, move2 * 1.0, 0.0);
1457                        },
1458                        Some(HandInfo::MainHand) => {
1459                            next.control_r.position =
1460                                Vec3::new(-s_a.sc.0 + move1, s_a.sc.1 - 7.0, s_a.sc.2);
1461                            next.control_r.orientation = Quaternion::rotation_x(s_a.sc.3 - 1.0)
1462                                * Quaternion::rotation_y(s_a.sc.4 + move1 * 0.5);
1463
1464                            next.hand_r.position = Vec3::new(-s_a.shl.0, s_a.shl.1, s_a.shl.2);
1465                            next.hand_r.orientation = Quaternion::rotation_x(s_a.shl.3)
1466                                * Quaternion::rotation_y(s_a.shl.4);
1467
1468                            next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
1469                            next.hand_l.orientation = Quaternion::rotation_x(s_a.shl.3)
1470                                * Quaternion::rotation_y(s_a.shl.4);
1471                            next.control_l.position = Vec3::new(s_a.sc.0, s_a.sc.1, s_a.sc.2);
1472                            next.control_l.orientation = Quaternion::rotation_x(s_a.sc.3);
1473
1474                            next.foot_l.position += Vec3::new(move1 * 1.0, move1 * 2.0, 0.0);
1475                            next.chest.orientation = Quaternion::rotation_z(move1 * -0.4);
1476                            next.head.orientation = Quaternion::rotation_z(move1 * 0.2);
1477                            next.shorts.orientation = Quaternion::rotation_z(move1 * 0.3);
1478                            next.belt.orientation = Quaternion::rotation_z(move1 * 0.1);
1479                            next.control_l
1480                                .orientation
1481                                .rotate_x(move1 * 0.4 + move2 * 0.6);
1482                            next.control_l.orientation.rotate_z(move1 * 0.4);
1483
1484                            next.foot_r.position += Vec3::new(move2 * -1.0, move2 * -2.0, 0.0);
1485                            next.control_l.position +=
1486                                Vec3::new(move2 * 5.0, move2 * 7.0, move2 * 5.0);
1487                            next.chest.position += Vec3::new(0.0, 0.0, move2 * -1.0);
1488                            next.shorts.orientation.rotate_x(move2 * 0.2);
1489                            next.shorts.position += Vec3::new(0.0, move2 * 1.0, 0.0);
1490
1491                            next.off_weapon_trail = false;
1492
1493                            next.do_hold_lantern(
1494                                s_a,
1495                                anim_time,
1496                                anim_time,
1497                                speednorm,
1498                                0.0,
1499                                tilt,
1500                                Some(d.last_ori),
1501                                Some(*d.look_dir),
1502                            );
1503                        },
1504                        Some(HandInfo::OffHand) => {
1505                            next.control_l.position =
1506                                Vec3::new(s_a.sc.0 + move1, s_a.sc.1 - 7.0, s_a.sc.2);
1507                            next.control_l.orientation = Quaternion::rotation_x(s_a.sc.3 - 1.0)
1508                                * Quaternion::rotation_y(s_a.sc.4 + move1 * -0.5);
1509
1510                            next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
1511                            next.hand_l.orientation = Quaternion::rotation_x(s_a.shl.3)
1512                                * Quaternion::rotation_y(s_a.shl.4);
1513
1514                            next.hand_r.position = Vec3::new(-s_a.shl.0, s_a.shl.1, s_a.shl.2);
1515                            next.hand_r.orientation = Quaternion::rotation_x(s_a.shl.3)
1516                                * Quaternion::rotation_y(s_a.shl.4);
1517                            next.control_r.position = Vec3::new(-s_a.sc.0, s_a.sc.1, s_a.sc.2);
1518                            next.control_r.orientation = Quaternion::rotation_x(s_a.sc.3);
1519
1520                            next.foot_r.position += Vec3::new(move1 * -1.0, move1 * 2.0, 0.0);
1521                            next.chest.orientation = Quaternion::rotation_z(move1 * 0.4);
1522                            next.head.orientation = Quaternion::rotation_z(move1 * -0.2);
1523                            next.shorts.orientation = Quaternion::rotation_z(move1 * -0.3);
1524                            next.belt.orientation = Quaternion::rotation_z(move1 * -0.1);
1525                            next.control_r
1526                                .orientation
1527                                .rotate_x(move1 * 0.4 + move2 * 0.6);
1528                            next.control_r.orientation.rotate_z(move1 * -0.4);
1529
1530                            next.foot_r.position += Vec3::new(move2 * 1.0, move2 * -2.0, 0.0);
1531                            next.control_r.position +=
1532                                Vec3::new(move2 * -5.0, move2 * 7.0, move2 * 5.0);
1533                            next.chest.position += Vec3::new(0.0, 0.0, move2 * -1.0);
1534                            next.shorts.orientation.rotate_x(move2 * 0.2);
1535                            next.shorts.position += Vec3::new(0.0, move2 * 1.0, 0.0);
1536
1537                            next.main_weapon_trail = false;
1538                        },
1539                        _ => {},
1540                    }
1541                }
1542            },
1543            Some("common.abilities.sword.defensive_stalwart_sword") => {
1544                legacy_initialize();
1545                let pullback = 1.0 - move3base.powi(4);
1546                let move1 = move1base.powf(0.25) * pullback;
1547                let move2 = move2base.powi(2) * pullback;
1548
1549                if let Some(ability_info) = d.ability_info {
1550                    match ability_info.hand {
1551                        Some(HandInfo::TwoHanded) => {
1552                            next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
1553                            next.hand_l.orientation = Quaternion::rotation_x(s_a.shl.3)
1554                                * Quaternion::rotation_y(s_a.shl.4);
1555                            next.hand_r.position = Vec3::new(
1556                                -s_a.sc.0 + 6.0 + move1 * -12.0,
1557                                -4.0 + move1 * 3.0,
1558                                -2.0,
1559                            );
1560                            next.hand_r.orientation = Quaternion::rotation_x(0.9 + move1 * 0.5);
1561                            next.control.position = Vec3::new(s_a.sc.0, s_a.sc.1, s_a.sc.2);
1562                            next.control.orientation = Quaternion::rotation_x(s_a.sc.3)
1563                                * Quaternion::rotation_z(move2 * -0.5);
1564
1565                            next.foot_r.position += Vec3::new(move1 * 1.0, move1 * -2.0, 0.0);
1566                            next.foot_r.orientation.rotate_z(move1 * -0.9);
1567                            next.chest.orientation = Quaternion::rotation_z(move1 * -0.5);
1568                            next.head.orientation = Quaternion::rotation_z(move1 * 0.3);
1569                            next.shorts.orientation = Quaternion::rotation_z(move1 * 0.1);
1570                            next.control.orientation.rotate_x(move1 * 0.4);
1571                            next.control.orientation.rotate_z(move1 * 0.5);
1572                            next.control.position += Vec3::new(0.0, 0.0, move1 * 4.0);
1573
1574                            next.control.position += Vec3::new(move2 * 8.0, 0.0, move2 * -1.0);
1575                            next.control.orientation.rotate_x(move2 * -0.6);
1576                            next.chest.position += Vec3::new(0.0, 0.0, move2 * -2.0);
1577                            next.belt.position += Vec3::new(0.0, 0.0, move2 * 1.0);
1578                            next.shorts.position += Vec3::new(0.0, 0.0, move2 * 1.0);
1579                            next.shorts.orientation.rotate_x(move2 * 0.2);
1580                            next.control.orientation.rotate_z(move2 * 0.4);
1581                        },
1582                        Some(HandInfo::MainHand) => {
1583                            next.control_r.position =
1584                                Vec3::new(-s_a.sc.0 + move1, s_a.sc.1 - 7.0, s_a.sc.2);
1585                            next.control_r.orientation = Quaternion::rotation_x(s_a.sc.3 - 1.0)
1586                                * Quaternion::rotation_y(s_a.sc.4 + move1 * 0.5);
1587
1588                            next.hand_r.position = Vec3::new(-s_a.shl.0, s_a.shl.1, s_a.shl.2);
1589                            next.hand_r.orientation = Quaternion::rotation_x(s_a.shl.3)
1590                                * Quaternion::rotation_y(s_a.shl.4);
1591
1592                            next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
1593                            next.hand_l.orientation = Quaternion::rotation_x(s_a.shl.3)
1594                                * Quaternion::rotation_y(s_a.shl.4);
1595
1596                            next.control_l.position = Vec3::new(s_a.sc.0, s_a.sc.1, s_a.sc.2);
1597                            next.control_l.orientation = Quaternion::rotation_x(s_a.sc.3)
1598                                * Quaternion::rotation_z(move2 * -0.5);
1599
1600                            next.foot_r.position += Vec3::new(move1 * 1.0, move1 * -2.0, 0.0);
1601                            next.foot_r.orientation.rotate_z(move1 * -0.9);
1602                            next.chest.orientation = Quaternion::rotation_z(move1 * -0.5);
1603                            next.head.orientation = Quaternion::rotation_z(move1 * 0.3);
1604                            next.shorts.orientation = Quaternion::rotation_z(move1 * 0.1);
1605                            next.control_l.orientation.rotate_x(move1 * 0.4);
1606                            next.control_l.orientation.rotate_z(move1 * 0.5);
1607                            next.control_l.position += Vec3::new(0.0, 0.0, move1 * 4.0);
1608
1609                            next.control_l.position += Vec3::new(move2 * 8.0, 0.0, move2 * -1.0);
1610                            next.control_l.orientation.rotate_x(move2 * -0.6);
1611                            next.chest.position += Vec3::new(0.0, 0.0, move2 * -2.0);
1612                            next.belt.position += Vec3::new(0.0, 0.0, move2 * 1.0);
1613                            next.shorts.position += Vec3::new(0.0, 0.0, move2 * 1.0);
1614                            next.shorts.orientation.rotate_x(move2 * 0.2);
1615                            next.control_l.orientation.rotate_z(move2 * 0.4);
1616
1617                            next.off_weapon_trail = false;
1618
1619                            next.do_hold_lantern(
1620                                s_a,
1621                                anim_time,
1622                                anim_time,
1623                                speednorm,
1624                                0.0,
1625                                tilt,
1626                                Some(d.last_ori),
1627                                Some(*d.look_dir),
1628                            );
1629                        },
1630                        Some(HandInfo::OffHand) => {
1631                            next.control_l.position =
1632                                Vec3::new(s_a.sc.0 + move1, s_a.sc.1 - 7.0, s_a.sc.2);
1633                            next.control_l.orientation = Quaternion::rotation_x(s_a.sc.3 - 1.0)
1634                                * Quaternion::rotation_y(s_a.sc.4 + move1 * -0.5);
1635
1636                            next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
1637                            next.hand_l.orientation = Quaternion::rotation_x(s_a.shl.3)
1638                                * Quaternion::rotation_y(s_a.shl.4);
1639
1640                            next.hand_r.position = Vec3::new(-s_a.shl.0, s_a.shl.1, s_a.shl.2);
1641                            next.hand_r.orientation = Quaternion::rotation_x(s_a.shl.3)
1642                                * Quaternion::rotation_y(s_a.shl.4);
1643
1644                            next.control_r.position = Vec3::new(-s_a.sc.0, s_a.sc.1, s_a.sc.2);
1645                            next.control_r.orientation = Quaternion::rotation_x(s_a.sc.3)
1646                                * Quaternion::rotation_z(move2 * 0.5);
1647
1648                            next.foot_l.position += Vec3::new(move1 * -1.0, move1 * -2.0, 0.0);
1649                            next.foot_l.orientation.rotate_z(move1 * 0.9);
1650                            next.chest.orientation = Quaternion::rotation_z(move1 * 0.5);
1651                            next.head.orientation = Quaternion::rotation_z(move1 * -0.3);
1652                            next.shorts.orientation = Quaternion::rotation_z(move1 * -0.1);
1653                            next.control_r.orientation.rotate_x(move1 * 0.4);
1654                            next.control_r.orientation.rotate_z(move1 * -0.5);
1655                            next.control_r.position += Vec3::new(0.0, 0.0, move1 * 4.0);
1656
1657                            next.control_r.position += Vec3::new(move2 * -8.0, 0.0, move2 * -1.0);
1658                            next.control_r.orientation.rotate_x(move2 * -0.6);
1659                            next.chest.position += Vec3::new(0.0, 0.0, move2 * -2.0);
1660                            next.belt.position += Vec3::new(0.0, 0.0, move2 * 1.0);
1661                            next.shorts.position += Vec3::new(0.0, 0.0, move2 * 1.0);
1662                            next.shorts.orientation.rotate_x(move2 * 0.2);
1663                            next.control_r.orientation.rotate_z(move2 * -0.4);
1664
1665                            next.main_weapon_trail = false;
1666                        },
1667                        _ => {},
1668                    }
1669                }
1670            },
1671            Some("common.abilities.sword.agile_dancing_edge") => {
1672                legacy_initialize();
1673                let pullback = 1.0 - move3base.powi(4);
1674                let move1 = move1base.powf(0.25) * pullback;
1675                let move2 = move2base.powi(2) * pullback;
1676
1677                if let Some(ability_info) = d.ability_info {
1678                    match ability_info.hand {
1679                        Some(HandInfo::TwoHanded) => {
1680                            next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
1681                            next.hand_l.orientation = Quaternion::rotation_x(s_a.shl.3)
1682                                * Quaternion::rotation_y(s_a.shl.4);
1683                            next.hand_r.position = Vec3::new(
1684                                -s_a.sc.0 + 6.0 + move1 * -12.0,
1685                                -4.0 + move1 * 3.0,
1686                                -2.0,
1687                            );
1688                            next.hand_r.orientation = Quaternion::rotation_x(0.9 + move1 * 0.5);
1689                            next.control.position = Vec3::new(s_a.sc.0, s_a.sc.1, s_a.sc.2);
1690                            next.control.orientation = Quaternion::rotation_x(s_a.sc.3);
1691
1692                            next.head.orientation = Quaternion::rotation_x(move1 * 0.3);
1693                            next.head.position += Vec3::new(0.0, 0.0, move1 * -1.0);
1694                            next.control.position += Vec3::new(move1 * 8.0, move1 * 5.0, 0.0);
1695
1696                            next.head.orientation.rotate_x(move2 * 0.2);
1697                            next.head.position += Vec3::new(0.0, 0.0, move2 * -1.0);
1698                            next.control.position += Vec3::new(0.0, move2 * -2.0, move2 * 12.0);
1699                            next.control.orientation.rotate_x(move2 * 1.1);
1700                        },
1701                        Some(HandInfo::MainHand) => {
1702                            next.control_r.position =
1703                                Vec3::new(-s_a.sc.0 + move1, s_a.sc.1 - 7.0, s_a.sc.2);
1704                            next.control_r.orientation = Quaternion::rotation_x(s_a.sc.3 - 1.0)
1705                                * Quaternion::rotation_y(s_a.sc.4 + move1 * 0.5);
1706
1707                            next.hand_r.position = Vec3::new(-s_a.shl.0, s_a.shl.1, s_a.shl.2);
1708                            next.hand_r.orientation = Quaternion::rotation_x(s_a.shl.3)
1709                                * Quaternion::rotation_y(s_a.shl.4);
1710
1711                            next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
1712                            next.hand_l.orientation = Quaternion::rotation_x(s_a.shl.3)
1713                                * Quaternion::rotation_y(s_a.shl.4);
1714
1715                            next.control_l.position = Vec3::new(s_a.sc.0, s_a.sc.1, s_a.sc.2);
1716                            next.control_l.orientation = Quaternion::rotation_x(s_a.sc.3);
1717
1718                            next.head.orientation = Quaternion::rotation_x(move1 * 0.3);
1719                            next.head.position += Vec3::new(0.0, 0.0, move1 * -1.0);
1720                            next.control_l.position += Vec3::new(move1 * 8.0, move1 * 5.0, 0.0);
1721
1722                            next.head.orientation.rotate_x(move2 * 0.2);
1723                            next.head.position += Vec3::new(0.0, 0.0, move2 * -1.0);
1724                            next.control_l.position += Vec3::new(0.0, move2 * -2.0, move2 * 12.0);
1725                            next.control_l.orientation.rotate_x(move2 * 1.1);
1726
1727                            next.off_weapon_trail = false;
1728
1729                            next.do_hold_lantern(
1730                                s_a,
1731                                anim_time,
1732                                anim_time,
1733                                speednorm,
1734                                0.0,
1735                                tilt,
1736                                Some(d.last_ori),
1737                                Some(*d.look_dir),
1738                            );
1739                        },
1740                        Some(HandInfo::OffHand) => {
1741                            next.control_l.position =
1742                                Vec3::new(s_a.sc.0 + move1, s_a.sc.1 - 7.0, s_a.sc.2);
1743                            next.control_l.orientation = Quaternion::rotation_x(s_a.sc.3 - 1.0)
1744                                * Quaternion::rotation_y(s_a.sc.4 + move1 * -0.5);
1745
1746                            next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
1747                            next.hand_l.orientation = Quaternion::rotation_x(s_a.shl.3)
1748                                * Quaternion::rotation_y(s_a.shl.4);
1749
1750                            next.hand_r.position = Vec3::new(-s_a.shl.0, s_a.shl.1, s_a.shl.2);
1751                            next.hand_r.orientation = Quaternion::rotation_x(s_a.shl.3)
1752                                * Quaternion::rotation_y(s_a.shl.4);
1753
1754                            next.control_r.position = Vec3::new(-s_a.sc.0, s_a.sc.1, s_a.sc.2);
1755                            next.control_r.orientation = Quaternion::rotation_x(s_a.sc.3);
1756
1757                            next.head.orientation = Quaternion::rotation_x(move1 * -0.3);
1758                            next.head.position += Vec3::new(0.0, 0.0, move1 * -1.0);
1759                            next.control_r.position += Vec3::new(move1 * -8.0, move1 * 5.0, 0.0);
1760
1761                            next.head.orientation.rotate_x(move2 * 0.2);
1762                            next.head.position += Vec3::new(0.0, 0.0, move2 * -1.0);
1763                            next.control_r.position += Vec3::new(0.0, move2 * -2.0, move2 * 12.0);
1764                            next.control_r.orientation.rotate_x(move2 * 1.1);
1765
1766                            next.main_weapon_trail = false;
1767                        },
1768                        _ => {},
1769                    }
1770                }
1771            },
1772            Some("common.abilities.sword.cleaving_blade_fever") => {
1773                legacy_initialize();
1774                let pullback = 1.0 - move3base.powi(4);
1775                let move1 = move1base.powf(0.25) * pullback;
1776                let move2 = move2base.powi(2) * pullback;
1777
1778                if let Some(ability_info) = d.ability_info {
1779                    match ability_info.hand {
1780                        Some(HandInfo::TwoHanded) => {
1781                            next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
1782                            next.hand_l.orientation = Quaternion::rotation_x(s_a.shl.3)
1783                                * Quaternion::rotation_y(s_a.shl.4);
1784                            next.hand_r.position = Vec3::new(
1785                                -s_a.sc.0 + 6.0 + move1 * -12.0,
1786                                -4.0 + move1 * 3.0,
1787                                -2.0,
1788                            );
1789                            next.hand_r.orientation = Quaternion::rotation_x(0.9 + move1 * 0.5);
1790                            next.control.position = Vec3::new(s_a.sc.0, s_a.sc.1, s_a.sc.2);
1791                            next.control.orientation = Quaternion::rotation_x(s_a.sc.3);
1792
1793                            next.foot_l.position += Vec3::new(move1 * 1.0, move1 * 2.0, 0.0);
1794                            next.chest.orientation = Quaternion::rotation_z(move1 * -0.4);
1795                            next.head.orientation = Quaternion::rotation_z(move1 * 0.2);
1796                            next.shorts.orientation = Quaternion::rotation_z(move1 * 0.3);
1797                            next.belt.orientation = Quaternion::rotation_z(move1 * 0.1);
1798                            next.control.orientation.rotate_x(move1 * 0.4 + move2 * 0.6);
1799                            next.control.orientation.rotate_z(move1 * 0.4);
1800
1801                            next.foot_r.position += Vec3::new(move2 * -1.0, move2 * -2.0, 0.0);
1802                            next.control.position +=
1803                                Vec3::new(move2 * 5.0, move2 * 7.0, move2 * 5.0);
1804                            next.chest.position += Vec3::new(0.0, 0.0, move2 * -1.0);
1805                            next.shorts.orientation.rotate_x(move2 * 0.2);
1806                            next.shorts.position += Vec3::new(0.0, move2 * 1.0, 0.0);
1807                        },
1808                        Some(HandInfo::MainHand) => {
1809                            next.control_r.position =
1810                                Vec3::new(-s_a.sc.0 + move1, s_a.sc.1 - 7.0, s_a.sc.2);
1811                            next.control_r.orientation = Quaternion::rotation_x(s_a.sc.3 - 1.0)
1812                                * Quaternion::rotation_y(s_a.sc.4 + move1 * 0.5);
1813
1814                            next.hand_r.position = Vec3::new(-s_a.shl.0, s_a.shl.1, s_a.shl.2);
1815                            next.hand_r.orientation = Quaternion::rotation_x(s_a.shl.3)
1816                                * Quaternion::rotation_y(s_a.shl.4);
1817
1818                            next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
1819                            next.hand_l.orientation = Quaternion::rotation_x(s_a.shl.3)
1820                                * Quaternion::rotation_y(s_a.shl.4);
1821
1822                            next.control_l.position = Vec3::new(s_a.sc.0, s_a.sc.1, s_a.sc.2);
1823                            next.control_l.orientation = Quaternion::rotation_x(s_a.sc.3);
1824
1825                            next.foot_l.position += Vec3::new(move1 * 1.0, move1 * 2.0, 0.0);
1826                            next.chest.orientation = Quaternion::rotation_z(move1 * -0.4);
1827                            next.head.orientation = Quaternion::rotation_z(move1 * 0.2);
1828                            next.shorts.orientation = Quaternion::rotation_z(move1 * 0.3);
1829                            next.belt.orientation = Quaternion::rotation_z(move1 * 0.1);
1830                            next.control_l
1831                                .orientation
1832                                .rotate_x(move1 * 0.4 + move2 * 0.6);
1833                            next.control_l.orientation.rotate_z(move1 * 0.4);
1834
1835                            next.foot_r.position += Vec3::new(move2 * -1.0, move2 * -2.0, 0.0);
1836                            next.control_l.position +=
1837                                Vec3::new(move2 * 5.0, move2 * 7.0, move2 * 5.0);
1838                            next.chest.position += Vec3::new(0.0, 0.0, move2 * -1.0);
1839                            next.shorts.orientation.rotate_x(move2 * 0.2);
1840                            next.shorts.position += Vec3::new(0.0, move2 * 1.0, 0.0);
1841
1842                            next.off_weapon_trail = false;
1843
1844                            next.do_hold_lantern(
1845                                s_a,
1846                                anim_time,
1847                                anim_time,
1848                                speednorm,
1849                                0.0,
1850                                tilt,
1851                                Some(d.last_ori),
1852                                Some(*d.look_dir),
1853                            );
1854                        },
1855                        Some(HandInfo::OffHand) => {
1856                            next.control_l.position =
1857                                Vec3::new(s_a.sc.0 + move1, s_a.sc.1 - 7.0, s_a.sc.2);
1858                            next.control_l.orientation = Quaternion::rotation_x(s_a.sc.3 - 1.0)
1859                                * Quaternion::rotation_y(s_a.sc.4 + move1 * -0.5);
1860
1861                            next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
1862                            next.hand_l.orientation = Quaternion::rotation_x(s_a.shl.3)
1863                                * Quaternion::rotation_y(s_a.shl.4);
1864
1865                            next.hand_r.position = Vec3::new(-s_a.shl.0, s_a.shl.1, s_a.shl.2);
1866                            next.hand_r.orientation = Quaternion::rotation_x(s_a.shl.3)
1867                                * Quaternion::rotation_y(s_a.shl.4);
1868
1869                            next.control_r.position = Vec3::new(-s_a.sc.0, s_a.sc.1, s_a.sc.2);
1870                            next.control_r.orientation = Quaternion::rotation_x(s_a.sc.3);
1871
1872                            next.foot_r.position += Vec3::new(move1 * -1.0, move1 * 2.0, 0.0);
1873                            next.chest.orientation = Quaternion::rotation_z(move1 * 0.4);
1874                            next.head.orientation = Quaternion::rotation_z(move1 * -0.2);
1875                            next.shorts.orientation = Quaternion::rotation_z(move1 * -0.3);
1876                            next.belt.orientation = Quaternion::rotation_z(move1 * -0.1);
1877                            next.control_r
1878                                .orientation
1879                                .rotate_x(move1 * 0.4 + move2 * 0.6);
1880                            next.control_r.orientation.rotate_z(move1 * -0.4);
1881
1882                            next.foot_r.position += Vec3::new(move2 * 1.0, move2 * -2.0, 0.0);
1883                            next.control_r.position +=
1884                                Vec3::new(move2 * -5.0, move2 * 7.0, move2 * 5.0);
1885                            next.chest.position += Vec3::new(0.0, 0.0, move2 * -1.0);
1886                            next.shorts.orientation.rotate_x(move2 * 0.2);
1887                            next.shorts.position += Vec3::new(0.0, move2 * 1.0, 0.0);
1888
1889                            next.main_weapon_trail = false;
1890                        },
1891                        _ => {},
1892                    }
1893                }
1894            },
1895            // ==================================
1896            //                AXE
1897            // ==================================
1898            Some("common.abilities.axe.basic_guard") => {
1899                let pullback = 1.0 - move3base.powi(4);
1900                let move1 = move1base.powf(0.25) * pullback;
1901                let move2 = (move2base * 10.0).sin();
1902
1903                if d.velocity.xy().magnitude_squared() < 0.5_f32.powi(2) {
1904                    next.chest.position =
1905                        Vec3::new(0.0, s_a.chest.0, s_a.chest.1 + move1 * -1.0 + move2 * 0.2);
1906                    next.chest.orientation = Quaternion::rotation_x(move1 * -0.15);
1907                    next.head.orientation = Quaternion::rotation_x(move1 * 0.25);
1908
1909                    next.belt.position =
1910                        Vec3::new(0.0, s_a.belt.0 + move1 * 0.5, s_a.belt.1 + move1 * 0.5);
1911                    next.shorts.position =
1912                        Vec3::new(0.0, s_a.shorts.0 + move1 * 1.3, s_a.shorts.1 + move1 * 1.0);
1913
1914                    next.belt.orientation = Quaternion::rotation_x(move1 * 0.15);
1915                    next.shorts.orientation = Quaternion::rotation_x(move1 * 0.25);
1916
1917                    if !d.is_riding {
1918                        next.foot_l.position =
1919                            Vec3::new(-s_a.foot.0, s_a.foot.1 + move1 * 2.0, s_a.foot.2);
1920                        next.foot_l.orientation = Quaternion::rotation_z(move1 * -0.5);
1921
1922                        next.foot_r.position =
1923                            Vec3::new(s_a.foot.0, s_a.foot.1 + move1 * -2.0, s_a.foot.2);
1924                        next.foot_r.orientation = Quaternion::rotation_x(move1 * -0.5);
1925                    }
1926                }
1927
1928                match d.hands {
1929                    (Some(Hands::Two), _) => {
1930                        next.main.position = Vec3::new(0.0, 0.0, 0.0);
1931                        next.main.orientation = Quaternion::rotation_x(0.0);
1932
1933                        next.hand_l.position = Vec3::new(s_a.ahl.0, s_a.ahl.1, s_a.ahl.2);
1934                        next.hand_l.orientation =
1935                            Quaternion::rotation_x(s_a.ahl.3) * Quaternion::rotation_y(s_a.ahl.4);
1936                        next.hand_r.position = Vec3::new(s_a.ahr.0, s_a.ahr.1, s_a.ahr.2);
1937                        next.hand_r.orientation =
1938                            Quaternion::rotation_x(s_a.ahr.3) * Quaternion::rotation_z(s_a.ahr.5);
1939
1940                        next.control.position = Vec3::new(
1941                            s_a.ac.0 + 0.5 + move1 * 13.0,
1942                            s_a.ac.1 + 9.0 + move1 * -3.0,
1943                            s_a.ac.2 + 2.5 + move1 * 8.0,
1944                        );
1945                        next.control.orientation =
1946                            Quaternion::rotation_x(s_a.ac.3 - 2.25 + move1 * -2.0)
1947                                * Quaternion::rotation_y(s_a.ac.4 - PI + move1 * -1.8)
1948                                * Quaternion::rotation_z(s_a.ac.5 - 0.2 + move1 * 4.0);
1949                    },
1950                    (Some(Hands::One), offhand) => {
1951                        next.main.position = Vec3::new(0.0, 0.0, 0.0);
1952                        next.main.orientation = Quaternion::rotation_x(0.0);
1953
1954                        next.control_l.position =
1955                            Vec3::new(-7.0, 8.0 + move1 * 3.0, 2.0 + move1 * 3.0);
1956                        next.control_l.orientation =
1957                            Quaternion::rotation_x(-0.3) * Quaternion::rotation_y(move1 * 1.0);
1958                        next.hand_l.position = Vec3::new(0.0, -0.5, 0.0);
1959                        next.hand_l.orientation = Quaternion::rotation_x(PI / 2.0);
1960                        if offhand.is_some() {
1961                            next.second.position = Vec3::new(0.0, 0.0, 0.0);
1962                            next.second.orientation = Quaternion::rotation_x(0.0);
1963                            next.control_r.position =
1964                                Vec3::new(7.0, 8.0 + move1 * 3.0, 2.0 + move1 * 3.0);
1965                            next.control_r.orientation =
1966                                Quaternion::rotation_x(-0.3) * Quaternion::rotation_y(move1 * -1.0);
1967                            next.hand_r.position = Vec3::new(0.0, -0.5, 0.0);
1968                            next.hand_r.orientation = Quaternion::rotation_x(PI / 2.0)
1969                        } else {
1970                            next.hand_r.position = Vec3::new(4.5, 8.0, 5.0);
1971                            next.hand_r.orientation =
1972                                Quaternion::rotation_x(1.9) * Quaternion::rotation_y(0.5)
1973                        }
1974                    },
1975                    (_, _) => {},
1976                }
1977            },
1978            Some("common.abilities.axe.cleave") => {
1979                legacy_initialize();
1980                let move1 = chargebase.min(1.0) * pullback;
1981                let move2 = move2base.powi(2) * pullback;
1982                let tension = (chargebase * 20.0).sin();
1983
1984                if let Some(ability_info) = d.ability_info {
1985                    match ability_info.hand {
1986                        Some(HandInfo::TwoHanded) => {
1987                            next.hand_l.position = Vec3::new(s_a.ahl.0, s_a.ahl.1, s_a.ahl.2);
1988                            next.hand_l.orientation = Quaternion::rotation_x(s_a.ahl.3)
1989                                * Quaternion::rotation_y(s_a.ahl.4);
1990                            next.hand_r.position = Vec3::new(s_a.ahr.0, s_a.ahr.1, s_a.ahr.2);
1991                            next.hand_r.orientation = Quaternion::rotation_x(s_a.ahr.3)
1992                                * Quaternion::rotation_z(s_a.ahr.5);
1993
1994                            next.control.position = Vec3::new(
1995                                s_a.ac.0 + 0.5 + move1 * 7.0,
1996                                s_a.ac.1 + 9.0 + move1 * -4.0,
1997                                s_a.ac.2 + 2.5 + move1 * 18.0 + tension / 5.0,
1998                            );
1999                            next.control.orientation = Quaternion::rotation_x(
2000                                s_a.ac.3 - 2.25 + move1 * -1.0 + tension / 30.0,
2001                            ) * Quaternion::rotation_y(s_a.ac.4 - PI)
2002                                * Quaternion::rotation_z(s_a.ac.5 - 0.2 - move1 * PI);
2003
2004                            next.control.orientation.rotate_x(move2 * -3.0);
2005                            next.control.position += Vec3::new(0.0, move2 * 8.0, move2 * -30.0);
2006                        },
2007                        Some(HandInfo::MainHand) => {
2008                            next.hand_l.position = Vec3::new(s_a.ahl.0, s_a.ahl.1, s_a.ahr.2);
2009                            next.hand_l.orientation = Quaternion::rotation_x(s_a.ahl.3);
2010
2011                            next.control_l.position = Vec3::new(
2012                                s_a.ac.0 + 0.5 + move1 * 1.0,
2013                                s_a.ac.1 + 9.0 + move1 * -4.0,
2014                                s_a.ac.2 + 2.5 + move1 * 14.0 + tension / 5.0,
2015                            );
2016
2017                            next.control_l.orientation =
2018                                Quaternion::rotation_x(move1 * 1.7 + tension / 30.0);
2019
2020                            next.control_l.orientation.rotate_x(move2 * -3.0);
2021                            next.control_l.position += Vec3::new(0.0, move2 * 8.0, move2 * -30.0);
2022
2023                            next.do_hold_lantern(
2024                                s_a,
2025                                anim_time,
2026                                anim_time,
2027                                speednorm,
2028                                0.0,
2029                                tilt,
2030                                Some(d.last_ori),
2031                                Some(*d.look_dir),
2032                            );
2033                        },
2034                        Some(HandInfo::OffHand) => {
2035                            next.hand_l.position = Vec3::new(s_a.ahl.0, s_a.ahl.1, s_a.ahr.2);
2036                            next.hand_l.orientation = Quaternion::rotation_x(s_a.ahl.3);
2037                            next.hand_r.position = Vec3::new(s_a.ahr.0, s_a.ahr.1, s_a.ahr.2);
2038                            next.hand_r.orientation = Quaternion::rotation_x(s_a.ahr.3);
2039
2040                            next.control_l.position = Vec3::new(
2041                                s_a.ac.0 + 0.5 + move1 * 1.0,
2042                                s_a.ac.1 + 9.0 + move1 * -4.0,
2043                                s_a.ac.2 + 2.5 + move1 * 14.0 + tension / 5.0,
2044                            );
2045
2046                            next.control_r.position = Vec3::new(
2047                                s_a.ac.0 + 15.0 + move1 * 1.0,
2048                                s_a.ac.1 + 9.0 + move1 * -4.0,
2049                                s_a.ac.2 + 2.5 + move1 * 14.0 + tension / 5.0,
2050                            );
2051
2052                            next.control_l.orientation =
2053                                Quaternion::rotation_x(move1 * 1.7 + tension / 30.0);
2054
2055                            next.control_r.orientation =
2056                                Quaternion::rotation_x(move1 * 1.7 + tension / 30.0);
2057
2058                            next.control.orientation.rotate_x(move2 * -3.0);
2059                            next.control.position += Vec3::new(0.0, move2 * 8.0, move2 * 10.0);
2060                        },
2061                        _ => {},
2062                    }
2063                }
2064            },
2065            Some("common.abilities.axe.execute") => {
2066                legacy_initialize();
2067                next.hand_l.position = Vec3::new(s_a.ahl.0, s_a.ahl.1, s_a.ahl.2);
2068                next.hand_l.orientation =
2069                    Quaternion::rotation_x(s_a.ahl.3) * Quaternion::rotation_y(s_a.ahl.4);
2070                next.hand_r.position = Vec3::new(s_a.ahr.0, s_a.ahr.1, s_a.ahr.2);
2071                next.hand_r.orientation =
2072                    Quaternion::rotation_x(s_a.ahr.3) * Quaternion::rotation_z(s_a.ahr.5);
2073
2074                next.control.position = Vec3::new(s_a.ac.0 + 0.5, s_a.ac.1 + 9.0, s_a.ac.2 + 2.5);
2075                next.control.orientation = Quaternion::rotation_x(s_a.ac.3 - 2.25)
2076                    * Quaternion::rotation_y(s_a.ac.4 - PI)
2077                    * Quaternion::rotation_z(s_a.ac.5 - 0.2 - move1 * PI);
2078
2079                next.control.orientation.rotate_x(move1 * 0.9);
2080                next.chest.orientation.rotate_z(move1 * 1.2);
2081                next.head.orientation.rotate_z(move1 * -0.5);
2082                next.belt.orientation.rotate_z(move1 * -0.3);
2083                next.shorts.orientation.rotate_z(move1 * -0.7);
2084                next.control.position += Vec3::new(move1 * 4.0, move1 * -12.0, move1 * 11.0);
2085
2086                next.chest.orientation.rotate_z(move2 * -2.0);
2087                next.head.orientation.rotate_z(move2 * 0.9);
2088                next.belt.orientation.rotate_z(move2 * 0.4);
2089                next.shorts.orientation.rotate_z(move2 * 1.1);
2090                next.control.orientation.rotate_x(move2 * -5.0);
2091                next.control.position += Vec3::new(move2 * -3.0, move2 * 12.0, move2 * -17.0);
2092                next.control.orientation.rotate_z(move2 * 0.7);
2093            },
2094            Some("common.abilities.axe.maelstrom") => {
2095                legacy_initialize();
2096                next.hand_l.position = Vec3::new(s_a.ahl.0, s_a.ahl.1, s_a.ahl.2);
2097                next.hand_l.orientation =
2098                    Quaternion::rotation_x(s_a.ahl.3) * Quaternion::rotation_y(s_a.ahl.4);
2099                next.hand_r.position = Vec3::new(s_a.ahr.0, s_a.ahr.1, s_a.ahr.2);
2100                next.hand_r.orientation =
2101                    Quaternion::rotation_x(s_a.ahr.3) * Quaternion::rotation_z(s_a.ahr.5);
2102
2103                next.control.position = Vec3::new(s_a.ac.0 + 0.5, s_a.ac.1 + 9.0, s_a.ac.2 + 2.5);
2104                next.control.orientation = Quaternion::rotation_x(s_a.ac.3 - 2.25)
2105                    * Quaternion::rotation_y(s_a.ac.4 - PI)
2106                    * Quaternion::rotation_z(s_a.ac.5 - 0.2 - move1 * PI);
2107
2108                next.control.orientation.rotate_x(move1 * 0.9);
2109                next.chest.orientation.rotate_z(move1 * 1.2);
2110                next.head.orientation.rotate_z(move1 * -0.5);
2111                next.belt.orientation.rotate_z(move1 * -0.3);
2112                next.shorts.orientation.rotate_z(move1 * -0.7);
2113                next.control.position += Vec3::new(move1 * 4.0, move1 * -12.0, move1 * 11.0);
2114
2115                next.chest.orientation.rotate_z(move2 * -2.0);
2116                next.head.orientation.rotate_z(move2 * 0.9);
2117                next.belt.orientation.rotate_z(move2 * 0.4);
2118                next.shorts.orientation.rotate_z(move2 * 1.1);
2119                next.control.orientation.rotate_x(move2 * -5.0);
2120                next.control.position += Vec3::new(move2 * 5.0, move2 * 12.0, move2 * -17.0);
2121                next.control.orientation.rotate_y(move2 * -2.0);
2122                next.control.orientation.rotate_z(move2 * -1.0);
2123                next.torso.orientation.rotate_z(move2base * -4.0 * PI);
2124            },
2125            Some("common.abilities.axe.lacerate") => {
2126                legacy_initialize();
2127                let move2_reset = ((move2base - 0.5).abs() - 0.5).abs() * 2.0;
2128
2129                next.hand_l.position = Vec3::new(s_a.ahl.0, s_a.ahl.1, s_a.ahl.2 + 10.0);
2130                next.hand_l.orientation =
2131                    Quaternion::rotation_x(s_a.ahl.3) * Quaternion::rotation_y(s_a.ahl.4);
2132                next.hand_r.position = Vec3::new(s_a.ahr.0, s_a.ahr.1, s_a.ahr.2);
2133                next.hand_r.orientation =
2134                    Quaternion::rotation_x(s_a.ahr.3) * Quaternion::rotation_z(s_a.ahr.5);
2135
2136                next.control.position = Vec3::new(s_a.ac.0 + 0.5, s_a.ac.1 + 9.0, s_a.ac.2 + 2.5);
2137                next.control.orientation = Quaternion::rotation_x(s_a.ac.3 - 2.25)
2138                    * Quaternion::rotation_y(s_a.ac.4 - PI)
2139                    * Quaternion::rotation_z(s_a.ac.5 - 0.2 - move1 * PI * 0.75);
2140
2141                next.chest.orientation.rotate_z(move1 * 1.2);
2142                next.head.orientation.rotate_z(move1 * -0.7);
2143                next.shorts.orientation.rotate_z(move1 * -0.9);
2144                next.belt.orientation.rotate_z(move1 * -0.3);
2145
2146                next.chest.orientation.rotate_z(move2 * -2.9);
2147                next.head.orientation.rotate_z(move2 * 1.2);
2148                next.shorts.orientation.rotate_z(move2 * 2.0);
2149                next.belt.orientation.rotate_z(move2 * 0.7);
2150                next.control.orientation.rotate_x(move2_reset * -1.0);
2151                next.control.orientation.rotate_z(move2 * -5.0);
2152                next.control.position += Vec3::new(move2 * 17.0, move2 * 3.0, 0.0);
2153            },
2154            Some("common.abilities.axe.riptide") => {
2155                legacy_initialize();
2156                let move2_reset = ((move2base - 0.5).abs() - 0.5).abs() * 2.0;
2157
2158                next.hand_l.position = Vec3::new(s_a.ahl.0, s_a.ahl.1, s_a.ahl.2);
2159                next.hand_l.orientation =
2160                    Quaternion::rotation_x(s_a.ahl.3) * Quaternion::rotation_y(s_a.ahl.4);
2161                next.hand_r.position = Vec3::new(s_a.ahr.0, s_a.ahr.1, s_a.ahr.2);
2162                next.hand_r.orientation =
2163                    Quaternion::rotation_x(s_a.ahr.3) * Quaternion::rotation_z(s_a.ahr.5);
2164
2165                next.control.position = Vec3::new(s_a.ac.0 + 0.5, s_a.ac.1 + 9.0, s_a.ac.2 + 2.5);
2166                next.control.orientation = Quaternion::rotation_x(s_a.ac.3 - 2.25)
2167                    * Quaternion::rotation_y(s_a.ac.4 - PI)
2168                    * Quaternion::rotation_z(s_a.ac.5 - 0.2 - move1 * PI * 0.75);
2169
2170                next.chest.orientation.rotate_z(move1 * 1.2);
2171                next.head.orientation.rotate_z(move1 * -0.7);
2172                next.shorts.orientation.rotate_z(move1 * -0.9);
2173                next.belt.orientation.rotate_z(move1 * -0.3);
2174
2175                next.chest.orientation.rotate_z(move2 * -2.9);
2176                next.head.orientation.rotate_z(move2 * 1.2);
2177                next.shorts.orientation.rotate_z(move2 * 2.0);
2178                next.belt.orientation.rotate_z(move2 * 0.7);
2179                next.control.orientation.rotate_x(move2_reset * -1.0);
2180                next.control.orientation.rotate_z(move2 * -5.0);
2181                next.control.position += Vec3::new(move2 * 17.0, move2 * 3.0, 0.0);
2182                next.torso.orientation.rotate_z(move2base * -TAU)
2183            },
2184            Some("common.abilities.axe.keelhaul") => {
2185                legacy_initialize();
2186                next.hand_l.position = Vec3::new(s_a.ahl.0, s_a.ahl.1, s_a.ahl.2);
2187                next.hand_l.orientation =
2188                    Quaternion::rotation_x(s_a.ahl.3) * Quaternion::rotation_y(s_a.ahl.4);
2189                next.hand_r.position = Vec3::new(s_a.ahr.0, s_a.ahr.1, s_a.ahr.2);
2190                next.hand_r.orientation =
2191                    Quaternion::rotation_x(s_a.ahr.3) * Quaternion::rotation_z(s_a.ahr.5);
2192
2193                next.control.position = Vec3::new(s_a.ac.0 + 0.5, s_a.ac.1 + 9.0, s_a.ac.2 + 2.5);
2194                next.control.orientation = Quaternion::rotation_x(s_a.ac.3 - 2.25)
2195                    * Quaternion::rotation_y(s_a.ac.4 - PI)
2196                    * Quaternion::rotation_z(s_a.ac.5 - 0.2);
2197
2198                next.control.orientation.rotate_z(move1 * -3.3);
2199                next.control.orientation.rotate_x(move1 * 0.8);
2200                next.control.position +=
2201                    Vec3::new(move1 * 4.0, move1 * 4.0 - move2 * 6.0, move1 * 10.0);
2202
2203                next.chest.orientation.rotate_z(move2 * 1.2);
2204                next.head.orientation.rotate_z(move2 * -0.5);
2205                next.belt.orientation.rotate_z(move2 * -0.3);
2206                next.shorts.orientation.rotate_z(move2 * -0.9);
2207                next.control.orientation.rotate_z(move2 * -1.2);
2208            },
2209            Some("common.abilities.axe.bulkhead") => {
2210                legacy_initialize();
2211                next.hand_l.position = Vec3::new(s_a.ahl.0, s_a.ahl.1, s_a.ahl.2);
2212                next.hand_l.orientation =
2213                    Quaternion::rotation_x(s_a.ahl.3) * Quaternion::rotation_y(s_a.ahl.4);
2214                next.hand_r.position = Vec3::new(s_a.ahr.0, s_a.ahr.1, s_a.ahr.2);
2215                next.hand_r.orientation =
2216                    Quaternion::rotation_x(s_a.ahr.3) * Quaternion::rotation_z(s_a.ahr.5);
2217
2218                next.control.position = Vec3::new(s_a.ac.0 + 0.5, s_a.ac.1 + 9.0, s_a.ac.2 + 2.5);
2219                next.control.orientation = Quaternion::rotation_x(s_a.ac.3 - 2.25)
2220                    * Quaternion::rotation_y(s_a.ac.4 - PI)
2221                    * Quaternion::rotation_z(
2222                        s_a.ac.5 - 0.2 + move1 * -PI * 0.75 + move2 * PI * 0.25,
2223                    );
2224
2225                next.chest.orientation.rotate_z(move1 * 1.8);
2226                next.head.orientation.rotate_z(move1 * -0.6);
2227                next.belt.orientation.rotate_z(move1 * -0.4);
2228                next.shorts.orientation.rotate_z(move1 * -1.3);
2229                next.control.orientation.rotate_x(move1 * -0.8);
2230
2231                next.chest.orientation.rotate_z(move2 * -3.8);
2232                next.head.orientation.rotate_z(move2 * 1.2);
2233                next.belt.orientation.rotate_z(move2 * 0.8);
2234                next.shorts.orientation.rotate_z(move2 * 2.1);
2235                next.control.orientation.rotate_x(move2 * 0.6);
2236                next.control.orientation.rotate_z(move2 * -4.0);
2237                next.control.position += Vec3::new(move2 * 12.0, move2 * -6.0, 0.0);
2238            },
2239            Some("common.abilities.axe.capsize") => {
2240                legacy_initialize();
2241                next.hand_l.position = Vec3::new(s_a.ahl.0, s_a.ahl.1, s_a.ahl.2);
2242                next.hand_l.orientation =
2243                    Quaternion::rotation_x(s_a.ahl.3) * Quaternion::rotation_y(s_a.ahl.4);
2244                next.hand_r.position = Vec3::new(s_a.ahr.0, s_a.ahr.1, s_a.ahr.2);
2245                next.hand_r.orientation =
2246                    Quaternion::rotation_x(s_a.ahr.3) * Quaternion::rotation_z(s_a.ahr.5);
2247
2248                next.control.position = Vec3::new(s_a.ac.0 + 0.5, s_a.ac.1 + 9.0, s_a.ac.2 + 2.5);
2249                next.control.orientation = Quaternion::rotation_x(s_a.ac.3 - 2.25)
2250                    * Quaternion::rotation_y(s_a.ac.4 - PI)
2251                    * Quaternion::rotation_z(
2252                        s_a.ac.5 - 0.2 + move1 * -PI * 0.75 + move2 * PI * 0.25,
2253                    );
2254
2255                next.chest.orientation.rotate_z(move1 * 1.8);
2256                next.head.orientation.rotate_z(move1 * -0.6);
2257                next.belt.orientation.rotate_z(move1 * -0.4);
2258                next.shorts.orientation.rotate_z(move1 * -1.3);
2259                next.control.orientation.rotate_x(move1 * -0.8);
2260
2261                next.chest.orientation.rotate_z(move2 * -3.8);
2262                next.head.orientation.rotate_z(move2 * 1.2);
2263                next.belt.orientation.rotate_z(move2 * 0.8);
2264                next.shorts.orientation.rotate_z(move2 * 2.1);
2265                next.control.orientation.rotate_x(move2 * 0.6);
2266                next.control.orientation.rotate_z(move2 * -4.0);
2267                next.control.position += Vec3::new(move2 * 12.0, move2 * -6.0, 0.0);
2268                next.torso.orientation.rotate_z(move2base * -TAU);
2269            },
2270            Some("common.abilities.axe.fracture") => {
2271                legacy_initialize();
2272                next.hand_l.position = Vec3::new(s_a.ahl.0, s_a.ahl.1, s_a.ahl.2);
2273                next.hand_l.orientation =
2274                    Quaternion::rotation_x(s_a.ahl.3) * Quaternion::rotation_y(s_a.ahl.4);
2275                next.hand_r.position = Vec3::new(s_a.ahr.0, s_a.ahr.1, s_a.ahr.2);
2276                next.hand_r.orientation =
2277                    Quaternion::rotation_x(s_a.ahr.3) * Quaternion::rotation_z(s_a.ahr.5);
2278
2279                next.control.position = Vec3::new(s_a.ac.0 + 0.5, s_a.ac.1 + 9.0, s_a.ac.2 + 2.5);
2280                next.control.orientation = Quaternion::rotation_x(s_a.ac.3 - 2.25)
2281                    * Quaternion::rotation_y(s_a.ac.4 - PI)
2282                    * Quaternion::rotation_z(s_a.ac.5 - 0.2 + move1 * -PI / 2.0 + move2 * -0.5);
2283
2284                next.control.orientation.rotate_x(move1 * 0.0);
2285                next.chest.orientation.rotate_x(move1 * -0.5);
2286                next.chest.orientation.rotate_z(move1 * 0.7);
2287                next.head.orientation.rotate_z(move1 * -0.3);
2288                next.belt.orientation.rotate_z(move1 * -0.1);
2289                next.shorts.orientation.rotate_z(move1 * -0.4);
2290
2291                next.chest.orientation.rotate_z(move2 * -1.8);
2292                next.head.orientation.rotate_z(move2 * 0.9);
2293                next.shorts.orientation.rotate_z(move2 * 1.3);
2294                next.belt.orientation.rotate_z(move2 * 0.6);
2295                next.control.orientation.rotate_x(move2 * -0.9);
2296                next.control.orientation.rotate_z(move2 * -3.5);
2297                next.control.position += Vec3::new(move2 * 14.0, move2 * 6.0, 0.0);
2298            },
2299            Some("common.abilities.axe.berserk") => {
2300                legacy_initialize();
2301                next.hand_l.position = Vec3::new(s_a.ahl.0, s_a.ahl.1, s_a.ahl.2);
2302                next.hand_l.orientation =
2303                    Quaternion::rotation_x(s_a.ahl.3) * Quaternion::rotation_y(s_a.ahl.4);
2304                next.hand_r.position = Vec3::new(s_a.ahr.0, s_a.ahr.1, s_a.ahr.2);
2305                next.hand_r.orientation =
2306                    Quaternion::rotation_x(s_a.ahr.3) * Quaternion::rotation_z(s_a.ahr.5);
2307
2308                next.control.position = Vec3::new(s_a.ac.0 + 0.5, s_a.ac.1 + 9.0, s_a.ac.2 + 2.5);
2309                next.control.orientation = Quaternion::rotation_x(s_a.ac.3 - 2.25)
2310                    * Quaternion::rotation_y(s_a.ac.4 - PI)
2311                    * Quaternion::rotation_z(s_a.ac.5 - 0.2);
2312
2313                next.control.orientation.rotate_z(move1 * -2.0);
2314                next.control.orientation.rotate_x(move1 * 3.5);
2315                next.control.position += Vec3::new(move1 * 14.0, move1 * -6.0, move1 * 15.0);
2316
2317                next.head.orientation.rotate_x(move2 * 0.6);
2318                next.chest.orientation.rotate_x(move2 * 0.4);
2319            },
2320            Some("common.abilities.axe.savage_sense") => {
2321                legacy_initialize();
2322                next.hand_l.position = Vec3::new(s_a.ahl.0, s_a.ahl.1, s_a.ahl.2);
2323                next.hand_l.orientation =
2324                    Quaternion::rotation_x(s_a.ahl.3) * Quaternion::rotation_y(s_a.ahl.4);
2325                next.hand_r.position = Vec3::new(s_a.ahr.0, s_a.ahr.1, s_a.ahr.2);
2326                next.hand_r.orientation =
2327                    Quaternion::rotation_x(s_a.ahr.3) * Quaternion::rotation_z(s_a.ahr.5);
2328
2329                next.control.position = Vec3::new(s_a.ac.0 + 0.5, s_a.ac.1 + 9.0, s_a.ac.2 + 2.5);
2330                next.control.orientation = Quaternion::rotation_x(s_a.ac.3 - 2.25)
2331                    * Quaternion::rotation_y(s_a.ac.4 - PI)
2332                    * Quaternion::rotation_z(s_a.ac.5 - 0.2);
2333
2334                next.chest.orientation = Quaternion::rotation_z(move1 * 0.6);
2335                next.head.orientation = Quaternion::rotation_z(move1 * -0.2);
2336                next.belt.orientation = Quaternion::rotation_z(move1 * -0.3);
2337                next.shorts.orientation = Quaternion::rotation_z(move1 * -0.1);
2338                next.foot_r.position += Vec3::new(0.0, move1 * 4.0, move1 * 4.0);
2339                next.foot_r.orientation.rotate_x(move1 * 1.2);
2340
2341                next.foot_r.position += Vec3::new(0.0, move2 * 4.0, move2 * -4.0);
2342                next.foot_r.orientation.rotate_x(move2 * -1.2);
2343            },
2344            Some("common.abilities.axe.adrenaline_rush") => {
2345                legacy_initialize();
2346                next.hand_l.position = Vec3::new(s_a.ahl.0, s_a.ahl.1, s_a.ahl.2);
2347                next.hand_l.orientation =
2348                    Quaternion::rotation_x(s_a.ahl.3) * Quaternion::rotation_y(s_a.ahl.4);
2349                next.hand_r.position = Vec3::new(s_a.ahr.0, s_a.ahr.1, s_a.ahr.2);
2350                next.hand_r.orientation =
2351                    Quaternion::rotation_x(s_a.ahr.3) * Quaternion::rotation_z(s_a.ahr.5);
2352
2353                next.control.position = Vec3::new(s_a.ac.0 + 0.5, s_a.ac.1 + 9.0, s_a.ac.2 + 2.5);
2354                next.control.orientation = Quaternion::rotation_x(s_a.ac.3 - 2.25)
2355                    * Quaternion::rotation_y(s_a.ac.4 - PI)
2356                    * Quaternion::rotation_z(s_a.ac.5 - 0.2 - move1 * PI);
2357
2358                next.control.orientation.rotate_z(move1 * -1.8);
2359                next.control.orientation.rotate_y(move1 * 1.5);
2360                next.control.position += Vec3::new(move1 * 11.0, 0.0, 0.0);
2361
2362                next.control.orientation.rotate_y(move2 * 0.7);
2363                next.control.orientation.rotate_z(move2 * 1.6);
2364                next.control.position += Vec3::new(move2 * -8.0, 0.0, move2 * -3.0);
2365            },
2366            Some("common.abilities.axe.bloodfeast") => {
2367                legacy_initialize();
2368                next.hand_l.position = Vec3::new(s_a.ahl.0, s_a.ahl.1, s_a.ahl.2);
2369                next.hand_l.orientation =
2370                    Quaternion::rotation_x(s_a.ahl.3) * Quaternion::rotation_y(s_a.ahl.4);
2371                next.hand_r.position = Vec3::new(s_a.ahr.0, s_a.ahr.1, s_a.ahr.2);
2372                next.hand_r.orientation =
2373                    Quaternion::rotation_x(s_a.ahr.3) * Quaternion::rotation_z(s_a.ahr.5);
2374
2375                next.control.position = Vec3::new(s_a.ac.0 + 0.5, s_a.ac.1 + 9.0, s_a.ac.2 + 2.5);
2376                next.control.orientation = Quaternion::rotation_x(s_a.ac.3 - 2.25)
2377                    * Quaternion::rotation_y(s_a.ac.4 - PI)
2378                    * Quaternion::rotation_z(s_a.ac.5 - 0.2);
2379
2380                next.control.orientation.rotate_z(move1 * -3.4);
2381                next.control.orientation.rotate_x(move1 * 1.1);
2382                next.control.position += Vec3::new(move1 * 14.0, move1 * -3.0, 0.0);
2383
2384                next.control.orientation.rotate_x(move2 * 1.7);
2385                next.control.orientation.rotate_z(move2 * -1.3);
2386                next.control.orientation.rotate_y(move2 * 0.8);
2387            },
2388            Some("common.abilities.axe.furor") => {
2389                legacy_initialize();
2390                next.hand_l.position = Vec3::new(s_a.ahl.0, s_a.ahl.1, s_a.ahl.2);
2391                next.hand_l.orientation =
2392                    Quaternion::rotation_x(s_a.ahl.3) * Quaternion::rotation_y(s_a.ahl.4);
2393                next.hand_r.position = Vec3::new(s_a.ahr.0, s_a.ahr.1, s_a.ahr.2);
2394                next.hand_r.orientation =
2395                    Quaternion::rotation_x(s_a.ahr.3) * Quaternion::rotation_z(s_a.ahr.5);
2396
2397                next.control.position = Vec3::new(s_a.ac.0 + 0.5, s_a.ac.1 + 9.0, s_a.ac.2 + 2.5);
2398                next.control.orientation = Quaternion::rotation_x(s_a.ac.3 - 2.25)
2399                    * Quaternion::rotation_y(s_a.ac.4 - PI)
2400                    * Quaternion::rotation_z(s_a.ac.5 - 0.2 - move1 * PI);
2401
2402                next.control.orientation.rotate_x(move1 * -1.0);
2403                next.control.position += Vec3::new(move1 * 3.0, move1 * -2.0, move1 * 14.0);
2404                next.control.orientation.rotate_z(move1 * 1.5);
2405
2406                next.control.orientation.rotate_y(move2 * -1.0);
2407                next.control.orientation.rotate_z(move2 * -1.6);
2408                next.control.orientation.rotate_y(move2 * 0.7);
2409                next.control.orientation.rotate_x(move2 * -0.5);
2410                next.control.position += Vec3::new(move2 * 9.0, move2 * -3.0, move2 * -14.0);
2411            },
2412            Some("common.abilities.axe.sunder") => {
2413                legacy_initialize();
2414                next.hand_l.position = Vec3::new(s_a.ahl.0, s_a.ahl.1, s_a.ahl.2);
2415                next.hand_l.orientation =
2416                    Quaternion::rotation_x(s_a.ahl.3) * Quaternion::rotation_y(s_a.ahl.4);
2417                next.hand_r.position = Vec3::new(s_a.ahr.0, s_a.ahr.1, s_a.ahr.2);
2418                next.hand_r.orientation =
2419                    Quaternion::rotation_x(s_a.ahr.3) * Quaternion::rotation_z(s_a.ahr.5);
2420
2421                next.control.position = Vec3::new(s_a.ac.0 + 0.5, s_a.ac.1 + 9.0, s_a.ac.2 + 2.5);
2422                next.control.orientation = Quaternion::rotation_x(s_a.ac.3 - 2.25)
2423                    * Quaternion::rotation_y(s_a.ac.4 - PI)
2424                    * Quaternion::rotation_z(s_a.ac.5 - 0.2);
2425
2426                next.control.orientation.rotate_z(move1 * -1.5);
2427                next.control.position += Vec3::new(move1 * 12.0, 0.0, move1 * 5.0);
2428                next.control.orientation.rotate_y(move1 * 0.5);
2429                next.main.position += Vec3::new(0.0, move1 * 10.0, 0.0);
2430                next.main.orientation.rotate_z(move1base * TAU);
2431                next.second.position += Vec3::new(0.0, move1 * 10.0, 0.0);
2432                next.second.orientation.rotate_z(move1base * -TAU);
2433
2434                next.main.orientation.rotate_z(move2base * TAU);
2435                next.main.position += Vec3::new(0.0, move2 * -10.0, 0.0);
2436                next.second.orientation.rotate_z(move2base * -TAU);
2437                next.second.position += Vec3::new(0.0, move2 * -10.0, 0.0);
2438                next.control.position += Vec3::new(0.0, 0.0, move2 * -5.0);
2439            },
2440            Some("common.abilities.axe.defiance") => {
2441                legacy_initialize();
2442                let tension = (move2base * 20.0).sin();
2443
2444                next.hand_l.position = Vec3::new(s_a.ahl.0, s_a.ahl.1, s_a.ahl.2);
2445                next.hand_l.orientation =
2446                    Quaternion::rotation_x(s_a.ahl.3) * Quaternion::rotation_y(s_a.ahl.4);
2447                next.hand_r.position = Vec3::new(s_a.ahr.0, s_a.ahr.1, s_a.ahr.2);
2448                next.hand_r.orientation =
2449                    Quaternion::rotation_x(s_a.ahr.3) * Quaternion::rotation_z(s_a.ahr.5);
2450
2451                next.control.position = Vec3::new(s_a.ac.0 + 0.5, s_a.ac.1 + 9.0, s_a.ac.2 + 2.5);
2452                next.control.orientation = Quaternion::rotation_x(s_a.ac.3 - 2.25)
2453                    * Quaternion::rotation_y(s_a.ac.4 - PI)
2454                    * Quaternion::rotation_z(s_a.ac.5 - 0.2);
2455
2456                next.control.orientation.rotate_z(move1 * -1.6);
2457                next.control.orientation.rotate_x(move1 * 1.7);
2458                next.control.position += Vec3::new(move1 * 12.0, move1 * -10.0, move1 * 18.0);
2459                next.head.orientation.rotate_x(move1 * 0.6);
2460                next.head.position += Vec3::new(0.0, 0.0, move1 * -3.0);
2461                next.control.orientation.rotate_z(move1 * 0.4);
2462
2463                next.head.orientation.rotate_x(tension * 0.3);
2464                next.control.position += Vec3::new(0.0, 0.0, tension * 2.0);
2465            },
2466            // ==================================
2467            //               HAMMER
2468            // ==================================
2469            Some("common.abilities.hammer.basic_guard") => {
2470                let pullback = 1.0 - move3base.powi(4);
2471                let move1 = move1base.powf(0.25) * pullback;
2472                let move2 = (move2base * 10.0).sin();
2473
2474                if d.velocity.xy().magnitude_squared() < 0.5_f32.powi(2) {
2475                    next.chest.position =
2476                        Vec3::new(0.0, s_a.chest.0, s_a.chest.1 + move1 * -1.0 + move2 * 0.2);
2477                    next.chest.orientation = Quaternion::rotation_x(move1 * -0.15);
2478                    next.head.orientation = Quaternion::rotation_x(move1 * 0.25);
2479
2480                    next.belt.position =
2481                        Vec3::new(0.0, s_a.belt.0 + move1 * 0.5, s_a.belt.1 + move1 * 0.5);
2482                    next.shorts.position =
2483                        Vec3::new(0.0, s_a.shorts.0 + move1 * 1.3, s_a.shorts.1 + move1 * 1.0);
2484
2485                    next.belt.orientation = Quaternion::rotation_x(move1 * 0.15);
2486                    next.shorts.orientation = Quaternion::rotation_x(move1 * 0.25);
2487
2488                    if !d.is_riding {
2489                        next.foot_l.position =
2490                            Vec3::new(-s_a.foot.0, s_a.foot.1 + move1 * 2.0, s_a.foot.2);
2491                        next.foot_l.orientation = Quaternion::rotation_z(move1 * -0.5);
2492
2493                        next.foot_r.position =
2494                            Vec3::new(s_a.foot.0, s_a.foot.1 + move1 * -2.0, s_a.foot.2);
2495                        next.foot_r.orientation = Quaternion::rotation_x(move1 * -0.5);
2496                    }
2497                }
2498
2499                match d.hands {
2500                    (Some(Hands::Two), _) => {
2501                        next.hand_l.position = Vec3::new(s_a.hhl.0, s_a.hhl.1, s_a.hhl.2);
2502                        next.hand_l.orientation = Quaternion::rotation_x(s_a.hhl.3)
2503                            * Quaternion::rotation_y(s_a.hhl.4)
2504                            * Quaternion::rotation_z(s_a.hhl.5);
2505                        next.hand_r.position = Vec3::new(s_a.hhr.0, s_a.hhr.1, s_a.hhr.2);
2506                        next.hand_r.orientation = Quaternion::rotation_x(s_a.hhr.3)
2507                            * Quaternion::rotation_y(s_a.hhr.4)
2508                            * Quaternion::rotation_z(s_a.hhr.5);
2509
2510                        next.main.position = Vec3::new(0.0, 0.0, 0.0);
2511                        next.main.orientation = Quaternion::rotation_x(0.0);
2512                        next.control.position = Vec3::new(
2513                            s_a.hc.0 + move1 * 3.0,
2514                            s_a.hc.1 + move1 * 3.0,
2515                            s_a.hc.2 + move1 * 10.0,
2516                        );
2517                        next.control.orientation = Quaternion::rotation_x(s_a.hc.3)
2518                            * Quaternion::rotation_y(s_a.hc.4)
2519                            * Quaternion::rotation_z(s_a.hc.5 + move1 * -1.0);
2520                    },
2521                    (Some(Hands::One), offhand) => {
2522                        next.control_l.position =
2523                            Vec3::new(-7.0, 8.0 + move1 * 3.0, 2.0 + move1 * 3.0);
2524                        next.control_l.orientation =
2525                            Quaternion::rotation_x(-0.3) * Quaternion::rotation_y(move1 * 1.0);
2526                        next.hand_l.position = Vec3::new(0.0, -0.5, 0.0);
2527                        next.hand_l.orientation = Quaternion::rotation_x(PI / 2.0);
2528
2529                        next.main.position = Vec3::new(0.0, 0.0, 0.0);
2530                        next.main.orientation = Quaternion::rotation_x(0.0);
2531
2532                        if offhand.is_some() {
2533                            next.control_r.position =
2534                                Vec3::new(7.0, 8.0 + move1 * 3.0, 2.0 + move1 * 3.0);
2535                            next.control_r.orientation =
2536                                Quaternion::rotation_x(-0.3) * Quaternion::rotation_y(move1 * -1.0);
2537                            next.hand_r.position = Vec3::new(0.0, -0.5, 0.0);
2538                            next.hand_r.orientation = Quaternion::rotation_x(PI / 2.0);
2539                            next.second.position = Vec3::new(0.0, 0.0, 0.0);
2540                            next.second.orientation = Quaternion::rotation_x(0.0);
2541                        } else {
2542                            next.hand_r.position = Vec3::new(4.5, 8.0, 5.0);
2543                            next.hand_r.orientation =
2544                                Quaternion::rotation_x(1.9) * Quaternion::rotation_y(0.5)
2545                        }
2546                    },
2547                    (_, _) => {},
2548                }
2549            },
2550            Some("common.abilities.hammer.solid_smash") => {
2551                if let Some(ability_info) = d.ability_info {
2552                    match ability_info.hand {
2553                        Some(HandInfo::TwoHanded) => {
2554                            hammer_start(&mut next, s_a);
2555
2556                            next.control.orientation.rotate_x(move1 * 2.7);
2557                            next.control.orientation.rotate_z(move1 * 1.4);
2558                            next.control.position += Vec3::new(-12.0, 0.0, 0.0) * move1;
2559                            next.control.orientation.rotate_x(move1 * -1.2);
2560                            twist_back(&mut next, move1, 0.8, 0.3, 0.1, 0.5);
2561
2562                            twist_forward(&mut next, move2, 1.4, 0.5, 0.3, 1.0);
2563                            next.control.orientation.rotate_x(move2 * -1.9);
2564                            next.control.orientation.rotate_z(move2 * 0.6);
2565                        },
2566                        Some(HandInfo::MainHand) => {
2567                            dual_wield_start(&mut next);
2568
2569                            next.control_l.orientation.rotate_x(move1 * 2.7);
2570                            next.control_l.position += Vec3::new(-3.0, 5.0, 5.0) * move1;
2571                            next.control_l.orientation.rotate_x(move1 * -1.2);
2572                            twist_back(&mut next, move1, 0.8, 0.3, 0.1, 0.5);
2573
2574                            twist_forward(&mut next, move2, 1.4, 0.5, 0.3, 1.0);
2575                            next.control_l.orientation.rotate_x(move2 * -1.9);
2576                            next.control_l.orientation.rotate_z(move2 * -0.6);
2577
2578                            next.do_hold_lantern(
2579                                s_a,
2580                                anim_time,
2581                                anim_time,
2582                                speednorm,
2583                                0.0,
2584                                tilt,
2585                                Some(d.last_ori),
2586                                Some(*d.look_dir),
2587                            );
2588                        },
2589                        Some(HandInfo::OffHand) => {
2590                            dual_wield_start(&mut next);
2591
2592                            next.control_l.orientation.rotate_x(move1 * 2.7);
2593                            next.control_l.position += Vec3::new(-3.0, 5.0, 5.0) * move1;
2594                            next.control_l.orientation.rotate_x(move1 * -1.2);
2595                            twist_back(&mut next, move1, 0.8, 0.3, 0.1, 0.5);
2596
2597                            twist_forward(&mut next, move2, 1.4, 0.5, 0.3, 1.0);
2598                            next.control_l.orientation.rotate_x(move2 * -1.9);
2599                            next.control_l.orientation.rotate_z(move2 * -0.6);
2600                        },
2601                        _ => {},
2602                    }
2603                }
2604            },
2605            Some("common.abilities.hammer.scornful_swipe") => {
2606                if let Some(ability_info) = d.ability_info {
2607                    match ability_info.hand {
2608                        Some(HandInfo::TwoHanded) => {
2609                            hammer_start(&mut next, s_a);
2610
2611                            let move1_pre = move1.min(0.5) * 2.0;
2612                            let move1_shake = ((move1.max(0.3) - 0.3) * 15.0).sin();
2613                            let move1_late = move1.powi(4);
2614
2615                            next.control.orientation.rotate_x(move1_pre * 2.3);
2616                            next.control.position += Vec3::new(0.0, 2.0, 16.0) * move1_pre;
2617                            next.control.position += Vec3::new(0.0, 0.0, 4.0) * move1_shake;
2618                            next.control.orientation.rotate_y(move1_late * 1.6);
2619                            next.control.position += Vec3::new(-8.0, 0.0, -8.0) * move1_late;
2620                            twist_back(&mut next, move1_late, 1.0, 0.4, 0.2, 0.7);
2621                            next.control.orientation.rotate_z(move1_late * 1.2);
2622
2623                            twist_forward(&mut next, move2, 1.9, 0.9, 0.6, 1.1);
2624                            next.control.orientation.rotate_y(move2 * -1.7);
2625                            next.control.orientation.rotate_z(move2 * -2.7);
2626                        },
2627                        Some(HandInfo::MainHand) => {
2628                            dual_wield_start(&mut next);
2629
2630                            let move1_pre = move1.min(0.5) * 2.0;
2631                            let move1_shake = ((move1.max(0.3) - 0.3) * 15.0).sin();
2632                            let move1_late = move1.powi(4);
2633
2634                            next.control_l.orientation.rotate_x(move1_pre * 2.3);
2635                            next.control_l.position += Vec3::new(0.0, 2.0, 16.0) * move1_pre;
2636                            next.control_l.position += Vec3::new(0.0, 0.0, 4.0) * move1_shake;
2637                            next.control_l.orientation.rotate_y(move1_late * 1.6);
2638                            next.control_l.position += Vec3::new(-8.0, 0.0, -8.0) * move1_late;
2639                            twist_back(&mut next, move1_late, 1.0, 0.4, 0.2, 0.7);
2640                            next.control_l.orientation.rotate_z(move1_late * 1.2);
2641
2642                            twist_forward(&mut next, move2, 1.9, 0.9, 0.6, 1.1);
2643                            next.control_l.orientation.rotate_y(move2 * -1.7);
2644                            next.control_l.orientation.rotate_z(move2 * -2.7);
2645
2646                            next.off_weapon_trail = false;
2647
2648                            next.do_hold_lantern(
2649                                s_a,
2650                                anim_time,
2651                                anim_time,
2652                                speednorm,
2653                                0.0,
2654                                tilt,
2655                                Some(d.last_ori),
2656                                Some(*d.look_dir),
2657                            );
2658                        },
2659                        Some(HandInfo::OffHand) => {
2660                            dual_wield_start(&mut next);
2661
2662                            let move1_pre = move1.min(0.5) * 2.0;
2663                            let move1_shake = ((move1.max(0.3) - 0.3) * 15.0).sin();
2664                            let move1_late = move1.powi(4);
2665
2666                            next.control_r.orientation.rotate_x(move1_pre * 2.3);
2667                            next.control_r.position += Vec3::new(0.0, 2.0, 16.0) * move1_pre;
2668                            next.control_r.position += Vec3::new(0.0, 0.0, 4.0) * move1_shake;
2669                            next.control_r.orientation.rotate_y(move1_late * 1.6);
2670                            next.control_r.position += Vec3::new(8.0, 0.0, -8.0) * move1_late;
2671                            twist_back(&mut next, -move1_late, 1.0, 0.4, 0.2, 0.7);
2672                            next.control_r.orientation.rotate_z(move1_late * 1.2);
2673
2674                            twist_forward(&mut next, -move2, 1.9, 0.9, 0.6, 1.1);
2675                            next.control_r.orientation.rotate_y(move2 * -1.7);
2676                            next.control_r.orientation.rotate_z(move2 * -2.7);
2677
2678                            next.main_weapon_trail = false;
2679                        },
2680                        _ => {},
2681                    }
2682                }
2683            },
2684            Some("common.abilities.hammer.heavy_whorl") => {
2685                hammer_start(&mut next, s_a);
2686
2687                twist_back(&mut next, move1, 2.0, 0.8, 0.4, 1.4);
2688                next.control.orientation.rotate_x(move1 * 0.6);
2689
2690                next.torso.orientation.rotate_z(move2base * -2.0 * PI);
2691                twist_forward(&mut next, move2, 3.4, 1.2, 0.8, 1.8);
2692                next.control.orientation.rotate_z(move2 * -2.3);
2693                next.control.position += Vec3::new(6.0, 0.0, 6.0) * move2;
2694            },
2695            Some("common.abilities.hammer.dual_heavy_whorl") => {
2696                dual_wield_start(&mut next);
2697
2698                twist_back(&mut next, move1, 2.0, 0.8, 0.4, 1.4);
2699                next.control_l.orientation.rotate_y(move1 * -PI / 2.0);
2700                next.control_r.orientation.rotate_y(move1 * -PI / 2.0);
2701                next.control.position += Vec3::new(0.0, 0.0, 4.0) * move1;
2702
2703                next.torso.orientation.rotate_z(move2base * -2.0 * PI);
2704                twist_forward(&mut next, move2, 3.4, 1.2, 0.8, 1.8);
2705                next.control_l.orientation.rotate_z(move2 * -2.3);
2706                next.control_r.orientation.rotate_z(move2 * -2.3);
2707            },
2708            Some("common.abilities.hammer.breach") => {
2709                if let Some(ability_info) = d.ability_info {
2710                    match ability_info.hand {
2711                        Some(HandInfo::TwoHanded) => {
2712                            hammer_start(&mut next, s_a);
2713
2714                            next.control.orientation.rotate_x(move1 * 2.5);
2715                            next.control.orientation.rotate_z(move1 * -4.8);
2716                            next.control.position += Vec3::new(-12.0, 0.0, 22.0) * move1;
2717                            twist_back(&mut next, move1, 0.6, 0.2, 0.0, 0.3);
2718
2719                            twist_forward(&mut next, move2, 1.6, 0.4, 0.2, 0.7);
2720                            next.control.orientation.rotate_x(move2 * -4.5);
2721                            next.control.position += Vec3::new(0.0, 0.0, -20.0) * move2;
2722                        },
2723                        Some(HandInfo::MainHand) => {
2724                            dual_wield_start(&mut next);
2725
2726                            next.control_l.orientation.rotate_x(move1 * 2.5);
2727                            next.control_l.orientation.rotate_z(move1 * -4.8);
2728                            next.control_l.position += Vec3::new(-6.0, 10.0, 22.0) * move1;
2729                            twist_back(&mut next, move1, 0.6, 0.2, 0.0, 0.3);
2730
2731                            twist_forward(&mut next, move2, 1.6, 0.4, 0.2, 0.7);
2732                            next.control_l.orientation.rotate_x(move2 * -4.5);
2733                            next.control_l.position += Vec3::new(0.0, 0.0, -20.0) * move2;
2734
2735                            next.off_weapon_trail = false;
2736
2737                            next.do_hold_lantern(
2738                                s_a,
2739                                anim_time,
2740                                anim_time,
2741                                speednorm,
2742                                0.0,
2743                                tilt,
2744                                Some(d.last_ori),
2745                                Some(*d.look_dir),
2746                            );
2747                        },
2748                        Some(HandInfo::OffHand) => {
2749                            dual_wield_start(&mut next);
2750
2751                            next.control_r.orientation.rotate_x(move1 * 2.2);
2752                            next.control_r.orientation.rotate_z(-move1 * -4.8);
2753                            next.control_r.position += Vec3::new(2.0, 10.0, 22.0) * move1;
2754                            twist_back(&mut next, -move1, 0.6, 0.2, 0.0, 0.3);
2755
2756                            twist_forward(&mut next, -move2, 1.6, 0.4, 0.2, 0.7);
2757                            next.control_r.orientation.rotate_x(move2 * -4.5);
2758                            next.control_r.position += Vec3::new(0.0, 0.0, -20.0) * move2;
2759
2760                            next.main_weapon_trail = false;
2761                        },
2762                        _ => {},
2763                    }
2764                }
2765            },
2766            Some("common.abilities.hammer.pile_driver") => {
2767                if let Some(ability_info) = d.ability_info {
2768                    match ability_info.hand {
2769                        Some(HandInfo::TwoHanded) => {
2770                            hammer_start(&mut next, s_a);
2771
2772                            let shake = (move1base * 15.0).sin();
2773                            let move1 = (move1base * 2.0).min(1.0) * pullback;
2774
2775                            twist_back(&mut next, move1, 0.9, 0.3, 0.1, 0.5);
2776                            next.control.orientation.rotate_x(move1 * 2.4);
2777                            next.control.position += Vec3::new(-14.0, 0.0, 14.0) * move1;
2778                            next.control.orientation.rotate_z(move1 * 1.8);
2779
2780                            next.control.orientation.rotate_x(shake * 0.15);
2781
2782                            twist_forward(&mut next, move2, 1.6, 0.5, 0.2, 0.9);
2783                            next.control.orientation.rotate_x(move2 * -4.0);
2784                            next.control.orientation.rotate_z(move2 * 0.4);
2785                            next.control.position += Vec3::new(0.0, 0.0, -12.0) * move2;
2786                        },
2787                        Some(HandInfo::MainHand) => {
2788                            dual_wield_start(&mut next);
2789
2790                            let shake = (move1base * 15.0).sin();
2791                            let move1 = (move1base * 2.0).min(1.0) * pullback;
2792
2793                            twist_back(&mut next, move1, 0.9, 0.3, 0.1, 0.5);
2794                            next.control_l.orientation.rotate_x(move1 * 2.4);
2795                            next.control_l.position += Vec3::new(-3.0, -4.0, 14.0) * move1;
2796                            next.control_l.orientation.rotate_z(move1 * 0.4);
2797
2798                            next.control_l.orientation.rotate_x(shake * 0.4);
2799
2800                            twist_forward(&mut next, move2, 1.6, 0.5, 0.2, 0.9);
2801                            next.control_l.orientation.rotate_x(move2 * -4.8);
2802                            next.control_l.orientation.rotate_z(move2 * 0.8);
2803                            next.control_l.position += Vec3::new(10.0, 12.0, -20.0) * move2;
2804
2805                            next.off_weapon_trail = false;
2806
2807                            next.do_hold_lantern(
2808                                s_a,
2809                                anim_time,
2810                                anim_time,
2811                                speednorm,
2812                                0.0,
2813                                tilt,
2814                                Some(d.last_ori),
2815                                Some(*d.look_dir),
2816                            );
2817                        },
2818                        Some(HandInfo::OffHand) => {
2819                            dual_wield_start(&mut next);
2820
2821                            let shake = (move1base * 15.0).sin();
2822                            let move1 = (move1base * 2.0).min(1.0) * pullback;
2823
2824                            twist_back(&mut next, -move1, 0.9, 0.3, 0.1, 0.5);
2825                            next.control_r.orientation.rotate_x(move1 * 2.4);
2826                            next.control_r.position += Vec3::new(2.0, -4.0, 14.0) * move1;
2827                            next.control_r.orientation.rotate_z(move1 * -0.2);
2828
2829                            next.control_r.orientation.rotate_x(shake * 0.4);
2830
2831                            twist_forward(&mut next, -move2, 1.6, 0.5, 0.2, 0.9);
2832                            next.control_r.orientation.rotate_x(move2 * -4.4);
2833                            next.control_r.orientation.rotate_z(move2 * 1.4);
2834                            next.control_r.position += Vec3::new(0.0, 20.0, -20.0) * move2;
2835
2836                            next.main_weapon_trail = false;
2837                        },
2838                        _ => {},
2839                    }
2840                }
2841            },
2842            Some("common.abilities.hammer.upheaval") => {
2843                hammer_start(&mut next, s_a);
2844                let move1_twist = move1 * (move1 * PI * 1.5).sin();
2845
2846                twist_forward(&mut next, move1_twist, 0.8, 0.3, 0.0, 0.4);
2847                let angle1 = 5.0;
2848                let angle2 = 4.0;
2849                next.control
2850                    .orientation
2851                    .rotate_x(move1base * (2.0 - angle1) + move2base * (2.0 - angle2));
2852                next.control.orientation.rotate_y(move1 * -0.8);
2853                next.control
2854                    .orientation
2855                    .rotate_x(move1base * angle1 + move2base * angle2);
2856                next.control.orientation.rotate_z(move1 * 1.0);
2857                next.control.orientation.rotate_x(move2 * 6.0);
2858                next.control.orientation.rotate_z(move2 * -0.6);
2859                next.control.position += Vec3::new(-16.0, 0.0, 0.0) * move1;
2860                next.control.position += Vec3::new(12.0, 0.0, 10.0) * move2;
2861                twist_forward(&mut next, move2, 1.0, 0.9, 0.4, 1.1);
2862            },
2863            Some("common.abilities.hammer.dual_upheaval") => {
2864                dual_wield_start(&mut next);
2865                let move1_return = (3.0 * move1base).sin();
2866
2867                next.control.orientation.rotate_x(4.0 * move1base);
2868                next.control_l.orientation.rotate_z(move1 * 0.6);
2869                next.control_r.orientation.rotate_z(move1 * -0.6);
2870                next.control.position += Vec3::new(0.0, 6.0, 8.0) * move1_return;
2871                next.control.orientation.rotate_x(3.5 * move2base);
2872                next.control_l.orientation.rotate_z(move2 * -1.4);
2873                next.control_r.orientation.rotate_z(move2 * 1.4);
2874                next.control.position += Vec3::new(0.0, 12.0, 10.0) * move2;
2875            },
2876            Some("common.abilities.hammer.wide_wallop") => {
2877                let move1 = chargebase.min(1.0) * pullback;
2878                let tension = (chargebase * 7.0).sin();
2879
2880                if let Some(ability_info) = d.ability_info {
2881                    match ability_info.hand {
2882                        Some(HandInfo::TwoHanded) => {
2883                            hammer_start(&mut next, s_a);
2884
2885                            next.control.orientation.rotate_x(move1 * 1.1 + move2 * 0.6);
2886                            twist_back(&mut next, move1 + tension / 25.0, 1.7, 0.7, 0.3, 1.1);
2887                            next.control.orientation.rotate_y(move1 * -0.8);
2888                            next.control.position += Vec3::new(0.0, 0.0, 6.0) * move1;
2889
2890                            twist_forward(&mut next, move2, 4.8, 1.7, 0.7, 3.2);
2891                            next.control.orientation.rotate_y(move2 * 2.0);
2892                            next.control.orientation.rotate_z(move2 * -1.8);
2893                        },
2894                        Some(HandInfo::MainHand) => {
2895                            dual_wield_start(&mut next);
2896
2897                            next.control_l
2898                                .orientation
2899                                .rotate_x(move1 * 1.1 + move2 * 0.6);
2900                            twist_back(&mut next, move1 + tension / 25.0, 1.7, 0.7, 0.3, 1.1);
2901                            next.control_l.orientation.rotate_y(move1 * -1.8);
2902                            next.control_l.position += Vec3::new(0.0, 5.0, 2.0) * move1;
2903
2904                            twist_forward(&mut next, move2, 4.8, 1.7, 0.7, 3.2);
2905                            next.control_l.orientation.rotate_y(move2 * 1.0);
2906                            next.control_l.orientation.rotate_z(move2 * -1.0);
2907
2908                            next.do_hold_lantern(
2909                                s_a,
2910                                anim_time,
2911                                anim_time,
2912                                speednorm,
2913                                0.0,
2914                                tilt,
2915                                Some(d.last_ori),
2916                                Some(*d.look_dir),
2917                            );
2918                        },
2919                        Some(HandInfo::OffHand) => {
2920                            dual_wield_start(&mut next);
2921
2922                            next.control_r
2923                                .orientation
2924                                .rotate_x(move1 * 1.1 + move2 * 0.6);
2925                            twist_back(&mut next, -move1 - tension / 25.0, 1.7, 0.7, 0.3, 1.1);
2926                            next.control_r.orientation.rotate_y(move1 * 1.8);
2927                            next.control_r.position += Vec3::new(0.0, 5.0, 2.0) * move1;
2928
2929                            twist_forward(&mut next, -move2, 4.8, 1.7, 0.7, 3.2);
2930                            next.control_r.orientation.rotate_y(-move2 * 1.0);
2931                            next.control_r.orientation.rotate_z(-move2 * -1.0);
2932                        },
2933                        _ => {},
2934                    }
2935                }
2936            },
2937            Some("common.abilities.hammer.intercept") => {
2938                hammer_start(&mut next, s_a);
2939                twist_back(&mut next, move1, 1.6, 0.7, 0.3, 1.1);
2940                next.control.orientation.rotate_x(move1 * 1.8);
2941
2942                twist_forward(&mut next, move2, 2.4, 0.9, 0.5, 1.4);
2943                next.control.orientation.rotate_z(move2 * -2.7);
2944                next.control.orientation.rotate_x(move2 * 2.0);
2945                next.control.position += Vec3::new(5.0, 0.0, 11.0) * move2;
2946            },
2947            Some("common.abilities.hammer.dual_intercept") => {
2948                dual_wield_start(&mut next);
2949                next.control_l.orientation.rotate_x(move1 * -1.4);
2950                next.control_l.orientation.rotate_z(move1 * 0.8);
2951                next.control_r.orientation.rotate_x(move1 * -1.4);
2952                next.control_r.orientation.rotate_z(move1 * -0.8);
2953                next.control.position += Vec3::new(0.0, 0.0, -6.0) * move1;
2954
2955                next.control_l.orientation.rotate_z(move2 * -2.6);
2956                next.control_l.orientation.rotate_x(move2 * 4.0);
2957                next.control_r.orientation.rotate_z(move2 * 2.6);
2958                next.control_r.orientation.rotate_x(move2 * 4.0);
2959                next.control.position += Vec3::new(0.0, 0.0, 20.0) * move2;
2960            },
2961            Some("common.abilities.hammer.spine_cracker") => {
2962                hammer_start(&mut next, s_a);
2963
2964                twist_back(&mut next, move1, 1.9, 1.5, 0.5, 1.2);
2965                next.head.position += Vec3::new(-2.0, 2.0, 0.0) * move1;
2966                next.control.orientation.rotate_x(move1 * 1.8);
2967                next.control.position += Vec3::new(0.0, 0.0, 8.0) * move1;
2968                next.control.orientation.rotate_y(move1 * 0.4);
2969
2970                twist_forward(&mut next, move2, 2.1, 1.6, 0.4, 1.3);
2971                next.control.orientation.rotate_z(move2 * 1.6);
2972                next.control.position += Vec3::new(-16.0, 12.0, -8.0) * move2;
2973            },
2974            Some("common.abilities.hammer.lung_pummel") => {
2975                if let Some(ability_info) = d.ability_info {
2976                    match ability_info.hand {
2977                        Some(HandInfo::TwoHanded) => {
2978                            hammer_start(&mut next, s_a);
2979
2980                            twist_back(&mut next, move1, 1.9, 0.7, 0.3, 1.2);
2981                            next.control.orientation.rotate_x(move1 * 1.2);
2982                            next.control.orientation.rotate_z(move1 * 1.0);
2983                            next.control.position += Vec3::new(-12.0, 0.0, 0.0) * move1;
2984
2985                            twist_forward(&mut next, move2, 3.4, 1.4, 0.9, 2.1);
2986                            next.control.orientation.rotate_z(move2 * -4.0);
2987                            next.control.position += Vec3::new(12.0, 0.0, 14.0) * move2;
2988                        },
2989                        Some(HandInfo::MainHand) => {
2990                            dual_wield_start(&mut next);
2991
2992                            twist_back(&mut next, move1, 1.9, 0.7, 0.3, 1.2);
2993                            next.control_l.orientation.rotate_y(move1 * -1.8);
2994                            next.control_l.orientation.rotate_z(move1 * 0.5);
2995                            next.control_l.position += Vec3::new(-12.0, 0.0, 0.0) * move1;
2996
2997                            twist_forward(&mut next, move2, 3.4, 1.4, 0.9, 2.1);
2998                            next.control_l.position += Vec3::new(20.0, 15.0, 14.0) * move2;
2999
3000                            next.off_weapon_trail = false;
3001
3002                            next.do_hold_lantern(
3003                                s_a,
3004                                anim_time,
3005                                anim_time,
3006                                speednorm,
3007                                0.0,
3008                                tilt,
3009                                Some(d.last_ori),
3010                                Some(*d.look_dir),
3011                            );
3012                        },
3013                        Some(HandInfo::OffHand) => {
3014                            dual_wield_start(&mut next);
3015
3016                            twist_back(&mut next, -move1, 1.9, 0.7, 0.3, 1.2);
3017                            next.control_r.orientation.rotate_y(move1 * 1.8);
3018                            next.control_r.orientation.rotate_z(move1 * -0.5);
3019                            next.control_r.position += Vec3::new(12.0, 0.0, 0.0) * move1;
3020
3021                            twist_forward(&mut next, -move2, 3.4, 1.4, 0.9, 2.1);
3022                            next.control_r.position += Vec3::new(-20.0, 15.0, 14.0) * move2;
3023
3024                            next.main_weapon_trail = false;
3025                        },
3026                        _ => {},
3027                    }
3028                }
3029            },
3030            Some("common.abilities.hammer.helm_crusher") => {
3031                if let Some(ability_info) = d.ability_info {
3032                    match ability_info.hand {
3033                        Some(HandInfo::TwoHanded) => {
3034                            hammer_start(&mut next, s_a);
3035
3036                            twist_back(&mut next, move1, 0.8, 0.3, 0.1, 0.5);
3037                            next.control.orientation.rotate_x(move1 * -0.8);
3038                            next.control.orientation.rotate_z(move1 * -1.6);
3039                            next.control.orientation.rotate_x(move1 * 2.8);
3040                            next.control.position += Vec3::new(-9.0, 0.0, 8.0) * move1;
3041                            next.control.orientation.rotate_z(move1 * -0.4);
3042
3043                            twist_forward(&mut next, move2, 1.8, 0.7, 0.4, 1.1);
3044                            next.control.orientation.rotate_x(move2 * -5.0);
3045                            next.control.orientation.rotate_z(move2 * -1.0);
3046                            next.control.position += Vec3::new(-12.0, 0.0, -8.0) * move2;
3047                        },
3048                        Some(HandInfo::MainHand) => {
3049                            dual_wield_start(&mut next);
3050
3051                            twist_back(&mut next, move1, 0.9, 0.3, 0.1, 0.5);
3052                            next.control_l.orientation.rotate_x(move1 * 2.4);
3053                            next.control_l.position += Vec3::new(-3.0, -4.0, 14.0) * move1;
3054                            next.control_l.orientation.rotate_z(move1 * 0.4);
3055
3056                            twist_forward(&mut next, move2, 1.6, 0.5, 0.2, 0.9);
3057                            next.control_l.orientation.rotate_x(move2 * -4.8);
3058                            next.control_l.orientation.rotate_z(move2 * 0.8);
3059                            next.control_l.position += Vec3::new(10.0, 12.0, -20.0) * move2;
3060
3061                            next.off_weapon_trail = false;
3062
3063                            next.do_hold_lantern(
3064                                s_a,
3065                                anim_time,
3066                                anim_time,
3067                                speednorm,
3068                                0.0,
3069                                tilt,
3070                                Some(d.last_ori),
3071                                Some(*d.look_dir),
3072                            );
3073                        },
3074                        Some(HandInfo::OffHand) => {
3075                            dual_wield_start(&mut next);
3076
3077                            twist_back(&mut next, -move1, 0.9, 0.3, 0.1, 0.5);
3078                            next.control_r.orientation.rotate_x(move1 * 2.4);
3079                            next.control_r.position += Vec3::new(2.0, -4.0, 14.0) * move1;
3080                            next.control_r.orientation.rotate_z(move1 * -0.2);
3081
3082                            twist_forward(&mut next, -move2, 1.6, 0.5, 0.2, 0.9);
3083                            next.control_r.orientation.rotate_x(move2 * -4.4);
3084                            next.control_r.orientation.rotate_z(move2 * 1.4);
3085                            next.control_r.position += Vec3::new(0.0, 20.0, -20.0) * move2;
3086
3087                            next.main_weapon_trail = false;
3088                        },
3089                        _ => {},
3090                    }
3091                }
3092            },
3093            Some("common.abilities.hammer.thunderclap") => {
3094                hammer_start(&mut next, s_a);
3095
3096                twist_back(&mut next, move1, 1.8, 0.9, 0.5, 1.1);
3097                next.control.orientation.rotate_x(move1 * 2.4);
3098                next.control.position += Vec3::new(-16.0, -8.0, 12.0) * move1;
3099                next.control.orientation.rotate_z(move1 * PI / 2.0);
3100                next.control.orientation.rotate_x(move1 * 0.6);
3101
3102                twist_forward(&mut next, move2, 2.4, 1.1, 0.6, 1.4);
3103                next.control.orientation.rotate_x(move2 * -5.0);
3104                next.control.position += Vec3::new(4.0, 12.0, -12.0) * move2;
3105                next.control.orientation.rotate_z(move2 * 0.6);
3106            },
3107            Some("common.abilities.hammer.earthshaker") => {
3108                hammer_start(&mut next, s_a);
3109
3110                next.hand_l.orientation.rotate_y(move1 * -PI);
3111                next.hand_r.orientation.rotate_y(move1 * -PI);
3112                next.control.orientation.rotate_x(2.4 * move1);
3113                next.control.orientation.rotate_z(move1 * -PI / 2.0);
3114                next.control.orientation.rotate_x(-0.6 * move1);
3115                next.control.position += Vec3::new(-8.0, 0.0, 24.0) * move1;
3116                next.chest.orientation.rotate_x(move1 * 0.5);
3117                next.torso.position += Vec3::new(0.0, 0.0, 8.0) * move1;
3118
3119                next.torso.position += Vec3::new(0.0, 0.0, -8.0) * move2;
3120                next.control.orientation.rotate_x(move2 * -0.8);
3121                next.control.position += Vec3::new(0.0, 0.0, -10.0) * move2;
3122                next.chest.orientation.rotate_x(move2 * -0.8);
3123            },
3124            Some("common.abilities.hammer.judgement") => {
3125                hammer_start(&mut next, s_a);
3126
3127                next.control.orientation.rotate_x(2.4 * move1);
3128                next.control.orientation.rotate_z(move1 * PI / 2.0);
3129                next.control.orientation.rotate_x(-0.6 * move1);
3130                next.control.position += Vec3::new(-8.0, 6.0, 24.0) * move1;
3131                next.chest.orientation.rotate_x(move1 * 0.5);
3132                next.torso.position += Vec3::new(0.0, 0.0, 8.0) * move1;
3133
3134                next.torso.position += Vec3::new(0.0, 0.0, -8.0) * move2;
3135                next.chest.orientation.rotate_x(-1.5 * move2);
3136                next.belt.orientation.rotate_x(0.3 * move2);
3137                next.shorts.orientation.rotate_x(0.6 * move2);
3138                next.control.orientation.rotate_x(-3.0 * move2);
3139                next.control.position += Vec3::new(0.0, 0.0, -16.0) * move2;
3140            },
3141            Some("common.abilities.hammer.retaliate") => {
3142                hammer_start(&mut next, s_a);
3143
3144                twist_back(&mut next, move1, 0.6, 0.2, 0.0, 0.3);
3145                next.control.orientation.rotate_x(move1 * 1.5);
3146                next.control.orientation.rotate_y(move1 * 0.4);
3147                next.control.position += Vec3::new(0.0, 0.0, 16.0) * move1;
3148
3149                twist_forward(&mut next, move2, 2.1, 0.6, 0.4, 0.9);
3150                next.control.orientation.rotate_y(move2 * 2.0);
3151                next.control.orientation.rotate_x(move2 * -2.5);
3152                next.control.orientation.rotate_z(move2 * -0.6);
3153                next.control.position += Vec3::new(6.0, -10.0, -14.0) * move2;
3154            },
3155            Some("common.abilities.hammer.tenacity") => {
3156                if let Some(ability_info) = d.ability_info {
3157                    match ability_info.hand {
3158                        Some(HandInfo::TwoHanded) => {
3159                            hammer_start(&mut next, s_a);
3160                            next.control.orientation.rotate_x(move1 * 0.6);
3161                            next.control.orientation.rotate_y(move1 * 0.9);
3162                            next.control.orientation.rotate_x(move1 * -0.6);
3163                            next.chest.orientation.rotate_x(move1 * 0.4);
3164                            next.control.position += Vec3::new(0.0, 4.0, 3.0) * move1;
3165
3166                            next.control.position += Vec3::new(
3167                                (move2 * 50.0).sin(),
3168                                (move2 * 67.0).sin(),
3169                                (move2 * 83.0).sin(),
3170                            );
3171                        },
3172                        Some(HandInfo::MainHand) => {
3173                            dual_wield_start(&mut next);
3174
3175                            next.control_l.orientation.rotate_x(move1 * 0.6);
3176                            next.control_l.orientation.rotate_y(move1 * 5.7);
3177                            next.control_l.orientation.rotate_z(move1 * 0.4);
3178                            next.chest.orientation.rotate_x(move1 * 0.4);
3179                            next.head.orientation.rotate_x(move1 * 0.4);
3180                            next.control_l.position += Vec3::new(-5.0, 8.0, 3.0) * move1;
3181
3182                            next.control_l.position += Vec3::new(
3183                                (move2 * 50.0).sin(),
3184                                (move2 * 67.0).sin(),
3185                                (move2 * 83.0).sin(),
3186                            );
3187
3188                            next.do_hold_lantern(
3189                                s_a,
3190                                anim_time,
3191                                anim_time,
3192                                speednorm,
3193                                0.0,
3194                                tilt,
3195                                Some(d.last_ori),
3196                                Some(*d.look_dir),
3197                            );
3198                        },
3199                        Some(HandInfo::OffHand) => {
3200                            dual_wield_start(&mut next);
3201
3202                            next.control_r.orientation.rotate_x(move1 * 0.6);
3203                            next.control_r.orientation.rotate_y(move1 * 5.7);
3204                            next.control_r.orientation.rotate_z(move1 * 0.4);
3205                            next.chest.orientation.rotate_x(move1 * 0.4);
3206                            next.head.orientation.rotate_x(move1 * 0.4);
3207                            next.control_r.position += Vec3::new(-15.0, 8.0, 3.0) * move1;
3208                            next.control_l.position += Vec3::new(4.0, -6.0, -9.0);
3209
3210                            next.control_r.position += Vec3::new(
3211                                (move2 * 50.0).sin(),
3212                                (move2 * 67.0).sin(),
3213                                (move2 * 83.0).sin(),
3214                            );
3215                        },
3216                        _ => {},
3217                    }
3218                }
3219
3220                next.control.orientation.rotate_x(move1 * 0.6);
3221                next.control.orientation.rotate_y(move1 * 0.9);
3222                next.control.orientation.rotate_x(move1 * -0.6);
3223                next.chest.orientation.rotate_x(move1 * 0.4);
3224                next.control.position += Vec3::new(0.0, 4.0, 3.0) * move1;
3225
3226                next.control.position += Vec3::new(
3227                    (move2 * 50.0).sin(),
3228                    (move2 * 67.0).sin(),
3229                    (move2 * 83.0).sin(),
3230                );
3231            },
3232            Some("common.abilities.hammer.tremor") => {
3233                if let Some(ability_info) = d.ability_info {
3234                    match ability_info.hand {
3235                        Some(HandInfo::TwoHanded) => {
3236                            hammer_start(&mut next, s_a);
3237
3238                            twist_back(&mut next, move1, 1.4, 0.7, 0.5, 0.9);
3239                            next.foot_l.orientation.rotate_z(move1 * 1.4);
3240                            next.foot_l.position += Vec3::new(-1.0, -3.0, 0.0) * move1;
3241                            next.control.orientation.rotate_x(move1 * 2.6);
3242                            next.control.orientation.rotate_y(move1 * 0.8);
3243
3244                            twist_forward(&mut next, move2, 2.1, 1.2, 0.9, 1.6);
3245                            next.foot_l.orientation.rotate_z(move2 * -1.4);
3246                            next.foot_l.position += Vec3::new(2.0, 7.0, 0.0) * move2;
3247                            next.control.orientation.rotate_z(move2 * 2.1);
3248                            next.control.orientation.rotate_x(move2 * -2.0);
3249                            next.control.orientation.rotate_z(move2 * 1.2);
3250                            next.control.position += Vec3::new(-16.0, 0.0, 0.0) * move2;
3251                            next.chest.orientation.rotate_x(-0.8 * move2);
3252                        },
3253                        Some(HandInfo::MainHand) => {
3254                            dual_wield_start(&mut next);
3255
3256                            twist_back(&mut next, move1, 1.4, 0.7, 0.5, 0.9);
3257                            next.foot_l.orientation.rotate_z(move1 * 1.4);
3258                            next.foot_l.position += Vec3::new(-1.0, -3.0, 0.0) * move1;
3259                            next.control_l.orientation.rotate_x(move1 * 2.6);
3260                            next.control_l.position += Vec3::new(0.0, 4.0, 10.0) * move1;
3261
3262                            twist_forward(&mut next, move2, 2.1, 1.2, 0.9, 1.6);
3263                            next.foot_l.orientation.rotate_z(move2 * -1.4);
3264                            next.foot_l.position += Vec3::new(2.0, 7.0, 0.0) * move2;
3265                            next.control_l.orientation.rotate_z(move2 * 2.1);
3266                            next.control_l.orientation.rotate_x(move2 * -2.0);
3267                            next.control_l.orientation.rotate_z(move2 * 1.2);
3268                            next.control_l.position += Vec3::new(-16.0, 0.0, 0.0) * move2;
3269                            next.chest.orientation.rotate_x(-0.8 * move2);
3270
3271                            next.do_hold_lantern(
3272                                s_a,
3273                                anim_time,
3274                                anim_time,
3275                                speednorm,
3276                                0.0,
3277                                tilt,
3278                                Some(d.last_ori),
3279                                Some(*d.look_dir),
3280                            );
3281                        },
3282                        Some(HandInfo::OffHand) => {
3283                            dual_wield_start(&mut next);
3284
3285                            twist_back(&mut next, -move1, 1.4, 0.7, 0.5, 0.9);
3286                            next.foot_r.orientation.rotate_z(-move1 * 1.4);
3287                            next.foot_r.position += Vec3::new(-1.0, -3.0, 0.0) * move1;
3288                            next.control_r.orientation.rotate_x(move1 * 2.6);
3289                            next.control_r.position += Vec3::new(0.0, 4.0, 10.0) * move1;
3290
3291                            twist_forward(&mut next, -move2, 2.1, 1.2, 0.9, 1.6);
3292                            next.foot_r.orientation.rotate_z(-move2 * -1.4);
3293                            next.foot_r.position += Vec3::new(2.0, 7.0, 0.0) * move2;
3294                            next.control_r.orientation.rotate_z(move2 * 2.1);
3295                            next.control_r.orientation.rotate_x(move2 * -2.0);
3296                            next.control_r.orientation.rotate_z(move2 * 1.2);
3297                            next.control_r.position += Vec3::new(-16.0, 8.0, 0.0) * move2;
3298                            next.chest.orientation.rotate_x(-0.8 * move2);
3299                        },
3300                        _ => {},
3301                    }
3302                }
3303            },
3304            Some("common.abilities.hammer.rampart") => {
3305                if let Some(ability_info) = d.ability_info {
3306                    match ability_info.hand {
3307                        Some(HandInfo::TwoHanded) => {
3308                            hammer_start(&mut next, s_a);
3309                            next.control.orientation.rotate_x(move1 * 0.6);
3310                            next.control.orientation.rotate_y(move1 * -PI / 2.0);
3311                            next.hand_l.orientation.rotate_y(move1 * -PI);
3312                            next.hand_r.orientation.rotate_y(move1 * -PI);
3313                            next.control.position += Vec3::new(-5.0, 0.0, 30.0) * move1;
3314
3315                            next.control.position += Vec3::new(0.0, 0.0, -10.0) * move2;
3316                            next.torso.orientation.rotate_x(move2 * -0.6);
3317                            next.control.orientation.rotate_x(move2 * 0.6);
3318                        },
3319                        Some(HandInfo::MainHand) => {
3320                            dual_wield_start(&mut next);
3321
3322                            next.control_l.orientation.rotate_x(move1 * 0.6);
3323                            next.control_l.orientation.rotate_y(move1 * -PI);
3324                            next.hand_l.orientation.rotate_y(move1 * PI);
3325                            next.control_l.position += Vec3::new(8.0, 14.0, 20.0) * move1;
3326
3327                            next.control_l.position += Vec3::new(0.0, 0.0, -10.0) * move2;
3328                            next.torso.orientation.rotate_x(move2 * -0.6);
3329                            next.control_l.orientation.rotate_x(move2 * 0.6);
3330
3331                            next.do_hold_lantern(
3332                                s_a,
3333                                anim_time,
3334                                anim_time,
3335                                speednorm,
3336                                0.0,
3337                                tilt,
3338                                Some(d.last_ori),
3339                                Some(*d.look_dir),
3340                            );
3341                        },
3342                        Some(HandInfo::OffHand) => {
3343                            dual_wield_start(&mut next);
3344
3345                            next.control_r.orientation.rotate_x(move1 * 0.6);
3346                            next.control_r.orientation.rotate_y(move1 * PI);
3347                            next.hand_l.orientation.rotate_y(move1 * PI);
3348                            next.control_r.position += Vec3::new(-8.0, 14.0, 20.0) * move1;
3349
3350                            next.control_r.position += Vec3::new(0.0, 0.0, -10.0) * move2;
3351                            next.torso.orientation.rotate_x(move2 * -0.6);
3352                            next.control_r.orientation.rotate_x(move2 * 0.6);
3353                        },
3354                        _ => {},
3355                    }
3356                }
3357            },
3358            Some("common.abilities.hammer.seismic_shock") => {
3359                hammer_start(&mut next, s_a);
3360
3361                next.control.orientation.rotate_x(move1 * 2.5);
3362                next.control.position += Vec3::new(0.0, 0.0, 28.0) * move1;
3363                next.head.orientation.rotate_x(move1 * 0.3);
3364                next.chest.orientation.rotate_x(move1 * 0.3);
3365                next.belt.orientation.rotate_x(move1 * -0.2);
3366                next.shorts.orientation.rotate_x(move1 * -0.3);
3367
3368                next.control.orientation.rotate_z(move2 * 2.0);
3369                next.control.orientation.rotate_x(move2 * -4.0);
3370                next.control.position += Vec3::new(-6.0, 0.0, -30.0) * move2;
3371                next.head.orientation.rotate_x(move2 * -0.9);
3372                next.chest.orientation.rotate_x(move2 * -0.5);
3373                next.belt.orientation.rotate_x(move2 * 0.2);
3374                next.shorts.orientation.rotate_x(move2 * 0.4);
3375            },
3376            // ==================================
3377            //                BOW
3378            // ==================================
3379            Some("common.abilities.bow.arrow_shot") => {
3380                bow_start(&mut next, s_a);
3381
3382                let charge = chargebase.min(1.0);
3383                let tension = (chargebase * 15.0).sin();
3384
3385                bow_draw(&mut next, move1base, d.look_dir.z);
3386
3387                next.hand_l.position +=
3388                    Vec3::new(0.0, charge * -3.0, 0.0) + Vec3::one() * tension * 0.05;
3389            },
3390            Some(
3391                "common.abilities.bow.broadhead"
3392                | "common.abilities.bow.burning_broadhead"
3393                | "common.abilities.bow.poison_broadhead"
3394                | "common.abilities.bow.freezing_broadhead"
3395                | "common.abilities.bow.lightning_broadhead",
3396            ) => {
3397                bow_start(&mut next, s_a);
3398
3399                let charge = chargebase.min(1.0);
3400                let tension = (chargebase * 50.0).sin();
3401
3402                next.hold.scale *= 1.3;
3403                bow_draw(&mut next, move1base, d.look_dir.z);
3404
3405                next.hand_l.position +=
3406                    Vec3::new(0.0, charge * -5.0, 0.0) + Vec3::one() * tension * 0.05;
3407            },
3408            Some("common.abilities.bow.foothold") => {
3409                bow_start(&mut next, s_a);
3410
3411                let move1a = (move1base * 1.5).min(1.0);
3412                let move1b = (move1base * 3.0 - 2.0).max(0.0).powi(4);
3413                let move1a_reta = move1a - move1b;
3414                let move2 = movementbase.min(1.0);
3415                let move1a_retb = move1a - move2;
3416                let move1b_ret = move1b - move2;
3417
3418                twist_back(&mut next, move1a_reta, 1.1, 0.7, 0.5, 0.8);
3419                next.foot_l.orientation.rotate_z(move1a_retb * 1.4);
3420                next.foot_l.position += Vec3::new(-2.0, -3.0, 0.0) * move1a_retb;
3421                next.control.orientation.rotate_z(move1a_reta * -0.9);
3422                next.control.position += Vec3::new(8.0, 3.0, 0.0) * move1a_reta;
3423
3424                twist_forward(&mut next, move1b_ret, 1.8, 1.1, 0.6, 1.0);
3425                next.foot_l.orientation.rotate_z(move1b_ret * -2.4);
3426                next.foot_l.orientation.rotate_x(move1b_ret * 1.2);
3427                next.foot_l.position += Vec3::new(11.0, 10.0, 6.0) * move1b_ret;
3428
3429                bow_draw(&mut next, move2, d.look_dir.z);
3430            },
3431            Some("common.abilities.bow.barrage") => {
3432                bow_start(&mut next, s_a);
3433
3434                next.hand_l.position += Vec3::new(4.0, -6.0, -6.0) * move1;
3435                next.hand_l.orientation.rotate_z(move1 * 2.0);
3436            },
3437            Some("common.abilities.bow.storm_chaser") => {
3438                bow_start(&mut next, s_a);
3439
3440                next.hand_l.position += Vec3::new(-4.0, 0.0, 4.0) * move1;
3441                next.hand_l.orientation.rotate_x(1.6 * move1);
3442
3443                next.hand_l.position += Vec3::new(0.0, 0.0, -10.0) * move2;
3444            },
3445            Some("common.abilities.bow.heavy_nock") => {
3446                bow_start(&mut next, s_a);
3447
3448                bow_draw(&mut next, move1, d.look_dir.z);
3449                next.control.position += Vec3::new(0.0, 0.0, 3.0) * move1;
3450                next.control.orientation.rotate_x(move1 * 0.6);
3451                next.hand_l.position += Vec3::new(0.0, -3.0, 0.0) * move1;
3452                next.hold.scale *= 1.0 + 0.5 * move1;
3453                let offset = 3.0;
3454                next.torso.position += Vec3::new(0.0, -5.0, -offset) * move1;
3455                next.foot_l.position += Vec3::new(0.0, 0.0, offset) * move1;
3456                next.foot_r.position += Vec3::new(0.0, 0.0, offset) * move1;
3457            },
3458            Some("common.abilities.bow.heartseeker") => {
3459                bow_start(&mut next, s_a);
3460
3461                next.control.orientation.rotate_y(move1 * 0.4);
3462                next.control.orientation.rotate_x(move1 * 0.6);
3463                next.control.position += Vec3::new(4.0, -15.0, 6.0) * move1;
3464            },
3465            Some(
3466                "common.abilities.bow.heartseeker_shot"
3467                | "common.abilities.bow.burning_heartseeker_shot"
3468                | "common.abilities.bow.poison_heartseeker_shot"
3469                | "common.abilities.bow.freezing_heartseeker_shot"
3470                | "common.abilities.bow.lightning_heartseeker_shot",
3471            ) => {
3472                bow_start(&mut next, s_a);
3473
3474                let charge = chargebase.min(1.0);
3475                let tension = (chargebase * 250.0).sin();
3476
3477                bow_draw(&mut next, move1base, d.look_dir.z);
3478
3479                next.hand_l.position +=
3480                    Vec3::new(0.0, charge * -3.0, 0.0) + Vec3::one() * tension * 0.1;
3481
3482                let offset = 3.0 + tension * 0.15;
3483                next.torso.position += Vec3::new(0.0, -5.0, -offset) * move1;
3484                next.foot_l.position += Vec3::new(0.0, -5.0, offset) * move1;
3485                next.foot_l.orientation.rotate_x(move1 * -PI / 2.0);
3486                next.foot_r.position += Vec3::new(0.0, 0.0, offset) * move1;
3487            },
3488            Some("common.abilities.bow.eagle_eye") => {
3489                bow_start(&mut next, s_a);
3490
3491                next.control.orientation.rotate_x(move1 * 0.8);
3492                next.control.position += Vec3::new(5.0, 0.0, 7.0) * move1;
3493            },
3494            Some("common.abilities.bow.septic_shot") => {
3495                bow_start(&mut next, s_a);
3496
3497                bow_draw(&mut next, move1base, d.look_dir.z);
3498
3499                let move1_return = if move1base < 0.6 {
3500                    move1base / 0.6
3501                } else if move1base < 0.8 {
3502                    1.0 - (move1base - 0.6) / 0.2
3503                } else {
3504                    0.0
3505                };
3506
3507                next.hand_l.position += Vec3::new(0.0, 0.0, -15.0) * move1_return;
3508                next.hand_l.position += Vec3::new(0.0, -5.0, 0.0) * move1;
3509                next.hand_l.orientation.rotate_x(move1_return * -3.0);
3510            },
3511            Some(
3512                "common.abilities.bow.ignite_arrow"
3513                | "common.abilities.bow.drench_arrow"
3514                | "common.abilities.bow.freeze_arrow"
3515                | "common.abilities.bow.jolt_arrow",
3516            ) => {
3517                bow_start(&mut next, s_a);
3518            },
3519            Some("common.abilities.bow.ardent_hunt" | "common.abilities.bow.ardent_hunt_clear") => {
3520                bow_start(&mut next, s_a);
3521
3522                next.foot_l.position += Vec3::new(0.0, 2.0, 0.0) * move1;
3523                next.control.position += Vec3::new(6.0, 3.0, 5.0) * move1;
3524                next.control.orientation.rotate_y(move1 * -1.0);
3525            },
3526            Some("common.abilities.bow.piercing_gale") => {
3527                bow_start(&mut next, s_a);
3528
3529                bow_draw(&mut next, move1base, d.look_dir.z);
3530
3531                next.control.orientation.rotate_z(move1 * 0.8);
3532                next.control.orientation.rotate_y(move1 * -4.0);
3533                next.control.orientation.rotate_z(move1 * -0.8);
3534            },
3535            Some(
3536                "common.abilities.bow.thorn_stake"
3537                | "common.abilities.bow.burning_thorn_stake"
3538                | "common.abilities.bow.poison_thorn_stake"
3539                | "common.abilities.bow.freezing_thorn_stake"
3540                | "common.abilities.bow.lightning_thorn_stake",
3541            ) => {
3542                bow_start(&mut next, s_a);
3543
3544                bow_draw(&mut next, move1base, d.look_dir.z);
3545
3546                let move1_return = if move1base < 0.6 {
3547                    move1base / 0.6
3548                } else if move1base < 0.8 {
3549                    1.0 - (move1base - 0.6) / 0.2
3550                } else {
3551                    0.0
3552                };
3553                let move1_delay = if move1 > 0.8 {
3554                    (move1 - 0.8) / 0.2
3555                } else {
3556                    0.0
3557                };
3558
3559                next.hand_l.orientation.rotate_x(move1_return * 6.0);
3560                next.hand_l.position += Vec3::new(0.0, -15.0, 0.0) * move1_return;
3561                next.hand_l.position += Vec3::new(0.0, -5.0, 0.0) * move1_delay;
3562            },
3563            Some("common.abilities.bow.hawkstrike") => {
3564                bow_start(&mut next, s_a);
3565
3566                bow_draw(&mut next, move1base * 2.0, d.look_dir.z);
3567            },
3568            Some("common.abilities.bow.hawkstrike_shot") => {
3569                bow_start(&mut next, s_a);
3570
3571                let charge = chargebase.min(1.0);
3572
3573                bow_draw(&mut next, move1base, d.look_dir.z);
3574
3575                next.hand_l.position += Vec3::new(0.0, charge * -5.0, 0.0);
3576                next.hand_l.orientation.rotate_y(charge * PI / 2.0);
3577            },
3578            Some("common.abilities.bow.death_volley") => {
3579                bow_start(&mut next, s_a);
3580                let look_z = d.look_dir_override.map_or(d.look_dir.z, |ldo| ldo.z);
3581                bow_draw(&mut next, move1base, look_z);
3582
3583                next.hold.scale *= 1.5;
3584                next.torso.position += Vec3::new(0.0, 0.0, -3.0) * move1;
3585                next.foot_l.orientation.rotate_x(-1.7 * move1);
3586                next.foot_l.position += Vec3::new(0.0, -8.0, 3.0) * move1;
3587                next.foot_r.position += Vec3::new(0.0, 6.0, 3.0) * move1;
3588            },
3589            // ==================================
3590            //             FIRE STAFF
3591            // ==================================
3592            Some("common.abilities.staff.flamethrower") => {
3593                let move1 = move1base;
3594                let move2 = move2base;
3595                let move3 = move3base;
3596
3597                next.hand_l.position = Vec3::new(s_a.sthl.0, s_a.sthl.1, s_a.sthl.2);
3598                next.hand_l.orientation =
3599                    Quaternion::rotation_x(s_a.sthl.3) * Quaternion::rotation_y(s_a.sthl.4);
3600                next.hand_r.position = Vec3::new(s_a.sthr.0, s_a.sthr.1, s_a.sthl.2);
3601                next.hand_r.orientation =
3602                    Quaternion::rotation_x(s_a.sthr.3) * Quaternion::rotation_y(s_a.sthr.4);
3603                next.main.position = Vec3::new(0.0, 0.0, 0.0);
3604                next.main.orientation = Quaternion::rotation_x(0.0);
3605
3606                next.control.position = Vec3::new(-4.0, 7.0, 4.0);
3607                next.control.orientation = Quaternion::rotation_x(-0.3)
3608                    * Quaternion::rotation_y(0.15)
3609                    * Quaternion::rotation_z(0.0);
3610
3611                next.control.position = Vec3::new(
3612                    s_a.stc.0 + (move1 * 16.0) * (1.0 - move3),
3613                    s_a.stc.1 + (move1 + (move2 * 8.0).sin() * 2.0) * (1.0 - move3),
3614                    s_a.stc.2 + (move1 * 10.0) * (1.0 - move3),
3615                );
3616                next.control.orientation =
3617                    Quaternion::rotation_x(s_a.stc.3 + (move1 * -1.2) * (1.0 - move3))
3618                        * Quaternion::rotation_y(
3619                            s_a.stc.4
3620                                + (move1 * -1.4 + (move2 * 16.0).sin() * 0.07) * (1.0 - move3),
3621                        )
3622                        * Quaternion::rotation_z(
3623                            (move1 * -1.7 + (move2 * 8.0 + PI / 4.0).sin() * 0.3) * (1.0 - move3),
3624                        );
3625                next.head.orientation = Quaternion::rotation_x(0.0);
3626
3627                next.hand_l.position = Vec3::new(
3628                    0.0 + (move1 * -1.0 + (move2 * 8.0).sin() * 3.5) * (1.0 - move3),
3629                    0.0 + (move1 * -5.0 + (move2 * 8.0).sin() * -2.0 + (move2 * 16.0).sin() * -1.5)
3630                        * (1.0 - move3),
3631                    -4.0 + (move1 * 19.0 + (move2 * 8.0 + PI / 2.0).sin() * 3.5) * (1.0 - move3),
3632                );
3633                next.hand_l.orientation =
3634                    Quaternion::rotation_x(s_a.sthr.3 + (move1 * -0.3) * (1.0 - move3))
3635                        * Quaternion::rotation_y(
3636                            (move1 * -1.1 + (move2 * 8.0 + PI / 2.0).sin() * -0.3) * (1.0 - move3),
3637                        )
3638                        * Quaternion::rotation_z((move1 * -2.8) * (1.0 - move3));
3639
3640                if d.velocity.magnitude_squared() < 0.5_f32.powi(2) {
3641                    next.head.orientation =
3642                        Quaternion::rotation_z(move1 * -0.5 + (move2 * 16.0).sin() * 0.05);
3643
3644                    if !d.is_riding {
3645                        next.foot_l.position =
3646                            Vec3::new(-s_a.foot.0, s_a.foot.1 + move1 * -3.0, s_a.foot.2);
3647                        next.foot_l.orientation = Quaternion::rotation_x(move1 * -0.5)
3648                            * Quaternion::rotation_z(move1 * 0.5);
3649
3650                        next.foot_r.position =
3651                            Vec3::new(s_a.foot.0, s_a.foot.1 + move1 * 4.0, s_a.foot.2);
3652                        next.foot_r.orientation = Quaternion::rotation_z(move1 * 0.5);
3653                    }
3654
3655                    next.chest.orientation =
3656                        Quaternion::rotation_x(move1 * -0.2 + (move2 * 8.0).sin() * 0.05)
3657                            * Quaternion::rotation_z(move1 * 0.5);
3658                    next.belt.orientation =
3659                        Quaternion::rotation_x(move1 * 0.1) * Quaternion::rotation_z(move1 * -0.1);
3660                    next.shorts.orientation =
3661                        Quaternion::rotation_x(move1 * 0.2) * Quaternion::rotation_z(move1 * -0.2);
3662                };
3663            },
3664            Some("common.abilities.staff.fireshockwave") => {
3665                let move1 = move1base;
3666                let move2 = move2base;
3667                let move3 = move3base;
3668
3669                next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1);
3670
3671                next.hand_l.position = Vec3::new(s_a.sthl.0, s_a.sthl.1, s_a.sthl.2);
3672                next.hand_l.orientation =
3673                    Quaternion::rotation_x(s_a.sthl.3) * Quaternion::rotation_y(s_a.sthl.4);
3674                next.hand_r.position = Vec3::new(s_a.sthr.0, s_a.sthr.1, s_a.sthr.2);
3675                next.hand_r.orientation =
3676                    Quaternion::rotation_x(s_a.sthr.3) * Quaternion::rotation_y(s_a.sthr.4);
3677                next.main.position = Vec3::new(0.0, 0.0, 0.0);
3678                next.main.orientation = Quaternion::rotation_x(0.0);
3679
3680                next.control.position = Vec3::new(s_a.stc.0, s_a.stc.1, s_a.stc.2);
3681                next.control.orientation =
3682                    Quaternion::rotation_x(s_a.stc.3) * Quaternion::rotation_y(s_a.stc.4);
3683
3684                let twist = move1 * 0.8;
3685
3686                next.control.position = Vec3::new(
3687                    s_a.stc.0 + (move1 * 5.0) * (1.0 - move3),
3688                    s_a.stc.1 + (move1 * 5.0) * (1.0 - move3),
3689                    s_a.stc.2 + (move1 * 10.0 + move2 * -10.0) * (1.0 - move3),
3690                );
3691                next.control.orientation =
3692                    Quaternion::rotation_x(s_a.stc.3 + (move1 * 0.8) * (1.0 - move3))
3693                        * Quaternion::rotation_y(
3694                            s_a.stc.4 + (move1 * -0.15 + move2 * -0.15) * (1.0 - move3),
3695                        )
3696                        * Quaternion::rotation_z((move1 * 0.8 + move2 * -0.8) * (1.0 - move3));
3697
3698                next.head.orientation = Quaternion::rotation_x((move1 * 0.4) * (1.0 - move3))
3699                    * Quaternion::rotation_z((twist * 0.2 + move2 * -0.8) * (1.0 - move3));
3700
3701                next.chest.position = Vec3::new(
3702                    0.0,
3703                    s_a.chest.0,
3704                    s_a.chest.1 + (move1 * 2.0 + move2 * -4.0) * (1.0 - move3),
3705                );
3706                next.chest.orientation = Quaternion::rotation_x((move2 * -0.8) * (1.0 - move3))
3707                    * Quaternion::rotation_z(twist * -0.2 + move2 * -0.1 + (1.0 - move3));
3708
3709                next.belt.orientation = Quaternion::rotation_x((move2 * 0.2) * (1.0 - move3))
3710                    * Quaternion::rotation_z((twist * 0.6 + move2 * -0.48) * (1.0 - move3));
3711
3712                next.shorts.orientation = Quaternion::rotation_x((move2 * 0.3) * (1.0 - move3))
3713                    * Quaternion::rotation_z((twist + move2 * -0.8) * (1.0 - move3));
3714
3715                if d.velocity.magnitude() < 0.5 && !d.is_riding {
3716                    next.foot_l.position = Vec3::new(
3717                        -s_a.foot.0,
3718                        s_a.foot.1 + move1 * -7.0 + move2 * 7.0,
3719                        s_a.foot.2,
3720                    );
3721                    next.foot_l.orientation = Quaternion::rotation_x(move1 * -0.8 + move2 * 0.8)
3722                        * Quaternion::rotation_z(move1 * 0.3 + move2 * -0.3);
3723
3724                    next.foot_r.position = Vec3::new(
3725                        s_a.foot.0,
3726                        s_a.foot.1 + move1 * 5.0 + move2 * -5.0,
3727                        s_a.foot.2,
3728                    );
3729                    next.foot_r.orientation = Quaternion::rotation_y(move1 * -0.3 + move2 * 0.3)
3730                        * Quaternion::rotation_z(move1 * 0.4 + move2 * -0.4);
3731                }
3732            },
3733            Some("common.abilities.staff.firebomb" | "common.abilities.staff.napalm_strike") => {
3734                let move1 = move1base;
3735                let move2 = move2base.powf(0.25);
3736                let move3 = move3base;
3737
3738                let ori: Vec2<f32> = Vec2::from(d.orientation);
3739                let last_ori = Vec2::from(d.last_ori);
3740                let tilt = if vek::Vec2::new(ori, last_ori)
3741                    .map(|o| o.magnitude_squared())
3742                    .map(|m| m > 0.001 && m.is_finite())
3743                    .reduce_and()
3744                    && ori.angle_between(last_ori).is_finite()
3745                {
3746                    ori.angle_between(last_ori).min(0.2)
3747                        * last_ori.determine_side(Vec2::zero(), ori).signum()
3748                } else {
3749                    0.0
3750                } * 1.3;
3751                let ori_angle = d.orientation.y.atan2(d.orientation.x);
3752                let lookdir_angle = d.look_dir.y.atan2(d.look_dir.x);
3753                let swivel = lookdir_angle - ori_angle;
3754                let xmove = (move1 * 6.0 + PI).sin();
3755                let ymove = (move1 * 6.0 + PI * (0.5)).sin();
3756
3757                next.hand_l.position = Vec3::new(s_a.sthl.0, s_a.sthl.1, s_a.sthl.2);
3758                next.hand_l.orientation = Quaternion::rotation_x(s_a.sthl.3);
3759
3760                next.hand_r.position = Vec3::new(s_a.sthr.0, s_a.sthr.1, s_a.sthr.2);
3761                next.hand_r.orientation =
3762                    Quaternion::rotation_x(s_a.sthr.3) * Quaternion::rotation_y(s_a.sthr.4);
3763
3764                next.main.position = Vec3::new(0.0, 0.0, 0.0);
3765                next.main.orientation = Quaternion::rotation_y(0.0);
3766
3767                next.control.position = Vec3::new(
3768                    s_a.stc.0 + (xmove * 3.0 + move1 * -4.0) * (1.0 - move3),
3769                    s_a.stc.1 + (2.0 + ymove * 3.0 + move2 * 3.0) * (1.0 - move3),
3770                    s_a.stc.2 + d.look_dir.z * 4.0,
3771                );
3772                next.control.orientation = Quaternion::rotation_x(
3773                    d.look_dir.z + s_a.stc.3 + (move2 * 0.6) * (1.0 - move3),
3774                ) * Quaternion::rotation_y(
3775                    s_a.stc.4 + (move1 * 0.5 + move2 * -0.5),
3776                ) * Quaternion::rotation_z(
3777                    s_a.stc.5 - (0.2 + move1 * -0.5 + move2 * 0.8) * (1.0 - move3),
3778                );
3779
3780                next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1);
3781                next.head.orientation = Quaternion::rotation_x(d.look_dir.z * 0.7)
3782                    * Quaternion::rotation_z(
3783                        tilt * -2.5 + (move1 * -0.2 + move2 * -0.4) * (1.0 - move3),
3784                    );
3785                next.chest.orientation = Quaternion::rotation_z(swivel * 0.8);
3786                next.torso.orientation = Quaternion::rotation_z(swivel * 0.2);
3787            },
3788            Some("common.abilities.staff.fire_breath") => {
3789                let move1 = move1base.powf(0.5) * pullback;
3790                let move2 = move2base * pullback;
3791
3792                next.hand_l.position = Vec3::new(s_a.sthl.0, s_a.sthl.1, s_a.sthl.2);
3793                next.hand_l.orientation =
3794                    Quaternion::rotation_x(s_a.sthl.3) * Quaternion::rotation_y(s_a.sthl.4);
3795                next.hand_r.position = Vec3::new(s_a.sthr.0, s_a.sthr.1, s_a.sthr.2);
3796                next.hand_r.orientation =
3797                    Quaternion::rotation_x(s_a.sthr.3) * Quaternion::rotation_y(s_a.sthr.4);
3798                next.main.position = Vec3::new(0.0, 0.0, 0.0);
3799                next.main.orientation = Quaternion::rotation_x(0.0);
3800
3801                next.control.position = Vec3::new(
3802                    s_a.stc.0 + move1 * -2.0,
3803                    s_a.stc.1 + move1 * 6.0,
3804                    s_a.stc.2 + d.look_dir.z * 3.0 + move1 * 3.0,
3805                );
3806                next.control.orientation =
3807                    Quaternion::rotation_x(s_a.stc.3 + d.look_dir.z * 0.8 + move1 * -0.4)
3808                        * Quaternion::rotation_y(s_a.stc.4 + move1 * 0.1)
3809                        * Quaternion::rotation_z(s_a.stc.5 + move1 * 0.1);
3810
3811                next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1);
3812                next.head.orientation = Quaternion::rotation_x(
3813                    d.look_dir.z * 0.6 + move1 * 0.1 + (move2 * 4.0).sin() * 0.03,
3814                );
3815
3816                next.chest.orientation =
3817                    Quaternion::rotation_x(move1 * -0.15 + (move2 * 4.0).sin() * 0.04);
3818                next.belt.orientation = Quaternion::rotation_x(move1 * 0.08);
3819                next.shorts.orientation = Quaternion::rotation_x(move1 * 0.12);
3820
3821                if d.velocity.magnitude_squared() < 0.5_f32.powi(2) && !d.is_riding {
3822                    next.foot_l.position =
3823                        Vec3::new(-s_a.foot.0, s_a.foot.1 + move1 * -2.0, s_a.foot.2);
3824                    next.foot_l.orientation = Quaternion::rotation_x(move1 * -0.3);
3825
3826                    next.foot_r.position =
3827                        Vec3::new(s_a.foot.0, s_a.foot.1 + move1 * 3.0, s_a.foot.2);
3828                    next.foot_r.orientation = Quaternion::rotation_x(move1 * 0.2);
3829                }
3830            },
3831            Some("common.abilities.staff.flame_cloak") => {
3832                let buildup_frac = 0.30;
3833                let t = match d.stage_section {
3834                    Some(StageSection::Buildup) => move1base * buildup_frac,
3835                    Some(StageSection::Action) => buildup_frac + move2base * (1.0 - buildup_frac),
3836                    _ => 0.0,
3837                };
3838                let circle_angle = (t * std::f32::consts::PI * 0.5).sin() * TAU;
3839
3840                next.hand_l.position = Vec3::new(s_a.sthl.0, s_a.sthl.1, s_a.sthl.2);
3841                next.hand_l.orientation =
3842                    Quaternion::rotation_x(s_a.sthl.3) * Quaternion::rotation_y(s_a.sthl.4);
3843                next.hand_r.position = Vec3::new(s_a.sthr.0, s_a.sthr.1, s_a.sthr.2);
3844                next.hand_r.orientation =
3845                    Quaternion::rotation_x(s_a.sthr.3) * Quaternion::rotation_y(s_a.sthr.4);
3846                next.main.position = Vec3::new(0.0, 0.0, 0.0);
3847                next.main.orientation = Quaternion::rotation_x(0.0);
3848
3849                let (sin_offset, cos_offset, forward_nudge) =
3850                    if matches!(d.stage_section, Some(StageSection::Recover)) {
3851                        let r = (move3base * std::f32::consts::PI * 0.5).cos();
3852                        (0.0_f32, r, 0.0_f32)
3853                    } else {
3854                        (circle_angle.sin(), circle_angle.cos(), (1.0 - t) * 6.0)
3855                    };
3856
3857                let tilt = 0.7;
3858                next.control.position = Vec3::new(
3859                    s_a.stc.0 + sin_offset * 1.5,
3860                    s_a.stc.1 + forward_nudge + cos_offset * 5.5 * tilt,
3861                    s_a.stc.2 + cos_offset * 5.5 * (1.0 - tilt),
3862                );
3863                next.control.orientation = Quaternion::rotation_x(s_a.stc.3 + cos_offset * 0.55)
3864                    * Quaternion::rotation_y(s_a.stc.4 + sin_offset * 0.35)
3865                    * Quaternion::rotation_z(s_a.stc.5);
3866            },
3867            // ==================================
3868            //           NATURE SCEPTRE
3869            // ==================================
3870            Some(
3871                "common.abilities.sceptre.lifestealbeam"
3872                | "common.abilities.custom.cardinal.steambeam",
3873            ) => {
3874                let move1 = move1base;
3875                let move2 = move2base;
3876                let move3 = move3base;
3877
3878                next.hand_l.position = Vec3::new(s_a.sthl.0, s_a.sthl.1, s_a.sthl.2);
3879                next.hand_l.orientation =
3880                    Quaternion::rotation_x(s_a.sthl.3) * Quaternion::rotation_y(s_a.sthl.4);
3881                next.hand_r.position = Vec3::new(s_a.sthr.0, s_a.sthr.1, s_a.sthl.2);
3882                next.hand_r.orientation =
3883                    Quaternion::rotation_x(s_a.sthr.3) * Quaternion::rotation_y(s_a.sthr.4);
3884                next.main.position = Vec3::new(0.0, 0.0, 0.0);
3885                next.main.orientation = Quaternion::rotation_x(0.0);
3886
3887                next.control.position = Vec3::new(-4.0, 7.0, 4.0);
3888                next.control.orientation = Quaternion::rotation_x(-0.3)
3889                    * Quaternion::rotation_y(0.15)
3890                    * Quaternion::rotation_z(0.0);
3891
3892                next.control.position = Vec3::new(
3893                    s_a.stc.0 + (move1 * 16.0) * (1.0 - move3),
3894                    s_a.stc.1 + (move1 + (move2 * 8.0).sin() * 2.0) * (1.0 - move3),
3895                    s_a.stc.2 + (move1 * 10.0) * (1.0 - move3),
3896                );
3897                next.control.orientation =
3898                    Quaternion::rotation_x(s_a.stc.3 + (move1 * -1.2) * (1.0 - move3))
3899                        * Quaternion::rotation_y(
3900                            s_a.stc.4
3901                                + (move1 * -1.4 + (move2 * 16.0).sin() * 0.07) * (1.0 - move3),
3902                        )
3903                        * Quaternion::rotation_z(
3904                            (move1 * -1.7 + (move2 * 8.0 + PI / 4.0).sin() * 0.3) * (1.0 - move3),
3905                        );
3906                next.head.orientation = Quaternion::rotation_x(0.0);
3907
3908                next.hand_l.position = Vec3::new(
3909                    0.0 + (move1 * -1.0 + (move2 * 8.0).sin() * 3.5) * (1.0 - move3),
3910                    0.0 + (move1 * -5.0 + (move2 * 8.0).sin() * -2.0 + (move2 * 16.0).sin() * -1.5)
3911                        * (1.0 - move3),
3912                    -4.0 + (move1 * 19.0 + (move2 * 8.0 + PI / 2.0).sin() * 3.5) * (1.0 - move3),
3913                );
3914                next.hand_l.orientation =
3915                    Quaternion::rotation_x(s_a.sthr.3 + (move1 * -0.3) * (1.0 - move3))
3916                        * Quaternion::rotation_y(
3917                            (move1 * -1.1 + (move2 * 8.0 + PI / 2.0).sin() * -0.3) * (1.0 - move3),
3918                        )
3919                        * Quaternion::rotation_z((move1 * -2.8) * (1.0 - move3));
3920
3921                if d.velocity.magnitude_squared() < 0.5_f32.powi(2) {
3922                    next.head.orientation =
3923                        Quaternion::rotation_z(move1 * -0.5 + (move2 * 16.0).sin() * 0.05);
3924
3925                    if !d.is_riding {
3926                        next.foot_l.position =
3927                            Vec3::new(-s_a.foot.0, s_a.foot.1 + move1 * -3.0, s_a.foot.2);
3928                        next.foot_l.orientation = Quaternion::rotation_x(move1 * -0.5)
3929                            * Quaternion::rotation_z(move1 * 0.5);
3930
3931                        next.foot_r.position =
3932                            Vec3::new(s_a.foot.0, s_a.foot.1 + move1 * 4.0, s_a.foot.2);
3933                        next.foot_r.orientation = Quaternion::rotation_z(move1 * 0.5);
3934                    }
3935
3936                    next.chest.orientation =
3937                        Quaternion::rotation_x(move1 * -0.2 + (move2 * 8.0).sin() * 0.05)
3938                            * Quaternion::rotation_z(move1 * 0.5);
3939                    next.belt.orientation =
3940                        Quaternion::rotation_x(move1 * 0.1) * Quaternion::rotation_z(move1 * -0.1);
3941                    next.shorts.orientation =
3942                        Quaternion::rotation_x(move1 * 0.2) * Quaternion::rotation_z(move1 * -0.2);
3943                };
3944            },
3945            Some(
3946                "common.abilities.sceptre.healingaura" | "common.abilities.sceptre.wardingaura",
3947            ) => {
3948                let move1 = move1base;
3949                let move2 = move2base;
3950                let move3 = move3base;
3951
3952                next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1);
3953
3954                next.hand_l.position = Vec3::new(s_a.sthl.0, s_a.sthl.1, s_a.sthl.2);
3955                next.hand_l.orientation =
3956                    Quaternion::rotation_x(s_a.sthl.3) * Quaternion::rotation_y(s_a.sthl.4);
3957                next.hand_r.position = Vec3::new(s_a.sthr.0, s_a.sthr.1, s_a.sthr.2);
3958                next.hand_r.orientation =
3959                    Quaternion::rotation_x(s_a.sthr.3) * Quaternion::rotation_y(s_a.sthr.4);
3960                next.main.position = Vec3::new(0.0, 0.0, 0.0);
3961                next.main.orientation = Quaternion::rotation_x(0.0);
3962
3963                next.control.position = Vec3::new(s_a.stc.0, s_a.stc.1, s_a.stc.2);
3964                next.control.orientation =
3965                    Quaternion::rotation_x(s_a.stc.3) * Quaternion::rotation_y(s_a.stc.4);
3966
3967                let twist = move1 * 0.8;
3968
3969                next.control.position = Vec3::new(
3970                    s_a.stc.0 + (move1 * 5.0) * (1.0 - move3),
3971                    s_a.stc.1 + (move1 * 5.0) * (1.0 - move3),
3972                    s_a.stc.2 + (move1 * 10.0 + move2 * -10.0) * (1.0 - move3),
3973                );
3974                next.control.orientation =
3975                    Quaternion::rotation_x(s_a.stc.3 + (move1 * 0.8) * (1.0 - move3))
3976                        * Quaternion::rotation_y(
3977                            s_a.stc.4 + (move1 * -0.15 + move2 * -0.15) * (1.0 - move3),
3978                        )
3979                        * Quaternion::rotation_z((move1 * 0.8 + move2 * -0.8) * (1.0 - move3));
3980
3981                next.head.orientation = Quaternion::rotation_x((move1 * 0.4) * (1.0 - move3))
3982                    * Quaternion::rotation_z((twist * 0.2 + move2 * -0.8) * (1.0 - move3));
3983
3984                next.chest.position = Vec3::new(
3985                    0.0,
3986                    s_a.chest.0,
3987                    s_a.chest.1 + (move1 * 2.0 + move2 * -4.0) * (1.0 - move3),
3988                );
3989                next.chest.orientation = Quaternion::rotation_x((move2 * -0.8) * (1.0 - move3))
3990                    * Quaternion::rotation_z(twist * -0.2 + move2 * -0.1 + (1.0 - move3));
3991
3992                next.belt.orientation = Quaternion::rotation_x((move2 * 0.2) * (1.0 - move3))
3993                    * Quaternion::rotation_z((twist * 0.6 + move2 * -0.48) * (1.0 - move3));
3994
3995                next.shorts.orientation = Quaternion::rotation_x((move2 * 0.3) * (1.0 - move3))
3996                    * Quaternion::rotation_z((twist + move2 * -0.8) * (1.0 - move3));
3997
3998                if d.velocity.magnitude() < 0.5 && !d.is_riding {
3999                    next.foot_l.position = Vec3::new(
4000                        -s_a.foot.0,
4001                        s_a.foot.1 + move1 * -7.0 + move2 * 7.0,
4002                        s_a.foot.2,
4003                    );
4004                    next.foot_l.orientation = Quaternion::rotation_x(move1 * -0.8 + move2 * 0.8)
4005                        * Quaternion::rotation_z(move1 * 0.3 + move2 * -0.3);
4006
4007                    next.foot_r.position = Vec3::new(
4008                        s_a.foot.0,
4009                        s_a.foot.1 + move1 * 5.0 + move2 * -5.0,
4010                        s_a.foot.2,
4011                    );
4012                    next.foot_r.orientation = Quaternion::rotation_y(move1 * -0.3 + move2 * 0.3)
4013                        * Quaternion::rotation_z(move1 * 0.4 + move2 * -0.4);
4014                }
4015            },
4016            // ==================================
4017            //               SHIELD
4018            // ==================================
4019            Some("common.abilities.shield.basic_guard" | "common.abilities.shield.power_guard") => {
4020                legacy_initialize();
4021                let pullback = 1.0 - move3base.powi(4);
4022                let move1 = move1base.powf(0.25) * pullback;
4023                let move2 = (move2base * 10.0).sin();
4024
4025                if d.velocity.xy().magnitude_squared() < 0.5_f32.powi(2) {
4026                    next.chest.position =
4027                        Vec3::new(0.0, s_a.chest.0, s_a.chest.1 + move1 * -1.0 + move2 * 0.2);
4028                    next.chest.orientation = Quaternion::rotation_x(move1 * -0.15);
4029                    next.head.orientation = Quaternion::rotation_x(move1 * 0.25);
4030
4031                    next.belt.position =
4032                        Vec3::new(0.0, s_a.belt.0 + move1 * 0.5, s_a.belt.1 + move1 * 0.5);
4033                    next.shorts.position =
4034                        Vec3::new(0.0, s_a.shorts.0 + move1 * 1.3, s_a.shorts.1 + move1 * 1.0);
4035
4036                    next.belt.orientation = Quaternion::rotation_x(move1 * 0.15);
4037                    next.shorts.orientation = Quaternion::rotation_x(move1 * 0.25);
4038
4039                    if !d.is_riding {
4040                        next.foot_l.position =
4041                            Vec3::new(-s_a.foot.0, s_a.foot.1 + move1 * 2.0, s_a.foot.2);
4042                        next.foot_l.orientation = Quaternion::rotation_z(move1 * -0.5);
4043
4044                        next.foot_r.position =
4045                            Vec3::new(s_a.foot.0, s_a.foot.1 + move1 * -2.0, s_a.foot.2);
4046                        next.foot_r.orientation = Quaternion::rotation_x(move1 * -0.5);
4047                    }
4048                }
4049
4050                if let Some(info) = d.ability_info {
4051                    match info.hand {
4052                        Some(HandInfo::MainHand) => {
4053                            next.control_l.position = Vec3::new(1.5, 8.0, 4.0 + move1 * 3.0);
4054                            next.control_l.orientation = Quaternion::rotation_x(0.25)
4055                                * Quaternion::rotation_y(0.0)
4056                                * Quaternion::rotation_z(-1.5);
4057                            next.hand_l.position = Vec3::new(0.0, -2.0, 0.0);
4058                            next.hand_l.orientation = Quaternion::rotation_x(PI / 2.0);
4059
4060                            next.control_r.position = Vec3::new(9.0, -5.0, 0.0);
4061                            next.control_r.orientation =
4062                                Quaternion::rotation_x(-1.75) * Quaternion::rotation_y(0.3);
4063                            next.hand_r.position = Vec3::new(0.0, -0.5, 0.0);
4064                            next.hand_r.orientation = Quaternion::rotation_x(PI / 2.0);
4065                        },
4066                        Some(HandInfo::OffHand) => {
4067                            next.control_r.position = Vec3::new(-1.5, 8.0, 4.0 + move1 * 3.0);
4068                            next.control_r.orientation = Quaternion::rotation_x(0.25)
4069                                * Quaternion::rotation_y(0.0)
4070                                * Quaternion::rotation_z(1.5);
4071                            next.hand_r.position = Vec3::new(0.0, -2.0, 0.0);
4072                            next.hand_r.orientation = Quaternion::rotation_x(PI / 2.0);
4073
4074                            next.control_l.position = Vec3::new(-9.0, -5.0, 0.0);
4075                            next.control_l.orientation =
4076                                Quaternion::rotation_x(-1.75) * Quaternion::rotation_y(-0.3);
4077                            next.hand_l.position = Vec3::new(0.0, -0.5, 0.0);
4078                            next.hand_l.orientation = Quaternion::rotation_x(PI / 2.0);
4079                        },
4080                        Some(HandInfo::TwoHanded) | None => {},
4081                    }
4082                }
4083            },
4084            // ==================================
4085            //            MISCELLANEOUS
4086            // ==================================
4087            Some("common.abilities.pick.swing") => {
4088                next.main.position = Vec3::new(0.0, 0.0, 0.0);
4089                next.main.orientation = Quaternion::rotation_x(0.0);
4090                next.second.position = Vec3::new(0.0, 0.0, 0.0);
4091                next.second.orientation = Quaternion::rotation_z(0.0);
4092                next.torso.position = Vec3::new(0.0, 0.0, 1.1);
4093                next.torso.orientation = Quaternion::rotation_z(0.0);
4094
4095                let move1 = move1base.powf(0.25);
4096                let move3 = move3base.powi(4);
4097                let pullback = 1.0 - move3;
4098                let moveret1 = move1base * pullback;
4099                let moveret2 = move2base * pullback;
4100
4101                next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1);
4102                next.head.orientation = Quaternion::rotation_x(moveret1 * 0.1 + moveret2 * 0.3)
4103                    * Quaternion::rotation_z(move1 * -0.2 + moveret2 * 0.2);
4104                next.chest.position = Vec3::new(0.0, s_a.chest.0, s_a.chest.1 + moveret2 * -2.0);
4105                next.chest.orientation = Quaternion::rotation_x(moveret1 * 0.4 + moveret2 * -0.7)
4106                    * Quaternion::rotation_y(moveret1 * 0.3 + moveret2 * -0.4)
4107                    * Quaternion::rotation_z(moveret1 * 0.5 + moveret2 * -0.5);
4108
4109                next.hand_l.position = Vec3::new(s_a.hhl.0, s_a.hhl.1, s_a.hhl.2 + moveret2 * -7.0);
4110                next.hand_l.orientation = Quaternion::rotation_x(s_a.hhl.3)
4111                    * Quaternion::rotation_y(s_a.hhl.4)
4112                    * Quaternion::rotation_z(s_a.hhl.5);
4113                next.hand_r.position = Vec3::new(s_a.hhr.0, s_a.hhr.1, s_a.hhr.2);
4114                next.hand_r.orientation = Quaternion::rotation_x(s_a.hhr.3)
4115                    * Quaternion::rotation_y(s_a.hhr.4)
4116                    * Quaternion::rotation_z(s_a.hhr.5);
4117
4118                next.control.position = Vec3::new(
4119                    s_a.hc.0 + moveret1 * -13.0 + moveret2 * 3.0,
4120                    s_a.hc.1 + (moveret2 * 5.0),
4121                    s_a.hc.2 + moveret1 * 8.0 + moveret2 * -6.0,
4122                );
4123                next.control.orientation =
4124                    Quaternion::rotation_x(s_a.hc.3 + (moveret1 * 1.5 + moveret2 * -2.55))
4125                        * Quaternion::rotation_y(s_a.hc.4 + moveret1 * PI / 2.0 + moveret2 * 0.5)
4126                        * Quaternion::rotation_z(s_a.hc.5 + (moveret2 * -0.5));
4127
4128                if skeleton.holding_lantern {
4129                    next.hand_r.position =
4130                        Vec3::new(s_a.hand.0, s_a.hand.1 + 5.0, s_a.hand.2 + 12.0);
4131                    next.hand_r.orientation =
4132                        Quaternion::rotation_x(2.25) * Quaternion::rotation_z(0.9);
4133
4134                    next.lantern.position = Vec3::new(-0.5, -0.5, -1.5);
4135                    next.lantern.orientation = next.hand_r.orientation.inverse();
4136                }
4137            },
4138            Some("common.abilities.shovel.dig") => {
4139                next.main.position = Vec3::new(0.0, 0.0, 0.0);
4140                next.main.orientation = Quaternion::rotation_x(0.0);
4141                next.second.position = Vec3::new(0.0, 0.0, 0.0);
4142                next.second.orientation = Quaternion::rotation_z(0.0);
4143                next.torso.position = Vec3::new(0.0, 0.0, 1.1);
4144                next.torso.orientation = Quaternion::rotation_z(0.0);
4145
4146                let move1 = move1base.powf(0.25);
4147                let move3 = move3base.powi(4);
4148                let pullback = 1.0 - move3;
4149                let moveret1 = move1base * pullback;
4150                let moveret2 = move2base * pullback;
4151
4152                next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1);
4153                next.head.orientation = Quaternion::rotation_x(moveret1 * 0.1 + moveret2 * 0.3)
4154                    * Quaternion::rotation_z(move1 * -0.2 + moveret2 * 0.2);
4155                next.chest.position = Vec3::new(0.0, s_a.chest.0, s_a.chest.1 + moveret2 * -2.0);
4156                next.chest.orientation = Quaternion::rotation_x(moveret1 * 0.4 + moveret2 * -0.7)
4157                    * Quaternion::rotation_y(moveret1 * 0.3 + moveret2 * -0.4)
4158                    * Quaternion::rotation_z(moveret1 * 0.5 + moveret2 * -0.5);
4159
4160                next.hand_l.position = Vec3::new(8.0, 6.0, 3.0);
4161                next.hand_l.orientation = Quaternion::rotation_x(PI / 2.0);
4162                next.hand_r.position = Vec3::new(8.0, 6.0, 15.0);
4163                next.hand_r.orientation = Quaternion::rotation_x(PI / 2.0);
4164                next.main.position = Vec3::new(7.5, 7.5, 13.2);
4165                next.main.orientation = Quaternion::rotation_y(PI);
4166
4167                next.control.position = Vec3::new(-11.0 + moveret1 * 8.0, 1.8, 4.0);
4168                next.control.orientation = Quaternion::rotation_x(moveret1 * 0.3 + moveret2 * 0.2)
4169                    * Quaternion::rotation_y(0.8 - moveret1 * 0.7 + moveret2 * 0.7)
4170                    * Quaternion::rotation_z(moveret2 * 0.1 - moveret1 * 0.4);
4171
4172                if skeleton.holding_lantern {
4173                    next.hand_r.position =
4174                        Vec3::new(s_a.hand.0, s_a.hand.1 + 5.0, s_a.hand.2 + 12.0);
4175                    next.hand_r.orientation =
4176                        Quaternion::rotation_x(2.25) * Quaternion::rotation_z(0.9);
4177
4178                    next.lantern.position = Vec3::new(-0.5, -0.5, -1.5);
4179                    next.lantern.orientation = next.hand_r.orientation.inverse();
4180                }
4181            },
4182            _ => {},
4183        }
4184
4185        next
4186    }
4187}