Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
groove_guy.inc.c
Go to the documentation of this file.
1#include "common.h"
2#include "effects.h"
3#include "battle/battle.h"
4#include "script_api/battle.h"
5#include "sprite/npc/ShyGuy.h"
6#include "sprite/npc/MediGuy.h"
7#include "sprite/npc/GrooveGuy.h"
8
9#define NAMESPACE A(groove_guy)
10
11extern ActorBlueprint A(red_shy_guy);
12extern ActorBlueprint A(medi_guy);
13
14extern EvtScript N(EVS_Init);
15extern EvtScript N(EVS_Idle);
16extern EvtScript N(EVS_TakeTurn);
17extern EvtScript N(EVS_HandleEvent);
18extern EvtScript N(EVS_RandomSummon);
19extern EvtScript N(EVS_SummonShyGuy);
20extern EvtScript N(EVS_SummonGrooveGuy);
21extern EvtScript N(EVS_SummonMediGuy);
22
23extern Formation N(ShyGuyFormation);
24extern Formation N(GrooveGuyFormation);
25extern Formation N(MediGuyFormation);
26
27enum N(ActorPartIDs) {
28 PRT_MAIN = 1,
29};
30
31enum N(ActorVars) {
32 AVAR_Generation = 0,
33};
34
35enum N(ActorParams) {
36 DMG_TACKLE = 2,
37};
38
39s32 N(DefaultAnims)[] = {
40 STATUS_KEY_NORMAL, ANIM_GrooveGuy_Anim01,
41 STATUS_KEY_STONE, ANIM_GrooveGuy_Anim00,
42 STATUS_KEY_SLEEP, ANIM_GrooveGuy_Anim06,
43 STATUS_KEY_POISON, ANIM_GrooveGuy_Anim01,
44 STATUS_KEY_STOP, ANIM_GrooveGuy_Anim00,
45 STATUS_KEY_STATIC, ANIM_GrooveGuy_Anim01,
46 STATUS_KEY_PARALYZE, ANIM_GrooveGuy_Anim00,
47 STATUS_KEY_DIZZY, ANIM_GrooveGuy_Anim07,
48 STATUS_KEY_FEAR, ANIM_GrooveGuy_Anim07,
50};
51
52s32 N(DefenseTable)[] = {
56};
57
58s32 N(StatusTable)[] = {
65 STATUS_KEY_FEAR, 100,
81};
82
83BSS PlayerStatus N(DummyPlayerStatus);
84
85ActorPartBlueprint N(ActorParts)[] = {
86 {
88 .index = PRT_MAIN,
89 .posOffset = { 0, 0, 0 },
90 .targetOffset = { 0, 24 },
91 .opacity = 255,
92 .idleAnimations = N(DefaultAnims),
93 .defenseTable = N(DefenseTable),
94 .eventFlags = ACTOR_EVENT_FLAGS_NONE,
95 .elementImmunityFlags = 0,
96 .projectileTargetOffset = { 0, -10 },
97 },
98};
99
100ActorBlueprint NAMESPACE = {
101 .flags = 0,
102 .type = ACTOR_TYPE_GROOVE_GUY,
103 .level = ACTOR_LEVEL_GROOVE_GUY,
104 .maxHP = 7,
105 .partCount = ARRAY_COUNT(N(ActorParts)),
106 .partsData = N(ActorParts),
107 .initScript = &N(EVS_Init),
108 .statusTable = N(StatusTable),
109 .escapeChance = 50,
110 .airLiftChance = 85,
111 .hurricaneChance = 80,
112 .spookChance = 70,
113 .upAndAwayChance = 95,
114 .spinSmashReq = 0,
115 .powerBounceChance = 80,
116 .coinReward = 2,
117 .size = { 28, 28 },
118 .healthBarOffset = { 0, 0 },
119 .statusIconOffset = { -10, 20 },
120 .statusTextOffset = { 10, 20 },
121};
122
123EvtScript N(EVS_Init) = {
124 Call(BindTakeTurn, ACTOR_SELF, Ref(N(EVS_TakeTurn)))
125 Call(BindIdle, ACTOR_SELF, Ref(N(EVS_Idle)))
126 Call(BindHandleEvent, ACTOR_SELF, Ref(N(EVS_HandleEvent)))
127 Call(SetActorVar, ACTOR_SELF, AVAR_Generation, 0)
128 Return
129 End
130};
131
132#include "common/battle/SetAbsoluteStatusOffsets.inc.c"
133
134EvtScript N(EVS_Idle) = {
135 Label(0)
136 Call(GetStatusFlags, ACTOR_SELF, LVar0)
138 Call(SetTargetOffset, ACTOR_SELF, PRT_MAIN, -4, 14)
139 Call(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, 0, 0)
140 Call(N(SetAbsoluteStatusOffsets), -13, 15, 4, 13)
141 Else
142 Call(SetTargetOffset, ACTOR_SELF, PRT_MAIN, 0, 24)
143 Call(SetProjectileTargetOffset, ACTOR_SELF, PRT_MAIN, 0, -10)
144 Call(N(SetAbsoluteStatusOffsets), -10, 20, 10, 20)
145 EndIf
146 Wait(1)
147 Goto(0)
148 Return
149 End
150};
151
152EvtScript N(EVS_ReturnHome) = {
153 Call(ResetAllActorSounds, ACTOR_SELF)
154 SetConst(LVar0, PRT_MAIN)
155 SetConst(LVar1, ANIM_GrooveGuy_Anim04)
157 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_GrooveGuy_Anim01)
158 Return
159 End
160};
161
162EvtScript N(EVS_HandleEvent) = {
163 Call(UseIdleAnimation, ACTOR_SELF, FALSE)
164 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_DISABLE)
165 Call(GetLastEvent, ACTOR_SELF, LVar0)
169 SetConst(LVar0, PRT_MAIN)
170 SetConst(LVar1, ANIM_GrooveGuy_Anim08)
174 SetConst(LVar0, PRT_MAIN)
175 SetConst(LVar1, ANIM_GrooveGuy_Anim0E)
176 SetConst(LVar2, ANIM_GrooveGuy_Anim0F)
179 SetConst(LVar0, PRT_MAIN)
180 SetConst(LVar1, ANIM_GrooveGuy_Anim0E)
181 SetConst(LVar2, ANIM_GrooveGuy_Anim0F)
183 SetConst(LVar0, PRT_MAIN)
184 SetConst(LVar1, ANIM_GrooveGuy_Anim0F)
186 Return
188 SetConst(LVar0, PRT_MAIN)
189 SetConst(LVar1, ANIM_GrooveGuy_Anim08)
192 SetConst(LVar0, PRT_MAIN)
193 SetConst(LVar1, ANIM_GrooveGuy_Anim08)
195 SetConst(LVar0, PRT_MAIN)
196 SetConst(LVar1, ANIM_GrooveGuy_Anim08)
198 Return
200 SetConst(LVar0, PRT_MAIN)
201 SetConst(LVar1, ANIM_GrooveGuy_Anim08)
203 SetConst(LVar0, PRT_MAIN)
204 SetConst(LVar1, ANIM_GrooveGuy_Anim08)
206 Call(SetActorSpeed, ACTOR_SELF, Float(4.0))
207 ExecWait(N(EVS_ReturnHome))
209 SetConst(LVar0, PRT_MAIN)
210 SetConst(LVar1, ANIM_GrooveGuy_Anim08)
212 SetConst(LVar0, PRT_MAIN)
213 SetConst(LVar1, ANIM_GrooveGuy_Anim08)
215 Return
218 SetConst(LVar0, PRT_MAIN)
219 SetConst(LVar1, ANIM_GrooveGuy_Anim01)
223 SetConst(LVar0, PRT_MAIN)
224 SetConst(LVar1, ANIM_GrooveGuy_Anim08)
226 Wait(10)
227 SetConst(LVar0, PRT_MAIN)
228 SetConst(LVar1, ANIM_GrooveGuy_Anim08)
230 Return
232 SetConst(LVar0, PRT_MAIN)
233 SetConst(LVar1, ANIM_GrooveGuy_Anim01)
236 SetConst(LVar0, PRT_MAIN)
237 SetConst(LVar1, ANIM_GrooveGuy_Anim04)
238 SetConst(LVar2, ANIM_GrooveGuy_Anim11)
240 Return
242 SetConst(LVar0, PRT_MAIN)
243 SetConst(LVar1, ANIM_GrooveGuy_Anim04)
246 SetConst(LVar0, PRT_MAIN)
247 SetConst(LVar1, ANIM_GrooveGuy_Anim04)
249 Return
251 SetConst(LVar0, PRT_MAIN)
252 SetConst(LVar1, ANIM_GrooveGuy_Anim01)
256 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_ENABLE)
257 Call(UseIdleAnimation, ACTOR_SELF, TRUE)
258 Return
259 End
260};
261
262EvtScript N(EVS_Attack_Tackle) = {
263 Call(UseIdleAnimation, ACTOR_SELF, FALSE)
264 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_DISABLE)
265 Call(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER)
266 Call(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH)
267 Call(BattleCamTargetActor, ACTOR_SELF)
268 Call(SetBattleCamTargetingModes, BTL_CAM_YADJ_TARGET, BTL_CAM_XADJ_AVG, FALSE)
269 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_GrooveGuy_Anim04)
270 Call(SetActorSpeed, ACTOR_SELF, Float(4.0))
271 Call(SetGoalToTarget, ACTOR_SELF)
272 Call(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
273 Add(LVar0, 50)
274 Set(LVar1, 0)
275 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
276 Call(RunToGoal, ACTOR_SELF, 0, FALSE)
277 Call(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_INCLUDE_POWER_UPS)
281 Set(LVarA, LVar0)
282 Call(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_JUMP, SOUND_ACTOR_HOP, 0)
284 Call(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK_INCREMENT, 10, 0)
285 Call(SetActorSpeed, ACTOR_SELF, Float(6.0))
286 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_GrooveGuy_Anim10)
287 Call(SetGoalToTarget, ACTOR_SELF)
288 Call(RunToGoal, ACTOR_SELF, 0, FALSE)
289 Call(SetActorSpeed, ACTOR_SELF, Float(6.0))
290 Call(SetActorJumpGravity, ACTOR_SELF, Float(0.5))
291 Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
292 Sub(LVar0, 30)
293 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
294 Call(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE)
296 Call(EnemyTestTarget, ACTOR_SELF, LVarA, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0)
297 EndIf
298 Call(ResetAllActorSounds, ACTOR_SELF)
299 Sub(LVar0, 20)
300 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
301 Call(JumpToGoal, ACTOR_SELF, 8, FALSE, TRUE, FALSE)
302 Wait(15)
303 Call(UseBattleCamPreset, BTL_CAM_DEFAULT)
304 Call(SetActorYaw, ACTOR_SELF, 180)
305 Call(AddActorDecoration, ACTOR_SELF, PRT_MAIN, 0, ACTOR_DECORATION_SWEAT)
306 Call(SetActorSpeed, ACTOR_SELF, Float(6.0))
307 ExecWait(N(EVS_ReturnHome))
308 Call(RemoveActorDecoration, ACTOR_SELF, PRT_MAIN, 0)
309 Call(SetActorYaw, ACTOR_SELF, 0)
310 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_ENABLE)
311 Call(UseIdleAnimation, ACTOR_SELF, TRUE)
312 Return
315 Thread
316 Wait(3)
317 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_ACTOR_HOP)
320 Call(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK_INCREMENT, 10, 0)
321 Call(SetActorSpeed, ACTOR_SELF, Float(6.0))
322 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_GrooveGuy_Anim10)
323 Call(SetGoalToTarget, ACTOR_SELF)
324 Call(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
325 Add(LVar0, 10)
326 Set(LVar1, 0)
327 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
328 Call(RunToGoal, ACTOR_SELF, 0, FALSE)
329 Wait(2)
330 Call(EnemyDamageTarget, ACTOR_SELF, LVar0, 0, 0, 0, DMG_TACKLE, BS_FLAGS1_TRIGGER_EVENTS)
334 Call(ResetAllActorSounds, ACTOR_SELF)
335 Call(UseBattleCamPreset, BTL_CAM_DEFAULT)
336 Call(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
337 Add(LVar0, 30)
338 Set(LVar1, 0)
339 Call(SetActorJumpGravity, ACTOR_SELF, Float(1.8))
340 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
341 Call(JumpToGoal, ACTOR_SELF, 10, FALSE, TRUE, FALSE)
342 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_GrooveGuy_Anim01)
343 Wait(8)
344 Call(SetActorSpeed, ACTOR_SELF, Float(6.0))
345 ExecWait(N(EVS_ReturnHome))
348 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_ENABLE)
349 Call(UseIdleAnimation, ACTOR_SELF, TRUE)
350 Return
351 End
352};
353
354EvtScript N(EVS_Attack_SleepySpin) = {
355 Call(UseIdleAnimation, ACTOR_SELF, FALSE)
356 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_DISABLE)
357 Call(SetTargetActor, ACTOR_SELF, ACTOR_PLAYER)
358 Call(UseBattleCamPreset, BTL_CAM_ENEMY_APPROACH)
359 Call(BattleCamTargetActor, ACTOR_SELF)
360 Call(SetBattleCamTargetingModes, BTL_CAM_YADJ_TARGET, BTL_CAM_XADJ_AVG, FALSE)
362 Call(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK_INCREMENT, 10, 0)
363 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_GrooveGuy_Anim10)
364 Call(SetActorSpeed, ACTOR_SELF, Float(4.0))
365 Call(SetGoalToTarget, ACTOR_SELF)
366 Call(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
367 Add(LVar0, 10)
368 Set(LVar1, 0)
369 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
370 Call(RunToGoal, ACTOR_SELF, 0, FALSE)
371 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_GROOVE_GUY_TWIRL)
372 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_GrooveGuy_Anim0C)
373 Set(LVar0, 0)
374 Loop(30)
375 Add(LVar0, 48)
376 Mod(LVar0, 360)
377 Call(SetActorYaw, ACTOR_SELF, LVar0)
378 Wait(1)
379 EndLoop
380 Call(SetActorYaw, ACTOR_SELF, 0)
381 Call(EnemyTestTarget, ACTOR_SELF, LVar0, 0, 0, 1, BS_FLAGS1_TRIGGER_EVENTS)
385 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_GrooveGuy_Anim0B)
386 Wait(20)
388 Call(EnemyTestTarget, ACTOR_SELF, LVar0, DAMAGE_TYPE_TRIGGER_LUCKY, 0, 0, 0)
389 EndIf
390 Call(UseBattleCamPreset, BTL_CAM_DEFAULT)
391 Call(ResetAllActorSounds, ACTOR_SELF)
392 Call(SetActorSpeed, ACTOR_SELF, Float(6.0))
393 ExecWait(N(EVS_ReturnHome))
394 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_ENABLE)
395 Call(UseIdleAnimation, ACTOR_SELF, TRUE)
396 Return
399 Call(SetGoalToTarget, ACTOR_SELF)
404 Call(WasStatusInflicted, ACTOR_SELF, LVar0)
405 IfEq(LVar0, TRUE)
406 Thread
407 Set(LVar0, 0)
408 Loop(30)
409 Add(LVar0, 48)
410 Mod(LVar0, 360)
411 Call(SetActorYaw, ACTOR_PLAYER, LVar0)
412 Wait(1)
413 EndLoop
414 Call(SetActorYaw, ACTOR_PLAYER, 0)
416 EndIf
417 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_GROOVE_GUY_LEAP)
418 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_GrooveGuy_Anim0B)
419 Set(LVar0, 0)
420 Loop(15)
421 Add(LVar0, 24)
422 Mod(LVar0, 360)
423 Call(SetActorYaw, ACTOR_SELF, LVar0)
424 Wait(1)
425 EndLoop
426 Call(SetActorYaw, ACTOR_SELF, 0)
427 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_GrooveGuy_Anim0C)
428 Call(UseBattleCamPreset, BTL_CAM_DEFAULT)
429 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_GROOVE_GUY_SPIN_DOWN)
430 Thread
431 Set(LVar0, 0)
432 Loop(20)
433 Add(LVar0, 72)
434 Mod(LVar0, 360)
435 Call(SetActorYaw, ACTOR_SELF, LVar0)
436 Wait(1)
437 EndLoop
438 Call(SetActorYaw, ACTOR_SELF, LVar0)
440 Call(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
441 Add(LVar0, 40)
442 Set(LVar1, 0)
443 Call(SetActorJumpGravity, ACTOR_SELF, Float(1.0))
444 Call(SetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
445 Call(JumpToGoal, ACTOR_SELF, 20, FALSE, TRUE, FALSE)
446 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_GrooveGuy_Anim0A)
447 Wait(25)
448 Call(ResetAllActorSounds, ACTOR_SELF)
449 Call(SetActorSpeed, ACTOR_SELF, Float(6.0))
450 ExecWait(N(EVS_ReturnHome))
453 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_ENABLE)
454 Call(UseIdleAnimation, ACTOR_SELF, TRUE)
455 Return
456 End
457};
458
459EvtScript N(EVS_GetAvailableColumn) = {
460 Set(LFlag1, FALSE)
461 Set(LFlag2, FALSE)
462 Set(LFlag3, FALSE)
463 Set(LFlag4, FALSE)
464 Call(CreateHomeTargetList, TARGET_FLAG_2 | TARGET_FLAG_PRIMARY_ONLY)
465 Call(InitTargetIterator)
466 Label(0)
467 Call(GetOwnerTarget, LVar0, LVar5)
468 Call(GetIndexFromHome, LVar0, LVar5)
469 Mod(LVar5, 4)
471 CaseEq(0)
472 Set(LFlag1, TRUE)
473 CaseEq(1)
474 Set(LFlag2, TRUE)
475 CaseEq(2)
476 Set(LFlag3, TRUE)
477 CaseEq(3)
478 Set(LFlag4, TRUE)
480 Call(ChooseNextTarget, ITER_NEXT, LVar0)
482 Goto(0)
483 EndIf
484 IfEq(LFlag1, FALSE)
485 Set(LVarA, 0)
486 Return
487 EndIf
488 IfEq(LFlag2, FALSE)
489 Set(LVarA, 1)
490 Return
491 EndIf
492 IfEq(LFlag3, FALSE)
493 Set(LVarA, 2)
494 Return
495 EndIf
496 IfEq(LFlag4, FALSE)
497 Set(LVarA, 3)
498 Return
499 EndIf
500 Set(LVarA, -1)
501 Return
502 End
503};
504
505EvtScript N(EVS_CountActiveSummoners) = {
506 Set(LVar9, 0)
507 Call(CreateHomeTargetList, TARGET_FLAG_2 | TARGET_FLAG_PRIMARY_ONLY)
508 Call(InitTargetIterator)
509 Label(0)
510 Call(GetOwnerTarget, LVar0, LVar1)
511 Call(GetOriginalActorType, LVar0, LVar2)
513 CaseEq(ACTOR_TYPE_GROOVE_GUY)
514 Call(GetStatusFlags, LVar0, LVar3)
516 Call(GetActorVar, LVar0, AVAR_Generation, LVar3)
517 IfNe(LVar3, 2)
518 Add(LVar9, 1)
519 EndIf
520 EndIf
522 Call(ChooseNextTarget, ITER_NEXT, LVar0)
524 Goto(0)
525 EndIf
526 Return
527 End
528};
529
530EvtScript N(EVS_TakeTurn) = {
531 Call(GetActorVar, ACTOR_SELF, AVAR_Generation, LVar0)
532 IfEq(LVar0, 2)
533 Call(RandInt, 100, LVar0)
534 IfLt(LVar0, 60)
535 Call(GetStatusFlags, ACTOR_PLAYER, LVar0)
537 ExecWait(N(EVS_Attack_Tackle))
538 Else
539 ExecWait(N(EVS_Attack_SleepySpin))
540 EndIf
541 Else
542 ExecWait(N(EVS_Attack_Tackle))
543 EndIf
544 Return
545 EndIf
546 ExecWait(N(EVS_GetAvailableColumn))
547 IfEq(LVarA, -1)
548 Call(RandInt, 100, LVar0)
549 IfLt(LVar0, 60)
550 Call(GetStatusFlags, ACTOR_PLAYER, LVar0)
552 ExecWait(N(EVS_Attack_Tackle))
553 Else
554 ExecWait(N(EVS_Attack_SleepySpin))
555 EndIf
556 Else
557 ExecWait(N(EVS_Attack_Tackle))
558 EndIf
559 Return
560 EndIf
561 ExecWait(N(EVS_CountActiveSummoners))
563 CaseEq(1)
564 Call(RandInt, 1000, LVar0)
565 IfLt(LVar0, 300)
566 ExecWait(N(EVS_RandomSummon))
567 Return
568 EndIf
569 CaseEq(2)
570 Call(RandInt, 1000, LVar0)
571 IfLt(LVar0, 150)
572 ExecWait(N(EVS_RandomSummon))
573 Return
574 EndIf
575 CaseEq(3)
576 Call(RandInt, 1000, LVar0)
577 IfLt(LVar0, 100)
578 ExecWait(N(EVS_RandomSummon))
579 Return
580 EndIf
582 Call(RandInt, 100, LVar0)
583 IfLt(LVar0, 60)
584 Call(GetStatusFlags, ACTOR_PLAYER, LVar0)
586 ExecWait(N(EVS_Attack_Tackle))
587 Else
588 ExecWait(N(EVS_Attack_SleepySpin))
589 EndIf
590 Else
591 ExecWait(N(EVS_Attack_Tackle))
592 EndIf
593 Return
594 End
595};
596
597EvtScript N(EVS_RandomSummon) = {
598 Call(UseBattleCamPreset, BTL_CAM_MIDPOINT_NORMAL)
599 Call(BattleCamTargetActor, ACTOR_SELF)
600 Call(RandInt, 2, LVar1)
602 CaseEq(0)
603 ExecWait(N(EVS_SummonShyGuy))
604 CaseEq(1)
605 ExecWait(N(EVS_SummonGrooveGuy))
606 CaseEq(2)
607 ExecWait(N(EVS_SummonMediGuy))
609 Call(UseBattleCamPreset, BTL_CAM_DEFAULT)
610 Call(SetIdleAnimations, ACTOR_SELF, PRT_MAIN, Ref(N(DefaultAnims)))
611 Return
612 End
613};
614
615API_CALLABLE(N(SpawnSpinFX)) {
616 Bytecode* args = script->ptrReadPos;
617 s32 x, y, z;
618 f32 scale;
619 s32 duration;
620
621 x = evt_get_variable(script, *args++);
622 y = evt_get_variable(script, *args++);
623 z = evt_get_variable(script, *args++);
624 scale = evt_get_float_variable(script, *args++);
625 duration = evt_get_variable(script, *args++);
626
627 N(DummyPlayerStatus).pos.x = x;
628 N(DummyPlayerStatus).pos.y = y;
629 N(DummyPlayerStatus).pos.z = z;
630 fx_effect_46(6, &N(DummyPlayerStatus), scale, duration);
631
632 return ApiStatus_DONE2;
633}
634
635EvtScript N(EVS_PerformSummonDance) = {
636 Thread
637 Wait(1)
638 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_CALL_FOR_BACKUP)
640 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_GrooveGuy_Anim0C)
641 Wait(4)
642 Thread
643 Wait(1)
644 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_CALL_FOR_BACKUP)
646 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_GrooveGuy_Anim0B)
647 Wait(4)
648 Thread
649 Wait(1)
650 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_CALL_FOR_BACKUP)
652 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_GrooveGuy_Anim0C)
653 Wait(4)
654 Thread
655 Wait(1)
656 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_CALL_FOR_BACKUP)
658 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_GrooveGuy_Anim0D)
659 Wait(4)
660 Thread
661 Wait(1)
662 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_CALL_FOR_BACKUP)
664 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_GrooveGuy_Anim0C)
665 Wait(4)
666 Thread
667 Wait(1)
668 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_CALL_FOR_BACKUP)
670 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_GrooveGuy_Anim0B)
671 Wait(4)
672 Thread
673 Wait(1)
674 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_CALL_FOR_BACKUP)
676 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_GrooveGuy_Anim0C)
677 Wait(4)
678 Thread
679 Wait(1)
680 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_CALL_FOR_BACKUP)
682 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_GrooveGuy_Anim0D)
683 Wait(4)
684 Thread
685 Wait(1)
686 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_CALL_FOR_BACKUP)
688 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_GrooveGuy_Anim0C)
689 Call(GetStatusFlags, ACTOR_SELF, LVar3)
691 SetF(LVar3, Float(1.0))
692 Else
693 SetF(LVar3, Float(0.4))
694 EndIf
695 Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
696 Call(N(SpawnSpinFX), LVar0, LVar1, LVar2, LVar3, 48)
697 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_GROOVE_GUY_SUMMON)
698 Set(LVar0, 0)
699 Loop(48)
700 Add(LVar0, 30)
701 IfGe(LVar0, 360)
702 Sub(LVar0, 360)
703 EndIf
704 Call(SetActorRotation, ACTOR_SELF, 0, LVar0, 0)
705 Wait(1)
706 EndLoop
707 Call(SetActorRotation, ACTOR_SELF, 0, 0, 0)
708 Call(GetActorPos, ACTOR_SELF, LVar0, LVar1, LVar2)
709 Add(LVar1, 30)
710 PlayEffect(EFFECT_SPARKLES, 0, LVar0, LVar1, LVar2, 30, 0)
711 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_RECOVER_HEART)
712 Call(SetAnimation, ACTOR_SELF, PRT_MAIN, ANIM_GrooveGuy_Anim0A)
713 Wait(8)
714 Return
715 End
716};
717
718EvtScript N(EVS_SummonShyGuy) = {
719 Call(UseIdleAnimation, ACTOR_SELF, FALSE)
720 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_DISABLE)
721 ExecWait(N(EVS_PerformSummonDance))
722 Call(SummonEnemy, Ref(N(ShyGuyFormation)), FALSE)
723 Set(LVarB, LVar0)
724 Set(LVar0, 200)
725 Set(LVar1, 0)
726 Set(LVar2, 0)
727 Call(SetActorPos, LVarB, LVar0, LVar1, LVar2)
728 Call(SetAnimation, LVarB, PRT_MAIN, ANIM_ShyGuy_Red_Anim04)
729 Call(UseBattleCamPreset, BTL_CAM_VIEW_ENEMIES)
730 Call(BattleCamTargetActor, ACTOR_SELF)
731 Call(SetGoalToIndex, LVarB, LVarA)
733 Call(SetActorSounds, ACTOR_SELF, ACTOR_SOUND_WALK_INCREMENT, 10, 0)
734 Call(SetActorSpeed, LVarB, Float(4.0))
735 Call(RunToGoal, LVarB, 0, FALSE)
736 Call(SetAnimation, LVarB, PRT_MAIN, ANIM_ShyGuy_Red_Anim01)
737 Call(GetActorPos, LVarB, LVar0, LVar1, LVar2)
738 Call(ForceHomePos, LVarB, LVar0, LVar1, LVar2)
739 Call(HPBarToHome, LVarB)
740 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_ENABLE)
741 Call(UseIdleAnimation, ACTOR_SELF, TRUE)
742 Return
743 End
744};
745
746EvtScript N(EVS_SummonGrooveGuy) = {
747 Call(UseIdleAnimation, ACTOR_SELF, FALSE)
748 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_DISABLE)
749 ExecWait(N(EVS_PerformSummonDance))
750 Call(UseBattleCamPreset, BTL_CAM_VIEW_ENEMIES)
751 Call(BattleCamTargetActor, ACTOR_SELF)
752 Call(SummonEnemy, Ref(N(GrooveGuyFormation)), FALSE)
753 Set(LVarB, LVar0)
754 Call(SetAnimation, LVarB, PRT_MAIN, ANIM_GrooveGuy_Anim0C)
755 Call(SetGoalToIndex, LVarB, LVarA)
756 Call(GetGoalPos, LVarB, LVar3, LVar4, LVar5)
757 Add(LVar3, 200)
758 Call(SetActorPos, LVarB, LVar3, LVar4, LVar5)
759 Thread
760 Set(LVar6, 0)
761 Loop(50)
762 Add(LVar6, 30)
763 Mod(LVar6, 360)
764 Call(SetActorYaw, LVarB, LVar6)
765 Wait(1)
766 EndLoop
767 Call(SetActorYaw, LVarB, 0)
770 Thread
771 Loop(2)
772 Call(PlaySoundAtActor, LVarB, SOUND_GROOVE_GUY_TWIRL)
773 Wait(25)
774 EndLoop
776 Call(SetActorSpeed, LVarB, Float(4.0))
777 Call(RunToGoal, LVarB, 0, FALSE)
778 Call(PlaySoundAtActor, ACTOR_SELF, SOUND_SMALL_LENS_FLARE)
779 Call(SetAnimation, LVarB, PRT_MAIN, ANIM_GrooveGuy_Anim0A)
780 Call(GetActorPos, LVarB, LVar0, LVar1, LVar2)
781 Add(LVar1, 20)
782 PlayEffect(EFFECT_LENS_FLARE, 0, LVar0, LVar1, LVar2, 30, 0)
783 Call(GetActorPos, LVarB, LVar0, LVar1, LVar2)
784 Call(ForceHomePos, LVarB, LVar0, LVar1, LVar2)
785 Wait(25)
786 Call(SetAnimation, LVarB, PRT_MAIN, ANIM_GrooveGuy_Anim01)
787 Call(HPBarToHome, LVarB)
788 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_ENABLE)
789 Call(UseIdleAnimation, ACTOR_SELF, TRUE)
790 Call(GetActorVar, ACTOR_SELF, AVAR_Generation, LVar0)
792 CaseEq(0)
793 Call(SetActorVar, LVarB, AVAR_Generation, 1)
794 CaseEq(1)
795 Call(SetActorVar, LVarB, AVAR_Generation, 2)
797 Return
798 End
799};
800
801EvtScript N(EVS_SummonMediGuy) = {
802 Call(UseIdleAnimation, ACTOR_SELF, FALSE)
803 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_DISABLE)
804 ExecWait(N(EVS_PerformSummonDance))
805 Call(SummonEnemy, Ref(N(MediGuyFormation)), FALSE)
806 Set(LVarB, LVar0)
807 Call(SetAnimation, LVarB, PRT_MAIN, ANIM_MediGuy_Anim05)
808 Add(LVarA, 4)
809 Call(SetGoalToIndex, LVarB, LVarA)
810 Call(GetGoalPos, LVarB, LVar3, LVar4, LVar5)
811 Set(LVar0, 200)
812 Set(LVar1, LVar4)
813 Set(LVar2, LVar5)
814 Call(SetActorPos, LVarB, LVar0, LVar1, LVar2)
816 Call(UseBattleCamPreset, BTL_CAM_VIEW_ENEMIES)
817 Call(BattleCamTargetActor, ACTOR_SELF)
818 Call(SetActorSpeed, LVarB, Float(4.0))
819 Call(RunToGoal, LVarB, 0, FALSE)
820 Call(SetAnimation, LVarB, PRT_MAIN, ANIM_MediGuy_Anim01)
821 Call(GetActorPos, LVarB, LVar0, LVar1, LVar2)
822 Call(ForceHomePos, LVarB, LVar0, LVar1, LVar2)
823 Call(HPBarToHome, LVarB)
824 Call(EnableIdleScript, ACTOR_SELF, IDLE_SCRIPT_ENABLE)
825 Call(UseIdleAnimation, ACTOR_SELF, TRUE)
826 Return
827 End
828};
829
830Vec3i N(SummonPos) = { NPC_DISPOSE_LOCATION };
831
832Formation N(ShyGuyFormation) = {
833 ACTOR_BY_POS(A(red_shy_guy), N(SummonPos), 100),
834};
835
836Formation N(GrooveGuyFormation) = {
837 ACTOR_BY_POS(NAMESPACE, N(SummonPos), 100),
838};
839
840Formation N(MediGuyFormation) = {
841 ACTOR_BY_POS(A(medi_guy), N(SummonPos), 100),
842};
Bytecode EvtScript[]
#define STATUS_FLAGS_IMMOBILIZED
Definition enums.h:2834
@ BTL_CAM_XADJ_AVG
Definition enums.h:4900
@ ACTOR_SOUND_WALK
Definition enums.h:2034
@ ACTOR_SOUND_WALK_INCREMENT
Definition enums.h:2038
@ ACTOR_SOUND_JUMP
Definition enums.h:2036
@ BS_FLAGS1_TRIGGER_EVENTS
Definition enums.h:3575
@ BS_FLAGS1_INCLUDE_POWER_UPS
Definition enums.h:3571
@ ELEMENT_END
Definition enums.h:2114
@ ELEMENT_SHOCK
Definition enums.h:2125
@ ELEMENT_NORMAL
Definition enums.h:2115
@ ITER_NO_MORE
Definition enums.h:2030
@ ITER_NEXT
Definition enums.h:2025
@ ACTOR_EVENT_FLAGS_NONE
Definition enums.h:3370
@ ACTOR_DECORATION_SWEAT
Definition enums.h:2045
@ STATUS_KEY_PARALYZE
Definition enums.h:2201
@ STATUS_TURN_MOD_DEFAULT
Definition enums.h:2227
@ STATUS_TURN_MOD_PARALYZE
Definition enums.h:2234
@ STATUS_KEY_FROZEN
Definition enums.h:2203
@ STATUS_TURN_MOD_SLEEP
Definition enums.h:2228
@ STATUS_TURN_MOD_DIZZY
Definition enums.h:2232
@ STATUS_KEY_STATIC
Definition enums.h:2207
@ STATUS_END
Definition enums.h:2196
@ STATUS_TURN_MOD_POISON
Definition enums.h:2233
@ STATUS_KEY_FEAR
Definition enums.h:2199
@ STATUS_TURN_MOD_STOP
Definition enums.h:2237
@ STATUS_KEY_SLEEP
Definition enums.h:2202
@ STATUS_KEY_STONE
Definition enums.h:2208
@ STATUS_KEY_STOP
Definition enums.h:2204
@ STATUS_TURN_MOD_FROZEN
Definition enums.h:2230
@ STATUS_KEY_SHRINK
Definition enums.h:2206
@ STATUS_KEY_DIZZY
Definition enums.h:2200
@ STATUS_KEY_POISON
Definition enums.h:2205
@ STATUS_TURN_MOD_STATIC
Definition enums.h:2229
@ STATUS_TURN_MOD_FEAR
Definition enums.h:2231
@ STATUS_KEY_NORMAL
Definition enums.h:2197
@ STATUS_TURN_MOD_SHRINK
Definition enums.h:2235
@ STATUS_KEY_DEFAULT
Definition enums.h:2198
@ HIT_RESULT_NO_DAMAGE
Definition enums.h:1952
@ HIT_RESULT_HIT
Definition enums.h:1950
@ HIT_RESULT_LUCKY
Definition enums.h:1955
@ HIT_RESULT_MISS
Definition enums.h:1956
@ BTL_CAM_MIDPOINT_NORMAL
Definition enums.h:4833
@ BTL_CAM_DEFAULT
Definition enums.h:4824
@ BTL_CAM_ENEMY_APPROACH
Definition enums.h:4885
@ BTL_CAM_VIEW_ENEMIES
Definition enums.h:4825
@ TARGET_FLAG_PRIMARY_ONLY
Definition enums.h:1863
@ TARGET_FLAG_2
Definition enums.h:1850
@ IDLE_SCRIPT_ENABLE
Definition enums.h:6408
@ IDLE_SCRIPT_DISABLE
Definition enums.h:6407
@ STATUS_FLAG_SHRINK
Definition enums.h:2819
@ STATUS_FLAG_DIZZY
Definition enums.h:2818
@ STATUS_FLAG_SLEEP
Definition enums.h:2812
@ SOUND_NONE
Definition enums.h:547
@ SOUND_GROOVE_GUY_SUMMON
Definition enums.h:1064
@ SOUND_SMALL_LENS_FLARE
Definition enums.h:1529
@ SOUND_RECOVER_HEART
Definition enums.h:1406
@ SOUND_GROOVE_GUY_SPIN_DOWN
Definition enums.h:1062
@ SOUND_ACTOR_HOP
Definition enums.h:1073
@ SOUND_GROOVE_GUY_TWIRL
Definition enums.h:1060
@ SOUND_ACTOR_STEP_A
Definition enums.h:1474
@ SOUND_ACTOR_STEP_B
Definition enums.h:1250
@ SOUND_GROOVE_GUY_LEAP
Definition enums.h:1061
@ SOUND_SHY_GUY_FLY
Definition enums.h:1199
@ SOUND_CALL_FOR_BACKUP
Definition enums.h:1063
@ ACTOR_PLAYER
Definition enums.h:2085
@ ACTOR_SELF
Definition enums.h:2084
@ BTL_CAM_YADJ_TARGET
Definition enums.h:4905
@ EVENT_HIT
Definition enums.h:2132
@ EVENT_SCARE_AWAY
Definition enums.h:2174
@ EVENT_BURN_HIT
Definition enums.h:2136
@ EVENT_IMMUNE
Definition enums.h:2146
@ EVENT_BURN_DEATH
Definition enums.h:2157
@ EVENT_ZERO_DAMAGE
Definition enums.h:2144
@ EVENT_SHOCK_DEATH
Definition enums.h:2159
@ EVENT_SPIN_SMASH_HIT
Definition enums.h:2133
@ EVENT_SPIN_SMASH_DEATH
Definition enums.h:2154
@ EVENT_HIT_COMBO
Definition enums.h:2131
@ EVENT_AIR_LIFT_FAILED
Definition enums.h:2152
@ EVENT_BEGIN_AIR_LIFT
Definition enums.h:2175
@ EVENT_DEATH
Definition enums.h:2153
@ EVENT_SHOCK_HIT
Definition enums.h:2165
@ EVENT_RECOVER_STATUS
Definition enums.h:2167
@ EVENT_BLOW_AWAY
Definition enums.h:2143
@ ACTOR_PART_FLAG_PRIMARY_TARGET
Definition enums.h:3362
@ DAMAGE_TYPE_STATUS_ALWAYS_HITS
Definition enums.h:2880
@ DAMAGE_TYPE_TRIGGER_LUCKY
Definition enums.h:2881
#define ApiStatus_DONE2
Definition evt.h:118
s32 Bytecode
Definition evt.h:7
s32 evt_get_variable(Evt *script, Bytecode var)
Definition evt.c:1690
f32 evt_get_float_variable(Evt *script, Bytecode var)
Definition evt.c:1930
EvtScript EVS_Enemy_ReturnHome
EvtScript EVS_Enemy_Knockback
EvtScript EVS_Enemy_ScareAway
EvtScript EVS_Enemy_Hit
EvtScript EVS_Enemy_Death
EvtScript EVS_Enemy_SpinSmashHit
EvtScript EVS_Enemy_ShockHit
EvtScript EVS_Enemy_AirLift
EvtScript EVS_Enemy_BlowAway
EvtScript EVS_Enemy_Recover
EvtScript EVS_Enemy_BurnHit
EvtScript EVS_Enemy_NoDamageHit
ApiStatus RandInt(Evt *script, b32 isInitialCall)
#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 LVar6
Definition macros.h:154
#define Ref(sym)
Address/pointer constant.
Definition macros.h:60
#define IfGe(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR >= RVAR.
Definition macros.h:284
#define Set(VAR, INT_VALUE)
Sets the given variable to a given value casted to an integer.
Definition macros.h:365
#define CaseEq(RVAR)
Marks the start of a switch case that executes only if LVAR == RVAR. It also marks the end of any pre...
Definition macros.h:319
#define Sub(VAR, INT_VALUE)
Definition macros.h:377
#define LFlag4
Definition macros.h:171
#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 Mod(VAR, INT_VALUE)
Definition macros.h:380
#define Add(VAR, INT_VALUE)
Definition macros.h:376
#define EndLoop
Marks the end of a loop.
Definition macros.h:248
#define EndCaseGroup
Marks the end of a switch case group (CaseOrEq and/or CaseAndEq), stopping fallthrough.
Definition macros.h:352
#define Goto(LABEL_ID)
Moves execution to the given label.
Definition macros.h:232
#define BSS
Definition macros.h:7
#define ARRAY_COUNT(arr)
Definition macros.h:40
#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 LFlag1
Definition macros.h:168
#define Label(LABEL_ID)
Marks this point in the script as a Goto target.
Definition macros.h:227
#define CaseOrEq(RVAR)
Marks the start of a switch case that executes only if LVAR == RVAR.
Definition macros.h:341
#define EndIf
Marks the end of an if statement or an else block.
Definition macros.h:298
#define LVar5
Definition macros.h:153
#define CaseDefault
Marks the start of a switch case that executes unconditionally. It also marks the end of any previous...
Definition macros.h:337
#define LVarB
Definition macros.h:159
#define ExecWait(EVT_SOURCE)
Launches a new child thread.
Definition macros.h:475
#define Thread
Marks the start of a thread block.
Definition macros.h:544
#define EndThread
Marks the end of a thread block.
Definition macros.h:547
#define SetF(VAR, FLOAT_VALUE)
Sets the given variable to a given value, but supports Floats.
Definition macros.h:373
#define IfFlag(LVAR, RVAR)
Marks the beginning of an if statement that only executes if the RVAR flag is set on LVAR,...
Definition macros.h:288
#define LVar2
Definition macros.h:150
#define DMG_STATUS_KEY(typeFlag, duration, chance)
Definition macros.h:224
#define LVar1
Definition macros.h:149
#define LVarA
Definition macros.h:158
#define IfNotFlag(LVAR, RVAR)
Marks the beginning of an if statement that only executes if the RVAR flag is unset on LVAR,...
Definition macros.h:292
#define Wait(NUM_FRAMES)
Blocks for the given number of frames.
Definition macros.h:254
#define LFlag2
Definition macros.h:169
#define LVar9
Definition macros.h:157
#define NPC_DISPOSE_LOCATION
Definition macros.h:158
#define A(sym)
Definition macros.h:36
#define PlayEffect(args...)
Definition macros.h:807
#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 Call(FUNC, ARGS...)
Calls a given C EVT API function with any number of arguments.
Definition macros.h:576
#define LFlag3
Definition macros.h:170
#define Loop(TIMES)
Marks the beginning of a loop.
Definition macros.h:245
#define LVar4
Definition macros.h:152
#define LVar3
Definition macros.h:151
#define LVar0
Definition macros.h:148
#define SetConst(VAR, CONST)
Sets the given variable to a given value, skipping the evt_get_variable call.
Definition macros.h:370
#define Return
Kills the current EVT thread.
Definition macros.h:217
#define ACTOR_BY_POS(_name, _pos, _priority, args...)
Definition battle.h:230
FormationRow Formation[]
Definition battle.h:167