6#include "sprite/npc/Spiny.h"
11API_CALLABLE(N(SpinyAI_Main)) {
12 Enemy* enemy = script->owner1.enemy;
36 if (isInitialCall || (enemy->varTable[10] == 100)) {
37 script->AI_TEMP_STATE = 100;
40 npc->
flags &= ~NPC_FLAG_JUMPING;
42 npc->
flags &= ~NPC_FLAG_GRAVITY;
44 enemy->varTable[10] = 0;
45 enemy->varTable[11] = -1;
54 enemy->
aiFlags &= ~AI_FLAG_SUSPEND;
56 npc->
curAnim = ANIM_Spiny_Anim18;
60 script->AI_TEMP_STATE = 102;
65 script->functionTemp[1] = 0;
66 script->AI_TEMP_STATE = 200;
70 if (script->AI_TEMP_STATE < 100 && x + 50 >= 421) {
71 script->AI_TEMP_STATE = 110;
74 switch (script->AI_TEMP_STATE) {
78 if (enemy->varTable[13] != 0) {
79 if (npc->
pos.
y <= 0.0) {
80 npc->
flags &= ~NPC_FLAG_GRAVITY;
84 npc->
flags &= ~NPC_FLAG_FLYING;
110 if (enemy->varTable[10] != 2) {
114 if (npc2->
yaw < 180.0) {
123 npc->
flags &= ~NPC_FLAG_INVISIBLE;
124 npc->
flags &= ~NPC_FLAG_GRAVITY;
126 npc->
curAnim = ANIM_Spiny_Anim18;
127 script->AI_TEMP_STATE = 101;
129 if (enemy->varTable[10] != 3) {
132 enemy->varTable[10] = 4;
138 script->AI_TEMP_STATE = 102;
153 y2 = npc->
pos.
y + 13.0;
164 enemy->varTable[10] = 5;
165 if (enemy->varTable[13] != 0) {
166 if (npc->
pos.
y <= 0.0) {
167 npc->
flags &= ~NPC_FLAG_GRAVITY;
171 npc->
flags &= ~NPC_FLAG_FLYING;
175 npc->
flags &= ~NPC_FLAG_FLYING;
177 npc->
flags &= ~NPC_FLAG_GRAVITY;
181 npc->
flags &= ~NPC_FLAG_JUMPING;
184 npc->
curAnim = ANIM_Spiny_Anim1A;
186 script->AI_TEMP_STATE = 103;
196 npc->
flags &= ~NPC_FLAG_IGNORE_CAMERA_FOR_YAW;
197 npc->
curAnim = ANIM_Spiny_Anim01;
198 script->AI_TEMP_STATE = 0;
207 npc->
flags &= ~NPC_FLAG_GRAVITY;
208 script->AI_TEMP_STATE = 111;
212 enemy->varTable[10] = 0;
213 script->AI_TEMP_STATE = 100;
void N UnkNpcAIFunc12(Evt *script, MobileAISettings *aiSettings, EnemyDetectVolume *territory)
ApiStatus N UnkDistFunc(Evt *script, MobileAISettings *aiSettings, EnemyDetectVolume *territory)
void N set_script_owner_npc_col_height(Evt *script, MobileAISettings *aiSettings, EnemyDetectVolume *territory)
void N set_script_owner_npc_anim(Evt *script, MobileAISettings *aiSettings, EnemyDetectVolume *territory)
#define npc_raycast_down_sides
@ AI_FLAG_SKIP_EMOTE_AFTER_FLEE
@ ENEMY_FLAG_ACTIVE_WHILE_OFFSCREEN
@ NPC_FLAG_IGNORE_CAMERA_FOR_YAW
s32 evt_get_variable(Evt *script, Bytecode var)
void get_screen_coords(s32 camID, f32 x, f32 y, f32 z, s32 *screenX, s32 *screenY, s32 *screenZ)
void basic_ai_wander(Evt *script, MobileAISettings *npcAISettings, EnemyDetectVolume *territory)
b32 npc_test_move_simple_with_slipping(s32, f32 *, f32 *, f32 *, f32, f32, f32, f32)
void basic_ai_wander_init(Evt *script, MobileAISettings *npcAISettings, EnemyDetectVolume *territory)
void basic_ai_loiter_init(Evt *script, MobileAISettings *aiSettings, EnemyDetectVolume *territory)
void basic_ai_suspend(Evt *script)
void basic_ai_loiter(Evt *script, MobileAISettings *npcAISettings, EnemyDetectVolume *territory)
enum TerritoryShape shape
enum TerritoryShape detectShape
Enemy * get_enemy(s32 npcID)
Looks for an enemy matching the specified npcID.
Npc * get_npc_unsafe(s32 npcID)
void npc_move_heading(Npc *npc, f32 speed, f32 yaw)
s32 skipPlayerDetectChance
EnemyTerritoryWander wander
EnemyTerritory * territory
#define NPC_DISPOSE_POS_Z
#define NPC_DISPOSE_POS_X
#define NPC_DISPOSE_POS_Y
PlayerStatus * gPlayerStatusPtr