Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
GrooveGuyAI.inc.c File Reference

Go to the source code of this file.

Functions

void N GrooveGuyAI_02 (Evt *script, MobileAISettings *aiSettings, EnemyDetectVolume *territory)
 
void N GrooveGuyAI_03 (Evt *script, MobileAISettings *aiSettings, EnemyDetectVolume *territory)
 

Function Documentation

◆ GrooveGuyAI_02()

void N GrooveGuyAI_02 ( Evt * script,
MobileAISettings * aiSettings,
EnemyDetectVolume * territory )

Definition at line 5 of file GrooveGuyAI.inc.c.

5 {
6 Enemy* enemy = script->owner1.enemy;
7 Npc* npc = get_npc_unsafe(enemy->npcID);
8
9 npc->duration = 0;
10 set_npc_yaw(npc, 270.0f);
11 enemy->varTable[0] = 0;
12 script->functionTemp[0] = 3;
13}
union Evt::@8 owner1
Initially -1.
s16 npcID
Definition npc.h:300
Npc * get_npc_unsafe(s32 npcID)
Definition npc.c:995
void set_npc_yaw(Npc *npc, f32 yaw)
Definition npc.c:1246
Definition npc.h:294
s16 duration

◆ GrooveGuyAI_03()

void N GrooveGuyAI_03 ( Evt * script,
MobileAISettings * aiSettings,
EnemyDetectVolume * territory )

Definition at line 15 of file GrooveGuyAI.inc.c.

15 {
16 Enemy* enemy = script->owner1.enemy;
17 Npc* npc = get_npc_unsafe((s32) enemy->npcID);
18 s32 phase;
19
20 switch (enemy->varTable[0]) {
21 case 0:
22 enemy->varTable[0] = 1;
23 enemy->varTable[1] = 0;
24 npc->curAnim = ANIM_GrooveGuy_Anim0C;
25 set_npc_yaw(npc, 270.0f);
26 npc->rot.y = 0.0f;
27 // fallthrough
28 case 1:
29 phase = enemy->varTable[1] % 16;
30 if (phase < 4) {
31 npc->curAnim = ANIM_GrooveGuy_Anim0C;
32 } else if (phase < 8) {
33 npc->curAnim = ANIM_GrooveGuy_Anim0B;
34 } else if (phase < 12) {
35 npc->curAnim = ANIM_GrooveGuy_Anim0C;
36 } else if (phase < 16) {
37 npc->curAnim = ANIM_GrooveGuy_Anim0D;
38 }
39 enemy->varTable[1]++;
40 if (enemy->varTable[1] >= 0x41) {
41 enemy->varTable[0] = 2;
42 }
43 break;
44 case 2:
45 enemy->varTable[0] = 3;
46 enemy->varTable[1] = 0;
47 npc->rot.y = 0.0f;
48 npc->curAnim = ANIM_GrooveGuy_Anim0C;
49 // fallthrough
50 case 3:
51 npc->rot.y += 35.0;
52 if (npc->rot.y > 360.0) {
53 npc->rot.y -= 360.0;
54 }
55 enemy->varTable[1]++;
56 if (enemy->varTable[1] >= 0x2E) {
57 enemy->varTable[0] = 4;
58 }
59 break;
60 }
61 if (enemy->varTable[0] == 4) {
62 npc->rot.y = 0.0f;
63 set_npc_yaw(npc, 270.0f);
64 script->functionTemp[0] = 0;
65 }
66}
AnimID curAnim
Vec3f rot