6 Enemy* enemy = script->owner1.enemy;
28 for (i = 0; i < 6; i++) {
43 Enemy* enemy = script->owner1.enemy;
45 f32 posX, posY, posZ, hitDepth;
47 if (aiSettings->playerSearchInterval >= 0) {
48 if (script->functionTemp[1] <= 0) {
49 script->functionTemp[1] = aiSettings->playerSearchInterval;
59 script->functionTemp[1]--;
76 moveSpeed, npc->
yaw, collHeight, collRadius * 1.2))
86 posY = npc->
pos.
y + 13.0;
95 npc->
flags &= ~NPC_FLAG_JUMPING;
97 script->functionTemp[1] = (
rand_int(1000) % 3) + 2;
99 if (aiSettings->unk_AI_2C <= 0) {
101 }
else if (aiSettings->moveTime <= 0) {
103 }
else if (script->functionTemp[1] == 0) {
114 Enemy* enemy = script->owner1.enemy;
117 npc->
duration = (aiSettings->waitTime / 2) +
rand_int((aiSettings->waitTime / 2) + 1);
124 Enemy* enemy = script->owner1.enemy;
127 if (aiSettings->playerSearchInterval >= 0 &&
basic_ai_check_player_dist(territory, enemy, aiSettings->chaseRadius, aiSettings->chaseOffsetDist, 0) != 0) {
136 script->functionTemp[1]--;
137 if (script->functionTemp[1] > 0) {
155 enemy->
moveSpeed = aiSettings->chaseSpeed;
161 Enemy* enemy = script->owner1.enemy;
163 f32 posX, posY, posZ;
164 f32 groundY, hitDepth;
188 posY = npc->
pos.
y + 13.0;
194 npc->
flags &= ~NPC_FLAG_JUMPING;
195 fx_walking_dust(2, npc->
pos.
x, npc->
pos.
y, npc->
pos.
z, 0.0f, 0.0f);
219API_CALLABLE(N(HoppingAI_Main)) {
220 Enemy* enemy = script->owner1.enemy;
221 Bytecode* args = script->ptrReadPos;
236 territoryPtr = &territory;
241 script->functionTemp[1] = 0;
242 npc->
flags &= ~NPC_FLAG_JUMPING;
243 npc->
flags &= ~NPC_FLAG_GRAVITY;
249 enemy->
flags &= ~ENEMY_FLAG_BEGIN_WITH_CHASING;
257 enemy->
aiFlags &= ~AI_FLAG_SUSPEND;
260 switch (script->AI_TEMP_STATE) {
void N HoppingAI_LosePlayer(Evt *script, MobileAISettings *aiSettings, EnemyDetectVolume *territory)
void N HoppingAI_LoiterInit(Evt *script, MobileAISettings *aiSettings, EnemyDetectVolume *territory)
void N HoppingAI_Chase(Evt *script, MobileAISettings *aiSettings, EnemyDetectVolume *territory)
void N HoppingAI_Hop(Evt *script, MobileAISettings *aiSettings, EnemyDetectVolume *territory)
void N HoppingAI_ChaseInit(Evt *script, MobileAISettings *aiSettings, EnemyDetectVolume *territory)
void N HoppingAI_Loiter(Evt *script, MobileAISettings *aiSettings, EnemyDetectVolume *territory)
void N HoppingAI_HopInit(Evt *script, MobileAISettings *aiSettings, EnemyDetectVolume *territory)
#define npc_raycast_down_sides
@ AI_FLAG_SKIP_EMOTE_AFTER_FLEE
@ AI_FLAG_SKIP_IDLE_ANIM_AFTER_FLEE
@ ENEMY_FLAG_BEGIN_WITH_CHASING
s32 evt_get_variable(Evt *script, Bytecode var)
b32 is_point_outside_territory(s32 shape, f32 centerX, f32 centerZ, f32 pointX, f32 pointZ, f32 sizeX, f32 sizeZ)
void basic_ai_chase_init(Evt *script, MobileAISettings *npcAISettings, EnemyDetectVolume *territory)
void ai_enemy_play_sound(Npc *npc, s32 arg1, s32 arg2)
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)
enum TerritoryShape shape
enum TerritoryShape detectShape
s32 basic_ai_check_player_dist(EnemyDetectVolume *arg0, Enemy *arg1, f32 arg2, f32 arg3, b8 arg4)
Npc * get_npc_unsafe(s32 npcID)
enum TerritoryShape wanderShape
void npc_move_heading(Npc *npc, f32 speed, f32 yaw)
s32 skipPlayerDetectChance
EnemyTerritoryWander wander
EnemyTerritory * territory
s16 turnAroundYawAdjustment
PlayerStatus * gPlayerStatusPtr