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