1use super::{
2 super::{Animation, vek::*},
3 CharacterSkeleton, SkeletonAttr, dual_wield_start, hammer_start, twist_back, twist_forward,
4};
5use common::{
6 comp::item::Hands,
7 states::utils::{AbilityInfo, HandInfo, StageSection},
8 util::Dir,
9};
10use core::f32::consts::{PI, TAU};
11
12pub struct BasicAction;
13
14pub struct BasicActionDependency<'a> {
15 pub ability_id: Option<&'a str>,
16 pub hands: (Option<Hands>, Option<Hands>),
17 pub stage_section: Option<StageSection>,
18 pub ability_info: Option<AbilityInfo>,
19 pub velocity: Vec3<f32>,
20 pub last_ori: Vec3<f32>,
21 pub orientation: Vec3<f32>,
22 pub look_dir: Dir,
23 pub is_riding: bool,
24}
25
26impl Animation for BasicAction {
27 type Dependency<'a> = BasicActionDependency<'a>;
28 type Skeleton = CharacterSkeleton;
29
30 #[cfg(feature = "use-dyn-lib")]
31 const UPDATE_FN: &'static [u8] = b"character_basic\0";
32
33 #[cfg_attr(feature = "be-dyn-lib", unsafe(export_name = "character_basic"))]
34 fn update_skeleton_inner(
35 skeleton: &Self::Skeleton,
36 d: Self::Dependency<'_>,
37 anim_time: f32,
38 rate: &mut f32,
39 s_a: &SkeletonAttr,
40 ) -> Self::Skeleton {
41 *rate = 1.0;
42 let mut next = (*skeleton).clone();
43
44 let mut legacy_initialize = || {
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 };
51
52 if matches!(d.stage_section, Some(StageSection::Action)) {
53 next.main_weapon_trail = true;
54 next.off_weapon_trail = true;
55 }
56 let (move1base, chargebase, movementbase, move2base, move3base) = match d.stage_section {
57 Some(StageSection::Buildup) => (anim_time, 0.0, 0.0, 0.0, 0.0),
58 Some(StageSection::Charge) => (1.0, anim_time, 0.0, 0.0, 0.0),
59 Some(StageSection::Movement) => (1.0, 1.0, anim_time, 0.0, 0.0),
60 Some(StageSection::Action) => (1.0, 1.0, 1.0, anim_time, 0.0),
61 Some(StageSection::Recover) => (1.0, 1.0, 1.0, 1.0, anim_time),
62 _ => (0.0, 0.0, 0.0, 0.0, 0.0),
63 };
64 let pullback = 1.0 - move3base;
65 let move1 = move1base * pullback;
66 let move2 = move2base * pullback;
67
68 match d.ability_id {
69 Some(
73 "common.abilities.sword.basic_guard" | "common.abilities.sword.defensive_guard",
74 ) => {
75 legacy_initialize();
76 let pullback = 1.0 - move3base.powi(4);
77 let move1 = move1base.powf(0.25) * pullback;
78 let move2 = (move2base * 10.0).sin();
79
80 if d.velocity.xy().magnitude_squared() < 0.5_f32.powi(2) {
81 next.chest.position =
82 Vec3::new(0.0, s_a.chest.0, s_a.chest.1 + move1 * -1.0 + move2 * 0.2);
83 next.chest.orientation = Quaternion::rotation_x(move1 * -0.15);
84 next.head.orientation = Quaternion::rotation_x(move1 * 0.25);
85
86 next.belt.position =
87 Vec3::new(0.0, s_a.belt.0 + move1 * 0.5, s_a.belt.1 + move1 * 0.5);
88 next.shorts.position =
89 Vec3::new(0.0, s_a.shorts.0 + move1 * 1.3, s_a.shorts.1 + move1 * 1.0);
90
91 next.belt.orientation = Quaternion::rotation_x(move1 * 0.15);
92 next.shorts.orientation = Quaternion::rotation_x(move1 * 0.25);
93
94 if !d.is_riding {
95 next.foot_l.position =
96 Vec3::new(-s_a.foot.0, s_a.foot.1 + move1 * 2.0, s_a.foot.2);
97 next.foot_l.orientation = Quaternion::rotation_z(move1 * -0.5);
98
99 next.foot_r.position =
100 Vec3::new(s_a.foot.0, s_a.foot.1 + move1 * -2.0, s_a.foot.2);
101 next.foot_r.orientation = Quaternion::rotation_x(move1 * -0.5);
102 }
103 }
104
105 match d.hands {
106 (Some(Hands::Two), _) => {
107 next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
108 next.hand_l.orientation =
109 Quaternion::rotation_x(s_a.shl.3) * Quaternion::rotation_y(s_a.shl.4);
110 next.hand_r.position = Vec3::new(
111 s_a.shr.0 + move1 * -2.0,
112 s_a.shr.1,
113 s_a.shr.2 + move1 * 20.0,
114 );
115 next.hand_r.orientation = Quaternion::rotation_x(s_a.shr.3)
116 * Quaternion::rotation_y(s_a.shr.4)
117 * Quaternion::rotation_z(move1 * 1.5);
118
119 next.control.position =
120 Vec3::new(s_a.sc.0 + move1 * -3.0, s_a.sc.1, s_a.sc.2 + move1 * 4.0);
121 next.control.orientation = Quaternion::rotation_x(s_a.sc.3)
122 * Quaternion::rotation_y(move1 * 1.1)
123 * Quaternion::rotation_z(move1 * 1.7);
124 },
125 (Some(Hands::One), offhand) => {
126 next.control_l.position =
127 Vec3::new(-7.0, 8.0 + move1 * 3.0, 2.0 + move1 * 3.0);
128 next.control_l.orientation =
129 Quaternion::rotation_x(-0.3) * Quaternion::rotation_y(move1 * 1.0);
130 next.hand_l.position = Vec3::new(0.0, -0.5, 0.0);
131 next.hand_l.orientation = Quaternion::rotation_x(PI / 2.0);
132 if offhand.is_some() {
133 next.control_r.position =
134 Vec3::new(7.0, 8.0 + move1 * 3.0, 2.0 + move1 * 3.0);
135 next.control_r.orientation =
136 Quaternion::rotation_x(-0.3) * Quaternion::rotation_y(move1 * -1.0);
137 next.hand_r.position = Vec3::new(0.0, -0.5, 0.0);
138 next.hand_r.orientation = Quaternion::rotation_x(PI / 2.0)
139 } else {
140 next.hand_r.position = Vec3::new(4.5, 8.0, 5.0);
141 next.hand_r.orientation =
142 Quaternion::rotation_x(1.9) * Quaternion::rotation_y(0.5)
143 }
144 },
145 (_, _) => {},
146 }
147 },
148 Some("common.abilities.sword.defensive_deflect") => {
149 legacy_initialize();
150 let move1 = move1base.powi(2);
151 let move2 = (move2base * 20.0).sin();
152 let move3 = move3base.powf(0.5);
153
154 next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
155 next.hand_l.orientation =
156 Quaternion::rotation_x(s_a.shl.3) * Quaternion::rotation_y(s_a.shl.4);
157 next.hand_r.position =
158 Vec3::new(-s_a.sc.0 + 6.0 + move1 * -12.0, -4.0 + move1 * 3.0, -2.0);
159 next.hand_r.orientation = Quaternion::rotation_x(0.9 + move1 * 0.5);
160 next.control.position = Vec3::new(s_a.sc.0, s_a.sc.1, s_a.sc.2);
161 next.control.orientation =
162 Quaternion::rotation_x(s_a.sc.3) * Quaternion::rotation_z(move1 * -0.9);
163
164 next.chest.orientation = Quaternion::rotation_z(move1 * -0.6);
165 next.head.orientation = Quaternion::rotation_z(move1 * 0.2);
166 next.belt.orientation = Quaternion::rotation_z(move1 * -0.1);
167 next.shorts.orientation = Quaternion::rotation_z(move1 * 0.1);
168 next.control.orientation.rotate_y(move1 * -1.7);
169 next.control.orientation.rotate_z(move1 * 0.6);
170 next.control.position += Vec3::new(move1 * 11.0, move1 * 2.0, move1 * 5.0);
171
172 next.control.orientation.rotate_y(move2 / 50.0);
173
174 next.chest.orientation.rotate_z(move3 * -0.6);
175 next.head.orientation.rotate_z(move3 * 0.4);
176 next.belt.orientation.rotate_z(move3 * 0.2);
177 next.shorts.orientation.rotate_z(move3 * 0.6);
178 next.control.position += Vec3::new(move3 * 6.0, 0.0, move3 * 9.0);
179 next.control.orientation.rotate_z(move3 * -0.5);
180 next.control.orientation.rotate_y(move3 * 0.6);
181 },
182 Some(
183 "common.abilities.sword.basic_thrust"
184 | "common.abilities.sword.defensive_vital_jab",
185 ) => {
186 legacy_initialize();
187 let pullback = 1.0 - move3base.powi(4);
188 let move1 = chargebase.powf(0.25).min(1.0) * pullback;
189 let move2 = move2base.powi(2) * pullback;
190 let tension = (chargebase * 20.0).sin();
191
192 next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
193 next.hand_l.orientation =
194 Quaternion::rotation_x(s_a.shl.3) * Quaternion::rotation_y(s_a.shl.4);
195 next.hand_r.position =
196 Vec3::new(-s_a.sc.0 + 6.0 + move1 * -13.2, -4.0 + move1 * 3.3, 1.0);
197 next.hand_r.orientation = Quaternion::rotation_x(PI * 0.5);
198 next.chest.position += Vec3::new(0.0, move1 * -0.55, 0.0);
199 next.control.position =
200 Vec3::new(s_a.sc.0, s_a.sc.1 + move2 * 3.3, s_a.sc.2 + move2 * 5.5);
201 next.control.orientation = Quaternion::rotation_x(s_a.sc.3 + move1 * -0.99)
202 * Quaternion::rotation_y(move1 * 1.1 + move2 * -1.1)
203 * Quaternion::rotation_z(move1 * 1.43 + move2 * -1.43);
204
205 next.chest.position += Vec3::new(0.0, move2 * 2.2, 0.0);
206 next.chest.orientation =
207 Quaternion::rotation_z(move1 * 1.1 + tension * 0.02 + move2 * -1.32);
208 next.head.position += Vec3::new(0.0, move2 * 1.1, 0.0);
209 next.head.orientation = Quaternion::rotation_x(move1 * 0.055 + move2 * -0.055)
210 * Quaternion::rotation_y(move1 * 0.055 + move2 * -0.055)
211 * Quaternion::rotation_z(move1 * -0.44 + move2 * 0.33);
212 next.belt.orientation = Quaternion::rotation_z(move1 * -0.275 + move2 * 0.22);
213 next.shorts.orientation = Quaternion::rotation_z(move1 * -0.66 + move2 * 0.33);
214 },
215 Some("common.abilities.sword.heavy_slam") => {
216 legacy_initialize();
217 let pullback = 1.0 - move3base.powi(4);
218 let move1 = chargebase.powf(0.25).min(1.0) * pullback;
219 let move2 = move2base.powi(2) * pullback;
220 let tension = (chargebase * 20.0).sin();
221
222 next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
223 next.hand_l.orientation =
224 Quaternion::rotation_x(s_a.shl.3) * Quaternion::rotation_y(s_a.shl.4);
225 next.hand_r.position =
226 Vec3::new(-s_a.sc.0 + 7.0 + move1 * -13.2, -5.0 + move1 * 3.3, -1.0);
227 next.chest.position += Vec3::new(0.0, move1 * -0.55, 0.0);
228 next.control.position = Vec3::new(s_a.sc.0, s_a.sc.1, s_a.sc.2);
229 next.control.orientation = Quaternion::rotation_x(s_a.sc.3)
230 * Quaternion::rotation_z(move1 * 0.33 + move2 * -0.77);
231
232 next.control
233 .orientation
234 .rotate_x(move1 * 1.54 + tension / 50.0);
235 next.control.position +=
236 Vec3::new(move1 * -2.2, 0.0, move1 * 9.9) + Vec3::one() * tension / 4.0;
237 next.chest.position += Vec3::new(0.0, move2 * 1.65, 0.0);
238 next.chest.orientation = Quaternion::rotation_z(move1 * 0.44 + tension / 50.0);
239 next.head.position += Vec3::new(0.0, move2 * 1.1, 0.0);
240 next.head.orientation = Quaternion::rotation_x(move2 * -0.22)
241 * Quaternion::rotation_y(move1 * 0.055 + move2 * 0.055)
242 * Quaternion::rotation_z(move2 * -0.165);
243 next.belt.orientation = Quaternion::rotation_z(move1 * -0.055 + move2 * 0.165);
244 next.shorts.orientation = Quaternion::rotation_z(move1 * -0.11 + move2 * 0.22);
245
246 if move2 < f32::EPSILON {
247 next.main_weapon_trail = false;
248 next.off_weapon_trail = false;
249 }
250 next.control.orientation.rotate_x(move2 * -3.3);
251 next.control.orientation.rotate_z(move2 * -0.44);
252 next.control.position += Vec3::new(move2 * 11.0, move2 * 5.5, move2 * -11.0);
253 next.chest.orientation.rotate_z(move2 * -0.66);
254 },
255 Some("common.abilities.sword.crippling_deep_rend") => {
256 legacy_initialize();
257 let pullback = 1.0 - move3base;
258 let move1pre = move1base.min(0.5) * 2.0 * pullback;
259 let move1post = (move1base.max(0.5) * 2.0 - 1.0) * pullback;
260 let move2 = chargebase.min(1.0) * pullback;
261 let move3 = move2base * pullback;
262 let tension = (chargebase * 20.0).sin();
263
264 next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
265 next.hand_l.orientation =
266 Quaternion::rotation_x(s_a.shl.3) * Quaternion::rotation_y(s_a.shl.4);
267 next.hand_r.position =
268 Vec3::new(-s_a.sc.0 + 3.0 + move1 * -9.0, -4.0 + move1 * 3.0, 0.0);
269 next.hand_r.orientation = Quaternion::rotation_x(0.9 + move1pre * 0.5);
270 next.control.position = Vec3::new(s_a.sc.0, s_a.sc.1, s_a.sc.2);
271 next.control.orientation =
272 Quaternion::rotation_x(s_a.sc.3) * Quaternion::rotation_z(move1pre * PI / 2.0);
273
274 next.foot_r.position += Vec3::new(0.0, move1pre * -2.5, 0.0);
275 next.foot_r.orientation.rotate_z(move1pre * -1.2);
276 next.chest.position += Vec3::new(0.0, move1pre * -2.0, 0.0);
277 next.chest.orientation = Quaternion::rotation_z(move1pre * -1.3);
278 next.head.orientation = Quaternion::rotation_x(move1pre * -0.05)
279 * Quaternion::rotation_y(move1pre * -0.05)
280 * Quaternion::rotation_z(move1pre * 0.7);
281 next.belt.orientation = Quaternion::rotation_z(move1pre * 0.4);
282 next.shorts.orientation = Quaternion::rotation_z(move1pre * 0.8);
283 next.control.orientation.rotate_y(move1pre * -1.5);
284 next.control.orientation.rotate_z(move1pre * 0.0);
285 next.control.position += Vec3::new(move1pre * 9.0, move1pre * -1.5, 0.0);
286
287 next.chest.position += Vec3::new(0.0, move1post * 2.0, 0.0);
288 next.chest.orientation.rotate_z(move1post * 1.2);
289 next.head.position += Vec3::new(0.0, move1post * 1.0, 0.0);
290 next.head.orientation.rotate_z(move1post * -0.7);
291 next.belt.orientation.rotate_z(move1post * -0.3);
292 next.shorts.orientation.rotate_z(move1post * -0.8);
293 next.foot_r.orientation.rotate_z(move1post * 1.2);
294 next.foot_r.orientation.rotate_x(move1post * -0.4);
295 next.control.orientation.rotate_z(move1post * -1.2);
296 next.control.position += Vec3::new(0.0, move1post * 8.0, move1post * 3.0);
297
298 next.control
299 .orientation
300 .rotate_y(move2 * -2.0 + tension / 10.0);
301 next.chest.orientation.rotate_z(move2 * -0.4 + move3 * -1.4);
302 next.control
303 .orientation
304 .rotate_z(move2 * 0.3 + move3 * -1.3);
305 next.head.orientation.rotate_z(move2 * 0.2 + move3 * 0.7);
306 next.belt.orientation.rotate_z(move3 * 0.3);
307 next.shorts.orientation.rotate_z(move2 * 0.2 + move3 * 0.6);
308 next.chest
309 .orientation
310 .rotate_y(move2 * -0.3 - tension / 100.0);
311 next.foot_r.orientation.rotate_z(move3 * -1.2);
312 },
313 Some(
314 "common.abilities.sword.cleaving_spiral_slash"
315 | "common.abilities.sword.cleaving_dual_spiral_slash",
316 ) => {
317 legacy_initialize();
318 let move1 = chargebase.powf(0.25).min(1.0) * pullback;
319 let move2_pre = move2base.min(0.3) * 10.0 / 3.0 * pullback;
320 let tension = (chargebase * 15.0).sin();
321
322 next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
323 next.hand_l.orientation =
324 Quaternion::rotation_x(s_a.shl.3) * Quaternion::rotation_y(s_a.shl.4);
325 next.hand_r.position =
326 Vec3::new(-s_a.sc.0 + 6.0 + move1 * -12.0, -4.0 + move1 * 3.0, -1.0);
327 next.hand_r.orientation = Quaternion::rotation_x(0.9 + move1 * 0.5);
328 next.control.position = Vec3::new(s_a.sc.0, s_a.sc.1, s_a.sc.2);
329 next.control.orientation = Quaternion::rotation_x(s_a.sc.3);
330
331 next.chest.orientation = Quaternion::rotation_z(move1 * 1.2 + tension / 70.0);
332 next.head.orientation =
333 Quaternion::rotation_y(move1 * 0.05) * Quaternion::rotation_z(move1 * -0.5);
334 next.belt.orientation = Quaternion::rotation_z(move1 * -0.3);
335 next.shorts.orientation = Quaternion::rotation_z(move1 * -0.6);
336 next.control.position += Vec3::new(0.0, move1 * 1.0, move1 * 1.0);
337 next.control.orientation.rotate_x(move1 * 0.2);
338 next.control.orientation.rotate_y(move1 * -1.0);
339
340 next.control.orientation.rotate_y(move2_pre * -1.6);
341 next.control.position += Vec3::new(0.0, 0.0, move2_pre * 4.0);
342 next.torso.orientation.rotate_z(move2base * -TAU);
343 next.chest.orientation.rotate_z(move2 * -2.0);
344 next.head.orientation.rotate_z(move2 * 1.3);
345 next.belt.orientation.rotate_z(move2 * 0.6);
346 next.shorts.orientation.rotate_z(move2 * 1.5);
347 next.control.orientation.rotate_y(move2 * 1.6);
348 next.control.orientation.rotate_z(move2 * -1.8);
349 next.control.position += Vec3::new(move2 * 14.0, 0.0, 0.0);
350 },
351 Some("common.abilities.sword.cleaving_earth_splitter") => {
352 legacy_initialize();
353
354 let pullback = 1.0 - move3base.powi(4);
355 let move1 = movementbase.min(1.0).powi(2) * pullback;
356 let move1alt = movementbase.min(1.0).powf(0.5);
357 let move2 = move2base;
358 let move3 = move2base.powf(0.25) * pullback;
359
360 next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
361 next.hand_l.orientation =
362 Quaternion::rotation_x(s_a.shl.3) * Quaternion::rotation_y(s_a.shl.4);
363 next.hand_r.position =
364 Vec3::new(-s_a.sc.0 + 6.0 + move1 * -12.0, -4.0 + move1 * 3.0, -2.0);
365 next.hand_r.orientation = Quaternion::rotation_x(0.9 + move1 * 0.5);
366 next.control.position = Vec3::new(s_a.sc.0, s_a.sc.1, s_a.sc.2);
367 next.control.orientation = Quaternion::rotation_x(s_a.sc.3);
368 next.torso.orientation.rotate_x(move1alt * -TAU);
369
370 next.torso.orientation.rotate_x(move1 * -0.8);
371 next.control.orientation.rotate_x(move1 * 1.5);
372 next.control.position += Vec3::new(move1 * 7.0, move1.powi(4) * -6.0, move1 * 20.0);
373
374 next.torso.orientation.rotate_x(move2 * 0.8);
375 next.chest.orientation = Quaternion::rotation_x(move2 * -0.4);
376 next.control.orientation.rotate_x(move2 * -1.2);
377 next.control.position += Vec3::new(0.0, move2 * 12.0, move2 * -8.0);
378
379 next.control.orientation.rotate_x(move3 * -1.2);
380 next.control.position += Vec3::new(0.0, move3 * 4.0, move3 * -8.0);
381 },
382 Some("common.abilities.sword.heavy_pillar_thrust") => {
383 legacy_initialize();
384 let pullback = 1.0 - move3base.powi(4);
385 let move1 = move1base.powf(0.5) * pullback;
386 let move1alt1 = move1base.powf(0.5).min(0.5) * 2.0 * pullback;
387 let move1alt2 = (move1base.powf(0.5).max(0.5) - 0.5) * 2.0 * pullback;
388 let move2 = move2base.powi(2) * 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 = Quaternion::rotation_x(s_a.shl.3 + move1alt2 * PI)
392 * Quaternion::rotation_y(s_a.shl.4);
393 next.hand_r.position = Vec3::new(
394 -s_a.sc.0 + 6.0 + move1alt1 * -12.0,
395 -4.0 + move1alt1 * 3.0,
396 -2.0,
397 );
398 next.hand_r.orientation =
399 Quaternion::rotation_x(0.9 + move1 * 0.5 + move1alt1 * PI);
400 next.control.position = Vec3::new(s_a.sc.0, s_a.sc.1, s_a.sc.2);
401 next.control.orientation = Quaternion::rotation_x(s_a.sc.3);
402
403 next.control.position += Vec3::new(
404 move1 * 6.0,
405 (1.0 - (move1 - 0.5).abs() * 2.0) * 3.0,
406 move1 * 22.0,
407 );
408 next.control.orientation.rotate_x(move1 * -1.5);
409
410 next.chest.orientation = Quaternion::rotation_x(move2 * -0.4);
411 next.head.orientation = Quaternion::rotation_x(move2 * 0.2);
412 next.belt.orientation = Quaternion::rotation_x(move2 * 0.4);
413 next.shorts.orientation = Quaternion::rotation_x(move2 * 0.8);
414 next.control.orientation.rotate_x(move2 * -0.4);
415 next.control.position += Vec3::new(0.0, 0.0, move2 * -10.0);
416 next.belt.position += Vec3::new(0.0, move2 * 2.0, move2 * 0.0);
417 next.shorts.position += Vec3::new(0.0, move2 * 4.0, move2 * 1.0);
418 next.chest.position += Vec3::new(0.0, move2 * -2.5, 0.0);
419 },
420 Some("common.abilities.sword.basic_mighty_strike") => {
421 legacy_initialize();
422 let pullback = 1.0 - move3base.powi(4);
423 let move1 = move1base.powf(0.25) * pullback;
424 let move2 = move2base.powf(0.1) * pullback;
425
426 next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
427 next.hand_l.orientation =
428 Quaternion::rotation_x(s_a.shl.3) * Quaternion::rotation_y(s_a.shl.4);
429 next.hand_r.position =
430 Vec3::new(-s_a.sc.0 + 6.0 + move1 * -12.0, -4.0 + move1 * 3.0, -2.0);
431 next.hand_r.orientation = Quaternion::rotation_x(0.9 + move1 * 0.5);
432 next.control.position = Vec3::new(
433 s_a.sc.0 + move1 * -2.0 + move2 * 14.0,
434 s_a.sc.1 + move2 * 4.0,
435 s_a.sc.2 + move1 * 10.0 - move2 * 12.0,
436 );
437 next.control.orientation =
438 Quaternion::rotation_x(s_a.sc.3 + move1 * 1.6 + move2 * -2.6)
439 * Quaternion::rotation_y(move1 * -0.4 + move2 * 0.6)
440 * Quaternion::rotation_z(move1 * -0.2 + move2 * -0.2);
441
442 next.chest.position += Vec3::new(0.0, move1 * -1.0 + move2 * 2.0, 0.0);
443 next.chest.orientation = Quaternion::rotation_z(move1 * 1.0 + move2 * -1.2);
444 next.head.position += Vec3::new(0.0, move2 * 1.0, 0.0);
445 next.head.orientation = Quaternion::rotation_x(move1 * 0.05 + move2 * -0.25)
446 * Quaternion::rotation_y(move1 * -0.05 + move2 * 0.05)
447 * Quaternion::rotation_z(move1 * -0.5 + move2 * 0.4);
448 next.belt.orientation = Quaternion::rotation_z(move1 * -0.25 + move2 * 0.2);
449 next.shorts.orientation = Quaternion::rotation_z(move1 * -0.5 + move2 * 0.4);
450 },
451 Some("common.abilities.sword.heavy_guillotine") => {
452 legacy_initialize();
453 let pullback = 1.0 - move3base.powi(4);
454 let move1 = move1base.powf(0.25) * pullback;
455 let move2 = move2base.powi(2) * pullback;
456
457 next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
458 next.hand_l.orientation =
459 Quaternion::rotation_x(s_a.shl.3) * Quaternion::rotation_y(s_a.shl.4);
460 next.hand_r.position =
461 Vec3::new(-s_a.sc.0 + 6.0 + move1 * -12.0, -4.0 + move1 * 3.0, -1.0);
462 next.control.position = Vec3::new(s_a.sc.0, s_a.sc.1, s_a.sc.2);
463 next.control.orientation = Quaternion::rotation_x(s_a.sc.3)
464 * Quaternion::rotation_z(move1 * 0.3 + move2 * -0.7);
465
466 next.control.orientation.rotate_x(move1 * 1.4);
467 next.control.position += Vec3::new(move1 * -2.0, move1 * -2.0, move1 * 10.0);
468 next.chest.position += Vec3::new(0.0, move1 * -1.0 + move2 * 2.0, 0.0);
469 next.chest.orientation = Quaternion::rotation_z(move1 * 0.4 + move2 * -0.6);
470 next.head.position += Vec3::new(0.0, move2 * 1.0, 0.0);
471 next.head.orientation = Quaternion::rotation_x(move1 * 0.05 + move2 * -0.25)
472 * Quaternion::rotation_y(move1 * 0.1 + move2 * -0.05)
473 * Quaternion::rotation_z(move1 * 0.1 + move2 * -0.25);
474
475 next.control.orientation.rotate_x(move2 * -3.0);
476 next.control.orientation.rotate_z(move2 * -0.4);
477 next.control.position += Vec3::new(move2 * 12.0, move2 * 6.0, move2 * -11.0);
478 },
479 Some("common.abilities.sword.defensive_counter") => {
480 legacy_initialize();
481 let pullback = 1.0 - move3base.powi(4);
482 let move1 = move1base.powf(0.5) * pullback;
483 let move2 = (move2base.min(2.0 / 3.0) * 1.5).powi(2) * pullback;
484
485 next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
486 next.hand_l.orientation =
487 Quaternion::rotation_x(s_a.shl.3) * Quaternion::rotation_y(s_a.shl.4);
488 next.hand_r.position =
489 Vec3::new(-s_a.sc.0 + 6.0 + move1 * -12.0, -4.0 + move1 * 3.0, -2.0);
490 next.hand_r.orientation = Quaternion::rotation_x(0.9 + move1 * 0.5);
491 next.control.position = Vec3::new(s_a.sc.0, s_a.sc.1, s_a.sc.2);
492 next.control.orientation =
493 Quaternion::rotation_x(s_a.sc.3) * Quaternion::rotation_z(move2 * -PI / 4.0);
494
495 if !d.is_riding {
496 next.foot_l.position = Vec3::new(-s_a.foot.0, s_a.foot.1, s_a.foot.2);
497 next.foot_r.position = Vec3::new(s_a.foot.0, s_a.foot.1, s_a.foot.2);
498 next.foot_l.orientation = Quaternion::identity();
499 next.foot_r.orientation = Quaternion::identity();
500 }
501
502 next.foot_l.position += Vec3::new(0.0, move1 * 4.0, 1.0 - (move1 - 0.5) * 2.0);
503 next.torso.position += Vec3::new(0.0, move1 * -2.0, 0.0);
504 next.chest.position += Vec3::new(0.0, move1 * 2.0, move1 * -3.0);
505 next.head.position += Vec3::new(0.0, move1 * 1.0, 0.0);
506 next.shorts.orientation = Quaternion::rotation_x(move1 * 0.3);
507 next.shorts.position += Vec3::new(0.0, move1 * 1.5, 0.0);
508 next.control.orientation.rotate_y(move1 * -1.5);
509 next.control.orientation.rotate_z(move1 * 0.8);
510
511 next.chest.orientation = Quaternion::rotation_z(move2 * -0.8);
512 next.head.orientation =
513 Quaternion::rotation_x(move2 * 0.05) * Quaternion::rotation_z(move2 * 0.35);
514 next.shorts.orientation.rotate_z(move2 * 0.5);
515 next.belt.orientation = Quaternion::rotation_z(move2 * 0.3);
516 next.control.orientation.rotate_z(move2 * -1.8);
517 next.control.orientation.rotate_x(move2 * 0.3);
518 next.control.position += Vec3::new(move2 * 7.0, move2 * 7.0, move2 * 6.0);
519 },
520 Some("common.abilities.sword.defensive_riposte") => {
521 legacy_initialize();
522 let pullback = 1.0 - move3base.powi(4);
523 let move1 = move1base.powf(0.25) * pullback;
524 let move2_slow = move2base.powi(8) * pullback;
525 let move2 = move2base.powi(2) * pullback;
526
527 next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
528 next.hand_l.orientation =
529 Quaternion::rotation_x(s_a.shl.3) * Quaternion::rotation_y(s_a.shl.4);
530 next.hand_r.position =
531 Vec3::new(-s_a.sc.0 + 6.0 + move1 * -12.0, -4.0 + move1 * 3.0, -2.0);
532 next.hand_r.orientation = Quaternion::rotation_x(0.9 + move1 * 0.5);
533 next.control.position = Vec3::new(s_a.sc.0, s_a.sc.1, s_a.sc.2);
534 next.control.orientation = Quaternion::rotation_x(s_a.sc.3)
535 * Quaternion::rotation_z(move1 * 1.3 + move2 * -0.7);
536
537 next.chest.position += Vec3::new(0.0, move1 * -1.0, 0.0);
538 next.chest.orientation = Quaternion::rotation_z(move1 * 0.8);
539 next.head.orientation = Quaternion::rotation_x(move1 * 0.05)
540 * Quaternion::rotation_y(move1 * 0.05)
541 * Quaternion::rotation_z(move1 * -0.4);
542 next.belt.orientation = Quaternion::rotation_z(move1 * -0.2);
543 next.shorts.orientation = Quaternion::rotation_z(move1 * -0.5);
544 next.control.orientation.rotate_x(move1 * 0.5);
545 next.control.orientation.rotate_y(move1 * 2.1);
546 next.control.orientation.rotate_z(move1 * -0.5);
547 next.control.position += Vec3::new(0.0, move1 * 5.0, move1 * 8.0);
548
549 next.chest.position += Vec3::new(0.0, move2 * 2.0, 0.0);
550 next.chest.orientation.rotate_z(move2 * -1.4);
551 next.head.position += Vec3::new(0.0, move2 * 1.0, 0.0);
552 next.head.orientation.rotate_x(move2 * -0.1);
553 next.head.orientation.rotate_y(move2 * -0.1);
554 next.head.orientation.rotate_z(move2 * 0.8);
555 next.belt.orientation.rotate_z(move2 * -0.3);
556 next.shorts.orientation.rotate_z(move2 * 0.6);
557 next.control.orientation.rotate_y(move2 * -4.0);
558 next.control
559 .orientation
560 .rotate_z(move2_slow * -3.0 + move2 * 1.0);
561 next.control.position +=
562 Vec3::new(move2_slow * 14.0, move2_slow * -2.0, move2_slow * -7.0);
563 },
564 Some("common.abilities.sword.heavy_fortitude") => {
565 legacy_initialize();
566 let pullback = 1.0 - move3base.powi(4);
567 let move1 = move1base.powf(0.25) * pullback;
568 let move2 = move2base.powi(2) * pullback;
569
570 next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
571 next.hand_l.orientation =
572 Quaternion::rotation_x(s_a.shl.3) * Quaternion::rotation_y(s_a.shl.4);
573 next.hand_r.position =
574 Vec3::new(-s_a.sc.0 + 6.0 + move1 * -12.0, -4.0 + move1 * 3.0, -2.0);
575 next.hand_r.orientation = Quaternion::rotation_x(0.9 + move1 * 0.5);
576 next.control.position = Vec3::new(s_a.sc.0, s_a.sc.1, s_a.sc.2);
577 next.control.orientation = Quaternion::rotation_x(s_a.sc.3);
578
579 next.foot_l.position += Vec3::new(move1 * 1.0, move1 * 2.0, 0.0);
580 next.chest.orientation = Quaternion::rotation_z(move1 * -0.4);
581 next.head.orientation = Quaternion::rotation_z(move1 * 0.2);
582 next.shorts.orientation = Quaternion::rotation_z(move1 * 0.3);
583 next.belt.orientation = Quaternion::rotation_z(move1 * 0.1);
584 next.control.orientation.rotate_x(move1 * 0.4 + move2 * 0.6);
585 next.control.orientation.rotate_z(move1 * 0.4);
586
587 next.foot_r.position += Vec3::new(move2 * -1.0, move2 * -2.0, 0.0);
588 next.control.position += Vec3::new(move2 * 5.0, move2 * 7.0, move2 * 5.0);
589 next.chest.position += Vec3::new(0.0, 0.0, move2 * -1.0);
590 next.shorts.orientation.rotate_x(move2 * 0.2);
591 next.shorts.position += Vec3::new(0.0, move2 * 1.0, 0.0);
592 },
593 Some("common.abilities.sword.defensive_stalwart_sword") => {
594 legacy_initialize();
595 let pullback = 1.0 - move3base.powi(4);
596 let move1 = move1base.powf(0.25) * pullback;
597 let move2 = move2base.powi(2) * pullback;
598
599 next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
600 next.hand_l.orientation =
601 Quaternion::rotation_x(s_a.shl.3) * Quaternion::rotation_y(s_a.shl.4);
602 next.hand_r.position =
603 Vec3::new(-s_a.sc.0 + 6.0 + move1 * -12.0, -4.0 + move1 * 3.0, -2.0);
604 next.hand_r.orientation = Quaternion::rotation_x(0.9 + move1 * 0.5);
605 next.control.position = Vec3::new(s_a.sc.0, s_a.sc.1, s_a.sc.2);
606 next.control.orientation =
607 Quaternion::rotation_x(s_a.sc.3) * Quaternion::rotation_z(move2 * -0.5);
608
609 next.foot_r.position += Vec3::new(move1 * 1.0, move1 * -2.0, 0.0);
610 next.foot_r.orientation.rotate_z(move1 * -0.9);
611 next.chest.orientation = Quaternion::rotation_z(move1 * -0.5);
612 next.head.orientation = Quaternion::rotation_z(move1 * 0.3);
613 next.shorts.orientation = Quaternion::rotation_z(move1 * 0.1);
614 next.control.orientation.rotate_x(move1 * 0.4);
615 next.control.orientation.rotate_z(move1 * 0.5);
616 next.control.position += Vec3::new(0.0, 0.0, move1 * 4.0);
617
618 next.control.position += Vec3::new(move2 * 8.0, 0.0, move2 * -1.0);
619 next.control.orientation.rotate_x(move2 * -0.6);
620 next.chest.position += Vec3::new(0.0, 0.0, move2 * -2.0);
621 next.belt.position += Vec3::new(0.0, 0.0, move2 * 1.0);
622 next.shorts.position += Vec3::new(0.0, 0.0, move2 * 1.0);
623 next.shorts.orientation.rotate_x(move2 * 0.2);
624 next.control.orientation.rotate_z(move2 * 0.4);
625 },
626 Some("common.abilities.sword.agile_dancing_edge") => {
627 legacy_initialize();
628 let pullback = 1.0 - move3base.powi(4);
629 let move1 = move1base.powf(0.25) * pullback;
630 let move2 = move2base.powi(2) * pullback;
631
632 next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
633 next.hand_l.orientation =
634 Quaternion::rotation_x(s_a.shl.3) * Quaternion::rotation_y(s_a.shl.4);
635 next.hand_r.position =
636 Vec3::new(-s_a.sc.0 + 6.0 + move1 * -12.0, -4.0 + move1 * 3.0, -2.0);
637 next.hand_r.orientation = Quaternion::rotation_x(0.9 + move1 * 0.5);
638 next.control.position = Vec3::new(s_a.sc.0, s_a.sc.1, s_a.sc.2);
639 next.control.orientation = Quaternion::rotation_x(s_a.sc.3);
640
641 next.head.orientation = Quaternion::rotation_x(move1 * 0.3);
642 next.head.position += Vec3::new(0.0, 0.0, move1 * -1.0);
643 next.control.position += Vec3::new(move1 * 8.0, move1 * 5.0, 0.0);
644
645 next.head.orientation.rotate_x(move2 * 0.2);
646 next.head.position += Vec3::new(0.0, 0.0, move2 * -1.0);
647 next.control.position += Vec3::new(0.0, move2 * -2.0, move2 * 12.0);
648 next.control.orientation.rotate_x(move2 * 1.1);
649 },
650 Some("common.abilities.sword.cleaving_blade_fever") => {
651 legacy_initialize();
652 let pullback = 1.0 - move3base.powi(4);
653 let move1 = move1base.powf(0.25) * pullback;
654 let move2 = move2base.powi(2) * pullback;
655
656 next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
657 next.hand_l.orientation =
658 Quaternion::rotation_x(s_a.shl.3) * Quaternion::rotation_y(s_a.shl.4);
659 next.hand_r.position =
660 Vec3::new(-s_a.sc.0 + 6.0 + move1 * -12.0, -4.0 + move1 * 3.0, -2.0);
661 next.hand_r.orientation = Quaternion::rotation_x(0.9 + move1 * 0.5);
662 next.control.position = Vec3::new(s_a.sc.0, s_a.sc.1, s_a.sc.2);
663 next.control.orientation = Quaternion::rotation_x(s_a.sc.3);
664
665 next.foot_l.position += Vec3::new(move1 * 1.0, move1 * 2.0, 0.0);
666 next.chest.orientation = Quaternion::rotation_z(move1 * -0.4);
667 next.head.orientation = Quaternion::rotation_z(move1 * 0.2);
668 next.shorts.orientation = Quaternion::rotation_z(move1 * 0.3);
669 next.belt.orientation = Quaternion::rotation_z(move1 * 0.1);
670 next.control.orientation.rotate_x(move1 * 0.4 + move2 * 0.6);
671 next.control.orientation.rotate_z(move1 * 0.4);
672
673 next.foot_r.position += Vec3::new(move2 * -1.0, move2 * -2.0, 0.0);
674 next.control.position += Vec3::new(move2 * 5.0, move2 * 7.0, move2 * 5.0);
675 next.chest.position += Vec3::new(0.0, 0.0, move2 * -1.0);
676 next.shorts.orientation.rotate_x(move2 * 0.2);
677 next.shorts.position += Vec3::new(0.0, move2 * 1.0, 0.0);
678 },
679 Some("common.abilities.axe.basic_guard") => {
683 let pullback = 1.0 - move3base.powi(4);
684 let move1 = move1base.powf(0.25) * pullback;
685 let move2 = (move2base * 10.0).sin();
686
687 if d.velocity.xy().magnitude_squared() < 0.5_f32.powi(2) {
688 next.chest.position =
689 Vec3::new(0.0, s_a.chest.0, s_a.chest.1 + move1 * -1.0 + move2 * 0.2);
690 next.chest.orientation = Quaternion::rotation_x(move1 * -0.15);
691 next.head.orientation = Quaternion::rotation_x(move1 * 0.25);
692
693 next.belt.position =
694 Vec3::new(0.0, s_a.belt.0 + move1 * 0.5, s_a.belt.1 + move1 * 0.5);
695 next.shorts.position =
696 Vec3::new(0.0, s_a.shorts.0 + move1 * 1.3, s_a.shorts.1 + move1 * 1.0);
697
698 next.belt.orientation = Quaternion::rotation_x(move1 * 0.15);
699 next.shorts.orientation = Quaternion::rotation_x(move1 * 0.25);
700
701 if !d.is_riding {
702 next.foot_l.position =
703 Vec3::new(-s_a.foot.0, s_a.foot.1 + move1 * 2.0, s_a.foot.2);
704 next.foot_l.orientation = Quaternion::rotation_z(move1 * -0.5);
705
706 next.foot_r.position =
707 Vec3::new(s_a.foot.0, s_a.foot.1 + move1 * -2.0, s_a.foot.2);
708 next.foot_r.orientation = Quaternion::rotation_x(move1 * -0.5);
709 }
710 }
711
712 match d.hands {
713 (Some(Hands::Two), _) => {
714 next.main.position = Vec3::new(0.0, 0.0, 0.0);
715 next.main.orientation = Quaternion::rotation_x(0.0);
716
717 next.hand_l.position = Vec3::new(s_a.ahl.0, s_a.ahl.1, s_a.ahl.2);
718 next.hand_l.orientation =
719 Quaternion::rotation_x(s_a.ahl.3) * Quaternion::rotation_y(s_a.ahl.4);
720 next.hand_r.position = Vec3::new(s_a.ahr.0, s_a.ahr.1, s_a.ahr.2);
721 next.hand_r.orientation =
722 Quaternion::rotation_x(s_a.ahr.3) * Quaternion::rotation_z(s_a.ahr.5);
723
724 next.control.position = Vec3::new(
725 s_a.ac.0 + move1 * 13.0,
726 s_a.ac.1 + move1 * -3.0,
727 s_a.ac.2 + move1 * 8.0,
728 );
729 next.control.orientation = Quaternion::rotation_x(s_a.ac.3 + move1 * -2.0)
730 * Quaternion::rotation_y(s_a.ac.4 + move1 * -1.8)
731 * Quaternion::rotation_z(s_a.ac.5 + move1 * 4.0);
732 },
733 (Some(Hands::One), offhand) => {
734 next.main.position = Vec3::new(0.0, 0.0, 0.0);
735 next.main.orientation = Quaternion::rotation_x(0.0);
736
737 next.control_l.position =
738 Vec3::new(-7.0, 8.0 + move1 * 3.0, 2.0 + move1 * 3.0);
739 next.control_l.orientation =
740 Quaternion::rotation_x(-0.3) * Quaternion::rotation_y(move1 * 1.0);
741 next.hand_l.position = Vec3::new(0.0, -0.5, 0.0);
742 next.hand_l.orientation = Quaternion::rotation_x(PI / 2.0);
743 if offhand.is_some() {
744 next.second.position = Vec3::new(0.0, 0.0, 0.0);
745 next.second.orientation = Quaternion::rotation_x(0.0);
746 next.control_r.position =
747 Vec3::new(7.0, 8.0 + move1 * 3.0, 2.0 + move1 * 3.0);
748 next.control_r.orientation =
749 Quaternion::rotation_x(-0.3) * Quaternion::rotation_y(move1 * -1.0);
750 next.hand_r.position = Vec3::new(0.0, -0.5, 0.0);
751 next.hand_r.orientation = Quaternion::rotation_x(PI / 2.0)
752 } else {
753 next.hand_r.position = Vec3::new(4.5, 8.0, 5.0);
754 next.hand_r.orientation =
755 Quaternion::rotation_x(1.9) * Quaternion::rotation_y(0.5)
756 }
757 },
758 (_, _) => {},
759 }
760 },
761 Some("common.abilities.axe.cleave") => {
762 legacy_initialize();
763 let move1 = chargebase.min(1.0) * pullback;
764 let move2 = move2base.powi(2) * pullback;
765 let tension = (chargebase * 20.0).sin();
766
767 next.hand_l.position = Vec3::new(s_a.ahl.0, s_a.ahl.1, s_a.ahl.2);
768 next.hand_l.orientation =
769 Quaternion::rotation_x(s_a.ahl.3) * Quaternion::rotation_y(s_a.ahl.4);
770 next.hand_r.position = Vec3::new(s_a.ahr.0, s_a.ahr.1, s_a.ahr.2);
771 next.hand_r.orientation =
772 Quaternion::rotation_x(s_a.ahr.3) * Quaternion::rotation_z(s_a.ahr.5);
773
774 next.control.position = Vec3::new(
775 s_a.ac.0 + move1 * 7.0,
776 s_a.ac.1 + move1 * -4.0,
777 s_a.ac.2 + move1 * 18.0 + tension / 5.0,
778 );
779 next.control.orientation =
780 Quaternion::rotation_x(s_a.ac.3 + move1 * -1.0 + tension / 30.0)
781 * Quaternion::rotation_y(s_a.ac.4)
782 * Quaternion::rotation_z(s_a.ac.5 - move1 * PI);
783
784 next.control.orientation.rotate_x(move2 * -3.0);
785 next.control.position += Vec3::new(0.0, move2 * 8.0, move2 * -30.0);
786 },
787 Some("common.abilities.axe.execute") => {
788 legacy_initialize();
789 next.hand_l.position = Vec3::new(s_a.ahl.0, s_a.ahl.1, s_a.ahl.2);
790 next.hand_l.orientation =
791 Quaternion::rotation_x(s_a.ahl.3) * Quaternion::rotation_y(s_a.ahl.4);
792 next.hand_r.position = Vec3::new(s_a.ahr.0, s_a.ahr.1, s_a.ahr.2);
793 next.hand_r.orientation =
794 Quaternion::rotation_x(s_a.ahr.3) * Quaternion::rotation_z(s_a.ahr.5);
795
796 next.control.position = Vec3::new(s_a.ac.0, s_a.ac.1, s_a.ac.2);
797 next.control.orientation = Quaternion::rotation_x(s_a.ac.3)
798 * Quaternion::rotation_y(s_a.ac.4)
799 * Quaternion::rotation_z(s_a.ac.5 - move1 * PI);
800
801 next.control.orientation.rotate_x(move1 * 0.9);
802 next.chest.orientation.rotate_z(move1 * 1.2);
803 next.head.orientation.rotate_z(move1 * -0.5);
804 next.belt.orientation.rotate_z(move1 * -0.3);
805 next.shorts.orientation.rotate_z(move1 * -0.7);
806 next.control.position += Vec3::new(move1 * 4.0, move1 * -12.0, move1 * 11.0);
807
808 next.chest.orientation.rotate_z(move2 * -2.0);
809 next.head.orientation.rotate_z(move2 * 0.9);
810 next.belt.orientation.rotate_z(move2 * 0.4);
811 next.shorts.orientation.rotate_z(move2 * 1.1);
812 next.control.orientation.rotate_x(move2 * -5.0);
813 next.control.position += Vec3::new(move2 * -3.0, move2 * 12.0, move2 * -17.0);
814 next.control.orientation.rotate_z(move2 * 0.7);
815 },
816 Some("common.abilities.axe.maelstrom") => {
817 legacy_initialize();
818 next.hand_l.position = Vec3::new(s_a.ahl.0, s_a.ahl.1, s_a.ahl.2);
819 next.hand_l.orientation =
820 Quaternion::rotation_x(s_a.ahl.3) * Quaternion::rotation_y(s_a.ahl.4);
821 next.hand_r.position = Vec3::new(s_a.ahr.0, s_a.ahr.1, s_a.ahr.2);
822 next.hand_r.orientation =
823 Quaternion::rotation_x(s_a.ahr.3) * Quaternion::rotation_z(s_a.ahr.5);
824
825 next.control.position = Vec3::new(s_a.ac.0, s_a.ac.1, s_a.ac.2);
826 next.control.orientation = Quaternion::rotation_x(s_a.ac.3)
827 * Quaternion::rotation_y(s_a.ac.4)
828 * Quaternion::rotation_z(s_a.ac.5 - move1 * PI);
829
830 next.control.orientation.rotate_x(move1 * 0.9);
831 next.chest.orientation.rotate_z(move1 * 1.2);
832 next.head.orientation.rotate_z(move1 * -0.5);
833 next.belt.orientation.rotate_z(move1 * -0.3);
834 next.shorts.orientation.rotate_z(move1 * -0.7);
835 next.control.position += Vec3::new(move1 * 4.0, move1 * -12.0, move1 * 11.0);
836
837 next.chest.orientation.rotate_z(move2 * -2.0);
838 next.head.orientation.rotate_z(move2 * 0.9);
839 next.belt.orientation.rotate_z(move2 * 0.4);
840 next.shorts.orientation.rotate_z(move2 * 1.1);
841 next.control.orientation.rotate_x(move2 * -5.0);
842 next.control.position += Vec3::new(move2 * 5.0, move2 * 12.0, move2 * -17.0);
843 next.control.orientation.rotate_y(move2 * -2.0);
844 next.control.orientation.rotate_z(move2 * -1.0);
845 next.torso.orientation.rotate_z(move2base * -4.0 * PI);
846 },
847 Some("common.abilities.axe.lacerate") => {
848 legacy_initialize();
849 let move2_reset = ((move2base - 0.5).abs() - 0.5).abs() * 2.0;
850
851 next.hand_l.position = Vec3::new(s_a.ahl.0, s_a.ahl.1, s_a.ahl.2 + 10.0);
852 next.hand_l.orientation =
853 Quaternion::rotation_x(s_a.ahl.3) * Quaternion::rotation_y(s_a.ahl.4);
854 next.hand_r.position = Vec3::new(s_a.ahr.0, s_a.ahr.1, s_a.ahr.2);
855 next.hand_r.orientation =
856 Quaternion::rotation_x(s_a.ahr.3) * Quaternion::rotation_z(s_a.ahr.5);
857
858 next.control.position = Vec3::new(s_a.ac.0, s_a.ac.1, s_a.ac.2);
859 next.control.orientation = Quaternion::rotation_x(s_a.ac.3)
860 * Quaternion::rotation_y(s_a.ac.4)
861 * Quaternion::rotation_z(s_a.ac.5 - move1 * PI * 0.75);
862
863 next.chest.orientation.rotate_z(move1 * 1.2);
864 next.head.orientation.rotate_z(move1 * -0.7);
865 next.shorts.orientation.rotate_z(move1 * -0.9);
866 next.belt.orientation.rotate_z(move1 * -0.3);
867
868 next.chest.orientation.rotate_z(move2 * -2.9);
869 next.head.orientation.rotate_z(move2 * 1.2);
870 next.shorts.orientation.rotate_z(move2 * 2.0);
871 next.belt.orientation.rotate_z(move2 * 0.7);
872 next.control.orientation.rotate_x(move2_reset * -1.0);
873 next.control.orientation.rotate_z(move2 * -5.0);
874 next.control.position += Vec3::new(move2 * 17.0, move2 * 3.0, 0.0);
875 },
876 Some("common.abilities.axe.riptide") => {
877 legacy_initialize();
878 let move2_reset = ((move2base - 0.5).abs() - 0.5).abs() * 2.0;
879
880 next.hand_l.position = Vec3::new(s_a.ahl.0, s_a.ahl.1, s_a.ahl.2);
881 next.hand_l.orientation =
882 Quaternion::rotation_x(s_a.ahl.3) * Quaternion::rotation_y(s_a.ahl.4);
883 next.hand_r.position = Vec3::new(s_a.ahr.0, s_a.ahr.1, s_a.ahr.2);
884 next.hand_r.orientation =
885 Quaternion::rotation_x(s_a.ahr.3) * Quaternion::rotation_z(s_a.ahr.5);
886
887 next.control.position = Vec3::new(s_a.ac.0, s_a.ac.1, s_a.ac.2);
888 next.control.orientation = Quaternion::rotation_x(s_a.ac.3)
889 * Quaternion::rotation_y(s_a.ac.4)
890 * Quaternion::rotation_z(s_a.ac.5 - move1 * PI * 0.75);
891
892 next.chest.orientation.rotate_z(move1 * 1.2);
893 next.head.orientation.rotate_z(move1 * -0.7);
894 next.shorts.orientation.rotate_z(move1 * -0.9);
895 next.belt.orientation.rotate_z(move1 * -0.3);
896
897 next.chest.orientation.rotate_z(move2 * -2.9);
898 next.head.orientation.rotate_z(move2 * 1.2);
899 next.shorts.orientation.rotate_z(move2 * 2.0);
900 next.belt.orientation.rotate_z(move2 * 0.7);
901 next.control.orientation.rotate_x(move2_reset * -1.0);
902 next.control.orientation.rotate_z(move2 * -5.0);
903 next.control.position += Vec3::new(move2 * 17.0, move2 * 3.0, 0.0);
904 next.torso.orientation.rotate_z(move2base * -TAU)
905 },
906 Some("common.abilities.axe.keelhaul") => {
907 legacy_initialize();
908 next.hand_l.position = Vec3::new(s_a.ahl.0, s_a.ahl.1, s_a.ahl.2);
909 next.hand_l.orientation =
910 Quaternion::rotation_x(s_a.ahl.3) * Quaternion::rotation_y(s_a.ahl.4);
911 next.hand_r.position = Vec3::new(s_a.ahr.0, s_a.ahr.1, s_a.ahr.2);
912 next.hand_r.orientation =
913 Quaternion::rotation_x(s_a.ahr.3) * Quaternion::rotation_z(s_a.ahr.5);
914
915 next.control.position = Vec3::new(s_a.ac.0, s_a.ac.1, s_a.ac.2);
916 next.control.orientation = Quaternion::rotation_x(s_a.ac.3)
917 * Quaternion::rotation_y(s_a.ac.4)
918 * Quaternion::rotation_z(s_a.ac.5);
919
920 next.control.orientation.rotate_z(move1 * -3.3);
921 next.control.orientation.rotate_x(move1 * 0.8);
922 next.control.position +=
923 Vec3::new(move1 * 4.0, move1 * 4.0 - move2 * 6.0, move1 * 10.0);
924
925 next.chest.orientation.rotate_z(move2 * 1.2);
926 next.head.orientation.rotate_z(move2 * -0.5);
927 next.belt.orientation.rotate_z(move2 * -0.3);
928 next.shorts.orientation.rotate_z(move2 * -0.9);
929 next.control.orientation.rotate_z(move2 * -1.2);
930 },
931 Some("common.abilities.axe.bulkhead") => {
932 legacy_initialize();
933 next.hand_l.position = Vec3::new(s_a.ahl.0, s_a.ahl.1, s_a.ahl.2);
934 next.hand_l.orientation =
935 Quaternion::rotation_x(s_a.ahl.3) * Quaternion::rotation_y(s_a.ahl.4);
936 next.hand_r.position = Vec3::new(s_a.ahr.0, s_a.ahr.1, s_a.ahr.2);
937 next.hand_r.orientation =
938 Quaternion::rotation_x(s_a.ahr.3) * Quaternion::rotation_z(s_a.ahr.5);
939
940 next.control.position = Vec3::new(s_a.ac.0, s_a.ac.1, s_a.ac.2);
941 next.control.orientation = Quaternion::rotation_x(s_a.ac.3)
942 * Quaternion::rotation_y(s_a.ac.4)
943 * Quaternion::rotation_z(s_a.ac.5 + move1 * -PI * 0.75 + move2 * PI * 0.25);
944
945 next.chest.orientation.rotate_z(move1 * 1.8);
946 next.head.orientation.rotate_z(move1 * -0.6);
947 next.belt.orientation.rotate_z(move1 * -0.4);
948 next.shorts.orientation.rotate_z(move1 * -1.3);
949 next.control.orientation.rotate_x(move1 * -0.8);
950
951 next.chest.orientation.rotate_z(move2 * -3.8);
952 next.head.orientation.rotate_z(move2 * 1.2);
953 next.belt.orientation.rotate_z(move2 * 0.8);
954 next.shorts.orientation.rotate_z(move2 * 2.1);
955 next.control.orientation.rotate_x(move2 * 0.6);
956 next.control.orientation.rotate_z(move2 * -4.0);
957 next.control.position += Vec3::new(move2 * 12.0, move2 * -6.0, 0.0);
958 },
959 Some("common.abilities.axe.capsize") => {
960 legacy_initialize();
961 next.hand_l.position = Vec3::new(s_a.ahl.0, s_a.ahl.1, s_a.ahl.2);
962 next.hand_l.orientation =
963 Quaternion::rotation_x(s_a.ahl.3) * Quaternion::rotation_y(s_a.ahl.4);
964 next.hand_r.position = Vec3::new(s_a.ahr.0, s_a.ahr.1, s_a.ahr.2);
965 next.hand_r.orientation =
966 Quaternion::rotation_x(s_a.ahr.3) * Quaternion::rotation_z(s_a.ahr.5);
967
968 next.control.position = Vec3::new(s_a.ac.0, s_a.ac.1, s_a.ac.2);
969 next.control.orientation = Quaternion::rotation_x(s_a.ac.3)
970 * Quaternion::rotation_y(s_a.ac.4)
971 * Quaternion::rotation_z(s_a.ac.5 + move1 * -PI * 0.75 + move2 * PI * 0.25);
972
973 next.chest.orientation.rotate_z(move1 * 1.8);
974 next.head.orientation.rotate_z(move1 * -0.6);
975 next.belt.orientation.rotate_z(move1 * -0.4);
976 next.shorts.orientation.rotate_z(move1 * -1.3);
977 next.control.orientation.rotate_x(move1 * -0.8);
978
979 next.chest.orientation.rotate_z(move2 * -3.8);
980 next.head.orientation.rotate_z(move2 * 1.2);
981 next.belt.orientation.rotate_z(move2 * 0.8);
982 next.shorts.orientation.rotate_z(move2 * 2.1);
983 next.control.orientation.rotate_x(move2 * 0.6);
984 next.control.orientation.rotate_z(move2 * -4.0);
985 next.control.position += Vec3::new(move2 * 12.0, move2 * -6.0, 0.0);
986 next.torso.orientation.rotate_z(move2base * -TAU);
987 },
988 Some("common.abilities.axe.fracture") => {
989 legacy_initialize();
990 next.hand_l.position = Vec3::new(s_a.ahl.0, s_a.ahl.1, s_a.ahl.2);
991 next.hand_l.orientation =
992 Quaternion::rotation_x(s_a.ahl.3) * Quaternion::rotation_y(s_a.ahl.4);
993 next.hand_r.position = Vec3::new(s_a.ahr.0, s_a.ahr.1, s_a.ahr.2);
994 next.hand_r.orientation =
995 Quaternion::rotation_x(s_a.ahr.3) * Quaternion::rotation_z(s_a.ahr.5);
996
997 next.control.position = Vec3::new(s_a.ac.0, s_a.ac.1, s_a.ac.2);
998 next.control.orientation = Quaternion::rotation_x(s_a.ac.3)
999 * Quaternion::rotation_y(s_a.ac.4)
1000 * Quaternion::rotation_z(s_a.ac.5 + move1 * -PI / 2.0 + move2 * -0.5);
1001
1002 next.control.orientation.rotate_x(move1 * 0.0);
1003 next.chest.orientation.rotate_x(move1 * -0.5);
1004 next.chest.orientation.rotate_z(move1 * 0.7);
1005 next.head.orientation.rotate_z(move1 * -0.3);
1006 next.belt.orientation.rotate_z(move1 * -0.1);
1007 next.shorts.orientation.rotate_z(move1 * -0.4);
1008
1009 next.chest.orientation.rotate_z(move2 * -1.8);
1010 next.head.orientation.rotate_z(move2 * 0.9);
1011 next.shorts.orientation.rotate_z(move2 * 1.3);
1012 next.belt.orientation.rotate_z(move2 * 0.6);
1013 next.control.orientation.rotate_x(move2 * -0.9);
1014 next.control.orientation.rotate_z(move2 * -3.5);
1015 next.control.position += Vec3::new(move2 * 14.0, move2 * 6.0, 0.0);
1016 },
1017 Some("common.abilities.axe.berserk") => {
1018 legacy_initialize();
1019 next.hand_l.position = Vec3::new(s_a.ahl.0, s_a.ahl.1, s_a.ahl.2);
1020 next.hand_l.orientation =
1021 Quaternion::rotation_x(s_a.ahl.3) * Quaternion::rotation_y(s_a.ahl.4);
1022 next.hand_r.position = Vec3::new(s_a.ahr.0, s_a.ahr.1, s_a.ahr.2);
1023 next.hand_r.orientation =
1024 Quaternion::rotation_x(s_a.ahr.3) * Quaternion::rotation_z(s_a.ahr.5);
1025
1026 next.control.position = Vec3::new(s_a.ac.0, s_a.ac.1, s_a.ac.2);
1027 next.control.orientation = Quaternion::rotation_x(s_a.ac.3)
1028 * Quaternion::rotation_y(s_a.ac.4)
1029 * Quaternion::rotation_z(s_a.ac.5);
1030
1031 next.control.orientation.rotate_z(move1 * -2.0);
1032 next.control.orientation.rotate_x(move1 * 3.5);
1033 next.control.position += Vec3::new(move1 * 14.0, move1 * -6.0, move1 * 15.0);
1034
1035 next.head.orientation.rotate_x(move2 * 0.6);
1036 next.chest.orientation.rotate_x(move2 * 0.4);
1037 },
1038 Some("common.abilities.axe.savage_sense") => {
1039 legacy_initialize();
1040 next.hand_l.position = Vec3::new(s_a.ahl.0, s_a.ahl.1, s_a.ahl.2);
1041 next.hand_l.orientation =
1042 Quaternion::rotation_x(s_a.ahl.3) * Quaternion::rotation_y(s_a.ahl.4);
1043 next.hand_r.position = Vec3::new(s_a.ahr.0, s_a.ahr.1, s_a.ahr.2);
1044 next.hand_r.orientation =
1045 Quaternion::rotation_x(s_a.ahr.3) * Quaternion::rotation_z(s_a.ahr.5);
1046
1047 next.control.position = Vec3::new(s_a.ac.0, s_a.ac.1, s_a.ac.2);
1048 next.control.orientation = Quaternion::rotation_x(s_a.ac.3)
1049 * Quaternion::rotation_y(s_a.ac.4)
1050 * Quaternion::rotation_z(s_a.ac.5);
1051
1052 next.chest.orientation = Quaternion::rotation_z(move1 * 0.6);
1053 next.head.orientation = Quaternion::rotation_z(move1 * -0.2);
1054 next.belt.orientation = Quaternion::rotation_z(move1 * -0.3);
1055 next.shorts.orientation = Quaternion::rotation_z(move1 * -0.1);
1056 next.foot_r.position += Vec3::new(0.0, move1 * 4.0, move1 * 4.0);
1057 next.foot_r.orientation.rotate_x(move1 * 1.2);
1058
1059 next.foot_r.position += Vec3::new(0.0, move2 * 4.0, move2 * -4.0);
1060 next.foot_r.orientation.rotate_x(move2 * -1.2);
1061 },
1062 Some("common.abilities.axe.adrenaline_rush") => {
1063 legacy_initialize();
1064 next.hand_l.position = Vec3::new(s_a.ahl.0, s_a.ahl.1, s_a.ahl.2);
1065 next.hand_l.orientation =
1066 Quaternion::rotation_x(s_a.ahl.3) * Quaternion::rotation_y(s_a.ahl.4);
1067 next.hand_r.position = Vec3::new(s_a.ahr.0, s_a.ahr.1, s_a.ahr.2);
1068 next.hand_r.orientation =
1069 Quaternion::rotation_x(s_a.ahr.3) * Quaternion::rotation_z(s_a.ahr.5);
1070
1071 next.control.position = Vec3::new(s_a.ac.0, s_a.ac.1, s_a.ac.2);
1072 next.control.orientation = Quaternion::rotation_x(s_a.ac.3)
1073 * Quaternion::rotation_y(s_a.ac.4)
1074 * Quaternion::rotation_z(s_a.ac.5 - move1 * PI);
1075
1076 next.control.orientation.rotate_z(move1 * -1.8);
1077 next.control.orientation.rotate_y(move1 * 1.5);
1078 next.control.position += Vec3::new(move1 * 11.0, 0.0, 0.0);
1079
1080 next.control.orientation.rotate_y(move2 * 0.7);
1081 next.control.orientation.rotate_z(move2 * 1.6);
1082 next.control.position += Vec3::new(move2 * -8.0, 0.0, move2 * -3.0);
1083 },
1084 Some("common.abilities.axe.bloodfeast") => {
1085 legacy_initialize();
1086 next.hand_l.position = Vec3::new(s_a.ahl.0, s_a.ahl.1, s_a.ahl.2);
1087 next.hand_l.orientation =
1088 Quaternion::rotation_x(s_a.ahl.3) * Quaternion::rotation_y(s_a.ahl.4);
1089 next.hand_r.position = Vec3::new(s_a.ahr.0, s_a.ahr.1, s_a.ahr.2);
1090 next.hand_r.orientation =
1091 Quaternion::rotation_x(s_a.ahr.3) * Quaternion::rotation_z(s_a.ahr.5);
1092
1093 next.control.position = Vec3::new(s_a.ac.0, s_a.ac.1, s_a.ac.2);
1094 next.control.orientation = Quaternion::rotation_x(s_a.ac.3)
1095 * Quaternion::rotation_y(s_a.ac.4)
1096 * Quaternion::rotation_z(s_a.ac.5);
1097
1098 next.control.orientation.rotate_z(move1 * -3.4);
1099 next.control.orientation.rotate_x(move1 * 1.1);
1100 next.control.position += Vec3::new(move1 * 14.0, move1 * -3.0, 0.0);
1101
1102 next.control.orientation.rotate_x(move2 * 1.7);
1103 next.control.orientation.rotate_z(move2 * -1.3);
1104 next.control.orientation.rotate_y(move2 * 0.8);
1105 },
1106 Some("common.abilities.axe.furor") => {
1107 legacy_initialize();
1108 next.hand_l.position = Vec3::new(s_a.ahl.0, s_a.ahl.1, s_a.ahl.2);
1109 next.hand_l.orientation =
1110 Quaternion::rotation_x(s_a.ahl.3) * Quaternion::rotation_y(s_a.ahl.4);
1111 next.hand_r.position = Vec3::new(s_a.ahr.0, s_a.ahr.1, s_a.ahr.2);
1112 next.hand_r.orientation =
1113 Quaternion::rotation_x(s_a.ahr.3) * Quaternion::rotation_z(s_a.ahr.5);
1114
1115 next.control.position = Vec3::new(s_a.ac.0, s_a.ac.1, s_a.ac.2);
1116 next.control.orientation = Quaternion::rotation_x(s_a.ac.3)
1117 * Quaternion::rotation_y(s_a.ac.4)
1118 * Quaternion::rotation_z(s_a.ac.5 - move1 * PI);
1119
1120 next.control.orientation.rotate_x(move1 * -1.0);
1121 next.control.position += Vec3::new(move1 * 3.0, move1 * -2.0, move1 * 14.0);
1122 next.control.orientation.rotate_z(move1 * 1.5);
1123
1124 next.control.orientation.rotate_y(move2 * -1.0);
1125 next.control.orientation.rotate_z(move2 * -1.6);
1126 next.control.orientation.rotate_y(move2 * 0.7);
1127 next.control.orientation.rotate_x(move2 * -0.5);
1128 next.control.position += Vec3::new(move2 * 9.0, move2 * -3.0, move2 * -14.0);
1129 },
1130 Some("common.abilities.axe.sunder") => {
1131 legacy_initialize();
1132 next.hand_l.position = Vec3::new(s_a.ahl.0, s_a.ahl.1, s_a.ahl.2);
1133 next.hand_l.orientation =
1134 Quaternion::rotation_x(s_a.ahl.3) * Quaternion::rotation_y(s_a.ahl.4);
1135 next.hand_r.position = Vec3::new(s_a.ahr.0, s_a.ahr.1, s_a.ahr.2);
1136 next.hand_r.orientation =
1137 Quaternion::rotation_x(s_a.ahr.3) * Quaternion::rotation_z(s_a.ahr.5);
1138
1139 next.control.position = Vec3::new(s_a.ac.0, s_a.ac.1, s_a.ac.2);
1140 next.control.orientation = Quaternion::rotation_x(s_a.ac.3)
1141 * Quaternion::rotation_y(s_a.ac.4)
1142 * Quaternion::rotation_z(s_a.ac.5);
1143
1144 next.control.orientation.rotate_z(move1 * -1.5);
1145 next.control.position += Vec3::new(move1 * 12.0, 0.0, move1 * 5.0);
1146 next.control.orientation.rotate_y(move1 * 0.5);
1147 next.main.position += Vec3::new(0.0, move1 * 10.0, 0.0);
1148 next.main.orientation.rotate_z(move1base * TAU);
1149 next.second.position += Vec3::new(0.0, move1 * 10.0, 0.0);
1150 next.second.orientation.rotate_z(move1base * -TAU);
1151
1152 next.main.orientation.rotate_z(move2base * TAU);
1153 next.main.position += Vec3::new(0.0, move2 * -10.0, 0.0);
1154 next.second.orientation.rotate_z(move2base * -TAU);
1155 next.second.position += Vec3::new(0.0, move2 * -10.0, 0.0);
1156 next.control.position += Vec3::new(0.0, 0.0, move2 * -5.0);
1157 },
1158 Some("common.abilities.axe.defiance") => {
1159 legacy_initialize();
1160 let tension = (move2base * 20.0).sin();
1161
1162 next.hand_l.position = Vec3::new(s_a.ahl.0, s_a.ahl.1, s_a.ahl.2);
1163 next.hand_l.orientation =
1164 Quaternion::rotation_x(s_a.ahl.3) * Quaternion::rotation_y(s_a.ahl.4);
1165 next.hand_r.position = Vec3::new(s_a.ahr.0, s_a.ahr.1, s_a.ahr.2);
1166 next.hand_r.orientation =
1167 Quaternion::rotation_x(s_a.ahr.3) * Quaternion::rotation_z(s_a.ahr.5);
1168
1169 next.control.position = Vec3::new(s_a.ac.0, s_a.ac.1, s_a.ac.2);
1170 next.control.orientation = Quaternion::rotation_x(s_a.ac.3)
1171 * Quaternion::rotation_y(s_a.ac.4)
1172 * Quaternion::rotation_z(s_a.ac.5);
1173
1174 next.control.orientation.rotate_z(move1 * -1.6);
1175 next.control.orientation.rotate_x(move1 * 1.7);
1176 next.control.position += Vec3::new(move1 * 12.0, move1 * -10.0, move1 * 18.0);
1177 next.head.orientation.rotate_x(move1 * 0.6);
1178 next.head.position += Vec3::new(0.0, 0.0, move1 * -3.0);
1179 next.control.orientation.rotate_z(move1 * 0.4);
1180
1181 next.head.orientation.rotate_x(tension * 0.3);
1182 next.control.position += Vec3::new(0.0, 0.0, tension * 2.0);
1183 },
1184 Some("common.abilities.hammer.basic_guard") => {
1188 let pullback = 1.0 - move3base.powi(4);
1189 let move1 = move1base.powf(0.25) * pullback;
1190 let move2 = (move2base * 10.0).sin();
1191
1192 if d.velocity.xy().magnitude_squared() < 0.5_f32.powi(2) {
1193 next.chest.position =
1194 Vec3::new(0.0, s_a.chest.0, s_a.chest.1 + move1 * -1.0 + move2 * 0.2);
1195 next.chest.orientation = Quaternion::rotation_x(move1 * -0.15);
1196 next.head.orientation = Quaternion::rotation_x(move1 * 0.25);
1197
1198 next.belt.position =
1199 Vec3::new(0.0, s_a.belt.0 + move1 * 0.5, s_a.belt.1 + move1 * 0.5);
1200 next.shorts.position =
1201 Vec3::new(0.0, s_a.shorts.0 + move1 * 1.3, s_a.shorts.1 + move1 * 1.0);
1202
1203 next.belt.orientation = Quaternion::rotation_x(move1 * 0.15);
1204 next.shorts.orientation = Quaternion::rotation_x(move1 * 0.25);
1205
1206 if !d.is_riding {
1207 next.foot_l.position =
1208 Vec3::new(-s_a.foot.0, s_a.foot.1 + move1 * 2.0, s_a.foot.2);
1209 next.foot_l.orientation = Quaternion::rotation_z(move1 * -0.5);
1210
1211 next.foot_r.position =
1212 Vec3::new(s_a.foot.0, s_a.foot.1 + move1 * -2.0, s_a.foot.2);
1213 next.foot_r.orientation = Quaternion::rotation_x(move1 * -0.5);
1214 }
1215 }
1216
1217 match d.hands {
1218 (Some(Hands::Two), _) => {
1219 next.hand_l.position = Vec3::new(s_a.hhl.0, s_a.hhl.1, s_a.hhl.2);
1220 next.hand_l.orientation = Quaternion::rotation_x(s_a.hhl.3)
1221 * Quaternion::rotation_y(s_a.hhl.4)
1222 * Quaternion::rotation_z(s_a.hhl.5);
1223 next.hand_r.position = Vec3::new(s_a.hhr.0, s_a.hhr.1, s_a.hhr.2);
1224 next.hand_r.orientation = Quaternion::rotation_x(s_a.hhr.3)
1225 * Quaternion::rotation_y(s_a.hhr.4)
1226 * Quaternion::rotation_z(s_a.hhr.5);
1227
1228 next.main.position = Vec3::new(0.0, 0.0, 0.0);
1229 next.main.orientation = Quaternion::rotation_x(0.0);
1230 next.control.position = Vec3::new(
1231 s_a.hc.0 + move1 * 3.0,
1232 s_a.hc.1 + move1 * 3.0,
1233 s_a.hc.2 + move1 * 10.0,
1234 );
1235 next.control.orientation = Quaternion::rotation_x(s_a.hc.3)
1236 * Quaternion::rotation_y(s_a.hc.4)
1237 * Quaternion::rotation_z(s_a.hc.5 + move1 * -1.0);
1238 },
1239 (Some(Hands::One), offhand) => {
1240 next.control_l.position =
1241 Vec3::new(-7.0, 8.0 + move1 * 3.0, 2.0 + move1 * 3.0);
1242 next.control_l.orientation =
1243 Quaternion::rotation_x(-0.3) * Quaternion::rotation_y(move1 * 1.0);
1244 next.hand_l.position = Vec3::new(0.0, -0.5, 0.0);
1245 next.hand_l.orientation = Quaternion::rotation_x(PI / 2.0);
1246
1247 next.main.position = Vec3::new(0.0, 0.0, 0.0);
1248 next.main.orientation = Quaternion::rotation_x(0.0);
1249
1250 if offhand.is_some() {
1251 next.control_r.position =
1252 Vec3::new(7.0, 8.0 + move1 * 3.0, 2.0 + move1 * 3.0);
1253 next.control_r.orientation =
1254 Quaternion::rotation_x(-0.3) * Quaternion::rotation_y(move1 * -1.0);
1255 next.hand_r.position = Vec3::new(0.0, -0.5, 0.0);
1256 next.hand_r.orientation = Quaternion::rotation_x(PI / 2.0);
1257 next.second.position = Vec3::new(0.0, 0.0, 0.0);
1258 next.second.orientation = Quaternion::rotation_x(0.0);
1259 } else {
1260 next.hand_r.position = Vec3::new(4.5, 8.0, 5.0);
1261 next.hand_r.orientation =
1262 Quaternion::rotation_x(1.9) * Quaternion::rotation_y(0.5)
1263 }
1264 },
1265 (_, _) => {},
1266 }
1267 },
1268 Some("common.abilities.hammer.solid_smash") => {
1269 hammer_start(&mut next, s_a);
1270
1271 next.control.orientation.rotate_x(move1 * 2.7);
1272 next.control.orientation.rotate_z(move1 * 1.4);
1273 next.control.position += Vec3::new(-12.0, 0.0, 0.0) * move1;
1274 next.control.orientation.rotate_x(move1 * -1.2);
1275 twist_back(&mut next, move1, 0.8, 0.3, 0.1, 0.5);
1276
1277 twist_forward(&mut next, move2, 1.4, 0.5, 0.3, 1.0);
1278 next.control.orientation.rotate_x(move2 * -1.9);
1279 next.control.orientation.rotate_z(move2 * 0.6);
1280 },
1281 Some("common.abilities.hammer.scornful_swipe") => {
1282 hammer_start(&mut next, s_a);
1283 let move1_pre = move1.min(0.5) * 2.0;
1284 let move1_shake = ((move1.max(0.3) - 0.3) * 15.0).sin();
1285 let move1_late = move1.powi(4);
1286
1287 next.control.orientation.rotate_x(move1_pre * 2.3);
1288 next.control.position += Vec3::new(0.0, 2.0, 16.0) * move1_pre;
1289 next.control.position += Vec3::new(0.0, 0.0, 4.0) * move1_shake;
1290 next.control.orientation.rotate_y(move1_late * 1.6);
1291 next.control.position += Vec3::new(-8.0, 0.0, -8.0) * move1_late;
1292 twist_back(&mut next, move1_late, 1.0, 0.4, 0.2, 0.7);
1293 next.control.orientation.rotate_z(move1_late * 1.2);
1294
1295 twist_forward(&mut next, move2, 1.9, 0.9, 0.6, 1.1);
1296 next.control.orientation.rotate_y(move2 * -1.7);
1297 next.control.orientation.rotate_z(move2 * -2.7);
1298 },
1299 Some("common.abilities.hammer.heavy_whorl") => {
1300 hammer_start(&mut next, s_a);
1301
1302 twist_back(&mut next, move1, 2.0, 0.8, 0.4, 1.4);
1303 next.control.orientation.rotate_x(move1 * 0.6);
1304
1305 next.torso.orientation.rotate_z(move2base * -2.0 * PI);
1306 twist_forward(&mut next, move2, 3.4, 1.2, 0.8, 1.8);
1307 next.control.orientation.rotate_z(move2 * -2.3);
1308 next.control.position += Vec3::new(6.0, 0.0, 6.0) * move2;
1309 },
1310 Some("common.abilities.hammer.dual_heavy_whorl") => {
1311 dual_wield_start(&mut next);
1312
1313 twist_back(&mut next, move1, 2.0, 0.8, 0.4, 1.4);
1314 next.control_l.orientation.rotate_y(move1 * -PI / 2.0);
1315 next.control_r.orientation.rotate_y(move1 * -PI / 2.0);
1316 next.control.position += Vec3::new(0.0, 0.0, 4.0) * move1;
1317
1318 next.torso.orientation.rotate_z(move2base * -2.0 * PI);
1319 twist_forward(&mut next, move2, 3.4, 1.2, 0.8, 1.8);
1320 next.control_l.orientation.rotate_z(move2 * -2.3);
1321 next.control_r.orientation.rotate_z(move2 * -2.3);
1322 },
1323 Some("common.abilities.hammer.breach") => {
1324 hammer_start(&mut next, s_a);
1325
1326 next.control.orientation.rotate_x(move1 * 2.5);
1327 next.control.orientation.rotate_z(move1 * -4.8);
1328 next.control.position += Vec3::new(-12.0, 0.0, 22.0) * move1;
1329 twist_back(&mut next, move1, 0.6, 0.2, 0.0, 0.3);
1330
1331 twist_forward(&mut next, move2, 1.6, 0.4, 0.2, 0.7);
1332 next.control.orientation.rotate_x(move2 * -4.5);
1333 next.control.position += Vec3::new(0.0, 0.0, -20.0) * move2;
1334 },
1335 Some("common.abilities.hammer.pile_driver") => {
1336 hammer_start(&mut next, s_a);
1337 let shake = (move1base * 15.0).sin();
1338 let move1 = (move1base * 2.0).min(1.0) * pullback;
1339
1340 twist_back(&mut next, move1, 0.9, 0.3, 0.1, 0.5);
1341 next.control.orientation.rotate_x(move1 * 2.4);
1342 next.control.position += Vec3::new(-14.0, 0.0, 14.0) * move1;
1343 next.control.orientation.rotate_z(move1 * 1.8);
1344
1345 next.control.orientation.rotate_x(shake * 0.15);
1346
1347 twist_forward(&mut next, move2, 1.6, 0.5, 0.2, 0.9);
1348 next.control.orientation.rotate_x(move2 * -4.0);
1349 next.control.orientation.rotate_z(move2 * 0.4);
1350 next.control.position += Vec3::new(0.0, 0.0, -12.0) * move2;
1351 },
1352 Some("common.abilities.hammer.upheaval") => {
1353 hammer_start(&mut next, s_a);
1354 let move1_twist = move1 * (move1 * PI * 1.5).sin();
1355
1356 twist_forward(&mut next, move1_twist, 0.8, 0.3, 0.0, 0.4);
1357 let angle1 = 5.0;
1358 let angle2 = 4.0;
1359 next.control
1360 .orientation
1361 .rotate_x(move1base * (2.0 - angle1) + move2base * (2.0 - angle2));
1362 next.control.orientation.rotate_y(move1 * -0.8);
1363 next.control
1364 .orientation
1365 .rotate_x(move1base * angle1 + move2base * angle2);
1366 next.control.orientation.rotate_z(move1 * 1.0);
1367 next.control.orientation.rotate_x(move2 * 6.0);
1368 next.control.orientation.rotate_z(move2 * -0.6);
1369 next.control.position += Vec3::new(-16.0, 0.0, 0.0) * move1;
1370 next.control.position += Vec3::new(12.0, 0.0, 10.0) * move2;
1371 twist_forward(&mut next, move2, 1.0, 0.9, 0.4, 1.1);
1372 },
1373 Some("common.abilities.hammer.dual_upheaval") => {
1374 dual_wield_start(&mut next);
1375 let move1_return = (3.0 * move1base).sin();
1376
1377 next.control.orientation.rotate_x(4.0 * move1base);
1378 next.control_l.orientation.rotate_z(move1 * 0.6);
1379 next.control_r.orientation.rotate_z(move1 * -0.6);
1380 next.control.position += Vec3::new(0.0, 6.0, 8.0) * move1_return;
1381 next.control.orientation.rotate_x(3.5 * move2base);
1382 next.control_l.orientation.rotate_z(move2 * -1.4);
1383 next.control_r.orientation.rotate_z(move2 * 1.4);
1384 next.control.position += Vec3::new(0.0, 12.0, 10.0) * move2;
1385 },
1386 Some("common.abilities.hammer.wide_wallop") => {
1387 hammer_start(&mut next, s_a);
1388 let move1 = chargebase.min(1.0) * pullback;
1389 let tension = (chargebase * 7.0).sin();
1390
1391 next.control.orientation.rotate_x(move1 * 1.1 + move2 * 0.6);
1392 twist_back(&mut next, move1 + tension / 25.0, 1.7, 0.7, 0.3, 1.1);
1393 next.control.orientation.rotate_y(move1 * -0.8);
1394 next.control.position += Vec3::new(0.0, 0.0, 6.0) * move1;
1395
1396 twist_forward(&mut next, move2, 4.8, 1.7, 0.7, 3.2);
1397 next.control.orientation.rotate_y(move2 * 2.0);
1398 next.control.orientation.rotate_z(move2 * -1.8);
1399 },
1400 Some("common.abilities.hammer.intercept") => {
1401 hammer_start(&mut next, s_a);
1402 twist_back(&mut next, move1, 1.6, 0.7, 0.3, 1.1);
1403 next.control.orientation.rotate_x(move1 * 1.8);
1404
1405 twist_forward(&mut next, move2, 2.4, 0.9, 0.5, 1.4);
1406 next.control.orientation.rotate_z(move2 * -2.7);
1407 next.control.orientation.rotate_x(move2 * 2.0);
1408 next.control.position += Vec3::new(5.0, 0.0, 11.0) * move2;
1409 },
1410 Some("common.abilities.hammer.dual_intercept") => {
1411 dual_wield_start(&mut next);
1412 next.control_l.orientation.rotate_x(move1 * -1.4);
1413 next.control_l.orientation.rotate_z(move1 * 0.8);
1414 next.control_r.orientation.rotate_x(move1 * -1.4);
1415 next.control_r.orientation.rotate_z(move1 * -0.8);
1416 next.control.position += Vec3::new(0.0, 0.0, -6.0) * move1;
1417
1418 next.control_l.orientation.rotate_z(move2 * -2.6);
1419 next.control_l.orientation.rotate_x(move2 * 4.0);
1420 next.control_r.orientation.rotate_z(move2 * 2.6);
1421 next.control_r.orientation.rotate_x(move2 * 4.0);
1422 next.control.position += Vec3::new(0.0, 0.0, 20.0) * move2;
1423 },
1424 Some("common.abilities.hammer.spine_cracker") => {
1425 hammer_start(&mut next, s_a);
1426
1427 twist_back(&mut next, move1, 1.9, 1.5, 0.5, 1.2);
1428 next.head.position += Vec3::new(-2.0, 2.0, 0.0) * move1;
1429 next.control.orientation.rotate_x(move1 * 1.8);
1430 next.control.position += Vec3::new(0.0, 0.0, 8.0) * move1;
1431 next.control.orientation.rotate_y(move1 * 0.4);
1432
1433 twist_forward(&mut next, move2, 2.1, 1.6, 0.4, 1.3);
1434 next.control.orientation.rotate_z(move2 * 1.6);
1435 next.control.position += Vec3::new(-16.0, 12.0, -8.0) * move2;
1436 },
1437 Some("common.abilities.hammer.lung_pummel") => {
1438 hammer_start(&mut next, s_a);
1439
1440 twist_back(&mut next, move1, 1.9, 0.7, 0.3, 1.2);
1441 next.control.orientation.rotate_x(move1 * 1.2);
1442 next.control.orientation.rotate_z(move1 * 1.0);
1443 next.control.position += Vec3::new(-12.0, 0.0, 0.0) * move1;
1444
1445 twist_forward(&mut next, move2, 3.4, 1.4, 0.9, 2.1);
1446 next.control.orientation.rotate_z(move2 * -4.0);
1447 next.control.position += Vec3::new(12.0, 0.0, 14.0) * move2;
1448 },
1449 Some("common.abilities.hammer.helm_crusher") => {
1450 hammer_start(&mut next, s_a);
1451
1452 twist_back(&mut next, move1, 0.8, 0.3, 0.1, 0.5);
1453 next.control.orientation.rotate_x(move1 * -0.8);
1454 next.control.orientation.rotate_z(move1 * -1.6);
1455 next.control.orientation.rotate_x(move1 * 2.8);
1456 next.control.position += Vec3::new(-9.0, 0.0, 8.0) * move1;
1457 next.control.orientation.rotate_z(move1 * -0.4);
1458
1459 twist_forward(&mut next, move2, 1.8, 0.7, 0.4, 1.1);
1460 next.control.orientation.rotate_x(move2 * -5.0);
1461 next.control.orientation.rotate_z(move2 * -1.0);
1462 next.control.position += Vec3::new(-12.0, 0.0, -8.0) * move2;
1463 },
1464 Some("common.abilities.hammer.thunderclap") => {
1465 hammer_start(&mut next, s_a);
1466
1467 twist_back(&mut next, move1, 1.8, 0.9, 0.5, 1.1);
1468 next.control.orientation.rotate_x(move1 * 2.4);
1469 next.control.position += Vec3::new(-16.0, -8.0, 12.0) * move1;
1470 next.control.orientation.rotate_z(move1 * PI / 2.0);
1471 next.control.orientation.rotate_x(move1 * 0.6);
1472
1473 twist_forward(&mut next, move2, 2.4, 1.1, 0.6, 1.4);
1474 next.control.orientation.rotate_x(move2 * -5.0);
1475 next.control.position += Vec3::new(4.0, 12.0, -12.0) * move2;
1476 next.control.orientation.rotate_z(move2 * 0.6);
1477 },
1478 Some("common.abilities.hammer.earthshaker") => {
1479 hammer_start(&mut next, s_a);
1480
1481 next.hand_l.orientation.rotate_y(move1 * -PI);
1482 next.hand_r.orientation.rotate_y(move1 * -PI);
1483 next.control.orientation.rotate_x(2.4 * move1);
1484 next.control.orientation.rotate_z(move1 * -PI / 2.0);
1485 next.control.orientation.rotate_x(-0.6 * move1);
1486 next.control.position += Vec3::new(-8.0, 0.0, 24.0) * move1;
1487 next.chest.orientation.rotate_x(move1 * 0.5);
1488 next.torso.position += Vec3::new(0.0, 0.0, 8.0) * move1;
1489
1490 next.torso.position += Vec3::new(0.0, 0.0, -8.0) * move2;
1491 next.control.orientation.rotate_x(move2 * -0.8);
1492 next.control.position += Vec3::new(0.0, 0.0, -10.0) * move2;
1493 next.chest.orientation.rotate_x(move2 * -0.8);
1494 },
1495 Some("common.abilities.hammer.judgement") => {
1496 hammer_start(&mut next, s_a);
1497
1498 next.control.orientation.rotate_x(2.4 * move1);
1499 next.control.orientation.rotate_z(move1 * PI / 2.0);
1500 next.control.orientation.rotate_x(-0.6 * move1);
1501 next.control.position += Vec3::new(-8.0, 6.0, 24.0) * move1;
1502 next.chest.orientation.rotate_x(move1 * 0.5);
1503 next.torso.position += Vec3::new(0.0, 0.0, 8.0) * move1;
1504
1505 next.torso.position += Vec3::new(0.0, 0.0, -8.0) * move2;
1506 next.chest.orientation.rotate_x(-1.5 * move2);
1507 next.belt.orientation.rotate_x(0.3 * move2);
1508 next.shorts.orientation.rotate_x(0.6 * move2);
1509 next.control.orientation.rotate_x(-3.0 * move2);
1510 next.control.position += Vec3::new(0.0, 0.0, -16.0) * move2;
1511 },
1512 Some("common.abilities.hammer.retaliate") => {
1513 hammer_start(&mut next, s_a);
1514
1515 twist_back(&mut next, move1, 0.6, 0.2, 0.0, 0.3);
1516 next.control.orientation.rotate_x(move1 * 1.5);
1517 next.control.orientation.rotate_y(move1 * 0.4);
1518 next.control.position += Vec3::new(0.0, 0.0, 16.0) * move1;
1519
1520 twist_forward(&mut next, move2, 2.1, 0.6, 0.4, 0.9);
1521 next.control.orientation.rotate_y(move2 * 2.0);
1522 next.control.orientation.rotate_x(move2 * -2.5);
1523 next.control.orientation.rotate_z(move2 * -0.6);
1524 next.control.position += Vec3::new(6.0, -10.0, -14.0) * move2;
1525 },
1526 Some("common.abilities.hammer.tenacity") => {
1527 hammer_start(&mut next, s_a);
1528
1529 next.control.orientation.rotate_x(move1 * 0.6);
1530 next.control.orientation.rotate_y(move1 * 0.9);
1531 next.control.orientation.rotate_x(move1 * -0.6);
1532 next.chest.orientation.rotate_x(move1 * 0.4);
1533 next.control.position += Vec3::new(0.0, 4.0, 3.0) * move1;
1534
1535 next.control.position += Vec3::new(
1536 (move2 * 50.0).sin(),
1537 (move2 * 67.0).sin(),
1538 (move2 * 83.0).sin(),
1539 );
1540 },
1541 Some("common.abilities.hammer.tremor") => {
1542 hammer_start(&mut next, s_a);
1543
1544 twist_back(&mut next, move1, 1.4, 0.7, 0.5, 0.9);
1545 next.foot_l.orientation.rotate_z(move1 * 1.4);
1546 next.foot_l.position += Vec3::new(-1.0, -3.0, 0.0) * move1;
1547 next.control.orientation.rotate_x(move1 * 2.6);
1548 next.control.orientation.rotate_y(move1 * 0.8);
1549
1550 twist_forward(&mut next, move2, 2.1, 1.2, 0.9, 1.6);
1551 next.foot_l.orientation.rotate_z(move2 * -1.4);
1552 next.foot_l.position += Vec3::new(2.0, 7.0, 0.0) * move2;
1553 next.control.orientation.rotate_z(move2 * 2.1);
1554 next.control.orientation.rotate_x(move2 * -2.0);
1555 next.control.orientation.rotate_z(move2 * 1.2);
1556 next.control.position += Vec3::new(-16.0, 0.0, 0.0) * move2;
1557 next.chest.orientation.rotate_x(-0.8 * move2);
1558 },
1559 Some("common.abilities.hammer.rampart") => {
1560 hammer_start(&mut next, s_a);
1561
1562 next.control.orientation.rotate_x(move1 * 0.6);
1563 next.control.orientation.rotate_y(move1 * -PI / 2.0);
1564 next.hand_l.orientation.rotate_y(move1 * -PI);
1565 next.hand_r.orientation.rotate_y(move1 * -PI);
1566 next.control.position += Vec3::new(-5.0, 0.0, 30.0) * move1;
1567
1568 next.control.position += Vec3::new(0.0, 0.0, -10.0) * move2;
1569 next.torso.orientation.rotate_x(move2 * -0.6);
1570 next.control.orientation.rotate_x(move2 * 0.6);
1571 },
1572 Some("common.abilities.hammer.seismic_shock") => {
1573 hammer_start(&mut next, s_a);
1574
1575 next.control.orientation.rotate_x(move1 * 2.5);
1576 next.control.position += Vec3::new(0.0, 0.0, 28.0) * move1;
1577 next.head.orientation.rotate_x(move1 * 0.3);
1578 next.chest.orientation.rotate_x(move1 * 0.3);
1579 next.belt.orientation.rotate_x(move1 * -0.2);
1580 next.shorts.orientation.rotate_x(move1 * -0.3);
1581
1582 next.control.orientation.rotate_z(move2 * 2.0);
1583 next.control.orientation.rotate_x(move2 * -4.0);
1584 next.control.position += Vec3::new(-6.0, 0.0, -30.0) * move2;
1585 next.head.orientation.rotate_x(move2 * -0.9);
1586 next.chest.orientation.rotate_x(move2 * -0.5);
1587 next.belt.orientation.rotate_x(move2 * 0.2);
1588 next.shorts.orientation.rotate_x(move2 * 0.4);
1589 },
1590 Some("common.abilities.bow.charged" | "common.abilities.bow.shotgun") => {
1594 let move2 = move2base;
1595
1596 let ori: Vec2<f32> = Vec2::from(d.orientation);
1597 let last_ori = Vec2::from(d.last_ori);
1598 let tilt = if vek::Vec2::new(ori, last_ori)
1599 .map(|o| o.magnitude_squared())
1600 .map(|m| m > 0.001 && m.is_finite())
1601 .reduce_and()
1602 && ori.angle_between(last_ori).is_finite()
1603 {
1604 ori.angle_between(last_ori).min(0.2)
1605 * last_ori.determine_side(Vec2::zero(), ori).signum()
1606 } else {
1607 0.0
1608 } * 1.3;
1609 let ori_angle = d.orientation.y.atan2(d.orientation.x);
1610 let lookdir_angle = d.look_dir.y.atan2(d.look_dir.x);
1611 let swivel = lookdir_angle - ori_angle;
1612
1613 next.main.position = Vec3::new(0.0, 0.0, 0.0);
1614 next.main.orientation = Quaternion::rotation_x(0.0);
1615 next.hand_l.position = Vec3::new(
1616 s_a.bhl.0 + move2 * -8.0,
1617 s_a.bhl.1 + move2 * -10.0,
1618 s_a.bhl.2,
1619 );
1620 next.hand_l.orientation =
1621 Quaternion::rotation_x(s_a.bhl.3) * Quaternion::rotation_y(move2 * 0.7);
1622 next.hand_r.position = Vec3::new(s_a.bhr.0, s_a.bhr.1, s_a.bhr.2);
1623 next.hand_r.orientation = Quaternion::rotation_x(s_a.bhr.3);
1624
1625 next.hold.position = Vec3::new(0.0, -1.0 + move2 * 2.0, -5.2 + move2 * 7.0);
1626 next.hold.orientation = Quaternion::rotation_x(-PI / 2.0);
1627 next.hold.scale = Vec3::one() * 1.0 * (1.0 - move2);
1628
1629 next.control.position = Vec3::new(
1630 s_a.bc.0 + 11.0 + move2 * 2.0,
1631 s_a.bc.1 + 2.0 + (d.look_dir.z * -5.0).min(-2.0) + move2 * -1.0,
1632 s_a.bc.2 + 8.0 + (d.look_dir.z * 15.0).max(-8.0),
1633 );
1634 next.control.orientation = Quaternion::rotation_x(d.look_dir.z)
1635 * Quaternion::rotation_y(-d.look_dir.z + s_a.bc.4 - 1.25)
1636 * Quaternion::rotation_z(s_a.bc.5 - 0.2 + move2 * -0.1);
1637
1638 next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1);
1639
1640 next.head.orientation = Quaternion::rotation_x(d.look_dir.z * 0.7)
1641 * Quaternion::rotation_z(tilt * -0.0);
1642 next.chest.orientation = Quaternion::rotation_z(swivel * 0.8 + 0.8 + move2 * 0.5);
1643 next.torso.orientation = Quaternion::rotation_z(swivel * 0.2);
1644
1645 next.shoulder_l.orientation = Quaternion::rotation_x(move2 * 0.5);
1646 },
1647 Some("common.abilities.staff.flamethrower") => {
1651 let move1 = move1base;
1652 let move2 = move2base;
1653 let move3 = move3base;
1654
1655 next.hand_l.position = Vec3::new(s_a.sthl.0, s_a.sthl.1, s_a.sthl.2);
1656 next.hand_l.orientation =
1657 Quaternion::rotation_x(s_a.sthl.3) * Quaternion::rotation_y(s_a.sthl.4);
1658 next.hand_r.position = Vec3::new(s_a.sthr.0, s_a.sthr.1, s_a.sthl.2);
1659 next.hand_r.orientation =
1660 Quaternion::rotation_x(s_a.sthr.3) * Quaternion::rotation_y(s_a.sthr.4);
1661 next.main.position = Vec3::new(0.0, 0.0, 0.0);
1662 next.main.orientation = Quaternion::rotation_x(0.0);
1663
1664 next.control.position = Vec3::new(-4.0, 7.0, 4.0);
1665 next.control.orientation = Quaternion::rotation_x(-0.3)
1666 * Quaternion::rotation_y(0.15)
1667 * Quaternion::rotation_z(0.0);
1668
1669 next.control.position = Vec3::new(
1670 s_a.stc.0 + (move1 * 16.0) * (1.0 - move3),
1671 s_a.stc.1 + (move1 + (move2 * 8.0).sin() * 2.0) * (1.0 - move3),
1672 s_a.stc.2 + (move1 * 10.0) * (1.0 - move3),
1673 );
1674 next.control.orientation =
1675 Quaternion::rotation_x(s_a.stc.3 + (move1 * -1.2) * (1.0 - move3))
1676 * Quaternion::rotation_y(
1677 s_a.stc.4
1678 + (move1 * -1.4 + (move2 * 16.0).sin() * 0.07) * (1.0 - move3),
1679 )
1680 * Quaternion::rotation_z(
1681 (move1 * -1.7 + (move2 * 8.0 + PI / 4.0).sin() * 0.3) * (1.0 - move3),
1682 );
1683 next.head.orientation = Quaternion::rotation_x(0.0);
1684
1685 next.hand_l.position = Vec3::new(
1686 0.0 + (move1 * -1.0 + (move2 * 8.0).sin() * 3.5) * (1.0 - move3),
1687 0.0 + (move1 * -5.0 + (move2 * 8.0).sin() * -2.0 + (move2 * 16.0).sin() * -1.5)
1688 * (1.0 - move3),
1689 -4.0 + (move1 * 19.0 + (move2 * 8.0 + PI / 2.0).sin() * 3.5) * (1.0 - move3),
1690 );
1691 next.hand_l.orientation =
1692 Quaternion::rotation_x(s_a.sthr.3 + (move1 * -0.3) * (1.0 - move3))
1693 * Quaternion::rotation_y(
1694 (move1 * -1.1 + (move2 * 8.0 + PI / 2.0).sin() * -0.3) * (1.0 - move3),
1695 )
1696 * Quaternion::rotation_z((move1 * -2.8) * (1.0 - move3));
1697
1698 if d.velocity.magnitude_squared() < 0.5_f32.powi(2) {
1699 next.head.orientation =
1700 Quaternion::rotation_z(move1 * -0.5 + (move2 * 16.0).sin() * 0.05);
1701
1702 if !d.is_riding {
1703 next.foot_l.position =
1704 Vec3::new(-s_a.foot.0, s_a.foot.1 + move1 * -3.0, s_a.foot.2);
1705 next.foot_l.orientation = Quaternion::rotation_x(move1 * -0.5)
1706 * Quaternion::rotation_z(move1 * 0.5);
1707
1708 next.foot_r.position =
1709 Vec3::new(s_a.foot.0, s_a.foot.1 + move1 * 4.0, s_a.foot.2);
1710 next.foot_r.orientation = Quaternion::rotation_z(move1 * 0.5);
1711 }
1712
1713 next.chest.orientation =
1714 Quaternion::rotation_x(move1 * -0.2 + (move2 * 8.0).sin() * 0.05)
1715 * Quaternion::rotation_z(move1 * 0.5);
1716 next.belt.orientation =
1717 Quaternion::rotation_x(move1 * 0.1) * Quaternion::rotation_z(move1 * -0.1);
1718 next.shorts.orientation =
1719 Quaternion::rotation_x(move1 * 0.2) * Quaternion::rotation_z(move1 * -0.2);
1720 };
1721 },
1722 Some("common.abilities.staff.fireshockwave") => {
1723 let move1 = move1base;
1724 let move2 = move2base;
1725 let move3 = move3base;
1726
1727 next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1);
1728
1729 next.hand_l.position = Vec3::new(s_a.sthl.0, s_a.sthl.1, s_a.sthl.2);
1730 next.hand_l.orientation =
1731 Quaternion::rotation_x(s_a.sthl.3) * Quaternion::rotation_y(s_a.sthl.4);
1732 next.hand_r.position = Vec3::new(s_a.sthr.0, s_a.sthr.1, s_a.sthr.2);
1733 next.hand_r.orientation =
1734 Quaternion::rotation_x(s_a.sthr.3) * Quaternion::rotation_y(s_a.sthr.4);
1735 next.main.position = Vec3::new(0.0, 0.0, 0.0);
1736 next.main.orientation = Quaternion::rotation_x(0.0);
1737
1738 next.control.position = Vec3::new(s_a.stc.0, s_a.stc.1, s_a.stc.2);
1739 next.control.orientation =
1740 Quaternion::rotation_x(s_a.stc.3) * Quaternion::rotation_y(s_a.stc.4);
1741
1742 let twist = move1 * 0.8;
1743
1744 next.control.position = Vec3::new(
1745 s_a.stc.0 + (move1 * 5.0) * (1.0 - move3),
1746 s_a.stc.1 + (move1 * 5.0) * (1.0 - move3),
1747 s_a.stc.2 + (move1 * 10.0 + move2 * -10.0) * (1.0 - move3),
1748 );
1749 next.control.orientation =
1750 Quaternion::rotation_x(s_a.stc.3 + (move1 * 0.8) * (1.0 - move3))
1751 * Quaternion::rotation_y(
1752 s_a.stc.4 + (move1 * -0.15 + move2 * -0.15) * (1.0 - move3),
1753 )
1754 * Quaternion::rotation_z((move1 * 0.8 + move2 * -0.8) * (1.0 - move3));
1755
1756 next.head.orientation = Quaternion::rotation_x((move1 * 0.4) * (1.0 - move3))
1757 * Quaternion::rotation_z((twist * 0.2 + move2 * -0.8) * (1.0 - move3));
1758
1759 next.chest.position = Vec3::new(
1760 0.0,
1761 s_a.chest.0,
1762 s_a.chest.1 + (move1 * 2.0 + move2 * -4.0) * (1.0 - move3),
1763 );
1764 next.chest.orientation = Quaternion::rotation_x((move2 * -0.8) * (1.0 - move3))
1765 * Quaternion::rotation_z(twist * -0.2 + move2 * -0.1 + (1.0 - move3));
1766
1767 next.belt.orientation = Quaternion::rotation_x((move2 * 0.2) * (1.0 - move3))
1768 * Quaternion::rotation_z((twist * 0.6 + move2 * -0.48) * (1.0 - move3));
1769
1770 next.shorts.orientation = Quaternion::rotation_x((move2 * 0.3) * (1.0 - move3))
1771 * Quaternion::rotation_z((twist + move2 * -0.8) * (1.0 - move3));
1772
1773 if d.velocity.magnitude() < 0.5 && !d.is_riding {
1774 next.foot_l.position = Vec3::new(
1775 -s_a.foot.0,
1776 s_a.foot.1 + move1 * -7.0 + move2 * 7.0,
1777 s_a.foot.2,
1778 );
1779 next.foot_l.orientation = Quaternion::rotation_x(move1 * -0.8 + move2 * 0.8)
1780 * Quaternion::rotation_z(move1 * 0.3 + move2 * -0.3);
1781
1782 next.foot_r.position = Vec3::new(
1783 s_a.foot.0,
1784 s_a.foot.1 + move1 * 5.0 + move2 * -5.0,
1785 s_a.foot.2,
1786 );
1787 next.foot_r.orientation = Quaternion::rotation_y(move1 * -0.3 + move2 * 0.3)
1788 * Quaternion::rotation_z(move1 * 0.4 + move2 * -0.4);
1789 }
1790 },
1791 Some("common.abilities.staff.firebomb") => {
1792 let move1 = move1base;
1793 let move2 = move2base.powf(0.25);
1794 let move3 = move3base;
1795
1796 let ori: Vec2<f32> = Vec2::from(d.orientation);
1797 let last_ori = Vec2::from(d.last_ori);
1798 let tilt = if vek::Vec2::new(ori, last_ori)
1799 .map(|o| o.magnitude_squared())
1800 .map(|m| m > 0.001 && m.is_finite())
1801 .reduce_and()
1802 && ori.angle_between(last_ori).is_finite()
1803 {
1804 ori.angle_between(last_ori).min(0.2)
1805 * last_ori.determine_side(Vec2::zero(), ori).signum()
1806 } else {
1807 0.0
1808 } * 1.3;
1809 let ori_angle = d.orientation.y.atan2(d.orientation.x);
1810 let lookdir_angle = d.look_dir.y.atan2(d.look_dir.x);
1811 let swivel = lookdir_angle - ori_angle;
1812 let xmove = (move1 * 6.0 + PI).sin();
1813 let ymove = (move1 * 6.0 + PI * (0.5)).sin();
1814
1815 next.hand_l.position = Vec3::new(s_a.sthl.0, s_a.sthl.1, s_a.sthl.2);
1816 next.hand_l.orientation = Quaternion::rotation_x(s_a.sthl.3);
1817
1818 next.hand_r.position = Vec3::new(s_a.sthr.0, s_a.sthr.1, s_a.sthr.2);
1819 next.hand_r.orientation =
1820 Quaternion::rotation_x(s_a.sthr.3) * Quaternion::rotation_y(s_a.sthr.4);
1821
1822 next.main.position = Vec3::new(0.0, 0.0, 0.0);
1823 next.main.orientation = Quaternion::rotation_y(0.0);
1824
1825 next.control.position = Vec3::new(
1826 s_a.stc.0 + (xmove * 3.0 + move1 * -4.0) * (1.0 - move3),
1827 s_a.stc.1 + (2.0 + ymove * 3.0 + move2 * 3.0) * (1.0 - move3),
1828 s_a.stc.2 + d.look_dir.z * 4.0,
1829 );
1830 next.control.orientation = Quaternion::rotation_x(
1831 d.look_dir.z + s_a.stc.3 + (move2 * 0.6) * (1.0 - move3),
1832 ) * Quaternion::rotation_y(
1833 s_a.stc.4 + (move1 * 0.5 + move2 * -0.5),
1834 ) * Quaternion::rotation_z(
1835 s_a.stc.5 - (0.2 + move1 * -0.5 + move2 * 0.8) * (1.0 - move3),
1836 );
1837
1838 next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1);
1839 next.head.orientation = Quaternion::rotation_x(d.look_dir.z * 0.7)
1840 * Quaternion::rotation_z(
1841 tilt * -2.5 + (move1 * -0.2 + move2 * -0.4) * (1.0 - move3),
1842 );
1843 next.chest.orientation = Quaternion::rotation_z(swivel * 0.8);
1844 next.torso.orientation = Quaternion::rotation_z(swivel * 0.2);
1845 },
1846 Some(
1850 "common.abilities.sceptre.lifestealbeam"
1851 | "common.abilities.custom.cardinal.steambeam",
1852 ) => {
1853 let move1 = move1base;
1854 let move2 = move2base;
1855 let move3 = move3base;
1856
1857 next.hand_l.position = Vec3::new(s_a.sthl.0, s_a.sthl.1, s_a.sthl.2);
1858 next.hand_l.orientation =
1859 Quaternion::rotation_x(s_a.sthl.3) * Quaternion::rotation_y(s_a.sthl.4);
1860 next.hand_r.position = Vec3::new(s_a.sthr.0, s_a.sthr.1, s_a.sthl.2);
1861 next.hand_r.orientation =
1862 Quaternion::rotation_x(s_a.sthr.3) * Quaternion::rotation_y(s_a.sthr.4);
1863 next.main.position = Vec3::new(0.0, 0.0, 0.0);
1864 next.main.orientation = Quaternion::rotation_x(0.0);
1865
1866 next.control.position = Vec3::new(-4.0, 7.0, 4.0);
1867 next.control.orientation = Quaternion::rotation_x(-0.3)
1868 * Quaternion::rotation_y(0.15)
1869 * Quaternion::rotation_z(0.0);
1870
1871 next.control.position = Vec3::new(
1872 s_a.stc.0 + (move1 * 16.0) * (1.0 - move3),
1873 s_a.stc.1 + (move1 + (move2 * 8.0).sin() * 2.0) * (1.0 - move3),
1874 s_a.stc.2 + (move1 * 10.0) * (1.0 - move3),
1875 );
1876 next.control.orientation =
1877 Quaternion::rotation_x(s_a.stc.3 + (move1 * -1.2) * (1.0 - move3))
1878 * Quaternion::rotation_y(
1879 s_a.stc.4
1880 + (move1 * -1.4 + (move2 * 16.0).sin() * 0.07) * (1.0 - move3),
1881 )
1882 * Quaternion::rotation_z(
1883 (move1 * -1.7 + (move2 * 8.0 + PI / 4.0).sin() * 0.3) * (1.0 - move3),
1884 );
1885 next.head.orientation = Quaternion::rotation_x(0.0);
1886
1887 next.hand_l.position = Vec3::new(
1888 0.0 + (move1 * -1.0 + (move2 * 8.0).sin() * 3.5) * (1.0 - move3),
1889 0.0 + (move1 * -5.0 + (move2 * 8.0).sin() * -2.0 + (move2 * 16.0).sin() * -1.5)
1890 * (1.0 - move3),
1891 -4.0 + (move1 * 19.0 + (move2 * 8.0 + PI / 2.0).sin() * 3.5) * (1.0 - move3),
1892 );
1893 next.hand_l.orientation =
1894 Quaternion::rotation_x(s_a.sthr.3 + (move1 * -0.3) * (1.0 - move3))
1895 * Quaternion::rotation_y(
1896 (move1 * -1.1 + (move2 * 8.0 + PI / 2.0).sin() * -0.3) * (1.0 - move3),
1897 )
1898 * Quaternion::rotation_z((move1 * -2.8) * (1.0 - move3));
1899
1900 if d.velocity.magnitude_squared() < 0.5_f32.powi(2) {
1901 next.head.orientation =
1902 Quaternion::rotation_z(move1 * -0.5 + (move2 * 16.0).sin() * 0.05);
1903
1904 if !d.is_riding {
1905 next.foot_l.position =
1906 Vec3::new(-s_a.foot.0, s_a.foot.1 + move1 * -3.0, s_a.foot.2);
1907 next.foot_l.orientation = Quaternion::rotation_x(move1 * -0.5)
1908 * Quaternion::rotation_z(move1 * 0.5);
1909
1910 next.foot_r.position =
1911 Vec3::new(s_a.foot.0, s_a.foot.1 + move1 * 4.0, s_a.foot.2);
1912 next.foot_r.orientation = Quaternion::rotation_z(move1 * 0.5);
1913 }
1914
1915 next.chest.orientation =
1916 Quaternion::rotation_x(move1 * -0.2 + (move2 * 8.0).sin() * 0.05)
1917 * Quaternion::rotation_z(move1 * 0.5);
1918 next.belt.orientation =
1919 Quaternion::rotation_x(move1 * 0.1) * Quaternion::rotation_z(move1 * -0.1);
1920 next.shorts.orientation =
1921 Quaternion::rotation_x(move1 * 0.2) * Quaternion::rotation_z(move1 * -0.2);
1922 };
1923 },
1924 Some(
1925 "common.abilities.sceptre.healingaura" | "common.abilities.sceptre.wardingaura",
1926 ) => {
1927 let move1 = move1base;
1928 let move2 = move2base;
1929 let move3 = move3base;
1930
1931 next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1);
1932
1933 next.hand_l.position = Vec3::new(s_a.sthl.0, s_a.sthl.1, s_a.sthl.2);
1934 next.hand_l.orientation =
1935 Quaternion::rotation_x(s_a.sthl.3) * Quaternion::rotation_y(s_a.sthl.4);
1936 next.hand_r.position = Vec3::new(s_a.sthr.0, s_a.sthr.1, s_a.sthr.2);
1937 next.hand_r.orientation =
1938 Quaternion::rotation_x(s_a.sthr.3) * Quaternion::rotation_y(s_a.sthr.4);
1939 next.main.position = Vec3::new(0.0, 0.0, 0.0);
1940 next.main.orientation = Quaternion::rotation_x(0.0);
1941
1942 next.control.position = Vec3::new(s_a.stc.0, s_a.stc.1, s_a.stc.2);
1943 next.control.orientation =
1944 Quaternion::rotation_x(s_a.stc.3) * Quaternion::rotation_y(s_a.stc.4);
1945
1946 let twist = move1 * 0.8;
1947
1948 next.control.position = Vec3::new(
1949 s_a.stc.0 + (move1 * 5.0) * (1.0 - move3),
1950 s_a.stc.1 + (move1 * 5.0) * (1.0 - move3),
1951 s_a.stc.2 + (move1 * 10.0 + move2 * -10.0) * (1.0 - move3),
1952 );
1953 next.control.orientation =
1954 Quaternion::rotation_x(s_a.stc.3 + (move1 * 0.8) * (1.0 - move3))
1955 * Quaternion::rotation_y(
1956 s_a.stc.4 + (move1 * -0.15 + move2 * -0.15) * (1.0 - move3),
1957 )
1958 * Quaternion::rotation_z((move1 * 0.8 + move2 * -0.8) * (1.0 - move3));
1959
1960 next.head.orientation = Quaternion::rotation_x((move1 * 0.4) * (1.0 - move3))
1961 * Quaternion::rotation_z((twist * 0.2 + move2 * -0.8) * (1.0 - move3));
1962
1963 next.chest.position = Vec3::new(
1964 0.0,
1965 s_a.chest.0,
1966 s_a.chest.1 + (move1 * 2.0 + move2 * -4.0) * (1.0 - move3),
1967 );
1968 next.chest.orientation = Quaternion::rotation_x((move2 * -0.8) * (1.0 - move3))
1969 * Quaternion::rotation_z(twist * -0.2 + move2 * -0.1 + (1.0 - move3));
1970
1971 next.belt.orientation = Quaternion::rotation_x((move2 * 0.2) * (1.0 - move3))
1972 * Quaternion::rotation_z((twist * 0.6 + move2 * -0.48) * (1.0 - move3));
1973
1974 next.shorts.orientation = Quaternion::rotation_x((move2 * 0.3) * (1.0 - move3))
1975 * Quaternion::rotation_z((twist + move2 * -0.8) * (1.0 - move3));
1976
1977 if d.velocity.magnitude() < 0.5 && !d.is_riding {
1978 next.foot_l.position = Vec3::new(
1979 -s_a.foot.0,
1980 s_a.foot.1 + move1 * -7.0 + move2 * 7.0,
1981 s_a.foot.2,
1982 );
1983 next.foot_l.orientation = Quaternion::rotation_x(move1 * -0.8 + move2 * 0.8)
1984 * Quaternion::rotation_z(move1 * 0.3 + move2 * -0.3);
1985
1986 next.foot_r.position = Vec3::new(
1987 s_a.foot.0,
1988 s_a.foot.1 + move1 * 5.0 + move2 * -5.0,
1989 s_a.foot.2,
1990 );
1991 next.foot_r.orientation = Quaternion::rotation_y(move1 * -0.3 + move2 * 0.3)
1992 * Quaternion::rotation_z(move1 * 0.4 + move2 * -0.4);
1993 }
1994 },
1995 Some("common.abilities.shield.basic_guard" | "common.abilities.shield.power_guard") => {
1999 legacy_initialize();
2000 let pullback = 1.0 - move3base.powi(4);
2001 let move1 = move1base.powf(0.25) * pullback;
2002 let move2 = (move2base * 10.0).sin();
2003
2004 if d.velocity.xy().magnitude_squared() < 0.5_f32.powi(2) {
2005 next.chest.position =
2006 Vec3::new(0.0, s_a.chest.0, s_a.chest.1 + move1 * -1.0 + move2 * 0.2);
2007 next.chest.orientation = Quaternion::rotation_x(move1 * -0.15);
2008 next.head.orientation = Quaternion::rotation_x(move1 * 0.25);
2009
2010 next.belt.position =
2011 Vec3::new(0.0, s_a.belt.0 + move1 * 0.5, s_a.belt.1 + move1 * 0.5);
2012 next.shorts.position =
2013 Vec3::new(0.0, s_a.shorts.0 + move1 * 1.3, s_a.shorts.1 + move1 * 1.0);
2014
2015 next.belt.orientation = Quaternion::rotation_x(move1 * 0.15);
2016 next.shorts.orientation = Quaternion::rotation_x(move1 * 0.25);
2017
2018 if !d.is_riding {
2019 next.foot_l.position =
2020 Vec3::new(-s_a.foot.0, s_a.foot.1 + move1 * 2.0, s_a.foot.2);
2021 next.foot_l.orientation = Quaternion::rotation_z(move1 * -0.5);
2022
2023 next.foot_r.position =
2024 Vec3::new(s_a.foot.0, s_a.foot.1 + move1 * -2.0, s_a.foot.2);
2025 next.foot_r.orientation = Quaternion::rotation_x(move1 * -0.5);
2026 }
2027 }
2028
2029 if let Some(info) = d.ability_info {
2030 match info.hand {
2031 Some(HandInfo::MainHand) => {
2032 next.control_l.position = Vec3::new(1.5, 8.0, 4.0 + move1 * 3.0);
2033 next.control_l.orientation = Quaternion::rotation_x(0.25)
2034 * Quaternion::rotation_y(0.0)
2035 * Quaternion::rotation_z(-1.5);
2036 next.hand_l.position = Vec3::new(0.0, -2.0, 0.0);
2037 next.hand_l.orientation = Quaternion::rotation_x(PI / 2.0);
2038
2039 next.control_r.position = Vec3::new(9.0, -5.0, 0.0);
2040 next.control_r.orientation =
2041 Quaternion::rotation_x(-1.75) * Quaternion::rotation_y(0.3);
2042 next.hand_r.position = Vec3::new(0.0, -0.5, 0.0);
2043 next.hand_r.orientation = Quaternion::rotation_x(PI / 2.0);
2044 },
2045 Some(HandInfo::OffHand) => {
2046 next.control_r.position = Vec3::new(-1.5, 8.0, 4.0 + move1 * 3.0);
2047 next.control_r.orientation = Quaternion::rotation_x(0.25)
2048 * Quaternion::rotation_y(0.0)
2049 * Quaternion::rotation_z(1.5);
2050 next.hand_r.position = Vec3::new(0.0, -2.0, 0.0);
2051 next.hand_r.orientation = Quaternion::rotation_x(PI / 2.0);
2052
2053 next.control_l.position = Vec3::new(-9.0, -5.0, 0.0);
2054 next.control_l.orientation =
2055 Quaternion::rotation_x(-1.75) * Quaternion::rotation_y(-0.3);
2056 next.hand_l.position = Vec3::new(0.0, -0.5, 0.0);
2057 next.hand_l.orientation = Quaternion::rotation_x(PI / 2.0);
2058 },
2059 Some(HandInfo::TwoHanded) | None => {},
2060 }
2061 }
2062 },
2063 Some("common.abilities.pick.swing") => {
2067 next.main.position = Vec3::new(0.0, 0.0, 0.0);
2068 next.main.orientation = Quaternion::rotation_x(0.0);
2069 next.second.position = Vec3::new(0.0, 0.0, 0.0);
2070 next.second.orientation = Quaternion::rotation_z(0.0);
2071 next.torso.position = Vec3::new(0.0, 0.0, 1.1);
2072 next.torso.orientation = Quaternion::rotation_z(0.0);
2073
2074 let move1 = move1base.powf(0.25);
2075 let move3 = move3base.powi(4);
2076 let pullback = 1.0 - move3;
2077 let moveret1 = move1base * pullback;
2078 let moveret2 = move2base * pullback;
2079
2080 next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1);
2081 next.head.orientation = Quaternion::rotation_x(moveret1 * 0.1 + moveret2 * 0.3)
2082 * Quaternion::rotation_z(move1 * -0.2 + moveret2 * 0.2);
2083 next.chest.position = Vec3::new(0.0, s_a.chest.0, s_a.chest.1 + moveret2 * -2.0);
2084 next.chest.orientation = Quaternion::rotation_x(moveret1 * 0.4 + moveret2 * -0.7)
2085 * Quaternion::rotation_y(moveret1 * 0.3 + moveret2 * -0.4)
2086 * Quaternion::rotation_z(moveret1 * 0.5 + moveret2 * -0.5);
2087
2088 next.hand_l.position = Vec3::new(s_a.hhl.0, s_a.hhl.1, s_a.hhl.2 + moveret2 * -7.0);
2089 next.hand_l.orientation = Quaternion::rotation_x(s_a.hhl.3)
2090 * Quaternion::rotation_y(s_a.hhl.4)
2091 * Quaternion::rotation_z(s_a.hhl.5);
2092 next.hand_r.position = Vec3::new(s_a.hhr.0, s_a.hhr.1, s_a.hhr.2);
2093 next.hand_r.orientation = Quaternion::rotation_x(s_a.hhr.3)
2094 * Quaternion::rotation_y(s_a.hhr.4)
2095 * Quaternion::rotation_z(s_a.hhr.5);
2096
2097 next.control.position = Vec3::new(
2098 s_a.hc.0 + moveret1 * -13.0 + moveret2 * 3.0,
2099 s_a.hc.1 + (moveret2 * 5.0),
2100 s_a.hc.2 + moveret1 * 8.0 + moveret2 * -6.0,
2101 );
2102 next.control.orientation =
2103 Quaternion::rotation_x(s_a.hc.3 + (moveret1 * 1.5 + moveret2 * -2.55))
2104 * Quaternion::rotation_y(s_a.hc.4 + moveret1 * PI / 2.0 + moveret2 * 0.5)
2105 * Quaternion::rotation_z(s_a.hc.5 + (moveret2 * -0.5));
2106
2107 if skeleton.holding_lantern {
2108 next.hand_r.position =
2109 Vec3::new(s_a.hand.0, s_a.hand.1 + 5.0, s_a.hand.2 + 12.0);
2110 next.hand_r.orientation =
2111 Quaternion::rotation_x(2.25) * Quaternion::rotation_z(0.9);
2112
2113 next.lantern.position = Vec3::new(-0.5, -0.5, -1.5);
2114 next.lantern.orientation = next.hand_r.orientation.inverse();
2115 }
2116 },
2117 Some("common.abilities.shovel.dig") => {
2118 next.main.position = Vec3::new(0.0, 0.0, 0.0);
2119 next.main.orientation = Quaternion::rotation_x(0.0);
2120 next.second.position = Vec3::new(0.0, 0.0, 0.0);
2121 next.second.orientation = Quaternion::rotation_z(0.0);
2122 next.torso.position = Vec3::new(0.0, 0.0, 1.1);
2123 next.torso.orientation = Quaternion::rotation_z(0.0);
2124
2125 let move1 = move1base.powf(0.25);
2126 let move3 = move3base.powi(4);
2127 let pullback = 1.0 - move3;
2128 let moveret1 = move1base * pullback;
2129 let moveret2 = move2base * pullback;
2130
2131 next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1);
2132 next.head.orientation = Quaternion::rotation_x(moveret1 * 0.1 + moveret2 * 0.3)
2133 * Quaternion::rotation_z(move1 * -0.2 + moveret2 * 0.2);
2134 next.chest.position = Vec3::new(0.0, s_a.chest.0, s_a.chest.1 + moveret2 * -2.0);
2135 next.chest.orientation = Quaternion::rotation_x(moveret1 * 0.4 + moveret2 * -0.7)
2136 * Quaternion::rotation_y(moveret1 * 0.3 + moveret2 * -0.4)
2137 * Quaternion::rotation_z(moveret1 * 0.5 + moveret2 * -0.5);
2138
2139 next.hand_l.position = Vec3::new(8.0, 6.0, 3.0);
2140 next.hand_l.orientation = Quaternion::rotation_x(PI / 2.0);
2141 next.hand_r.position = Vec3::new(8.0, 6.0, 15.0);
2142 next.hand_r.orientation = Quaternion::rotation_x(PI / 2.0);
2143 next.main.position = Vec3::new(7.5, 7.5, 13.2);
2144 next.main.orientation = Quaternion::rotation_y(PI);
2145
2146 next.control.position = Vec3::new(-11.0 + moveret1 * 8.0, 1.8, 4.0);
2147 next.control.orientation = Quaternion::rotation_x(moveret1 * 0.3 + moveret2 * 0.2)
2148 * Quaternion::rotation_y(0.8 - moveret1 * 0.7 + moveret2 * 0.7)
2149 * Quaternion::rotation_z(moveret2 * 0.1 - moveret1 * 0.4);
2150
2151 if skeleton.holding_lantern {
2152 next.hand_r.position =
2153 Vec3::new(s_a.hand.0, s_a.hand.1 + 5.0, s_a.hand.2 + 12.0);
2154 next.hand_r.orientation =
2155 Quaternion::rotation_x(2.25) * Quaternion::rotation_z(0.9);
2156
2157 next.lantern.position = Vec3::new(-0.5, -0.5, -1.5);
2158 next.lantern.orientation = next.hand_r.orientation.inverse();
2159 }
2160 },
2161 _ => {},
2162 }
2163
2164 next
2165 }
2166}