2#define _AI_PATROL_INC_ 0
10 Enemy* enemy = script->owner1.enemy;
20 script->functionTemp[1] = 0;
24 script->AI_PATROL_GOAL_INDEX = 0;
30 ret =
dist2D(posX, posZ, x, z);
33 script->AI_PATROL_GOAL_INDEX = j;
48 Enemy* enemy = script->owner1.enemy;
53 if (aiSettings->playerSearchInterval >= 0) {
54 if (script->functionTemp[1] <= 0) {
55 script->functionTemp[1] = aiSettings->playerSearchInterval;
67 script->functionTemp[1]--;
83 script->functionTemp[1] = (
rand_int(1000) % 3) + 2;
84 if ((aiSettings->unk_AI_2C <= 0) || (aiSettings->moveTime <= 0) ||
85 (aiSettings->waitTime <= 0) || (script->functionTemp[1] == 0)) {
88 if (
rand_int(10000) % 100 < aiSettings->moveTime) {
97 Enemy* enemy = script->owner1.enemy;
100 npc->
duration = (aiSettings->waitTime / 2) +
rand_int((aiSettings->waitTime / 2) + 1);
108 Enemy* enemy = script->owner1.enemy;
112 if ((aiSettings->playerSearchInterval >= 0) &&
basic_ai_check_player_dist(territory, enemy, aiSettings->chaseRadius, aiSettings->chaseOffsetDist, 0)) {
128 script->functionTemp[1]--;
129 if (script->functionTemp[1] != 0) {
133 npc->
duration = aiSettings->waitTime / 2 +
rand_int(aiSettings->waitTime / 2 + 1);
142 Enemy* enemy = script->owner1.enemy;
145 script->functionTemp[2]++;
147 script->functionTemp[2] = 0;
159 Enemy* enemy = script->owner1.enemy;
179 npc->
flags &= ~NPC_FLAG_JUMPING;
185 Enemy* enemy = script->owner1.enemy;
190 npc->
duration = (aiSettings->chaseUpdateInterval / 2) +
rand_int(aiSettings->chaseUpdateInterval / 2 + 1);
197 if (aiSettings->chaseTurnRate <
fabsf(angleDiff)) {
200 if (angleDiff < 0.0f) {
201 angle += -aiSettings->chaseTurnRate;
203 angle += aiSettings->chaseTurnRate;
208 script->functionTemp[0] = 13;
212 Enemy* enemy = script->owner1.enemy;
233 Enemy* enemy = script->owner1.enemy;
247 Enemy* enemy = script->owner1.enemy;
254 script->AI_PATROL_GOAL_INDEX = i;
261 script->functionTemp[1] = 0;
void N PatrolAI_MoveInit(Evt *script, MobileAISettings *aiSettings, EnemyDetectVolume *territory)
void N PatrolAI_PostLoiter(Evt *script, MobileAISettings *aiSettings, EnemyDetectVolume *territory)
void N PatrolAI_Loiter(Evt *script, MobileAISettings *aiSettings, EnemyDetectVolume *territory)
void N PatrolNoAttackAI_15(Evt *script, MobileAISettings *aiSettings, EnemyDetectVolume *territory)
void N PatrolAI_Jump(Evt *script, MobileAISettings *aiSettings, EnemyDetectVolume *territory)
void N PatrolAI_JumpInit(Evt *script, MobileAISettings *aiSettings, EnemyDetectVolume *territory)
void N PatrolAI_ChaseInit(Evt *script, MobileAISettings *aiSettings, EnemyDetectVolume *territory)
void N PatrolAI_Chase(Evt *script, MobileAISettings *aiSettings, EnemyDetectVolume *territory)
void N PatrolAI_Move(Evt *script, MobileAISettings *aiSettings, EnemyDetectVolume *territory)
void N PatrolAI_LoiterInit(Evt *script, MobileAISettings *aiSettings, EnemyDetectVolume *territory)
void N PatrolAI_LosePlayer(Evt *script, MobileAISettings *aiSettings, EnemyDetectVolume *territory)
@ AI_ACTION_LOOK_AROUND_DURING_LOITER
@ AI_ACTION_JUMP_WHEN_SEE_PLAYER
void ai_enemy_play_sound(Npc *npc, s32 arg1, s32 arg2)
f32 dist2D(f32 ax, f32 ay, f32 bx, f32 by)
f32 get_clamped_angle_diff(f32, f32)
s32 basic_ai_check_player_dist(EnemyDetectVolume *arg0, Enemy *arg1, f32 arg2, f32 arg3, b8 arg4)
void npc_surface_spawn_fx(Npc *npc, SurfaceInteractMode mode)
Npc * get_npc_unsafe(s32 npcID)
EnemyTerritoryPatrol patrol
NpcSettings * npcSettings
void npc_move_heading(Npc *npc, f32 speed, f32 yaw)
EnemyTerritory * territory
s16 turnAroundYawAdjustment
PlayerStatus * gPlayerStatusPtr