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

Go to the source code of this file.

Macros

#define _AI_FIRE_BAR_INC_   0
 

Enumerations

enum  { FIRE_BAR_SLOW_DOWN = 0 , FIRE_BAR_SPEED_UP = 1 , FIRE_BAR_HIT = 2 }
 

Functions

void N FireBarAI_Callback (FireBarData *data, s32 mode)
 

Macro Definition Documentation

◆ _AI_FIRE_BAR_INC_

#define _AI_FIRE_BAR_INC_   0

Definition at line 2 of file FireBarAI.inc.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
FIRE_BAR_SLOW_DOWN 
FIRE_BAR_SPEED_UP 
FIRE_BAR_HIT 

Definition at line 10 of file FireBarAI.inc.c.

10 {
13 FIRE_BAR_HIT = 2,
14};
@ FIRE_BAR_HIT
@ FIRE_BAR_SPEED_UP
@ FIRE_BAR_SLOW_DOWN

Function Documentation

◆ FireBarAI_Callback()

void N FireBarAI_Callback ( FireBarData * data,
s32 mode )

Definition at line 143 of file FireBarAI.inc.c.

143 {
144 switch (mode) {
146 if (data->flags & 2) {
147 data->rotRate *= 0.95f;
148 }
149 break;
151 data->rotRate *= 1.12f;
152 if (data->soundIndex == 10) {
153 Evt* script = start_script(&N(EVS_FireBar_Defeated), EVT_PRIORITY_1, 0);
154 script->varTable[0] = data->firstNpc;
155 script->varTable[1] = data->npcCount;
156 data->flags |= 2;
157 }
158 break;
159 case FIRE_BAR_HIT:
160 data->rotRate = abs(data->settings->rotRate) * signF(-data->rotRate);
161 break;
162 }
163 return;
164}
@ EVT_PRIORITY_1
Definition evt.h:152
f32 signF(f32 val)
Definition 43F0.c:557
Evt * start_script(EvtScript *source, s32 priority, s32 initialState)
s32 npcCount
Definition npc.h:135
s32 firstNpc
Definition npc.h:134
FireBarAISettings * settings
Definition npc.h:140
f32 rotRate
Definition npc.h:133
s32 flags
Definition npc.h:131
s32 soundIndex
Definition npc.h:137