veloren_voxygen_anim/character/
multi.rs

1use super::{
2    super::{Animation, vek::*},
3    CharacterSkeleton, SkeletonAttr, dual_wield_start, hammer_start, twist_back, twist_forward,
4};
5use common::{
6    states::utils::{AbilityInfo, HandInfo, StageSection},
7    util::Dir,
8};
9use core::f32::consts::{PI, TAU};
10use std::ops::{Mul, Sub};
11
12pub struct MultiAction;
13
14pub struct MultiActionDependency<'a> {
15    pub ability_id: Option<&'a str>,
16    pub stage_section: Option<StageSection>,
17    pub ability_info: Option<AbilityInfo>,
18    pub current_action: u32,
19    pub max_actions: Option<u32>,
20    pub move_dir: Vec2<f32>,
21    pub orientation: Vec3<f32>,
22    pub look_dir: Dir,
23    pub velocity: Vec3<f32>,
24    pub is_riding: bool,
25}
26
27impl Animation for MultiAction {
28    type Dependency<'a> = MultiActionDependency<'a>;
29    type Skeleton = CharacterSkeleton;
30
31    #[cfg(feature = "use-dyn-lib")]
32    const UPDATE_FN: &'static [u8] = b"character_multi\0";
33
34    #[cfg_attr(feature = "be-dyn-lib", export_name = "character_multi")]
35    fn update_skeleton_inner(
36        skeleton: &Self::Skeleton,
37        d: Self::Dependency<'_>,
38        anim_time: f32,
39        rate: &mut f32,
40        s_a: &SkeletonAttr,
41    ) -> Self::Skeleton {
42        *rate = 1.0;
43        let mut next = (*skeleton).clone();
44
45        next.main.position = Vec3::new(0.0, 0.0, 0.0);
46        next.main.orientation = Quaternion::rotation_z(0.0);
47        next.second.position = Vec3::new(0.0, 0.0, 0.0);
48        next.second.orientation = Quaternion::rotation_z(0.0);
49        if matches!(d.stage_section, Some(StageSection::Action)) {
50            next.main_weapon_trail = true;
51            next.off_weapon_trail = true;
52        }
53        let multi_action_pullback = 1.0
54            - if matches!(d.stage_section, Some(StageSection::Recover)) {
55                anim_time.powi(4)
56            } else {
57                0.0
58            };
59
60        for action in 0..=d.current_action {
61            let (move1base, move2base, move3base) = if action == d.current_action {
62                match d.stage_section {
63                    Some(StageSection::Buildup) => (anim_time, 0.0, 0.0),
64                    Some(StageSection::Action) => (1.0, anim_time, 0.0),
65                    Some(StageSection::Recover) => (1.0, 1.0, anim_time),
66                    _ => (0.0, 0.0, 0.0),
67                }
68            } else {
69                (1.0, 1.0, 1.0)
70            };
71            let move1 = move1base * multi_action_pullback;
72            let move2 = move2base * multi_action_pullback;
73
74            match d.ability_id {
75                // ==================================
76                //               SWORD
77                // ==================================
78                Some(
79                    "common.abilities.sword.basic_double_slash"
80                    | "common.abilities.sword.heavy_double_slash"
81                    | "common.abilities.sword.agile_double_slash"
82                    | "common.abilities.sword.defensive_double_slash"
83                    | "common.abilities.sword.crippling_double_slash"
84                    | "common.abilities.sword.cleaving_double_slash",
85                ) => {
86                    let move1 = move1base.powf(0.25) * multi_action_pullback;
87                    let move2 = move2base.powi(2) * multi_action_pullback;
88                    let move2alt = move2base.powf(0.25) * multi_action_pullback;
89
90                    match action {
91                        0 => {
92                            next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
93                            next.hand_l.orientation = Quaternion::rotation_x(s_a.shl.3)
94                                * Quaternion::rotation_y(s_a.shl.4);
95                            if !d.is_riding {
96                                next.foot_l.position =
97                                    Vec3::new(-s_a.foot.0, s_a.foot.1, s_a.foot.2);
98                                next.foot_r.position =
99                                    Vec3::new(s_a.foot.0, s_a.foot.1, s_a.foot.2);
100                            }
101
102                            next.chest.position += Vec3::new(0.0, move1 * -0.5, 0.0);
103                            next.chest.orientation =
104                                Quaternion::rotation_y(move1 * 0.1 + move2alt * -0.15)
105                                    * Quaternion::rotation_z(move1 * 1.2 + move2alt * -2.0);
106                            next.head.orientation =
107                                Quaternion::rotation_x(move1 * 0.2 + move2alt * -0.24)
108                                    * Quaternion::rotation_y(move1 * 0.3 + move2alt * -0.36)
109                                    * Quaternion::rotation_z(move1 * -0.3 + move2alt * 0.72);
110                            next.belt.orientation =
111                                Quaternion::rotation_z(move1 * -0.8 + move2alt * 1.0);
112                            next.shorts.orientation =
113                                Quaternion::rotation_z(move1 * -1.0 + move2alt * 1.4);
114                            next.hand_r.position = Vec3::new(
115                                -s_a.sc.0 + 6.0 + move1 * -12.0,
116                                -4.0 + move1 * 3.0,
117                                -2.0,
118                            );
119                            next.foot_l.orientation = Quaternion::rotation_z(move1 * 0.2);
120                            next.hand_r.orientation = Quaternion::rotation_x(0.9 + move1 * 0.5);
121                            next.control.position = Vec3::new(
122                                s_a.sc.0 + move1 * -3.0 + move2 * 20.0,
123                                s_a.sc.1,
124                                s_a.sc.2 + move1 * 10.0 + move2alt * -10.0,
125                            );
126                            next.control.orientation =
127                                Quaternion::rotation_x(s_a.sc.3 + move2alt * -1.2)
128                                    * Quaternion::rotation_y(move1 * -1.2 + move2 * 2.3)
129                                    * Quaternion::rotation_z(move2alt * -1.5);
130                            next.chest.position += Vec3::new(0.0, move2 * 2.0, 0.0);
131                            next.foot_l.position += Vec3::new(0.0, move2 * 2.5, 0.0);
132                            next.foot_r.position += Vec3::new(0.0, move2 * 0.5, 0.0);
133                        },
134                        1 => {
135                            next.control.orientation.rotate_x(move1 * 3.2);
136                            next.control.orientation.rotate_z(move1 * 1.0);
137
138                            next.chest.position += Vec3::new(0.0, move2 * 1.0, 0.0);
139                            next.chest.orientation.rotate_z(move2 * 1.4);
140                            next.head.orientation.rotate_z(move2 * -0.4);
141                            next.shorts.orientation.rotate_z(move2 * -0.8);
142                            next.belt.orientation.rotate_z(move2 * -0.3);
143                            next.control.orientation.rotate_z(move2 * 2.7);
144                            next.control.position += Vec3::new(move2 * -27.0, 0.0, move2 * 5.0);
145                        },
146                        _ => {},
147                    }
148                },
149                Some("common.abilities.sword.heavy_sweep") => {
150                    next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
151                    next.hand_l.orientation =
152                        Quaternion::rotation_x(s_a.shl.3) * Quaternion::rotation_y(s_a.shl.4);
153                    next.hand_r.position =
154                        Vec3::new(-s_a.sc.0 + 6.0 + move1 * -12.0, -4.0 + move1 * 3.0, -2.0);
155
156                    if !d.is_riding {
157                        next.foot_l.position = Vec3::new(-s_a.foot.0, s_a.foot.1, s_a.foot.2);
158                        next.foot_r.position = Vec3::new(s_a.foot.0, s_a.foot.1, s_a.foot.2);
159                    }
160
161                    next.chest.position += Vec3::new(0.0, move1 * -0.5, 0.0);
162                    next.hand_r.orientation = Quaternion::rotation_x(0.9 + move1 * 0.5);
163                    next.control.position = Vec3::new(s_a.sc.0, s_a.sc.1, s_a.sc.2);
164                    next.control.orientation = Quaternion::rotation_x(s_a.sc.3);
165
166                    next.chest.orientation = Quaternion::rotation_y(move1 * 0.1 + move2 * -0.15)
167                        * Quaternion::rotation_z(move1 * 1.2 + move2 * -2.0);
168                    next.head.orientation = Quaternion::rotation_x(move1 * 0.2 + move2 * -0.24)
169                        * Quaternion::rotation_y(move1 * 0.3 + move2 * -0.36)
170                        * Quaternion::rotation_z(move1 * -0.3 + move2 * 0.72);
171                    next.control.orientation.rotate_x(move1 * 1.2);
172                    next.control.position += Vec3::new(move1 * -4.0, 0.0, move1 * 6.0);
173                    next.control.orientation.rotate_y(move1 * -1.6);
174                    next.foot_l.orientation = Quaternion::rotation_z(move1 * 0.2);
175
176                    next.foot_l.position += Vec3::new(0.0, move2 * 2.5, 0.0);
177                    next.foot_r.position += Vec3::new(0.0, move2 * 0.5, 0.0);
178                    next.chest.position += Vec3::new(0.0, move2 * 3.0, 0.0);
179                    next.chest.orientation.rotate_z(move2 * -0.6);
180                    next.control.orientation.rotate_z(move2 * -3.8);
181                    next.control.position += Vec3::new(move2 * 24.0, 0.0, 0.0);
182                },
183                Some("common.abilities.sword.heavy_pommel_strike") => {
184                    let move1 = move1base.powf(0.25) * multi_action_pullback;
185                    let move2 = move2base.powi(2) * multi_action_pullback;
186
187                    next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
188                    next.hand_l.orientation =
189                        Quaternion::rotation_x(s_a.shl.3) * Quaternion::rotation_y(s_a.shl.4);
190                    next.hand_r.position =
191                        Vec3::new(-s_a.sc.0 + 6.0 + move1 * -12.0, -4.0 + move1 * 3.0, -2.0);
192                    next.hand_r.orientation = Quaternion::rotation_x(0.9 + move1 * 0.5);
193
194                    if !d.is_riding {
195                        next.foot_l.position = Vec3::new(-s_a.foot.0, s_a.foot.1, s_a.foot.2);
196                        next.foot_r.position = Vec3::new(s_a.foot.0, s_a.foot.1, s_a.foot.2);
197                    }
198
199                    next.control.position = Vec3::new(s_a.sc.0, s_a.sc.1, s_a.sc.2);
200                    next.control.orientation = Quaternion::rotation_x(s_a.sc.3);
201
202                    next.chest.position += Vec3::new(0.0, move1 * -0.5, 0.0);
203                    next.chest.orientation = Quaternion::rotation_x(move1 * 0.15)
204                        * Quaternion::rotation_y(move1 * 0.15)
205                        * Quaternion::rotation_z(move1 * 0.3);
206                    next.head.orientation = Quaternion::rotation_y(move1 * -0.15)
207                        * Quaternion::rotation_z(move1 * -0.3);
208                    next.shorts.orientation = Quaternion::rotation_z(move1 * -0.2);
209                    next.belt.orientation = Quaternion::rotation_z(move1 * -0.1);
210                    next.control.orientation.rotate_x(move1 * 2.2);
211                    next.control.position += Vec3::new(move1 * -2.0, move1 * -8.0, move1 * 10.0);
212                    next.control.orientation.rotate_z(move1 * -0.3);
213                    next.foot_l.orientation = Quaternion::rotation_z(move1 * 0.2);
214
215                    next.chest.position += Vec3::new(0.0, move2 * 6.0, 0.0);
216                    next.chest.orientation.rotate_x(move2 * -0.2);
217                    next.chest.orientation.rotate_y(move2 * -0.1);
218                    next.chest.orientation.rotate_z(move2 * -0.6);
219                    next.foot_l.position += Vec3::new(0.0, move2 * 5.0, 0.0);
220                    next.foot_r.position += Vec3::new(0.0, move2 * 1.0, 0.0);
221                    next.head.orientation.rotate_x(move2 * -0.3);
222                    next.head.orientation.rotate_z(move2 * 0.4);
223                    next.shorts.orientation.rotate_z(move2 * 0.5);
224                    next.belt.orientation.rotate_z(move2 * 0.2);
225                    next.control.position += Vec3::new(move2 * -8.0, move2 * 24.0, move2 * -1.5);
226                    next.control.orientation.rotate_x(move2 * -0.2);
227                    next.control.orientation.rotate_z(move2 * 0.6);
228                },
229                Some("common.abilities.sword.agile_quick_draw") => {
230                    let move1 = move1base.powf(0.25) * multi_action_pullback;
231                    let move2 = move2base.powi(2) * multi_action_pullback;
232
233                    next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
234                    next.hand_l.orientation =
235                        Quaternion::rotation_x(s_a.shl.3) * Quaternion::rotation_y(s_a.shl.4);
236                    next.hand_r.position =
237                        Vec3::new(-s_a.sc.0 + 6.0 + move1 * -12.0, -4.0 + move1 * 3.0, -1.0);
238                    next.hand_r.orientation = Quaternion::rotation_x(0.9 + move1 * 0.5);
239                    next.control.position = Vec3::new(s_a.sc.0, s_a.sc.1, s_a.sc.2);
240                    next.control.orientation = Quaternion::rotation_x(s_a.sc.3)
241                        * Quaternion::rotation_z(move2.signum() * -PI / 2.0);
242
243                    next.control.orientation.rotate_x(move1 * 1.6 + move2 * 0.2);
244                    next.chest.position += Vec3::new(0.0, move1 * -0.5, 0.0);
245                    next.chest.orientation = Quaternion::rotation_z(move1 * 1.0);
246                    next.head.orientation = Quaternion::rotation_y(move1 * 0.2 + move2 * -0.24)
247                        * Quaternion::rotation_z(move1 * 0.3 + move2 * -0.36)
248                        * Quaternion::rotation_z(move1 * -0.3 + move2 * 0.72);
249                    next.belt.orientation = Quaternion::rotation_z(move1 * -0.2);
250                    next.shorts.orientation = Quaternion::rotation_z(move1 * -0.5);
251                    next.control.position += Vec3::new(move1 * -8.0, 0.0, move1 * 5.0);
252
253                    next.chest.position += Vec3::new(0.0, move2 * 6.0, 0.0);
254                    next.chest.orientation.rotate_z(move2 * -2.4);
255                    next.belt.orientation.rotate_z(move2 * 0.8);
256                    next.shorts.orientation.rotate_z(move2 * 1.5);
257                    next.control.orientation.rotate_z(move2 * -3.8);
258                    next.control.position += Vec3::new(move2 * 9.0, move2 * 4.0, 0.0);
259                },
260                Some("common.abilities.sword.agile_feint") => {
261                    let move1 = move1base.powf(0.25) * multi_action_pullback;
262                    let move2 = move2base.powi(2) * multi_action_pullback;
263
264                    next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
265                    next.hand_l.orientation =
266                        Quaternion::rotation_x(s_a.shl.3) * Quaternion::rotation_y(s_a.shl.4);
267                    next.hand_r.position =
268                        Vec3::new(-s_a.sc.0 + 6.0 + move1 * -12.0, -4.0 + move1 * 3.0, -2.0);
269                    next.hand_r.orientation = Quaternion::rotation_x(0.9 + move1 * 0.5);
270                    next.control.position = Vec3::new(s_a.sc.0, s_a.sc.1, s_a.sc.2);
271                    next.control.orientation = Quaternion::rotation_x(s_a.sc.3);
272
273                    if !d.is_riding {
274                        next.foot_l.position = Vec3::new(-s_a.foot.0, s_a.foot.1, s_a.foot.2);
275                        next.foot_r.position = Vec3::new(s_a.foot.0, s_a.foot.1, s_a.foot.2);
276                    }
277
278                    next.control.position += Vec3::new(0.0, 0.0, move1 * 4.0);
279
280                    // Right feint if x < 0, else left
281                    if d.move_dir.x < 0.0 {
282                        next.chest.orientation =
283                            Quaternion::rotation_y(move1 * 0.1 + move2 * -0.15)
284                                * Quaternion::rotation_z(move1 * 1.2 + move2 * -2.0);
285                        next.chest.position += Vec3::new(0.0, move1 * -0.5, 0.0);
286                        next.head.orientation = Quaternion::rotation_x(move1 * 0.2 + move2 * -0.24)
287                            * Quaternion::rotation_y(move1 * 0.3 + move2 * -0.36)
288                            * Quaternion::rotation_z(move1 * -0.3 + move2 * 0.72);
289                        next.shorts.orientation = Quaternion::rotation_z(move1 * 0.4);
290                        next.belt.orientation = Quaternion::rotation_z(move1 * 0.2);
291                        next.control.position += Vec3::new(move1 * 12.0, 6.0, 0.0);
292                        next.control.orientation = Quaternion::rotation_x(move1 * 0.2)
293                            * Quaternion::rotation_y(move1 * -1.7)
294                            * Quaternion::rotation_z(move1 * 0.7);
295
296                        next.chest.position += Vec3::new(0.0, move2 * 6.0, 0.0);
297                        next.belt.orientation.rotate_z(move2 * 0.1);
298                        next.control.orientation.rotate_z(move2 * -1.9);
299                        next.control.position += Vec3::new(move2 * 5.0, move2 * 2.0, 0.0);
300                    } else {
301                        next.chest.orientation =
302                            Quaternion::rotation_y(move1 * -0.1 + move2 * 0.15)
303                                * Quaternion::rotation_z(move1 * -1.2 + move2 * 2.0);
304                        next.chest.position += Vec3::new(0.0, move1 * -0.5, 0.0);
305                        next.head.orientation = Quaternion::rotation_y(move1 * -0.2 + move2 * 0.24)
306                            * Quaternion::rotation_z(move1 * -0.3 + move2 * 0.36)
307                            * Quaternion::rotation_z(move1 * 0.3 + move2 * -0.72);
308                        next.shorts.orientation = Quaternion::rotation_z(move1 * -0.4);
309                        next.belt.orientation = Quaternion::rotation_z(move1 * -0.2);
310                        next.control.position += Vec3::new(move1 * -6.0, 6.0, 0.0);
311                        next.control.orientation = Quaternion::rotation_x(move1 * 0.2)
312                            * Quaternion::rotation_y(move1 * 1.7)
313                            * Quaternion::rotation_z(move1 * -0.7);
314
315                        next.chest.position += Vec3::new(0.0, move2 * 6.0, 0.0);
316                        next.belt.orientation.rotate_z(move2 * -0.1);
317                        next.control.orientation.rotate_z(move2 * 1.9);
318                        next.control.position += Vec3::new(move2 * -5.0, move2 * 2.0, 0.0);
319                    }
320                },
321                Some("common.abilities.sword.defensive_disengage") => {
322                    let move1 = move1base.powf(0.25) * multi_action_pullback;
323                    let move2 = move2base.powi(2) * multi_action_pullback;
324
325                    next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
326                    next.hand_l.orientation =
327                        Quaternion::rotation_x(s_a.shl.3) * Quaternion::rotation_y(s_a.shl.4);
328                    next.hand_r.position =
329                        Vec3::new(-s_a.sc.0 + 6.0 + move1 * -12.0, -4.0 + move1 * 3.0, -2.0);
330                    next.hand_r.orientation = Quaternion::rotation_x(0.9 + move1 * 0.5);
331                    next.control.position = Vec3::new(s_a.sc.0, s_a.sc.1, s_a.sc.2);
332                    next.control.orientation = Quaternion::rotation_x(s_a.sc.3);
333
334                    next.chest.orientation = Quaternion::rotation_y(move1 * 0.1 + move2 * -0.15)
335                        * Quaternion::rotation_z(move1 * 1.2 + move2 * -2.0);
336                    next.shorts.orientation = Quaternion::rotation_z(move1 * -0.2);
337                    next.belt.orientation = Quaternion::rotation_z(move1 * -0.5);
338                    next.head.orientation = Quaternion::rotation_x(move1 * 0.2 + move2 * -0.24)
339                        * Quaternion::rotation_y(move1 * 0.3 + move2 * -0.36)
340                        * Quaternion::rotation_z(move1 * -0.3 + move2 * 1.2);
341                    next.foot_l.position += Vec3::new(0.0, move1 * -4.0, 0.0);
342
343                    next.chest.orientation.rotate_z(move2 * -1.4);
344                    next.belt.orientation.rotate_z(move2 * 0.4);
345                    next.shorts.orientation.rotate_z(move2 * 0.8);
346                    next.control.orientation.rotate_y(move2 * -1.6);
347                    next.control.orientation.rotate_z(move2 * -1.9);
348                    next.control.position += Vec3::new(move2 * 9.0, move2 * 4.0, 0.0);
349                },
350                Some("common.abilities.sword.crippling_gouge") => {
351                    let move1 = move1base.powf(0.25) * multi_action_pullback;
352                    let move2 = move2base.powi(2) * multi_action_pullback;
353
354                    next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
355                    next.hand_l.orientation =
356                        Quaternion::rotation_x(s_a.shl.3) * Quaternion::rotation_y(s_a.shl.4);
357                    next.hand_r.position =
358                        Vec3::new(-s_a.sc.0 + 4.0 + move1 * -12.0, -2.0 + move1 * 3.0, 0.0);
359                    next.hand_r.orientation = Quaternion::rotation_x(move1 * 0.5);
360
361                    if !d.is_riding {
362                        next.foot_l.position = Vec3::new(-s_a.foot.0, s_a.foot.1, s_a.foot.2);
363                        next.foot_r.position = Vec3::new(s_a.foot.0, s_a.foot.1, s_a.foot.2);
364                    }
365
366                    next.control.position = Vec3::new(s_a.sc.0, s_a.sc.1, s_a.sc.2);
367                    next.control.orientation = Quaternion::rotation_x(s_a.sc.3);
368
369                    next.chest.position += Vec3::new(0.0, move1 * -2.0, 0.0);
370                    next.chest.orientation = Quaternion::rotation_x(move1 * 0.05)
371                        * Quaternion::rotation_y(move1 * 0.05)
372                        * Quaternion::rotation_z(move1 * -1.0);
373                    next.head.orientation = Quaternion::rotation_x(move1 * 0.05)
374                        * Quaternion::rotation_y(move1 * 0.05)
375                        * Quaternion::rotation_z(move1 * 0.8);
376                    next.belt.orientation = Quaternion::rotation_z(move1 * 0.4);
377                    next.shorts.orientation = Quaternion::rotation_z(move1 * 1.0);
378                    next.control.orientation.rotate_y(move1 * -1.7);
379                    next.control.orientation.rotate_z(move1 * 0.5);
380                    next.control.position +=
381                        Vec3::new(4.0 + move1 * 10.0, 8.0 + move1 * -8.0, move1 * 9.0);
382                    next.foot_l.orientation = Quaternion::rotation_z(move1 * 0.2);
383
384                    next.chest.position += Vec3::new(0.0, move2 * 4.0, 0.0);
385                    next.chest.orientation.rotate_z(move2 * 0.9);
386                    next.foot_l.position += Vec3::new(0.0, move2 * 2.0, 0.0);
387                    next.head.position += Vec3::new(0.0, move2 * 2.0, 0.0);
388                    next.head.orientation.rotate_x(move2 * -0.15);
389                    next.head.orientation.rotate_y(move2 * -0.25);
390                    next.head.orientation.rotate_z(move2 * -0.8);
391                    next.belt.orientation.rotate_z(move2 * -0.4);
392                    next.shorts.orientation.rotate_z(move2 * -0.8);
393                    next.control.orientation.rotate_z(move2 * -1.5);
394                    next.control.position += Vec3::new(move2 * -6.0, move2 * 15.0, 0.0);
395                },
396                Some("common.abilities.sword.crippling_hamstring") => {
397                    let move1 = move1base.powf(0.25) * multi_action_pullback;
398                    let move2 = (move2base.powi(2).max(0.5) - 0.5) * 2.0 * multi_action_pullback;
399                    let move2alt = move2base.powi(2).min(0.5) * 2.0 * multi_action_pullback;
400
401                    next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
402                    next.hand_l.orientation =
403                        Quaternion::rotation_x(s_a.shl.3) * Quaternion::rotation_y(s_a.shl.4);
404                    next.hand_r.position =
405                        Vec3::new(-s_a.sc.0 + 6.0 + move1 * -12.0, -4.0 + move1 * 3.0, -2.0);
406                    next.hand_r.orientation = Quaternion::rotation_x(0.9 + move1 * 0.5);
407                    next.control.position = Vec3::new(s_a.sc.0, s_a.sc.1, s_a.sc.2);
408                    next.control.orientation = Quaternion::rotation_x(s_a.sc.3)
409                        * Quaternion::rotation_z((move2alt + move2) * -PI / 4.0);
410
411                    next.chest.orientation = Quaternion::rotation_z(move1 * 1.3)
412                        * Quaternion::rotation_x(move2alt * -0.3);
413                    next.chest.position += Vec3::new(0.0, move1 * -2.0, 0.0);
414                    next.head.orientation = Quaternion::rotation_x(move1 * 0.18 + move2alt * -0.18)
415                        * Quaternion::rotation_y(move1 * 0.18 + move2alt * -0.18)
416                        * Quaternion::rotation_z(move1 * -0.36 + move2alt * -0.24);
417                    next.belt.orientation = Quaternion::rotation_z(move1 * -0.4)
418                        * Quaternion::rotation_x(move2alt * 0.3);
419                    next.shorts.orientation = Quaternion::rotation_z(move1 * -1.0 + move2 * 1.0)
420                        * Quaternion::rotation_x(move2alt * 0.5);
421                    next.foot_l.orientation = Quaternion::rotation_z(move1 * 0.8);
422                    next.foot_l.position += Vec3::new(0.0, move1 * -2.0, 0.0);
423                    next.control.orientation.rotate_x(move1 * 0.4);
424
425                    next.foot_r.position += Vec3::new(0.0, move2alt * 3.0, 0.0);
426                    next.shorts.position +=
427                        Vec3::new(move2alt * 1.0, move2alt * 2.0, move2alt * 0.0);
428                    next.control
429                        .orientation
430                        .rotate_x(move2alt * -0.8 + move2 * -0.6);
431                    next.chest.orientation.rotate_z(move2 * -1.7);
432                    next.chest.position += Vec3::new(0.0, move2 * 4.0, 0.0);
433                    next.control.orientation.rotate_z(move2 * -1.6);
434                    next.control.position += Vec3::new(move2 * 14.0, move2 * 3.0, move2 * 6.0);
435                },
436                Some("common.abilities.sword.offensive_combo") => {
437                    let move1 = move1base.powf(0.25) * multi_action_pullback;
438                    let move2 = move2base.powi(2) * multi_action_pullback;
439
440                    match action {
441                        0 => {
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                            next.hand_r.position = Vec3::new(
446                                -s_a.sc.0 + 6.0 + move1 * -12.0,
447                                -4.0 + move1 * 3.0,
448                                -2.0,
449                            );
450                            next.hand_r.orientation = Quaternion::rotation_x(0.9 + move1 * 0.5);
451                            next.control.position = Vec3::new(
452                                s_a.sc.0 + move1 * 13.0,
453                                s_a.sc.1 - move1 * 3.0,
454                                s_a.sc.2 + move1 * 9.0,
455                            );
456                            next.control.orientation =
457                                Quaternion::rotation_x(s_a.sc.3 + move1 * 0.5)
458                                    * Quaternion::rotation_y(move1 * 1.4)
459                                    * Quaternion::rotation_z(0.0);
460                            next.chest.orientation = Quaternion::rotation_z(move1 * -0.6);
461                            next.head.orientation = Quaternion::rotation_z(move1 * 0.35);
462                            next.belt.orientation = Quaternion::rotation_z(move1 * 0.25);
463                            next.shorts.orientation = Quaternion::rotation_z(move1 * 0.4);
464
465                            next.chest.orientation.rotate_z(move2 * 1.1);
466                            next.head.orientation.rotate_z(move2 * -0.75);
467                            next.belt.orientation.rotate_z(move2 * -0.6);
468                            next.shorts.orientation.rotate_z(move2 * -0.8);
469                            next.control.orientation.rotate_z(move2 * 2.9);
470                            next.control.position += Vec3::new(
471                                move2 * -16.0,
472                                (1.0 - (move2 - 0.6)).abs() * 6.0,
473                                move2 * -6.0,
474                            );
475                        },
476                        1 => {
477                            next.chest.orientation.rotate_z(move1 * -0.15);
478                            next.head.orientation.rotate_z(move1 * 0.12);
479                            next.belt.orientation.rotate_z(move1 * 0.08);
480                            next.shorts.orientation.rotate_z(move1 * 0.12);
481                            next.control.orientation.rotate_z(move1 * 0.2);
482                            next.control.orientation.rotate_x(move1 * PI);
483                            next.control.orientation.rotate_y(move1 * 0.05);
484
485                            next.chest.orientation.rotate_z(move2 * -0.9);
486                            next.head.orientation.rotate_z(move2 * 0.65);
487                            next.belt.orientation.rotate_z(move2 * 0.45);
488                            next.shorts.orientation.rotate_z(move2 * 0.7);
489                            next.control.orientation.rotate_z(move2 * -3.0);
490                            next.control.orientation.rotate_y(move2 * -0.4);
491                            next.control.position += Vec3::new(move2 * 17.0, 0.0, move2 * 6.0);
492                        },
493                        2 => {
494                            next.chest.orientation.rotate_z(move1 * 0.5);
495                            next.chest.orientation.rotate_x(move1 * 0.2);
496                            next.head.orientation.rotate_z(move1 * -0.4);
497                            next.belt.orientation.rotate_z(move1 * -0.1);
498                            next.shorts.orientation.rotate_z(move1 * -0.45);
499                            next.control.orientation.rotate_z(move1 * -0.2);
500                            next.control.orientation.rotate_y(move1 * -1.4);
501                            next.control.orientation.rotate_z(move1 * 0.15);
502                            next.control.orientation.rotate_x(move1 * 0.5);
503                            next.control.position += Vec3::new(
504                                move1 * -8.0,
505                                (move1 - 0.5).max(0.0) * -10.0,
506                                move1.powi(3) * 16.0,
507                            );
508                            next.foot_l.position += Vec3::new(0.0, move1 * 3.0, move1 * 3.0);
509                            next.foot_l.orientation.rotate_x(move1 * 0.2);
510
511                            next.foot_l.orientation.rotate_x(move2 * -0.2);
512                            next.foot_l.position += Vec3::new(0.0, 0.0, move2 * -3.0);
513                            next.chest.orientation.rotate_x(move2 * -0.5);
514                            next.control.orientation.rotate_x(move2 * -2.3);
515                            next.control.position += Vec3::new(0.0, move2 * 16.0, move2 * -25.0);
516                        },
517                        _ => {},
518                    }
519                },
520                Some(
521                    "common.abilities.sword.basic_crescent_slash"
522                    | "common.abilities.sword.heavy_crescent_slash"
523                    | "common.abilities.sword.agile_crescent_slash"
524                    | "common.abilities.sword.defensive_crescent_slash"
525                    | "common.abilities.sword.crippling_crescent_slash"
526                    | "common.abilities.sword.cleaving_crescent_slash",
527                ) => {
528                    let move1 = move1base.powf(0.25) * multi_action_pullback;
529                    let move2 = move2base.powi(2) * multi_action_pullback;
530
531                    next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
532                    next.hand_l.orientation =
533                        Quaternion::rotation_x(s_a.shl.3) * Quaternion::rotation_y(s_a.shl.4);
534                    next.hand_r.position = Vec3::new(
535                        -s_a.sc.0 + 6.0 + move1 * -12.0,
536                        -4.0 + move1 * 3.0,
537                        -2.0 + move1.min(0.5) * 2.0 * 10.0 + (move1.max(0.5) - 0.5) * 2.0 * -10.0,
538                    );
539                    next.hand_r.orientation = Quaternion::rotation_x(0.9 + move1 * 0.5);
540                    next.control.position = Vec3::new(s_a.sc.0, s_a.sc.1, s_a.sc.2);
541                    next.control.orientation = Quaternion::rotation_x(s_a.sc.3);
542
543                    next.chest.orientation = Quaternion::rotation_y(move1 * 0.1 + move2 * -0.15)
544                        * Quaternion::rotation_z(move1 * 1.2 + move2 * -2.0);
545                    next.chest.position += Vec3::new(0.0, move1 * -2.0, 0.0);
546                    next.head.orientation = Quaternion::rotation_x(move1 * 0.1 + move2 * -0.2)
547                        * Quaternion::rotation_y(move1 * 0.3 + move2 * -0.36)
548                        * Quaternion::rotation_z(move1 * -0.3 + move2 * -0.72);
549                    next.shorts.orientation = Quaternion::rotation_z(move1 * -0.5);
550                    next.belt.orientation = Quaternion::rotation_z(move1 * -0.2);
551                    next.control
552                        .orientation
553                        .rotate_y(move1 * -1.5 + move2 * -0.7);
554                    next.control.position += Vec3::new(0.0, move1 * -2.0, move1 * -2.0);
555                    next.foot_l.orientation = Quaternion::rotation_z(move1 * 0.2);
556
557                    next.foot_l.position += Vec3::new(0.0, move2 * 2.5, 0.0);
558                    next.foot_r.position += Vec3::new(0.0, move2 * -0.5, 0.0);
559                    next.chest.orientation.rotate_z(move2 * -1.4);
560                    next.chest.position += Vec3::new(0.0, move2 * 4.0, 0.0);
561                    next.head.orientation.rotate_y(move2 * -0.1);
562                    next.head.orientation.rotate_z(move2 * 1.4);
563                    next.shorts.orientation.rotate_z(move2 * 0.8);
564                    next.belt.orientation.rotate_z(move2 * 0.4);
565                    next.control.orientation.rotate_x(move2 * 0.3);
566                    next.control.orientation.rotate_z(move2 * -1.5);
567                    next.control.position += Vec3::new(move2 * 12.0, move2 * 12.0, move2 * 18.0);
568                    next.control.orientation.rotate_x(move2 * 0.7);
569                },
570                Some(
571                    "common.abilities.sword.basic_fell_strike"
572                    | "common.abilities.sword.heavy_fell_strike"
573                    | "common.abilities.sword.agile_fell_strike"
574                    | "common.abilities.sword.defensive_fell_strike"
575                    | "common.abilities.sword.crippling_fell_strike"
576                    | "common.abilities.sword.cleaving_fell_strike",
577                ) => {
578                    let move1 = move1base.powf(0.25) * multi_action_pullback;
579                    let move2 = move2base.powf(0.5) * multi_action_pullback;
580
581                    next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
582                    next.hand_l.orientation =
583                        Quaternion::rotation_x(s_a.shl.3) * Quaternion::rotation_y(s_a.shl.4);
584                    next.hand_r.position =
585                        Vec3::new(-s_a.sc.0 + 6.0 + move1 * -12.0, -4.0 + move1 * 3.0, -2.0);
586                    next.hand_r.orientation = Quaternion::rotation_x(0.9 + move1 * 0.5);
587                    next.control.position = Vec3::new(s_a.sc.0, s_a.sc.1, s_a.sc.2);
588                    next.control.orientation = Quaternion::rotation_x(s_a.sc.3);
589
590                    next.chest.orientation = Quaternion::rotation_y(move1 * 0.1 + move2 * -0.15)
591                        * Quaternion::rotation_z(move1 * 1.4 + move2 * -1.4);
592                    next.chest.position += Vec3::new(0.0, move1 * -2.0, 0.0);
593                    next.head.orientation = Quaternion::rotation_x(move1 * 0.1 + move2 * -0.2)
594                        * Quaternion::rotation_y(move1 * 0.3 + move2 * -0.36)
595                        * Quaternion::rotation_z(move1 * -0.3 + move2 * -0.72);
596                    next.belt.orientation = Quaternion::rotation_z(move1 * -0.2);
597                    next.shorts.orientation = Quaternion::rotation_z(move1 * -0.5);
598                    next.control.position += Vec3::new(0.0, 0.0, move1 * 5.0);
599                    next.foot_l.orientation = Quaternion::rotation_z(move1 * 0.2);
600
601                    next.foot_l.position += Vec3::new(0.0, move2 * 2.5, 0.0);
602                    next.foot_r.position += Vec3::new(0.0, move2 * -0.5, 0.0);
603                    next.chest.orientation.rotate_z(move2 * -1.4);
604                    next.chest.position += Vec3::new(0.0, move2 * 4.0, 0.0);
605                    next.head.orientation.rotate_z(move2 * 1.4);
606                    next.belt.orientation.rotate_z(move2 * 0.4);
607                    next.shorts.orientation.rotate_z(move2 * 0.8);
608                    next.control.orientation.rotate_y(move2 * -1.6);
609                    next.control.orientation.rotate_z(move2 * -1.1);
610                    next.control.position += Vec3::new(move2 * 12.0, move2 * 8.0, move2 * -1.0);
611                },
612                Some(
613                    "common.abilities.sword.basic_skewer"
614                    | "common.abilities.sword.heavy_skewer"
615                    | "common.abilities.sword.agile_skewer"
616                    | "common.abilities.sword.defensive_skewer"
617                    | "common.abilities.sword.crippling_skewer"
618                    | "common.abilities.sword.cleaving_skewer",
619                ) => {
620                    let move1 = move1base.powf(0.25) * multi_action_pullback;
621                    let move2 = move2base.powi(2) * multi_action_pullback;
622
623                    next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
624                    next.hand_l.orientation =
625                        Quaternion::rotation_x(s_a.shl.3) * Quaternion::rotation_y(s_a.shl.4);
626                    next.hand_r.position = Vec3::new(
627                        -s_a.sc.0 + 6.0 + move1 * -12.0,
628                        -4.0 + move1 * 3.0,
629                        -2.0 + move1.min(0.5) * 2.0 * 10.0 + (move1.max(0.5) - 0.5) * 2.0 * -10.0,
630                    );
631                    next.hand_r.orientation = Quaternion::rotation_x(0.9 + move1 * 0.5);
632                    next.control.position = Vec3::new(s_a.sc.0, s_a.sc.1, s_a.sc.2);
633                    next.control.orientation = Quaternion::rotation_x(s_a.sc.3);
634
635                    next.chest.orientation = Quaternion::rotation_y(move1 * 0.1 + move2 * -0.15)
636                        * Quaternion::rotation_z(move1 * 1.2);
637                    next.chest.position += Vec3::new(0.0, move1 * 3.0, 0.0);
638                    next.head.orientation = Quaternion::rotation_x(move1 * 0.1 + move2 * -0.2)
639                        * Quaternion::rotation_y(move1 * 0.3 + move2 * -0.36)
640                        * Quaternion::rotation_z(move1 * -0.3 + move2 * -0.72);
641                    next.shorts.orientation = Quaternion::rotation_z(move1 * -0.5);
642                    next.belt.orientation = Quaternion::rotation_z(move1 * -0.2);
643                    next.control.orientation.rotate_x(move1 * -1.0);
644                    next.control.orientation.rotate_z(move1 * -1.2);
645                    next.control.position += Vec3::new(0.0, move1 * -6.0, 2.0);
646                    next.foot_r.position += Vec3::new(move1 * -1.0, move1 * 6.0, 0.0);
647
648                    next.chest.orientation.rotate_z(move2 * -1.4);
649                    next.head.orientation.rotate_z(move2 * 1.1);
650                    next.shorts.orientation.rotate_z(move2 * 0.8);
651                    next.belt.orientation.rotate_z(move2 * 0.4);
652                    next.control.orientation.rotate_z(move2 * 1.4);
653                    next.control.position += Vec3::new(0.0, move2 * 12.0, 0.0);
654                },
655                Some(
656                    "common.abilities.sword.basic_cascade"
657                    | "common.abilities.sword.heavy_cascade"
658                    | "common.abilities.sword.agile_cascade"
659                    | "common.abilities.sword.defensive_cascade"
660                    | "common.abilities.sword.crippling_cascade"
661                    | "common.abilities.sword.cleaving_cascade",
662                ) => {
663                    let move1 = move1base.powf(0.25) * multi_action_pullback;
664                    let move2 = move2base.powi(2) * multi_action_pullback;
665
666                    next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
667                    next.hand_l.orientation =
668                        Quaternion::rotation_x(s_a.shl.3) * Quaternion::rotation_y(s_a.shl.4);
669                    next.hand_r.position = Vec3::new(
670                        -s_a.sc.0 + 6.0 + move1 * -12.0,
671                        -4.0 + move1 * 3.0,
672                        -2.0 + move1.min(0.5) * 2.0 * 10.0 + (move1.max(0.5) - 0.5) * 2.0 * -10.0,
673                    );
674                    next.hand_r.orientation = Quaternion::rotation_x(0.9 + move1 * 0.5);
675                    next.control.position = Vec3::new(s_a.sc.0, s_a.sc.1, s_a.sc.2);
676                    next.control.orientation = Quaternion::rotation_x(s_a.sc.3);
677
678                    next.chest.orientation = Quaternion::rotation_y(move1 * 0.1 + move2 * -0.15)
679                        * Quaternion::rotation_z(move1 * 0.4 + move2 * -0.5);
680                    next.chest.position += Vec3::new(0.0, move1 * -1.0, 0.0);
681                    next.head.orientation = Quaternion::rotation_x(move1 * 0.1 + move2 * -0.24)
682                        * Quaternion::rotation_y(move1 * -0.2 + move2 * 0.36)
683                        * Quaternion::rotation_z(move1 * -0.1 + move2 * -0.96);
684                    next.control.orientation.rotate_x(move1 * 1.7);
685                    next.control.position += Vec3::new(0.0, move1 * 6.0, move1 * 16.0);
686                    next.foot_l.orientation = Quaternion::rotation_z(move1 * 0.2);
687
688                    next.foot_l.position += Vec3::new(0.0, move2 * 2.5, 0.0);
689                    next.foot_r.position += Vec3::new(0.0, move2 * -0.5, 0.0);
690                    next.chest.orientation.rotate_z(move2 * -0.5);
691                    next.chest.position += Vec3::new(0.0, move2 * 4.0, 0.0);
692                    next.head.orientation.rotate_z(move2 * 1.4);
693                    next.control.orientation.rotate_z(move2 * -0.3);
694                    next.control.orientation.rotate_x(move2 * -3.4);
695                    next.control.position += Vec3::new(move2 * 6.0, move2 * -7.0, move2 * -18.0);
696                },
697                Some(
698                    "common.abilities.sword.basic_cross_cut"
699                    | "common.abilities.sword.heavy_cross_cut"
700                    | "common.abilities.sword.agile_cross_cut"
701                    | "common.abilities.sword.defensive_cross_cut"
702                    | "common.abilities.sword.crippling_cross_cut"
703                    | "common.abilities.sword.cleaving_cross_cut",
704                ) => {
705                    let move1 =
706                        ((move1base.max(0.4) - 0.4) * 1.5).powf(0.5) * multi_action_pullback;
707                    let move2 = (move2base.min(0.4) * 2.5).powi(2) * multi_action_pullback;
708
709                    match action {
710                        0 => {
711                            let fast1 = move1.min(0.2) * 5.0;
712                            next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
713                            next.hand_l.orientation = Quaternion::rotation_x(s_a.shl.3)
714                                * Quaternion::rotation_y(s_a.shl.4);
715                            next.hand_r.position = Vec3::new(
716                                -s_a.sc.0 + 6.0 + fast1 * -12.0,
717                                -4.0 + fast1 * 3.0,
718                                -2.0,
719                            );
720                            next.hand_r.orientation = Quaternion::rotation_x(0.9 + fast1 * 0.5);
721                            next.control.position = Vec3::new(s_a.sc.0, s_a.sc.1, s_a.sc.2);
722                            next.control.orientation = Quaternion::rotation_x(s_a.sc.3);
723
724                            next.control.position +=
725                                Vec3::new(move1 * 5.0, move1 * 4.0, move1 * 10.0);
726                            next.control.orientation.rotate_x(move1 * 1.0);
727                            next.control.orientation.rotate_z(move1 * -0.5);
728                            next.control.orientation.rotate_y(move1 * -0.3);
729                            next.chest.orientation =
730                                Quaternion::rotation_y(move1 * 0.1 + move2 * -0.15)
731                                    * Quaternion::rotation_z(move1 * 1.2 + move2 * -0.8);
732                            next.chest.position += Vec3::new(0.0, move1 * -1.0, 0.0);
733                            next.head.orientation =
734                                Quaternion::rotation_x(move1 * 0.1 + move2 * -0.2)
735                                    * Quaternion::rotation_y(move1 * 0.3 + move2 * -0.36)
736                                    * Quaternion::rotation_z(move1 * -0.3 + move2 * -0.72);
737                            next.shorts.orientation = Quaternion::rotation_z(move1 * -0.2);
738                            next.belt.orientation = Quaternion::rotation_z(move1 * -0.1);
739
740                            next.foot_l.position += Vec3::new(0.0, move2 * 4.0, 0.0);
741                            next.foot_r.position += Vec3::new(0.0, move2 * 1.5, 0.0);
742                            next.chest.orientation.rotate_z(move2 * -0.6);
743                            next.chest.position += Vec3::new(0.0, move2 * 4.0, 0.0);
744                            next.head.orientation.rotate_z(move2 * 0.8);
745                            next.shorts.orientation.rotate_z(move2 * 0.8);
746                            next.belt.orientation.rotate_z(move2 * 0.4);
747                            next.control.orientation.rotate_x(move2 * -2.0);
748                            next.control.orientation.rotate_z(move2 * -0.5);
749                            next.control.position +=
750                                Vec3::new(move2 * 8.0, move2 * 2.0, move2 * -12.0);
751                        },
752                        1 => {
753                            next.control.position +=
754                                Vec3::new(move1 * 5.0, move1 * -2.0, move1 * 10.0);
755                            next.control.orientation.rotate_x(move1 * 1.6);
756                            next.control.orientation.rotate_z(move1 * 1.1);
757                            next.control.orientation.rotate_y(move1 * 0.6);
758
759                            next.foot_r.position += Vec3::new(0.0, move2 * 1.0, 0.0);
760                            next.chest.orientation.rotate_z(move2 * 1.1);
761                            next.head.orientation.rotate_z(move2 * -0.3);
762                            next.shorts.orientation.rotate_z(move2 * -0.8);
763                            next.belt.orientation.rotate_z(move2 * -0.4);
764                            next.control.position += Vec3::new(move2 * -9.0, 0.0, move2 * -5.0);
765                            next.control.orientation.rotate_x(move2 * -2.0);
766                            next.control.orientation.rotate_z(move2 * 0.5);
767                        },
768                        _ => {},
769                    }
770                },
771                Some(
772                    "common.abilities.sword.basic_dual_cross_cut"
773                    | "common.abilities.sword.heavy_dual_cross_cut"
774                    | "common.abilities.sword.agile_dual_cross_cut"
775                    | "common.abilities.sword.defensive_dual_cross_cut"
776                    | "common.abilities.sword.crippling_dual_cross_cut"
777                    | "common.abilities.sword.cleaving_dual_cross_cut",
778                ) => {
779                    let move1 =
780                        ((move1base.max(0.4) - 0.4) * 1.5).powf(0.5) * multi_action_pullback;
781                    let move2 = (move2base.min(0.4) * 2.5).powi(2) * multi_action_pullback;
782
783                    next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
784                    next.hand_l.orientation =
785                        Quaternion::rotation_x(s_a.shl.3) * Quaternion::rotation_y(s_a.shl.4);
786                    next.hand_r.position = Vec3::new(-s_a.shl.0, s_a.shl.1, s_a.shl.2);
787                    next.hand_r.orientation = Quaternion::rotation_x(s_a.shl.3);
788                    next.control_l.position = Vec3::new(s_a.sc.0, s_a.sc.1, s_a.sc.2);
789                    next.control_l.orientation = Quaternion::rotation_x(s_a.sc.3);
790                    next.control_r.position = Vec3::new(-s_a.sc.0, s_a.sc.1, s_a.sc.2);
791                    next.control_r.orientation = Quaternion::rotation_x(-s_a.sc.3);
792
793                    next.control_l.position += Vec3::new(move1 * 1.0, move1 * 6.0, move1 * 13.0);
794                    next.control_l.orientation.rotate_x(move1 * 1.0);
795                    next.control_l.orientation.rotate_z(move1 * -0.5);
796                    next.control_l.orientation.rotate_y(move1 * -0.3);
797                    next.control_r.position += Vec3::new(move1 * -1.0, move1 * 6.0, move1 * 13.0);
798                    next.control_r.orientation.rotate_x(move1 * -1.0);
799                    next.control_r.orientation.rotate_z(move1 * 0.5);
800                    next.control_r.orientation.rotate_y(move1 * 0.3);
801                    next.head.orientation = Quaternion::rotation_x(move1 * 0.15 + move2 * -0.3);
802                    next.foot_r.position += Vec3::new(0.0, move1 * -1.0, 0.0);
803                    next.chest.position += Vec3::new(0.0, move1 * -1.0, 0.0);
804
805                    next.head.position += Vec3::new(0.0, move2 * 1.0, 0.0);
806                    next.foot_l.position += Vec3::new(0.0, move2 * 2.0, 0.0);
807                    next.chest.position += Vec3::new(0.0, move2 * 2.0, 0.0);
808                    next.control_l.orientation.rotate_x(move2 * -2.3);
809                    next.control_l.orientation.rotate_z(move2 * -0.4);
810                    next.control_l.position += Vec3::new(move2 * 11.0, move2 * 2.0, move2 * -14.0);
811                    next.control_r.orientation.rotate_x(move2 * -1.6);
812                    next.control_r.orientation.rotate_z(move2 * 0.4);
813                    next.control_r.position += Vec3::new(move2 * -11.0, move2 * 2.0, move2 * -14.0);
814                },
815                Some("common.abilities.sword.crippling_bloody_gash") => {
816                    let move1 = move1base.powf(0.25) * multi_action_pullback;
817                    let move2 = move2base.powf(0.5) * multi_action_pullback;
818
819                    next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
820                    next.hand_l.orientation =
821                        Quaternion::rotation_x(s_a.shl.3) * Quaternion::rotation_y(s_a.shl.4);
822                    next.hand_r.position =
823                        Vec3::new(-s_a.sc.0 + 6.0 + move1 * -12.0, -4.0 + move1 * 3.0, -2.0);
824                    next.hand_r.orientation = Quaternion::rotation_x(0.9 + move1 * 0.5);
825                    next.control.position = Vec3::new(s_a.sc.0, s_a.sc.1, s_a.sc.2);
826                    next.control.orientation =
827                        Quaternion::rotation_x(s_a.sc.3) * Quaternion::rotation_z(move1 * -0.2);
828
829                    next.chest.orientation = Quaternion::rotation_y(move1 * 0.05 + move2 * -0.1)
830                        * Quaternion::rotation_z(move1 * -0.4 + move2 * 0.8);
831                    next.chest.position += Vec3::new(0.0, move1 * -2.0, 0.0);
832                    next.head.orientation = Quaternion::rotation_y(move1 * 0.1 + move2 * -0.36)
833                        * Quaternion::rotation_z(move1 * -0.1 + move2 * -0.24);
834                    next.belt.orientation = Quaternion::rotation_z(move1 * 0.1);
835                    next.control.orientation.rotate_y(move1 * 2.1);
836                    next.control.orientation.rotate_z(move1 * -0.4);
837                    next.control.position += Vec3::new(move1 * 8.0, 0.0, move1 * 3.0);
838                    next.foot_l.position += Vec3::new(0.0, move1 * -1.0, 0.0);
839                    next.foot_r.position += Vec3::new(0.0, move1 * -3.0, 0.0);
840                    next.foot_l.orientation = Quaternion::rotation_z(move1 * 0.2);
841
842                    next.foot_l.position += Vec3::new(0.0, move2 * 4.0, 0.0);
843                    next.foot_r.position += Vec3::new(0.0, move2 * 3.0, 0.0);
844                    next.chest.orientation.rotate_z(move2 * 0.7);
845                    next.chest.position += Vec3::new(0.0, move2 * 4.0, 0.0);
846                    next.head.orientation.rotate_z(move2 * 0.1);
847                    next.head.position += Vec3::new(0.0, move2 * 1.0, 0.0);
848                    next.shorts.orientation.rotate_z(move2 * -1.4);
849                    next.belt.orientation.rotate_z(move2 * -0.7);
850                    next.control.orientation.rotate_y(move2 * -0.9);
851                    next.control.orientation.rotate_z(move2 * 2.5);
852                    next.control.position += Vec3::new(move2 * -7.0, move2 * 8.0, move2 * 6.0);
853                },
854                Some("common.abilities.sword.crippling_eviscerate") => {
855                    let move1 = move1base.powf(0.25) * multi_action_pullback;
856                    let move2 = move2base.powf(0.5) * multi_action_pullback;
857
858                    next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
859                    next.hand_l.orientation =
860                        Quaternion::rotation_x(s_a.shl.3) * Quaternion::rotation_y(s_a.shl.4);
861                    next.hand_r.position =
862                        Vec3::new(-s_a.sc.0 + 6.0 + move1 * -12.0, -4.0 + move1 * 3.0, -2.0);
863                    next.hand_r.orientation = Quaternion::rotation_x(0.9 + move1 * 0.5);
864                    next.control.position = Vec3::new(s_a.sc.0, s_a.sc.1, s_a.sc.2);
865                    next.control.orientation =
866                        Quaternion::rotation_x(s_a.sc.3) * Quaternion::rotation_z(move1 * 3.0);
867
868                    if !d.is_riding {
869                        next.foot_l.position = Vec3::new(-s_a.foot.0, s_a.foot.1, s_a.foot.2);
870                        next.foot_r.position = Vec3::new(s_a.foot.0, s_a.foot.1, s_a.foot.2);
871                        next.foot_l.orientation = Quaternion::identity();
872                        next.foot_r.orientation = Quaternion::identity();
873                    }
874
875                    next.chest.orientation = Quaternion::rotation_z(move1 * 1.2);
876                    next.head.orientation = Quaternion::rotation_x(move1 * 0.1 + move2 * -0.2)
877                        * Quaternion::rotation_y(move1 * 0.2 + move2 * -0.36)
878                        * Quaternion::rotation_z(move1 * -0.72 + move2 * -0.1);
879                    next.belt.orientation = Quaternion::rotation_z(move1 * -0.4);
880                    next.shorts.orientation = Quaternion::rotation_z(move1 * -0.9);
881                    next.control.orientation.rotate_x(move1 * 0.4);
882                    next.foot_r.position += Vec3::new(0.0, move1 * 2.0, 0.0);
883                    next.foot_l.orientation.rotate_z(move1 * 0.6);
884                    next.chest.position += Vec3::new(0.0, move1 * -2.0, 0.0);
885                    next.foot_l.position += Vec3::new(0.0, move1 * -4.0, 0.0);
886                    next.control.orientation.rotate_y(move1 * -1.4);
887                    next.chest.orientation.rotate_y(move1 * -0.3);
888                    next.belt.orientation.rotate_y(move1 * 0.3);
889                    next.shorts.orientation.rotate_y(move1 * 0.35);
890                    next.belt.position += Vec3::new(move1 * -1.0, 0., 0.0);
891                    next.shorts.position += Vec3::new(move1 * -2.0, move1 * 0.0, 0.0);
892                    next.control.position += Vec3::new(0.0, 0.0, move1 * 4.0);
893
894                    next.chest.orientation.rotate_z(move2 * -2.3);
895                    next.chest.position += Vec3::new(0.0, move2 * 1.0, 0.0);
896                    next.head.orientation.rotate_z(move2 * 1.4);
897                    next.belt.orientation.rotate_z(move2 * 1.2);
898                    next.shorts.orientation.rotate_z(move2 * 2.2);
899                    next.shorts.orientation.rotate_x(move2 * 0.5);
900                    next.belt.orientation.rotate_y(move2 * -0.3);
901                    next.belt.orientation.rotate_x(move2 * 0.3);
902                    next.belt.position += Vec3::new(0.0, move2 * -1.0, move2 * -1.0);
903                    next.shorts.position += Vec3::new(move2 * 0.5, move2 * 0.0, 0.0);
904                    next.control.orientation.rotate_z(move2 * -2.2);
905                    next.control.position += Vec3::new(move2 * 14.0, move2 * 6.0, 0.0);
906                },
907                Some("common.abilities.sword.cleaving_sky_splitter") => {
908                    let move1 = move1base.powf(0.25) * multi_action_pullback;
909                    let move2 = move2base.powf(0.5) * multi_action_pullback;
910
911                    next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
912                    next.hand_l.orientation =
913                        Quaternion::rotation_x(s_a.shl.3) * Quaternion::rotation_y(s_a.shl.4);
914                    next.hand_r.position =
915                        Vec3::new(-s_a.sc.0 + 6.0 + move1 * -12.0, -4.0 + move1 * 3.0, -2.0);
916                    next.hand_r.orientation = Quaternion::rotation_x(0.9 + move1 * 0.5);
917                    next.chest.position += Vec3::new(0.0, move1 * 1.0, 0.0);
918                    next.control.position = Vec3::new(s_a.sc.0, s_a.sc.1, s_a.sc.2);
919                    next.control.orientation =
920                        Quaternion::rotation_x(s_a.sc.3) * Quaternion::rotation_z(move1 * -0.2);
921                    next.foot_r.position += Vec3::new(0.0, move1 * 1.0, 0.0);
922
923                    next.foot_l.position += Vec3::new(0.0, move2 * -1.0, 0.0);
924                    next.foot_r.position += Vec3::new(0.0, move2 * -1.0, 0.0);
925                    next.chest.orientation = Quaternion::rotation_x(move1 * -0.7);
926                    next.chest.position += Vec3::new(0.0, move2 * -1.0, 0.0);
927                    next.control.orientation = Quaternion::rotation_x(move1 * -0.9);
928                    next.control.position += Vec3::new(move1 * 6.0, move1 * 8.0, move1 * 3.0);
929
930                    next.chest.orientation.rotate_x(move2 * 1.2);
931                    next.control.orientation.rotate_x(move2 * 2.7);
932                    next.control.position += Vec3::new(0.0, move2 * -11.0, move2 * 22.0);
933                },
934                Some(
935                    "common.abilities.sword.cleaving_whirlwind_slice"
936                    | "common.abilities.sword.cleaving_bladestorm"
937                    | "common.abilities.sword.cleaving_dual_whirlwind_slice"
938                    | "common.abilities.sword.cleaving_dual_bladestorm",
939                ) => {
940                    let pullback = 1.0 - move3base.powi(4);
941                    let move2_no_pullback = move2base + d.current_action as f32;
942                    let move2base = if d.current_action == 0 {
943                        move2base
944                    } else {
945                        1.0
946                    };
947                    let move2_pre = move2base.min(0.3) * 10.0 / 3.0 * pullback;
948                    let move2 = move2base * pullback;
949
950                    if action == 0 {
951                        let move1 = move1base * pullback;
952
953                        next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
954                        next.hand_l.orientation =
955                            Quaternion::rotation_x(s_a.shl.3) * Quaternion::rotation_y(s_a.shl.4);
956                        next.hand_r.position = Vec3::new(-s_a.sc.0 + -6.0, -1.0, -2.0);
957                        next.hand_r.orientation = Quaternion::rotation_x(1.4);
958                        next.control.position = Vec3::new(s_a.sc.0, s_a.sc.1, s_a.sc.2);
959                        next.control.orientation =
960                            Quaternion::rotation_x(s_a.sc.3) * Quaternion::rotation_z(move1 * PI);
961
962                        next.chest.orientation = Quaternion::rotation_z(move1 * 1.2);
963                        next.head.orientation = Quaternion::rotation_z(move1 * -0.7);
964                        next.belt.orientation = Quaternion::rotation_z(move1 * -0.3);
965                        next.shorts.orientation = Quaternion::rotation_z(move1 * -0.8);
966                        next.control.orientation.rotate_x(move1 * 0.2);
967                        next.foot_r
968                            .orientation
969                            .rotate_x(move1 * -0.4 + move2_pre * 0.4);
970                        next.foot_r.orientation.rotate_z(move1 * 1.2);
971                    }
972
973                    next.control.orientation.rotate_y(move2_pre * 1.75);
974                    next.control.orientation.rotate_z(move2 * 1.1);
975                    next.control.position += Vec3::new(0.0, 0.0, move2_pre * 4.0);
976                    next.torso.orientation.rotate_z(move2_no_pullback * TAU);
977                    next.chest.orientation.rotate_x(move2 * -0.1);
978                    next.chest.orientation.rotate_y(move2 * -0.2);
979                    next.chest.orientation.rotate_z(move2 * -1.8);
980                    next.head.orientation.rotate_y(move2 * -0.1);
981                    next.head.orientation.rotate_z(move2 * 1.1);
982                    next.belt.orientation.rotate_z(move2 * 0.6);
983                    next.shorts.orientation.rotate_z(move2 * 1.1);
984                    next.foot_r.position += Vec3::new(0.0, move2_pre * -3.0, 0.0);
985                    next.foot_r.orientation.rotate_z(move2_pre * -1.5);
986                    next.control.orientation.rotate_z(move2 * -1.4);
987                    next.control.position += Vec3::new(move2 * 16.0, 0.0, -1.0);
988                },
989                Some(
990                    "common.abilities.sword.agile_perforate"
991                    | "common.abilities.sword.agile_flurry",
992                ) => {
993                    let pullback = 1.0 - move3base.powi(4);
994                    let move1 = move1base.powf(0.25) * pullback;
995                    let move2 = (move2base.min(0.5).mul(2.0).powi(2)
996                        - move2base.max(0.5).sub(0.5).mul(2.0))
997                        * pullback;
998
999                    next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
1000                    next.hand_l.orientation =
1001                        Quaternion::rotation_x(s_a.shl.3) * Quaternion::rotation_y(s_a.shl.4);
1002                    next.hand_r.position =
1003                        Vec3::new(-s_a.sc.0 + 6.0 + move1 * -12.0, -4.0 + move1 * 3.0, -2.0);
1004                    next.hand_r.orientation = Quaternion::rotation_x(0.9 + move1 * 0.5);
1005                    next.control.position = Vec3::new(s_a.sc.0, s_a.sc.1, s_a.sc.2);
1006                    next.control.orientation = Quaternion::rotation_x(s_a.sc.3);
1007
1008                    next.chest.orientation =
1009                        Quaternion::rotation_y(move1 * 0.05) * Quaternion::rotation_z(move1 * 0.6);
1010                    next.chest.position += Vec3::new(0.0, move1 * -1.0, 0.0);
1011                    next.head.orientation =
1012                        Quaternion::rotation_x(move1 * 0.05) * Quaternion::rotation_z(move1 * -0.4);
1013                    next.shorts.orientation = Quaternion::rotation_z(move1 * -0.8);
1014                    next.belt.orientation = Quaternion::rotation_z(move1 * -0.4);
1015                    next.control.orientation.rotate_x(move1 * -1.1);
1016                    next.control.orientation.rotate_z(move1 * -0.7);
1017                    next.control.position += Vec3::new(move1 * 1.0, move1 * -4.0, move1 * 4.0);
1018                    next.foot_l.position += Vec3::new(0.0, move1 * 0.5, 0.0);
1019                    next.foot_r.position += Vec3::new(0.0, move1 * -2.5, 0.0);
1020
1021                    next.chest.orientation.rotate_y(move2 * -0.1);
1022                    next.chest.orientation.rotate_z(move2 * -1.0);
1023                    next.chest.position += Vec3::new(0.0, move2 * 2.0, 0.0);
1024                    next.head.orientation.rotate_x(move2 * -0.1);
1025                    next.head.orientation.rotate_z(move2 * 0.6);
1026                    next.head.position += Vec3::new(0.0, move2 * 0.5, 0.0);
1027                    next.belt.orientation.rotate_z(move2 * 0.4);
1028                    next.shorts.orientation.rotate_z(move2 * 0.8);
1029                    next.control.orientation.rotate_z(move2 * 1.1);
1030                    next.control.position += Vec3::new(0.0, move2 * 16.0, 0.0);
1031                },
1032                Some(
1033                    "common.abilities.sword.agile_dual_perforate"
1034                    | "common.abilities.sword.agile_dual_flurry",
1035                ) => {
1036                    let pullback = 1.0 - move3base.powi(4);
1037                    let move1 = move1base.powf(0.25) * pullback;
1038                    let move2 = (move2base.min(0.5).mul(2.0).powi(2)
1039                        - move2base.max(0.5).sub(0.5).mul(2.0))
1040                        * pullback;
1041                    let dir = if d.current_action % 2 == 1 { 1.0 } else { -1.0 };
1042
1043                    next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
1044                    next.hand_l.orientation =
1045                        Quaternion::rotation_x(s_a.shl.3) * Quaternion::rotation_y(s_a.shl.4);
1046                    next.hand_r.position = Vec3::new(-s_a.shl.0, s_a.shl.1, s_a.shl.2);
1047                    next.hand_r.orientation = Quaternion::rotation_x(s_a.shl.3);
1048                    next.control_l.position = Vec3::new(s_a.sc.0, s_a.sc.1, s_a.sc.2);
1049                    next.control_l.orientation = Quaternion::rotation_x(s_a.sc.3);
1050                    next.control_r.position = Vec3::new(-s_a.sc.0, s_a.sc.1, s_a.sc.2);
1051                    next.control_r.orientation = Quaternion::rotation_x(s_a.sc.3);
1052
1053                    next.control_l.orientation.rotate_x(move1 * -1.1);
1054                    next.control_l.orientation.rotate_z(move1 * 0.7);
1055                    next.control_l.position += Vec3::new(move1 * 1.0, move1 * -2.0, move1 * 3.0);
1056                    next.control_r.orientation.rotate_x(move1 * -1.1);
1057                    next.control_r.orientation.rotate_z(move1 * -0.7);
1058                    next.control_r.position += Vec3::new(move1 * -1.0, move1 * -2.0, move1 * 3.0);
1059                    next.chest.position += Vec3::new(0.0, move1 * -1.0, 0.0);
1060                    next.foot_r.orientation.rotate_z(move1 * -0.2);
1061                    next.foot_l.position += Vec3::new(0.0, move1 * 0.5, 0.0);
1062                    next.foot_r.position += Vec3::new(0.0, move1 * -1.5, 0.0);
1063
1064                    next.chest.position += Vec3::new(0.0, move2 * 2.0, 0.0);
1065                    next.chest.orientation = Quaternion::rotation_y(move2 * -0.05)
1066                        * Quaternion::rotation_z(move2 * -1.2 * dir);
1067                    next.head.orientation = Quaternion::rotation_x(move2 * -0.1)
1068                        * Quaternion::rotation_z(move2 * 0.45 * dir);
1069                    next.belt.orientation.rotate_z(move2 * 0.4 * dir);
1070                    next.shorts.orientation.rotate_z(move2 * 0.8 * dir);
1071                    next.control_l
1072                        .orientation
1073                        .rotate_z(move2 * 1.2 * dir.max(0.0));
1074                    next.control_l.position += Vec3::new(
1075                        move2 * -12.0 * dir.max(0.0),
1076                        move2 * 18.0 * dir.max(0.0),
1077                        0.0,
1078                    );
1079                    next.control_r
1080                        .orientation
1081                        .rotate_z(move2 * 1.2 * dir.min(0.0));
1082                    next.control_r.position += Vec3::new(
1083                        move2 * -12.0 * dir.min(0.0),
1084                        move2 * 18.0 * -(dir.min(0.0)),
1085                        0.0,
1086                    );
1087                    next.control_l.orientation.rotate_z(move1 * -0.7);
1088                    next.control_r.orientation.rotate_z(move1 * 0.7);
1089                },
1090                Some("common.abilities.sword.agile_hundred_cuts") => {
1091                    let pullback = 1.0 - move3base.powi(4);
1092                    let move1 = move1base.powf(0.25) * pullback;
1093                    let move2 = move2base.powf(0.25) * pullback;
1094                    let (move2a, move2b, move2c, move2d) = match d.current_action % 4 {
1095                        0 => (move2, 0.0, 0.0, 0.0),
1096                        1 => (1.0, move2, 0.0, 0.0),
1097                        2 => (1.0, 1.0, move2, 0.0),
1098                        3 => (1.0, 1.0, 1.0, move2),
1099                        _ => (0.0, 0.0, 0.0, 0.0),
1100                    };
1101
1102                    next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
1103                    next.hand_l.orientation =
1104                        Quaternion::rotation_x(s_a.shl.3) * Quaternion::rotation_y(s_a.shl.4);
1105                    next.hand_r.position =
1106                        Vec3::new(-s_a.sc.0 + 6.0 + move1 * -12.0, -4.0 + move1 * 3.0, -2.0);
1107                    next.hand_r.orientation = Quaternion::rotation_x(0.9 + move1 * 0.5);
1108                    next.control.position = Vec3::new(s_a.sc.0, s_a.sc.1, s_a.sc.2);
1109                    next.control.orientation = Quaternion::rotation_x(s_a.sc.3);
1110
1111                    next.chest.orientation =
1112                        Quaternion::rotation_y(move1 * -0.05) * Quaternion::rotation_z(move1 * 0.4);
1113                    next.chest.position += Vec3::new(0.0, move1 * 0.5, 0.0);
1114                    next.head.orientation = Quaternion::rotation_z(move1 * -0.2);
1115                    next.shorts.orientation = Quaternion::rotation_z(move1 * -0.8);
1116                    next.belt.orientation = Quaternion::rotation_z(move1 * -0.4);
1117                    next.control.orientation.rotate_y(move1 * -1.2);
1118                    next.control.position += Vec3::new(0.0, move1 * 2.0, move1 * 10.0);
1119                    next.foot_l.position += Vec3::new(0.0, move1 * 3.5, 0.0);
1120                    next.foot_r.position += Vec3::new(0.0, move1 * -1.5, 0.0);
1121                    next.foot_l.orientation = Quaternion::rotation_z(move1 * 0.1);
1122                    next.foot_r.orientation = Quaternion::rotation_z(move1 * -0.4);
1123
1124                    next.chest.orientation.rotate_y(move2a * 0.05);
1125                    next.chest.orientation.rotate_z(move2a * -0.3);
1126                    next.head.orientation.rotate_z(move2a * -0.1);
1127                    next.chest.position += Vec3::new(0.0, move2 * 0.05, 0.0);
1128                    next.control.orientation.rotate_z(move2a * -2.0);
1129                    next.control.position += Vec3::new(move2a * 18.0, move2a * 5.0, move2a * -5.0);
1130
1131                    next.chest.orientation.rotate_y(move2b * -0.05);
1132                    next.chest.orientation.rotate_z(move2b * 0.3);
1133                    next.head.orientation.rotate_z(move2b * 0.1);
1134                    next.chest.position += Vec3::new(0.0, move2b * 0.05, 0.0);
1135                    next.control.orientation.rotate_z(move2b * 2.9);
1136                    next.control.position += Vec3::new(move2b * -18.0, move2b * -5.0, 0.0);
1137
1138                    next.chest.orientation.rotate_y(move2c * 0.05);
1139                    next.chest.orientation.rotate_z(move2c * -0.3);
1140                    next.head.orientation.rotate_z(move2c * -0.1);
1141                    next.chest.position += Vec3::new(0.0, move2c * 0.05, 0.0);
1142                    next.control.orientation.rotate_z(move2c * -2.3);
1143                    next.control.position += Vec3::new(move2c * 18.0, move2c * 5.0, move2c * 10.0);
1144
1145                    next.chest.orientation.rotate_y(move2d * 0.05);
1146                    next.chest.orientation.rotate_z(move2d * -0.3);
1147                    next.head.orientation.rotate_z(move2d * 0.1);
1148                    next.chest.position += Vec3::new(0.0, move2d * 0.05, 0.0);
1149                    next.control.orientation.rotate_z(move2d * -2.7);
1150                    next.control.position += Vec3::new(move2d * 18.0, move2d * 5.0, move2a * -5.0);
1151                },
1152                Some("common.abilities.sword.crippling_mutilate") => {
1153                    let pullback = 1.0 - move3base.powi(4);
1154                    let move1 = if action == d.current_action {
1155                        move1base.powf(0.25) * pullback
1156                    } else {
1157                        0.0
1158                    };
1159                    let move2 = if d.current_action % 2 == 0 {
1160                        move2base
1161                    } else {
1162                        1.0 - move2base
1163                    } * pullback;
1164
1165                    next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
1166                    next.hand_l.orientation =
1167                        Quaternion::rotation_x(s_a.shl.3) * Quaternion::rotation_y(s_a.shl.4);
1168                    next.hand_r.position =
1169                        Vec3::new(-s_a.sc.0 + 6.0 + move1 * -12.0, -4.0 + move1 * 3.0, -2.0);
1170                    next.hand_r.orientation = Quaternion::rotation_x(0.9 + move1 * 0.5);
1171                    next.control.position = Vec3::new(s_a.sc.0, s_a.sc.1, s_a.sc.2);
1172                    next.control.orientation = Quaternion::rotation_x(s_a.sc.3);
1173
1174                    next.chest.orientation =
1175                        Quaternion::rotation_y(move1 * 0.05) * Quaternion::rotation_z(move1 * 0.5);
1176                    next.chest.position += Vec3::new(0.0, move1 * -1.0, 0.0);
1177                    next.head.orientation =
1178                        Quaternion::rotation_y(move1 * 0.1) * Quaternion::rotation_z(move1 * -0.4);
1179                    next.shorts.orientation = Quaternion::rotation_z(move1 * -0.8);
1180                    next.belt.orientation = Quaternion::rotation_z(move1 * -0.4);
1181                    next.control.orientation.rotate_x(move1 * -0.6);
1182                    next.control.orientation.rotate_z(move1 * -0.7);
1183                    next.control.position += Vec3::new(move1 * 1.0, move1 * -4.0, move1 * 2.0);
1184                    next.foot_l.orientation = Quaternion::rotation_z(move1 * 0.1);
1185                    next.foot_r.orientation = Quaternion::rotation_z(move1 * -0.2);
1186                    next.foot_l.position += Vec3::new(0.0, move1 * 1.0, 0.0);
1187                    next.foot_r.position += Vec3::new(0.0, move1 * -3.0, 0.0);
1188
1189                    next.chest.orientation.rotate_y(move2 * -0.1);
1190                    next.chest.orientation.rotate_z(move2 * -0.8);
1191                    next.head.orientation.rotate_y(move2 * -0.1);
1192                    next.head.orientation.rotate_z(move2 * 0.6);
1193                    next.belt.orientation.rotate_z(move2 * 0.4);
1194                    next.shorts.orientation.rotate_z(move2 * 0.8);
1195                    next.control.orientation.rotate_z(move2 * 1.1);
1196                    next.control.position += Vec3::new(0.0, move2 * 14.0, move2 * 10.0);
1197                },
1198                // ==================================
1199                //                AXE
1200                // ==================================
1201                Some("common.abilities.axe.triple_chop") => match action {
1202                    0 => {
1203                        next.hand_l.position = Vec3::new(s_a.ahl.0, s_a.ahl.1, s_a.ahl.2);
1204                        next.hand_l.orientation =
1205                            Quaternion::rotation_x(s_a.ahl.3) * Quaternion::rotation_y(s_a.ahl.4);
1206                        next.hand_r.position = Vec3::new(s_a.ahr.0, s_a.ahr.1, s_a.ahr.2);
1207                        next.hand_r.orientation =
1208                            Quaternion::rotation_x(s_a.ahr.3) * Quaternion::rotation_z(s_a.ahr.5);
1209
1210                        next.control.position =
1211                            Vec3::new(s_a.ac.0 + move1 * -1.0, s_a.ac.1 + move1 * -4.0, s_a.ac.2);
1212                        next.control.orientation = Quaternion::rotation_x(s_a.ac.3 + move1 * -1.5)
1213                            * Quaternion::rotation_y(s_a.ac.4)
1214                            * Quaternion::rotation_z(s_a.ac.5 + move1 * (0.4 - PI));
1215
1216                        next.chest.orientation.rotate_z(move1 * 0.4);
1217                        next.head.orientation.rotate_z(move1 * -0.2);
1218                        next.belt.orientation.rotate_z(move1 * -0.1);
1219                        next.shorts.orientation.rotate_z(move1 * -0.2);
1220
1221                        next.chest.orientation.rotate_z(move2 * -0.6);
1222                        next.head.orientation.rotate_z(move2 * 0.3);
1223                        next.belt.orientation.rotate_z(move2 * 0.1);
1224                        next.shorts.orientation.rotate_z(move2 * 0.2);
1225                        next.control.orientation = next.control.orientation
1226                            * Quaternion::rotation_z(move2 * -0.5)
1227                            * Quaternion::rotation_x(move2 * 2.0);
1228                        next.control.orientation.rotate_y(move2 * -0.7);
1229                        next.control.position += Vec3::new(move2 * 15.0, 0.0, move2 * -4.0);
1230                    },
1231                    1 => {
1232                        next.chest.orientation.rotate_z(move1 * -0.2);
1233                        next.head.orientation.rotate_z(move1 * 0.1);
1234                        next.shorts.orientation.rotate_z(move1 * 0.1);
1235                        next.control.orientation.rotate_y(move1 * 0.9);
1236                        next.control.orientation.rotate_x(move1 * 1.5);
1237                        next.control.orientation.rotate_z(move1 * -0.4);
1238                        next.control.position += Vec3::new(move1 * 4.0, 0.0, move1 * 4.0);
1239
1240                        next.chest.orientation.rotate_z(move2 * 0.6);
1241                        next.head.orientation.rotate_z(move2 * -0.3);
1242                        next.belt.orientation.rotate_z(move2 * -0.1);
1243                        next.shorts.orientation.rotate_z(move2 * -0.2);
1244                        next.control.orientation = next.control.orientation
1245                            * Quaternion::rotation_z(move2 * 0.5)
1246                            * Quaternion::rotation_x(move2 * 2.0);
1247                        next.control.orientation.rotate_y(move2 * 0.7);
1248                        next.control.position += Vec3::new(move2 * -15.0, 0.0, move2 * -4.0);
1249                    },
1250                    2 => {
1251                        next.control.orientation.rotate_z(move1 * -0.4);
1252                        next.control.orientation.rotate_x(move1 * 2.5);
1253                        next.control.orientation.rotate_z(move1 * -1.0);
1254                        next.control.position += Vec3::new(move1 * -3.0, 0.0, move1 * 4.0);
1255
1256                        next.chest.orientation.rotate_z(move2 * -0.3);
1257                        next.head.orientation.rotate_z(move2 * 0.1);
1258                        next.shorts.orientation.rotate_z(move2 * 0.1);
1259                        next.control.orientation.rotate_x(move2 * -2.5);
1260                        next.control.orientation.rotate_z(move2 * -0.8);
1261                        next.control.position += Vec3::new(move2 * 5.0, 0.0, move2 * -6.0);
1262                    },
1263                    _ => {},
1264                },
1265                Some("common.abilities.axe.brutal_swing") => {
1266                    next.hand_l.position = Vec3::new(s_a.ahl.0, s_a.ahl.1, s_a.ahl.2);
1267                    next.hand_l.orientation =
1268                        Quaternion::rotation_x(s_a.ahl.3) * Quaternion::rotation_y(s_a.ahl.4);
1269                    next.hand_r.position = Vec3::new(s_a.ahr.0, s_a.ahr.1, s_a.ahr.2);
1270                    next.hand_r.orientation =
1271                        Quaternion::rotation_x(s_a.ahr.3) * Quaternion::rotation_z(s_a.ahr.5);
1272
1273                    next.control.position =
1274                        Vec3::new(s_a.ac.0 + move1 * -1.0, s_a.ac.1 + move1 * -4.0, s_a.ac.2);
1275                    next.control.orientation = Quaternion::rotation_x(s_a.ac.3 + move1 * -0.4)
1276                        * Quaternion::rotation_y(s_a.ac.4 + move1 * -0.5)
1277                        * Quaternion::rotation_z(s_a.ac.5 + move1 * (1.5 - PI));
1278
1279                    next.control.orientation.rotate_z(move2 * -3.5);
1280                    next.control.position += Vec3::new(move2 * 12.0, move2 * 4.0, 0.0);
1281                    next.torso.orientation.rotate_z(move2base * -TAU);
1282                },
1283                Some("common.abilities.axe.rising_tide") => {
1284                    next.hand_l.position = Vec3::new(s_a.ahl.0, s_a.ahl.1, s_a.ahl.2);
1285                    next.hand_l.orientation =
1286                        Quaternion::rotation_x(s_a.ahl.3) * Quaternion::rotation_y(s_a.ahl.4);
1287                    next.hand_r.position = Vec3::new(s_a.ahr.0, s_a.ahr.1, s_a.ahr.2);
1288                    next.hand_r.orientation =
1289                        Quaternion::rotation_x(s_a.ahr.3) * Quaternion::rotation_z(s_a.ahr.5);
1290
1291                    next.control.position =
1292                        Vec3::new(s_a.ac.0 + move1 * -1.0, s_a.ac.1 + move1 * -4.0, s_a.ac.2);
1293                    next.control.orientation = Quaternion::rotation_x(s_a.ac.3 + move1 * 0.6)
1294                        * Quaternion::rotation_y(s_a.ac.4 + move1 * -0.5)
1295                        * Quaternion::rotation_z(s_a.ac.5 + move1 * (3.0 - PI));
1296
1297                    next.chest.orientation = Quaternion::rotation_z(move1 * 0.6);
1298                    next.head.orientation = Quaternion::rotation_z(move1 * -0.2);
1299                    next.belt.orientation = Quaternion::rotation_z(move1 * -0.3);
1300                    next.shorts.orientation = Quaternion::rotation_z(move1 * -0.1);
1301
1302                    next.chest.orientation.rotate_z(move2 * -1.4);
1303                    next.head.orientation.rotate_z(move2 * 0.5);
1304                    next.belt.orientation.rotate_z(move2 * 0.7);
1305                    next.shorts.orientation.rotate_z(move2 * 0.3);
1306                    next.control.orientation.rotate_z(move2 * -2.0);
1307                    next.control.position += Vec3::new(move2 * 17.0, 0.0, move2 * 13.0);
1308                    next.control.orientation.rotate_x(move2 * 2.0);
1309                    next.control.orientation.rotate_y(move2 * -0.8);
1310                    next.control.orientation.rotate_z(move2 * -1.0);
1311                },
1312                Some("common.abilities.axe.rake") => {
1313                    next.hand_l.position = Vec3::new(s_a.ahl.0, s_a.ahl.1, s_a.ahl.2);
1314                    next.hand_l.orientation =
1315                        Quaternion::rotation_x(s_a.ahl.3) * Quaternion::rotation_y(s_a.ahl.4);
1316                    next.hand_r.position = Vec3::new(s_a.ahr.0, s_a.ahr.1, s_a.ahr.2);
1317                    next.hand_r.orientation =
1318                        Quaternion::rotation_x(s_a.ahr.3) * Quaternion::rotation_z(s_a.ahr.5);
1319
1320                    next.control.position = Vec3::new(s_a.ac.0 + move1 * 8.0, s_a.ac.1, s_a.ac.2);
1321                    next.control.orientation = Quaternion::rotation_x(s_a.ac.3 - move1 * 2.5)
1322                        * Quaternion::rotation_y(s_a.ac.4)
1323                        * Quaternion::rotation_z(s_a.ac.5 + move1 * (0.7 - PI));
1324
1325                    next.chest.orientation.rotate_z(move1 * -0.5);
1326                    next.head.orientation.rotate_z(move1 * 0.3);
1327                    next.belt.orientation.rotate_z(move1 * 0.2);
1328
1329                    next.control.orientation.rotate_x(move2 * -1.2);
1330                    next.chest.orientation.rotate_z(move2 * 1.2);
1331                    next.head.orientation.rotate_z(move2 * -0.7);
1332                    next.belt.orientation.rotate_z(move2 * -0.6);
1333                    next.control.position += Vec3::new(move2 * -6.0, move2 * -20.0, move2 * -4.0);
1334                },
1335                Some("common.abilities.axe.skull_bash") => {
1336                    next.hand_l.position = Vec3::new(s_a.ahl.0, s_a.ahl.1, s_a.ahl.2);
1337                    next.hand_l.orientation =
1338                        Quaternion::rotation_x(s_a.ahl.3) * Quaternion::rotation_y(s_a.ahl.4);
1339                    next.hand_r.position = Vec3::new(s_a.ahr.0, s_a.ahr.1, s_a.ahr.2);
1340                    next.hand_r.orientation =
1341                        Quaternion::rotation_x(s_a.ahr.3) * Quaternion::rotation_z(s_a.ahr.5);
1342
1343                    next.control.position = Vec3::new(s_a.ac.0, s_a.ac.1, s_a.ac.2);
1344                    next.control.orientation = Quaternion::rotation_x(s_a.ac.3)
1345                        * Quaternion::rotation_y(s_a.ac.4)
1346                        * Quaternion::rotation_z(s_a.ac.5 - move1 * PI * 0.75);
1347
1348                    next.control.orientation.rotate_x(move1 * -2.0);
1349                    next.chest.orientation.rotate_z(move1 * 0.8);
1350                    next.head.orientation.rotate_z(move1 * -0.3);
1351                    next.shorts.orientation.rotate_z(move1 * -0.5);
1352                    next.belt.orientation.rotate_z(move1 * -0.1);
1353                    next.control.orientation.rotate_y(move1 * -0.6);
1354                    next.control.position += Vec3::new(move1 * 6.0, move1 * -2.0, 0.0);
1355
1356                    next.chest.orientation.rotate_z(move2 * -1.7);
1357                    next.head.orientation.rotate_z(move2 * 0.9);
1358                    next.shorts.orientation.rotate_z(move2 * 1.1);
1359                    next.belt.orientation.rotate_z(move2 * 0.5);
1360                    next.control.orientation.rotate_x(move2 * -1.8);
1361                    next.control.position += Vec3::new(move2 * 9.0, move2 * 2.0, move2 * -5.0);
1362                },
1363                Some("common.abilities.axe.plunder") => {
1364                    next.hand_l.position = Vec3::new(s_a.ahl.0, s_a.ahl.1, s_a.ahl.2);
1365                    next.hand_l.orientation =
1366                        Quaternion::rotation_x(s_a.ahl.3) * Quaternion::rotation_y(s_a.ahl.4);
1367                    next.hand_r.position = Vec3::new(s_a.ahr.0, s_a.ahr.1, s_a.ahr.2);
1368                    next.hand_r.orientation =
1369                        Quaternion::rotation_x(s_a.ahr.3) * Quaternion::rotation_z(s_a.ahr.5);
1370
1371                    next.control.position = Vec3::new(s_a.ac.0, s_a.ac.1, s_a.ac.2);
1372                    next.control.orientation = Quaternion::rotation_x(s_a.ac.3)
1373                        * Quaternion::rotation_y(s_a.ac.4)
1374                        * Quaternion::rotation_z(s_a.ac.5 + move2 * PI * 0.0);
1375
1376                    next.chest.orientation.rotate_z(move1 * 0.9);
1377                    next.head.orientation.rotate_z(move1 * -0.3);
1378                    next.belt.orientation.rotate_z(move1 * -0.2);
1379                    next.shorts.orientation.rotate_z(move1 * -0.6);
1380
1381                    next.chest.orientation.rotate_z(move2 * -2.0);
1382                    next.head.orientation.rotate_z(move2 * 0.7);
1383                    next.belt.orientation.rotate_z(move2 * 0.4);
1384                    next.shorts.orientation.rotate_z(move2 * 1.2);
1385                    next.control.orientation.rotate_y(move2 * 2.5);
1386                    next.control.orientation.rotate_x(move2 * -1.2);
1387                    next.control.position += Vec3::new(move2 * 8.0, 0.0, 0.0);
1388                },
1389                Some("common.abilities.axe.fierce_raze") => {
1390                    if action == 0 {
1391                        next.hand_l.position = Vec3::new(s_a.ahl.0, s_a.ahl.1, s_a.ahl.2);
1392                        next.hand_l.orientation =
1393                            Quaternion::rotation_x(s_a.ahl.3) * Quaternion::rotation_y(s_a.ahl.4);
1394                        next.hand_r.position = Vec3::new(s_a.ahr.0, s_a.ahr.1, s_a.ahr.2);
1395                        next.hand_r.orientation =
1396                            Quaternion::rotation_x(s_a.ahr.3) * Quaternion::rotation_z(s_a.ahr.5);
1397
1398                        next.control.position = Vec3::new(s_a.ac.0, s_a.ac.1, s_a.ac.2);
1399                        next.control.orientation = Quaternion::rotation_x(s_a.ac.3)
1400                            * Quaternion::rotation_y(s_a.ac.4)
1401                            * Quaternion::rotation_z(s_a.ac.5 + move1 * -PI);
1402
1403                        next.chest.orientation.rotate_z(move1 * 0.7);
1404                        next.head.orientation.rotate_z(move1 * -0.3);
1405                        next.belt.orientation.rotate_z(move1 * -0.2);
1406                        next.shorts.orientation.rotate_z(move1 * -0.4);
1407                        next.control.orientation.rotate_x(move1 * -2.1);
1408                        next.control.orientation.rotate_z(move1 * -0.5);
1409                        next.control.position += Vec3::new(move1 * 6.0, move1 * -3.0, 0.0);
1410                        next.control.orientation.rotate_y(move1 * -0.3);
1411                    }
1412
1413                    let move2 = (move2base.min(0.5).mul(2.0)
1414                        - move2base.max(0.5).sub(0.5).mul(2.0))
1415                        * multi_action_pullback;
1416
1417                    if anim_time > 0.5 {
1418                        next.main_weapon_trail = false;
1419                        next.off_weapon_trail = false;
1420                    }
1421
1422                    next.chest.orientation.rotate_z(move2 * -1.8);
1423                    next.head.orientation.rotate_z(move2 * 0.8);
1424                    next.belt.orientation.rotate_z(move2 * 0.4);
1425                    next.shorts.orientation.rotate_z(move2 * 1.1);
1426                    next.control.orientation.rotate_x(move2 * -2.7);
1427                    next.control.position += Vec3::new(move2 * 4.0, 0.0, move2 * -7.0);
1428                },
1429                Some("common.abilities.axe.dual_fierce_raze") => {
1430                    if action == 0 {
1431                        next.hand_l.position = Vec3::new(s_a.ahl.0, s_a.ahl.1, s_a.ahl.2 + -4.0);
1432                        next.hand_l.orientation =
1433                            Quaternion::rotation_x(s_a.ahl.3) * Quaternion::rotation_y(s_a.ahl.4);
1434                        next.hand_r.position = Vec3::new(s_a.ahr.0, s_a.ahr.1, s_a.ahr.2);
1435                        next.hand_r.orientation =
1436                            Quaternion::rotation_x(s_a.ahr.3) * Quaternion::rotation_z(s_a.ahr.5);
1437
1438                        next.control.position = Vec3::new(s_a.ac.0, s_a.ac.1, s_a.ac.2);
1439                        next.control.orientation = Quaternion::rotation_x(s_a.ac.3)
1440                            * Quaternion::rotation_y(s_a.ac.4)
1441                            * Quaternion::rotation_z(s_a.ac.5);
1442                        next.control_r.position += Vec3::new(8.0, 0.0, 0.0);
1443
1444                        next.chest.orientation.rotate_z(move1 * 0.7);
1445                        next.head.orientation.rotate_z(move1 * -0.3);
1446                        next.belt.orientation.rotate_z(move1 * -0.2);
1447                        next.shorts.orientation.rotate_z(move1 * -0.4);
1448                        next.control.orientation.rotate_x(move1 * -2.1);
1449                        next.control.orientation.rotate_z(move1 * -0.5);
1450                        next.control.position += Vec3::new(move1 * 6.0, move1 * -3.0, 0.0);
1451                        next.control.orientation.rotate_y(move1 * -0.3);
1452                    }
1453
1454                    let move2 = (move2base.min(0.5).mul(2.0)
1455                        - move2base.max(0.5).sub(0.5).mul(2.0))
1456                        * multi_action_pullback;
1457
1458                    if anim_time > 0.5 {
1459                        next.main_weapon_trail = false;
1460                        next.off_weapon_trail = false;
1461                    }
1462
1463                    next.chest.orientation.rotate_z(move2 * -1.8);
1464                    next.head.orientation.rotate_z(move2 * 0.8);
1465                    next.belt.orientation.rotate_z(move2 * 0.4);
1466                    next.shorts.orientation.rotate_z(move2 * 1.1);
1467                    next.control.orientation.rotate_x(move2 * -2.7);
1468                    next.control.position += Vec3::new(move2 * 4.0, 0.0, move2 * -7.0);
1469                },
1470                // ==================================
1471                //               HAMMER
1472                // ==================================
1473                Some("common.abilities.hammer.vigorous_bash") => {
1474                    hammer_start(&mut next, s_a);
1475                    twist_forward(&mut next, move1, 1.4, 0.7, 0.5, 0.9);
1476                    next.control.orientation.rotate_y(move1 * 0.3);
1477                    next.control.orientation.rotate_z(move1 * -0.3);
1478                    next.control.position += Vec3::new(12.0, -3.0, 3.0) * move1;
1479
1480                    twist_back(&mut next, move2, 1.8, 0.9, 0.6, 1.1);
1481                    next.control.orientation.rotate_z(move2 * -2.1);
1482                    next.control.orientation.rotate_x(move2 * 0.6);
1483                    next.control.position += Vec3::new(-20.0, 8.0, 0.0) * move2;
1484                },
1485                Some("common.abilities.hammer.iron_tempest") => {
1486                    if action == 0 {
1487                        hammer_start(&mut next, s_a);
1488
1489                        twist_back(&mut next, move1, 2.0, 0.8, 0.3, 1.4);
1490                        next.control.orientation.rotate_x(move1 * 0.8);
1491                        next.control.position += Vec3::new(-15.0, 0.0, 6.0) * move1;
1492                        next.control.orientation.rotate_z(move1 * 1.2);
1493                    }
1494
1495                    let move2 =
1496                        move2base / d.max_actions.map_or(1.0, |x| x as f32) * multi_action_pullback;
1497
1498                    next.torso.orientation.rotate_z(-TAU * move2base);
1499                    twist_forward(&mut next, move2, 3.0, 1.2, 0.5, 1.8);
1500                    next.control.orientation.rotate_z(move2 * -5.0);
1501                    next.control.position += Vec3::new(20.0, 0.0, 0.0) * move2;
1502                },
1503                Some("common.abilities.hammer.dual_iron_tempest") => {
1504                    if action == 0 {
1505                        dual_wield_start(&mut next);
1506
1507                        twist_back(&mut next, move1, 2.0, 0.8, 0.3, 1.4);
1508                        next.control_l.orientation.rotate_y(move1 * -PI / 2.0);
1509                        next.control_r.orientation.rotate_y(move1 * -PI / 2.0);
1510                        next.control.orientation.rotate_z(move1 * 1.2);
1511                        next.control.position += Vec3::new(-10.0, 10.0, 6.0) * move1;
1512                        next.control_r.position += Vec3::new(0.0, -10.0, 0.0) * move1;
1513                    }
1514
1515                    let move2 =
1516                        move2base / d.max_actions.map_or(1.0, |x| x as f32) * multi_action_pullback;
1517
1518                    next.torso.orientation.rotate_z(-TAU * move2base);
1519                    twist_forward(&mut next, move2, 3.0, 1.2, 0.5, 1.8);
1520                    next.control.orientation.rotate_z(move2 * -3.0);
1521                    next.control.position += Vec3::new(20.0, -10.0, 0.0) * move2;
1522                    next.control_r.position += Vec3::new(0.0, 10.0, 0.0) * move2;
1523                    next.control_l.position += Vec3::new(0.0, -10.0, 0.0) * move2;
1524                },
1525                // ==================================
1526                //                BOW
1527                // ==================================
1528                Some("common.abilities.bow.repeater") => {
1529                    let speed = Vec2::<f32>::from(d.velocity).magnitude();
1530                    let ori_angle = d.orientation.y.atan2(d.orientation.x);
1531                    let lookdir_angle = d.look_dir.y.atan2(d.look_dir.x);
1532                    let swivel = lookdir_angle - ori_angle;
1533
1534                    next.hand_l.position = Vec3::new(s_a.bhl.0, s_a.bhl.1, s_a.bhl.2);
1535                    next.hand_l.orientation = Quaternion::rotation_x(s_a.bhl.3);
1536                    next.hand_r.position = Vec3::new(s_a.bhr.0, s_a.bhr.1, s_a.bhr.2);
1537                    next.hand_r.orientation = Quaternion::rotation_x(s_a.bhr.3);
1538                    next.main.position = Vec3::new(0.0, 0.0, 0.0);
1539                    next.main.orientation =
1540                        Quaternion::rotation_y(0.0) * Quaternion::rotation_z(0.0);
1541
1542                    next.hold.position = Vec3::new(0.0, -1.0 + move2 * 2.0, -5.2);
1543                    next.hold.orientation =
1544                        Quaternion::rotation_x(-PI / 2.0) * Quaternion::rotation_z(0.0);
1545                    next.hold.scale = Vec3::one() * (1.0);
1546
1547                    next.chest.orientation = Quaternion::rotation_z(swivel * 0.8);
1548                    next.torso.orientation = Quaternion::rotation_z(swivel * 0.2);
1549
1550                    if speed < 0.5 {
1551                        if !d.is_riding {
1552                            next.foot_l.position =
1553                                Vec3::new(-s_a.foot.0 - 0.75, s_a.foot.1 + 4.0, s_a.foot.2);
1554                            next.foot_l.orientation =
1555                                Quaternion::rotation_x(0.2 + move1 * -0.1 + move2 * -0.2)
1556                                    * Quaternion::rotation_z(move2 * 0.1);
1557
1558                            next.foot_r.position =
1559                                Vec3::new(s_a.foot.0 + 0.75, s_a.foot.1, s_a.foot.2);
1560                            next.foot_r.orientation =
1561                                Quaternion::rotation_x(0.06 + move1 * -0.2 + move2 * -0.5)
1562                                    * Quaternion::rotation_z(-0.6 + move2 * 0.8);
1563                        }
1564
1565                        next.chest.position = Vec3::new(0.0, s_a.chest.0, s_a.chest.1);
1566                        next.chest.orientation = Quaternion::rotation_x(0.0);
1567                    };
1568                    next.shorts.position = Vec3::new(0.0, s_a.shorts.0 + 2.0, s_a.shorts.1);
1569                    next.shorts.orientation = Quaternion::rotation_x(0.2 + move2 * 0.2);
1570                    next.belt.position = Vec3::new(0.0, s_a.belt.0 + 1.0, s_a.belt.1);
1571                    next.belt.orientation = Quaternion::rotation_x(0.1 + move2 * 0.1);
1572                    next.control.position =
1573                        Vec3::new(s_a.bc.0 + 5.0, s_a.bc.1 + 3.0, s_a.bc.2 + 5.0);
1574                    next.control.orientation = Quaternion::rotation_x(s_a.bc.3 + 0.4)
1575                        * Quaternion::rotation_y(s_a.bc.4 + 0.8)
1576                        * Quaternion::rotation_z(s_a.bc.5);
1577                    next.head.orientation =
1578                        Quaternion::rotation_x(0.15) * Quaternion::rotation_y(0.15 + move1 * 0.05);
1579                    next.torso.orientation = Quaternion::rotation_x(0.25 + move2 * -0.2);
1580
1581                    next.hand_l.position = Vec3::new(0.0, -2.5 + move2 * -6.0, 0.0);
1582                    next.hand_l.orientation = Quaternion::rotation_x(1.5)
1583                        * Quaternion::rotation_y(-0.0)
1584                        * Quaternion::rotation_z(-0.3);
1585                },
1586                // ==================================
1587                //              SHIELD
1588                // ==================================
1589                Some("common.abilities.shield.singlestrike") => {
1590                    if let Some(ability_info) = d.ability_info {
1591                        match ability_info.hand {
1592                            Some(HandInfo::TwoHanded) => {
1593                                next.main.orientation = Quaternion::rotation_x(0.0);
1594                                next.chest.orientation = Quaternion::rotation_z(move1 * -0.3);
1595                                next.torso.orientation = Quaternion::rotation_z(move1 * -1.0);
1596                                next.head.orientation = Quaternion::rotation_z(move1 * 0.75);
1597                                next.head.position = Vec3::new(0.5, s_a.head.0 + 0.5, s_a.head.1);
1598
1599                                next.control.position = Vec3::new(move1 * -10.0, 6.0, move1 * 6.0);
1600                                next.control.orientation = Quaternion::rotation_z(-0.25);
1601
1602                                next.hand_l.position = Vec3::new(0.0, -2.0, 0.0);
1603                                next.hand_l.orientation = Quaternion::rotation_x(PI / 2.0);
1604
1605                                next.hand_r.position = Vec3::new(0.0, 0.0, 0.0);
1606                                next.hand_r.orientation = Quaternion::rotation_x(PI / 2.0)
1607                                    * Quaternion::rotation_y(PI / 2.0);
1608                            },
1609                            Some(HandInfo::MainHand) => {
1610                                next.main.orientation = Quaternion::rotation_x(0.0);
1611                                next.chest.orientation = Quaternion::rotation_z(move1 * -0.3);
1612                                next.torso.orientation = Quaternion::rotation_z(move1 * -1.2);
1613                                next.head.orientation = Quaternion::rotation_z(move1 * 0.75);
1614                                next.head.position = Vec3::new(0.5, s_a.head.0 + 0.5, s_a.head.1);
1615
1616                                next.control_l.position =
1617                                    Vec3::new(move1 * -12.0, 4.0, move1 * 6.0);
1618                                next.control_l.orientation = Quaternion::rotation_x(move1 * 0.0)
1619                                    * Quaternion::rotation_y(0.0)
1620                                    * Quaternion::rotation_z(-0.25);
1621                                next.hand_l.position = Vec3::new(0.0, -1.5, 0.0);
1622                                next.hand_l.orientation = Quaternion::rotation_x(PI / 2.0);
1623
1624                                next.control_r.position = Vec3::new(9.0, -1.0, 0.0);
1625                                next.control_r.orientation = Quaternion::rotation_x(-1.75);
1626                                next.hand_r.position = Vec3::new(0.0, 0.5, 0.0);
1627                                next.hand_r.orientation = Quaternion::rotation_x(PI / 2.0);
1628                            },
1629                            Some(HandInfo::OffHand) => {
1630                                next.main.orientation = Quaternion::rotation_x(0.0);
1631                                next.chest.orientation = Quaternion::rotation_z(move1 * 0.3);
1632                                next.torso.orientation = Quaternion::rotation_z(move1 * 1.2);
1633                                next.head.orientation = Quaternion::rotation_z(move1 * -0.75);
1634                                next.head.position = Vec3::new(-0.5, s_a.head.0 + -0.5, s_a.head.1);
1635
1636                                next.control_r.position = Vec3::new(move1 * 12.0, 4.0, move1 * 6.0);
1637                                next.control_r.orientation = Quaternion::rotation_x(move1 * 0.0)
1638                                    * Quaternion::rotation_y(0.0)
1639                                    * Quaternion::rotation_z(0.25);
1640                                next.hand_r.position = Vec3::new(0.0, -1.5, 0.0);
1641                                next.hand_r.orientation = Quaternion::rotation_x(PI / 2.0);
1642
1643                                next.control_l.position = Vec3::new(-9.0, -1.0, 0.0);
1644                                next.control_l.orientation = Quaternion::rotation_x(-1.75);
1645                                next.hand_l.position = Vec3::new(0.0, 0.5, 0.0);
1646                                next.hand_l.orientation = Quaternion::rotation_x(PI / 2.0);
1647                            },
1648                            _ => {},
1649                        }
1650                    }
1651                },
1652                _ => {},
1653            }
1654        }
1655        next
1656    }
1657}