26 Enemy* enemy = script->owner1.enemy;
33 npc->
yaw = enemy->varTable[0];
44 Enemy* enemy = script->owner1.enemy;
48 if (aiSettings->playerSearchInterval >= 0 &&
basic_ai_check_player_dist(territory, enemy, aiSettings->chaseRadius, aiSettings->chaseOffsetDist, 0)) {
80 npc->
flags &= ~NPC_FLAG_JUMPING;
86 Enemy* enemy = script->owner1.enemy;
91 npc->
duration = (aiSettings->chaseUpdateInterval / 2) +
rand_int(aiSettings->chaseUpdateInterval / 2 + 1);
98 if (aiSettings->chaseTurnRate <
fabsf(angleDiff)) {
101 if (angleDiff < 0.0f) {
102 tempAngle += -aiSettings->chaseTurnRate;
104 tempAngle += aiSettings->chaseTurnRate;
113 Enemy* enemy = script->owner1.enemy;
142 Enemy* enemy = script->owner1.enemy;
147 npc->
moveSpeed = aiSettings->chaseSpeed * 0.3;
151 script->functionTemp[1] = 0;
156 Enemy* enemy = script->owner1.enemy;
160 if (aiSettings->playerSearchInterval >= 0) {
161 if (script->functionTemp[1] <= 0) {
162 script->functionTemp[1] = aiSettings->playerSearchInterval;
175 script->functionTemp[1]--;
191API_CALLABLE(N(GuardAI_Main)) {
192 Bytecode* args = script->ptrReadPos;
193 Enemy* enemy = script->owner1.enemy;
211 enemy->varTable[0] = npc->
yaw;
213 npc->
flags &= ~NPC_FLAG_JUMPING;
217 npc->
flags &= ~NPC_FLAG_FLYING;
219 npc->
flags &= ~NPC_FLAG_GRAVITY;
225 script->functionTemp[1] = 15;
226 enemy->
aiFlags &= ~AI_FLAG_SUSPEND;
229 enemy->
flags &= ~ENEMY_FLAG_BEGIN_WITH_CHASING;
233 switch (script->AI_TEMP_STATE) {
void N GuardAI_Alert(Evt *script, GuardAISettings *aiSettings, EnemyDetectVolume *territory)
void N GuardAI_LosePlayer(Evt *script, GuardAISettings *aiSettings, EnemyDetectVolume *territory)
void N GuardAI_Chase(Evt *script, GuardAISettings *aiSettings, EnemyDetectVolume *arg2)
@ AI_STATE_GUARD_RETURN_HOME
@ AI_STATE_GUARD_RETURN_HOME_INIT
@ AI_STATE_GUARD_IDLE_INIT
void N GuardAI_AlertInit(Evt *script, GuardAISettings *aiSettings, EnemyDetectVolume *territory)
void N GuardAI_ReturnHomeInit(Evt *script, GuardAISettings *aiSettings, EnemyDetectVolume *territory)
void N GuardAI_ChaseInit(Evt *script, GuardAISettings *aiSettings, EnemyDetectVolume *territory)
void N GuardAI_IdleInit(Evt *script, GuardAISettings *aiSettings, EnemyDetectVolume *territory)
void N GuardAI_ReturnHome(Evt *script, GuardAISettings *aiSettings, EnemyDetectVolume *territory)
void N GuardAI_Idle(Evt *script, GuardAISettings *aiSettings, EnemyDetectVolume *territory)
@ ENEMY_FLAG_BEGIN_WITH_CHASING
@ AI_ACTION_JUMP_WHEN_SEE_PLAYER
s32 evt_get_variable(Evt *script, Bytecode var)
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)
void basic_ai_suspend(Evt *script)
enum TerritoryShape shape
enum TerritoryShape detectShape
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)
NpcSettings * npcSettings
void npc_move_heading(Npc *npc, f32 speed, f32 yaw)
s32 skipPlayerDetectChance
EnemyTerritoryWander wander
EnemyTerritory * territory
s16 turnAroundYawAdjustment
PlayerStatus * gPlayerStatusPtr