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