Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
HammerSupport.inc.c
Go to the documentation of this file.
1#include "common.h"
2#include "script_api/battle.h"
4#include "sprite/player.h"
5
8
9EvtScript N(EVS_HammerSupport_SmashApproach) = {
10 Call(InitTargetIterator)
11 Call(SetGoalToTarget, ACTOR_PLAYER)
12 Call(AddGoalPos, ACTOR_PLAYER, 0, 0, 0)
13 Call(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
14 Sub(LVar0, 32)
15 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
16 Call(UseBattleCamPreset, BTL_CAM_PLAYER_ATTACK_APPROACH)
17 Call(SetActorSpeed, ACTOR_PLAYER, Float(5.0))
18 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario1_Run)
19 Call(PlayerRunToGoal, 0)
20 Return
21 End
22};
23
24EvtScript N(EVS_HammerSupport_QuakeApproach) = {
25 Call(SetGoalPos, ACTOR_PLAYER, -33, 0, 0)
26 Call(UseBattleCamPreset, BTL_CAM_PLAYER_ATTACK_APPROACH)
27 Call(SetActorSpeed, ACTOR_PLAYER, Float(5.0))
28 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario1_Run)
29 Call(PlayerRunToGoal, 0)
30 Return
31 End
32};
33
34// delay while player holds hammer on the ground before raising it
35// can be sped up by pre-emptively holding left
36EvtScript N(EVS_HammerSupport_BasicRaiseDelay) = {
37 Call(SetGoalToTarget, ACTOR_PLAYER)
38 Call(AddGoalPos, ACTOR_PLAYER, 0, 0, 0)
39 Set(LVar1, 0)
40 Loop(10)
41 Call(CheckButtonDown, BUTTON_STICK_LEFT, LVar0)
42 IfEq(LVar0, TRUE)
43 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario1_Idle)
45 EndIf
46 Wait(1)
47 Add(LVar1, 1)
48 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_MarioB1_Smash1_Begin)
50 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_MarioB1_Smash1_Begin)
52 CaseLt(3)
53 Wait(4)
54 CaseLt(5)
55 Wait(3)
56 CaseLt(7)
57 Wait(2)
58 CaseLt(9)
59 Wait(1)
60 CaseLt(11)
61 Wait(0)
63 Return
64 End
65};
66
67// delay while player holds hammer on the ground before raising it
68// can be sped up by pre-emptively holding left
69EvtScript N(EVS_HammerSupport_SuperRaiseDelay) = {
70 Call(SetGoalToTarget, ACTOR_PLAYER)
71 Call(AddGoalPos, ACTOR_PLAYER, 0, 0, 0)
72 Set(LVar1, 0)
73 Loop(10)
74 Call(CheckButtonDown, BUTTON_STICK_LEFT, LVar0)
75 IfEq(LVar0, TRUE)
76 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario1_Idle)
78 EndIf
79 Wait(1)
80 Add(LVar1, 1)
81 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_MarioB1_Smash2_Begin)
83 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_MarioB1_Smash2_Begin)
85 CaseLt(3)
86 Wait(4)
87 CaseLt(5)
88 Wait(3)
89 CaseLt(7)
90 Wait(2)
91 CaseLt(9)
92 Wait(1)
93 CaseLt(11)
94 Wait(0)
96 Return
97 End
98};
99
100// delay while player holds hammer on the ground before raising it
101// can be sped up by pre-emptively holding left
102EvtScript N(EVS_HammerSupport_UltraRaiseDelay) = {
103 Call(SetGoalToTarget, ACTOR_PLAYER)
104 Call(AddGoalPos, ACTOR_PLAYER, 0, 0, 0)
105 Set(LVar1, 0)
106 Loop(10)
107 Call(CheckButtonDown, BUTTON_STICK_LEFT, LVar0)
108 IfEq(LVar0, TRUE)
109 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario1_Idle)
111 EndIf
112 Wait(1)
113 Add(LVar1, 1)
114 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_MarioB1_Smash3_Begin)
115 EndLoop
116 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_MarioB1_Smash3_Begin)
118 CaseLt(3)
119 Wait(4)
120 CaseLt(5)
121 Wait(3)
122 CaseLt(7)
123 Wait(2)
124 CaseLt(9)
125 Wait(1)
126 CaseLt(11)
127 Wait(0)
129 Return
130 End
131};
132
133EvtScript N(EVS_HammerSupport_F) = {
134 Call(UseBattleCamPreset, BTL_CAM_PLAYER_AIM_HAMMER)
135 Call(SetBattleCamOffsetY, 8)
136 Call(InitTargetIterator)
137 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_HAMMER_WINDUP)
138 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_MarioB1_Smash1_PullBack)
139 Wait(4)
140 Call(action_command_hammer_start, 0, 36, 3)
141 Call(SetActionQuality, 0)
142 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_MarioB1_Smash1_Hold1)
143 Set(LVar1, 0)
144 Loop(30)
145 Wait(1)
146 Call(GetActionQuality, LVar0)
147 IfNe(LVar0, 0)
148 IfNe(LVar1, 1)
149 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_MarioB1_Smash1_Hold2)
150 Set(LVar1, 1)
151 EndIf
152 EndIf
153 Call(CheckButtonDown, BUTTON_STICK_LEFT, LVar0)
154 IfEq(LVar0, FALSE)
156 EndIf
157 EndLoop
158 Label(0)
159 Wait(1)
160 Call(CheckButtonDown, BUTTON_STICK_LEFT, LVar0)
161 IfEq(LVar0, TRUE)
162 Goto(0)
163 EndIf
164 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_MarioB1_Smash1_PreSwing)
165 Wait(3)
166 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_MarioB1_Smash1_Swing)
167 Call(UseBattleCamPreset, BTL_CAM_PLAYER_HAMMER_STRIKE)
168 Return
169 End
170};
171
172EvtScript N(EVS_HammerSupport_ReturnHome_Success) = {
173 Call(PlayerYieldTurn)
174 Call(UseBattleCamPreset, BTL_CAM_RETURN_HOME)
175 Call(MoveBattleCamOver, 5)
176 Call(func_802693F0)
177 Wait(20)
178 Call(EnablePlayerBlur, ACTOR_BLUR_RESET)
179 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario1_Idle)
180 Wait(5)
181 Call(SetGoalToHome, ACTOR_PLAYER)
182 Call(SetActorSpeed, ACTOR_PLAYER, Float(8.0))
183 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario1_Run)
184 Call(PlayerRunToGoal, 0)
185 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario1_Idle)
186 Return
187 End
188};
189
190EvtScript N(EVS_Hammer_ReturnHome_B) = {
191 Call(PlayerYieldTurn)
192 Call(func_802693F0)
193 Wait(20)
194 Call(EnablePlayerBlur, ACTOR_BLUR_RESET)
195 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario1_Idle)
196 Wait(5)
197 Call(SetGoalToHome, ACTOR_PLAYER)
198 Call(SetActorSpeed, ACTOR_PLAYER, Float(8.0))
199 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario1_Run)
200 Call(PlayerRunToGoal, 0)
201 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario1_Idle)
202 Return
203 End
204};
205
206EvtScript N(EVS_HammerSupport_ReturnHome_Miss) = {
207 Call(PlayerYieldTurn)
208 Call(UseBattleCamPreset, BTL_CAM_PLAYER_MISTAKE)
209 Call(func_802693F0)
210 Wait(20)
211 Call(EnablePlayerBlur, ACTOR_BLUR_RESET)
212 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario1_Idle)
213 Wait(5)
214 Call(SetGoalToHome, ACTOR_PLAYER)
215 Call(SetActorSpeed, ACTOR_PLAYER, Float(8.0))
216 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario1_Run)
217 Call(PlayerRunToGoal, 0)
218 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario1_Idle)
219 Return
220 End
221};
222
223EvtScript N(EVS_UseBasicHammer) = {
224 Call(LoadActionCommand, ACTION_COMMAND_SMASH)
225 Call(action_command_hammer_init)
226 ExecWait(N(EVS_HammerSupport_SmashApproach))
227 Call(SetGoalToTarget, ACTOR_PLAYER)
228 Call(AddGoalPos, ACTOR_PLAYER, 0, 0, 0)
229 ExecWait(N(EVS_HammerSupport_BasicRaiseDelay))
230 Call(PlayerTestEnemy, LVar0, DAMAGE_TYPE_SMASH, 0, 0, 0, 16)
231 Call(UseBattleCamPreset, BTL_CAM_PLAYER_AIM_HAMMER)
232 Call(SetBattleCamOffsetY, 8)
233 Call(InitTargetIterator)
234 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_HAMMER_WINDUP)
235 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_MarioB1_Smash1_PullBack)
236 Wait(4)
237 Call(N(IsBerserkerEquipped))
239 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_MarioB1_Smash1_Hold1)
240 Call(GetActionCommandMode, LVar0)
241 IfLt(LVar0, 2)
242 Call(N(ShouldMovesAutoSucceed))
243 IfEq(LVar0, 0)
244 Loop(45)
245 Wait(1)
246 Call(CheckButtonDown, BUTTON_STICK_LEFT, LVar0)
247 IfNe(LVar0, FALSE)
249 EndIf
250 EndLoop
251 EndIf
252 EndIf
253 Add(LVarD, 6)
254 Call(action_command_hammer_start, 0, LVarD, 3)
255 Call(SetActionQuality, 0)
256 Set(LVar1, 0)
257 Loop(30)
258 Wait(1)
259 Call(GetActionQuality, LVar0)
260 IfNe(LVar0, 0)
261 IfNe(LVar1, 1)
262 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_MarioB1_Smash1_Hold2)
263 Set(LVar1, 1)
264 EndIf
265 EndIf
266 Call(CheckButtonDown, BUTTON_STICK_LEFT, LVar0)
267 IfEq(LVar0, FALSE)
269 EndIf
270 EndLoop
271 Label(0)
272 Call(GetActionCommandMode, LVar0)
273 IfLt(LVar0, 2)
274 Wait(1)
275 Call(GetActionSuccess, LVar0)
276 IfEq(LVar0, 0)
277 Goto(0)
278 EndIf
279 EndIf
280 Else
281 Call(action_command_hammer_start, 0, LVar1, 3)
282 Call(SetActionQuality, 0)
283 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_MarioB1_Smash1_Hold1)
284 Sub(LVar1, 10)
285 Wait(LVar1)
286 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_MarioB1_Smash1_Hold2)
287 Wait(5)
288 EndIf
289 Call(GetActionCommandMode, LVar0)
290 IfEq(LVar0, 2)
291 Call(SetActionCommandMode, 3)
292 Loop(0)
293 Call(GetActionCommandMode, LVar0)
294 IfLt(LVar0, 2)
296 EndIf
297 Wait(1)
298 EndLoop
299 EndIf
300 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_MarioB1_Smash1_PreSwing)
301 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_HAMMER_SWING_1)
302 Wait(3)
303 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_MarioB1_Smash1_Swing)
304 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_HAMMER_STRIKE_1)
305 Return
306 End
307};
308
309EvtScript N(EVS_UseSuperHammer) = {
310 Call(LoadActionCommand, ACTION_COMMAND_SMASH)
311 Call(action_command_hammer_init)
312 ExecWait(N(EVS_HammerSupport_SmashApproach))
313 Call(SetGoalToTarget, ACTOR_PLAYER)
314 Call(AddGoalPos, ACTOR_PLAYER, 0, 0, 0)
315 ExecWait(N(EVS_HammerSupport_SuperRaiseDelay))
316 Call(PlayerTestEnemy, LVar0, DAMAGE_TYPE_SMASH, 0, 0, 0, BS_FLAGS1_INCLUDE_POWER_UPS)
317 Call(UseBattleCamPreset, BTL_CAM_PLAYER_AIM_HAMMER)
318 Call(SetBattleCamOffsetY, 8)
319 Call(InitTargetIterator)
320 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_HAMMER_WINDUP)
321 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_MarioB1_Smash2_PullBack)
322 Wait(4)
323 Call(N(IsBerserkerEquipped))
324 IfEq(LVar0, TRUE)
325 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_MarioB1_Smash2_Hold1)
326 Call(N(ShouldMovesAutoSucceed))
328 Loop(45)
329 Wait(1)
330 Call(CheckButtonDown, BUTTON_STICK_LEFT, LVar0)
331 IfNe(LVar0, FALSE)
333 EndIf
334 EndLoop
335 EndIf
336 Add(LVarD, 6)
337 Call(action_command_hammer_start, 0, LVarD, 3)
338 Call(SetActionQuality, 0)
339 Set(LVar1, 0)
340 Loop(30)
341 Wait(1)
342 Call(GetActionQuality, LVar0)
343 IfNe(LVar0, 0)
344 IfNe(LVar1, 1)
345 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_MarioB1_Smash2_Hold2)
346 Set(LVar1, 1)
347 EndIf
348 EndIf
349 Call(CheckButtonDown, BUTTON_STICK_LEFT, LVar0)
350 IfEq(LVar0, FALSE)
352 EndIf
353 EndLoop
354 Label(0)
355 Wait(1)
356 Call(GetActionSuccess, LVar0)
357 IfEq(LVar0, 0)
358 Goto(0)
359 EndIf
360 Else
361 Call(action_command_hammer_start, 0, LVar1, 3)
362 Call(SetActionQuality, 0)
363 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_MarioB1_Smash2_Hold1)
364 Sub(LVar1, 10)
365 Wait(LVar1)
366 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_MarioB1_Smash2_Hold2)
367 Wait(5)
368 EndIf
369 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_MarioB1_Smash2_PreSwing)
370 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_HAMMER_SWING_2)
371 Wait(3)
372 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_MarioB1_Smash2_Swing)
373 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_HAMMER_STRIKE_2)
374 Return
375 End
376};
377
378EvtScript N(EVS_UseUltraHammer) = {
379 Call(LoadActionCommand, ACTION_COMMAND_SMASH)
380 Call(action_command_hammer_init)
381 ExecWait(N(EVS_HammerSupport_SmashApproach))
382 Call(SetGoalToTarget, ACTOR_PLAYER)
383 Call(AddGoalPos, ACTOR_PLAYER, 0, 0, 0)
384 ExecWait(N(EVS_HammerSupport_UltraRaiseDelay))
385 Call(PlayerTestEnemy, LVar0, DAMAGE_TYPE_SMASH, 0, 0, 0, BS_FLAGS1_INCLUDE_POWER_UPS)
386 Call(UseBattleCamPreset, BTL_CAM_PLAYER_AIM_HAMMER)
387 Call(SetBattleCamOffsetY, 8)
388 Call(InitTargetIterator)
389 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_HAMMER_WINDUP)
390 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_MarioB1_Smash3_PullBack)
391 Wait(4)
392 Call(N(IsBerserkerEquipped))
393 IfEq(LVar0, TRUE)
394 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_MarioB1_Smash3_Hold1)
395 Call(N(ShouldMovesAutoSucceed))
397 Loop(45)
398 Wait(1)
399 Call(CheckButtonDown, BUTTON_STICK_LEFT, LVar0)
400 IfNe(LVar0, FALSE)
402 EndIf
403 EndLoop
404 EndIf
405 Add(LVarD, 6)
406 Call(action_command_hammer_start, 0, LVarD, 3)
407 Call(SetActionQuality, 0)
408 Set(LVar1, 0)
409 Loop(30)
410 Wait(1)
411 Call(GetActionQuality, LVar0)
412 IfNe(LVar0, 0)
413 IfNe(LVar1, 1)
414 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_MarioB1_Smash3_Hold2)
415 Set(LVar1, 1)
416 EndIf
417 EndIf
418 Call(CheckButtonDown, BUTTON_STICK_LEFT, LVar0)
419 IfEq(LVar0, FALSE)
421 EndIf
422 EndLoop
423 Label(0)
424 Wait(1)
425 Call(GetActionSuccess, LVar0)
426 IfEq(LVar0, 0)
427 Goto(0)
428 EndIf
429 Else
430 Call(action_command_hammer_start, 0, LVar1, 3)
431 Call(SetActionQuality, 0)
432 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_MarioB1_Smash3_Hold1)
433 Sub(LVar1, 10)
434 Wait(LVar1)
435 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_MarioB1_Smash3_Hold2)
436 Wait(5)
437 EndIf
438 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_MarioB1_Smash3_PreSwing)
439 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_HAMMER_SWING_3)
440 Wait(3)
441 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_MarioB1_Smash3_Swing)
442 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_HAMMER_STRIKE_3)
443 Return
444 End
445};
446
447EvtScript N(EVS_Hammer_UseBasicQuake) = {
448 Call(ChooseNextTarget, ITER_LAST, LVar0)
449 Call(LoadActionCommand, ACTION_COMMAND_SMASH)
450 Call(action_command_hammer_init)
451 ExecWait(N(EVS_HammerSupport_QuakeApproach))
452 Call(SetGoalToTarget, ACTOR_PLAYER)
453 Call(AddGoalPos, ACTOR_PLAYER, 0, 0, 0)
454 ExecWait(N(EVS_HammerSupport_BasicRaiseDelay))
455 Call(UseBattleCamPreset, BTL_CAM_PLAYER_AIM_HAMMER)
456 Call(AddBattleCamDist, 80)
457 Call(InitTargetIterator)
458 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_HAMMER_WINDUP)
459 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_MarioB1_Smash1_PullBack)
460 Wait(8)
461 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_MarioB1_Smash1_Hold1)
462 Call(N(ShouldMovesAutoSucceed))
463 IfEq(LVar0, 0)
464 Loop(45)
465 Wait(1)
466 Call(CheckButtonDown, BUTTON_STICK_LEFT, LVar0)
467 IfNe(LVar0, FALSE)
469 EndIf
470 EndLoop
471 EndIf
472 Add(LVarD, 6)
473 Call(action_command_hammer_start, 0, LVarD, 3)
474 Call(SetActionQuality, 0)
475 Set(LVar1, 0)
476 Loop(30)
477 Wait(1)
478 Call(GetActionQuality, LVar0)
479 IfNe(LVar0, 0)
480 IfNe(LVar1, 1)
481 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_MarioB1_Smash1_Hold2)
482 Set(LVar1, 1)
483 EndIf
484 EndIf
485 Call(CheckButtonDown, BUTTON_STICK_LEFT, LVar0)
486 IfEq(LVar0, FALSE)
488 EndIf
489 EndLoop
490 Label(0)
491 Wait(1)
492 Call(GetActionSuccess, LVar0)
493 IfEq(LVar0, 0)
494 Goto(0)
495 EndIf
496 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_HAMMER_SWING_1)
497 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_MarioB1_Smash1_PreSwing)
498 Wait(3)
499 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_MarioB1_Smash1_Swing)
500 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_HAMMER_STRIKE_1)
501 Return
502 End
503};
504
505EvtScript N(EVS_Hammer_UseSuperQuake) = {
506 Call(ChooseNextTarget, ITER_LAST, LVar0)
507 Call(LoadActionCommand, ACTION_COMMAND_SMASH)
508 Call(action_command_hammer_init)
509 ExecWait(N(EVS_HammerSupport_QuakeApproach))
510 Call(SetGoalToTarget, ACTOR_PLAYER)
511 Call(AddGoalPos, ACTOR_PLAYER, 0, 0, 0)
512 ExecWait(N(EVS_HammerSupport_SuperRaiseDelay))
513 Call(UseBattleCamPreset, BTL_CAM_PLAYER_AIM_HAMMER)
514 Call(AddBattleCamDist, 80)
515 Call(InitTargetIterator)
516 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_HAMMER_WINDUP)
517 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_MarioB1_Smash2_PullBack)
518 Wait(8)
519 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_MarioB1_Smash2_Hold1)
520 Call(N(ShouldMovesAutoSucceed))
521 IfEq(LVar0, 0)
522 Loop(45)
523 Wait(1)
524 Call(CheckButtonDown, BUTTON_STICK_LEFT, LVar0)
525 IfNe(LVar0, FALSE)
527 EndIf
528 EndLoop
529 EndIf
530 Add(LVarD, 6)
531 Call(action_command_hammer_start, 0, LVarD, 3)
532 Loop(60)
533 Wait(1)
534 Call(CheckButtonDown, BUTTON_STICK_LEFT, LVar0)
535 IfEq(LVar0, FALSE)
537 EndIf
538 EndLoop
539 Label(0)
540 Wait(1)
541 Call(GetActionSuccess, LVar0)
542 IfEq(LVar0, 0)
543 Goto(0)
544 EndIf
545 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_HAMMER_SWING_2)
546 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_MarioB1_Smash2_PreSwing)
547 Wait(3)
548 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_MarioB1_Smash2_Swing)
549 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_HAMMER_STRIKE_2)
550 Return
551 End
552};
553
554EvtScript N(EVS_Hammer_UseUltraQuake) = {
555 Call(ChooseNextTarget, ITER_LAST, LVar0)
556 Call(LoadActionCommand, ACTION_COMMAND_SMASH)
557 Call(action_command_hammer_init)
558 ExecWait(N(EVS_HammerSupport_QuakeApproach))
559 Call(SetGoalToTarget, ACTOR_PLAYER)
560 Call(AddGoalPos, ACTOR_PLAYER, 0, 0, 0)
561 ExecWait(N(EVS_HammerSupport_UltraRaiseDelay))
562 Call(UseBattleCamPreset, BTL_CAM_PLAYER_AIM_HAMMER)
563 Call(AddBattleCamDist, 80)
564 Call(InitTargetIterator)
565 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_HAMMER_WINDUP)
566 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_MarioB1_Smash3_PullBack)
567 Wait(8)
568 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_MarioB1_Smash3_Hold1)
569 Call(N(ShouldMovesAutoSucceed))
570 IfEq(LVar0, 0)
571 Loop(45)
572 Wait(1)
573 Call(CheckButtonDown, BUTTON_STICK_LEFT, LVar0)
574 IfNe(LVar0, FALSE)
576 EndIf
577 EndLoop
578 EndIf
579 Add(LVarD, 6)
580 Call(action_command_hammer_start, 0, LVarD, 3)
581 Loop(60)
582 Wait(1)
583 Call(CheckButtonDown, BUTTON_STICK_LEFT, LVar0)
584 IfEq(LVar0, FALSE)
586 EndIf
587 EndLoop
588 Label(0)
589 Wait(1)
590 Call(GetActionSuccess, LVar0)
591 IfEq(LVar0, 0)
592 Goto(0)
593 EndIf
594 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_HAMMER_SWING_3)
595 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_MarioB1_Smash3_PreSwing)
596 Wait(3)
597 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_MarioB1_Smash3_Swing)
598 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_HAMMER_STRIKE_3)
599 Return
600 End
601};
Bytecode EvtScript[]
@ ACTION_COMMAND_SMASH
Definition enums.h:3474
@ BUTTON_STICK_LEFT
Definition enums.h:2793
@ BS_FLAGS1_INCLUDE_POWER_UPS
Definition enums.h:3571
@ ITER_LAST
Definition enums.h:2027
@ HIT_RESULT_HIT
Definition enums.h:1950
@ BTL_CAM_RETURN_HOME
Definition enums.h:4826
@ BTL_CAM_PLAYER_MISTAKE
Definition enums.h:4851
@ BTL_CAM_PLAYER_AIM_HAMMER
Definition enums.h:4865
@ BTL_CAM_PLAYER_HAMMER_STRIKE
Definition enums.h:4866
@ BTL_CAM_PLAYER_ATTACK_APPROACH
Definition enums.h:4848
@ SOUND_HAMMER_STRIKE_3
Definition enums.h:1559
@ SOUND_HAMMER_SWING_3
Definition enums.h:1556
@ SOUND_HAMMER_STRIKE_1
Definition enums.h:1557
@ SOUND_HAMMER_SWING_1
Definition enums.h:1554
@ SOUND_HAMMER_SWING_2
Definition enums.h:1555
@ SOUND_HAMMER_WINDUP
Definition enums.h:744
@ SOUND_HAMMER_STRIKE_2
Definition enums.h:1558
@ ACTOR_PLAYER
Definition enums.h:2085
@ ACTOR_SELF
Definition enums.h:2084
@ ACTOR_BLUR_RESET
Definition enums.h:6415
@ DAMAGE_TYPE_SMASH
Definition enums.h:2857
#define Else
Marks the end of an if statement and the start of the else block.
Definition macros.h:295
#define Switch(LVAR)
Marks the start of a switch statement.
Definition macros.h:311
#define Set(VAR, INT_VALUE)
Sets the given variable to a given value casted to an integer.
Definition macros.h:365
#define Sub(VAR, INT_VALUE)
Definition macros.h:377
#define IfNe(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR != RVAR.
Definition macros.h:272
#define End
Signals the end of EVT script data. A script missing this will likely crash on load.
Definition macros.h:213
#define Add(VAR, INT_VALUE)
Definition macros.h:376
#define EndLoop
Marks the end of a loop.
Definition macros.h:248
#define Goto(LABEL_ID)
Moves execution to the given label.
Definition macros.h:232
#define IfLt(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR < RVAR.
Definition macros.h:275
#define Float(DOUBLE)
Definition macros.h:51
#define Label(LABEL_ID)
Marks this point in the script as a Goto target.
Definition macros.h:227
#define EndIf
Marks the end of an if statement or an else block.
Definition macros.h:298
#define ExecWait(EVT_SOURCE)
Launches a new child thread.
Definition macros.h:475
#define BreakLoop
Breaks out of the innermost loop.
Definition macros.h:251
#define LVar2
Definition macros.h:150
#define LVar1
Definition macros.h:149
#define LVarD
Definition macros.h:161
#define Wait(NUM_FRAMES)
Blocks for the given number of frames.
Definition macros.h:254
#define EndSwitch
Marks the end of a switch statement and any case.
Definition macros.h:362
#define IfEq(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR == RVAR.
Definition macros.h:269
#define CaseLt(RVAR)
Marks the start of a switch case that executes only if LVAR < RVAR. It also marks the end of any prev...
Definition macros.h:325
#define Call(FUNC, ARGS...)
Calls a given C EVT API function with any number of arguments.
Definition macros.h:576
#define Loop(TIMES)
Marks the beginning of a loop.
Definition macros.h:245
#define LVar0
Definition macros.h:148
#define Return
Kills the current EVT thread.
Definition macros.h:217