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