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