11#define ENEMY_FLAG_COMBINATION (ENEMY_FLAG_IGNORE_PARTNER | ENEMY_FLAG_CANT_INTERACT | \
12 ENEMY_FLAG_IGNORE_HAMMER | ENEMY_FLAG_IGNORE_JUMP | ENEMY_FLAG_IGNORE_TOUCH | ENEMY_FLAG_SKIP_BATTLE)
19 Enemy* enemy = script->owner1.enemy;
25 npc->
flags &= ~NPC_FLAG_INVISIBLE;
27 script->AI_TEMP_STATE = 1;
32 Enemy* enemy = script->owner1.enemy;
36 npc->
alpha = N(MagikoopaAI_TeleportAnim)[npc->
duration].alpha;
44 if (N(MagikoopaAI_TeleportAnim)[npc->
duration].alpha == 0) {
50 script->AI_TEMP_STATE = 5;
56 f32 angle = (
rand_int(100) % 2) * 180.0f;
60 npc->
yaw = angle + 90.0f;
61 script->AI_TEMP_STATE = 6;
65 Enemy* enemy = script->owner1.enemy;
71 script->AI_TEMP_STATE = 10;
76 Enemy* enemy = script->owner1.enemy;
81 enemy->varTable[0] = 1;
84 npc->
flags &= ~NPC_FLAG_INVISIBLE;
92 posY = npc->
pos.
y + 100.0;
98 script->AI_TEMP_STATE = 0xB;
102 Enemy* enemy = script->owner1.enemy;
107 if (enemy->varTable[0] == 0) {
127 enemy->
flags &= ~ENEMY_FLAG_COMBINATION;
129 if (enemy->varTable[0] == 0) {
136 script->AI_TEMP_STATE = 20;
143 script->AI_TEMP_STATE = 20;
148 Enemy* enemy = script->owner1.enemy;
152 script->AI_TEMP_STATE = 21;
156 Enemy* enemy = script->owner1.enemy;
158 f32 posX, posY, posZ;
164 fx_emote(2, npc, 0.0f, npc->
collisionHeight, 1.0f, 2.0f, -20.0f, 12, &emoteTemp);
167 script->AI_TEMP_STATE = 0;
174 posY = npc->
pos.
y + 32.0f;
175 posZ = npc->
pos.
z + 1.0f;
177 fx_gather_energy_pink(0, posX, posY, posZ, 0.1f, 0xD);
179 script->AI_TEMP_STATE = 0x16;
184 Enemy* temp_s0 = script->owner1.enemy;
191 script->AI_TEMP_STATE = 0x17;
196 Enemy* enemy = script->owner1.enemy;
204 if (projectileEnemy != 1) {
205 fx_emote(2, npc, 0.0f, npc->
collisionHeight, 1.0f, 2.0f, -20.0f, 0xC, &emoteTemp);
208 script->AI_TEMP_STATE = 0;
213 script->AI_TEMP_STATE = 0x18;
219 Enemy* enemy = script->owner1.enemy;
226 script->AI_TEMP_STATE = 0;
230API_CALLABLE(N(MagikoopaAI_Main)) {
231 Enemy* enemy = script->owner1.enemy;
235 Bytecode* args = script->ptrReadPos;
253 npc->
flags &= ~NPC_FLAG_JUMPING;
258 enemy->
aiFlags &= ~AI_FLAG_SUSPEND;
265 script->AI_TEMP_STATE = 0;
268 switch (script->AI_TEMP_STATE) {
271 if (script->AI_TEMP_STATE != 1) {
309API_CALLABLE(N(MagikoopaAI_OnPlayerWon)) {
310 Enemy* enemy = script->owner1.enemy;
318API_CALLABLE(N(MagikoopaAI_OnPlayerFled)) {
319 Enemy* enemy = script->owner1.enemy;
325 script->functionTemp[0] = 0;
329API_CALLABLE(N(MagikoopaAI_OnHitInit)) {
330 Enemy* enemy = script->owner1.enemy;
336API_CALLABLE(N(MagikoopaAI_OnHit)) {
337 Enemy* enemy = script->owner1.enemy;
340 if (enemy->varTable[0] == 2) {
void N MagikoopaAI_00(Evt *script, MobileAISettings *aiSettings, EnemyDetectVolume *territory)
void N MagikoopaAI_23(Evt *script, MobileAISettings *aiSettings, EnemyDetectVolume *territory)
void N MagikoopaAI_01(Evt *script, MobileAISettings *aiSettings, EnemyDetectVolume *territory)
void N MagikoopaAI_10(Evt *script, MobileAISettings *aiSettings, EnemyDetectVolume *territory)
#define ENEMY_FLAG_COMBINATION
void N MagikoopaAI_05(Evt *script, MobileAISettings *aiSettings, EnemyDetectVolume *territory)
void N MagikoopaAI_22(Evt *script, MobileAISettings *aiSettings, EnemyDetectVolume *territory)
void N MagikoopaAI_11(Evt *script, MobileAISettings *aiSettings, EnemyDetectVolume *territory)
void N MagikoopaAI_06(Evt *script, MobileAISettings *aiSettings, EnemyDetectVolume *territory)
void N MagikoopaAI_21(Evt *script, MobileAISettings *aiSettings, EnemyDetectVolume *territory)
void N MagikoopaAI_24(Evt *script, MobileAISettings *aiSettings, EnemyDetectVolume *territory)
void N MagikoopaAI_20(Evt *script, MobileAISettings *aiSettings, EnemyDetectVolume *territory)
s32 N MagikoopaAI_CanShootSpell(Evt *script, f32 arg1, f32 arg2, EnemyDetectVolume *territory)
#define npc_raycast_down_sides
@ ENEMY_FLAG_ACTIVE_WHILE_OFFSCREEN
@ NPC_FLAG_FLIP_INSTANTLY
s32 evt_get_variable(Evt *script, Bytecode var)
void ai_enemy_play_sound(Npc *npc, s32 arg1, s32 arg2)
s32 evt_set_variable(Evt *script, Bytecode var, s32 value)
f32 dist2D(f32 ax, f32 ay, f32 bx, f32 by)
void add_vec2D_polar(f32 *x, f32 *y, f32 r, f32 theta)
enum TerritoryShape shape
enum TerritoryShape detectShape
Enemy * get_enemy(s32 npcID)
Looks for an enemy matching the specified npcID.
void enable_npc_shadow(Npc *npc)
void disable_npc_shadow(Npc *npc)
Npc * get_npc_unsafe(s32 npcID)
EncounterStatus gCurrentEncounter
void npc_move_heading(Npc *npc, f32 speed, f32 yaw)
s32 skipPlayerDetectChance
EnemyTerritoryWander wander
EnemyTerritory * territory
void set_npc_imgfx_all(s32 spriteIdx, ImgFXType imgfxType, s32 imgfxArg1, s32 imgfxArg2, s32 imgfxArg3, s32 imgfxArg4, s32 imgfxArg5)
PlayerStatus * gPlayerStatusPtr