3#include "sprite/npc/MontyMole.h"
30#define INTANGIBLE_MONTY_MOLE_NPC_FLAGS \
31 ENEMY_FLAG_SKIP_BATTLE \
32 | ENEMY_FLAG_IGNORE_TOUCH \
33 | ENEMY_FLAG_IGNORE_JUMP \
34 | ENEMY_FLAG_IGNORE_HAMMER \
35 | ENEMY_FLAG_IGNORE_PARTNER \
36 | ENEMY_FLAG_CANT_INTERACT
38static s32 N(MontyMoleAI_CanAttack)(
Evt* script,
EnemyDetectVolume* territory, f32 radius, f32 arg3) {
45 enemy = script->owner1.enemy;
73 Enemy* enemy = script->owner1.enemy;
76 npc->
duration = (aiSettings->moveTime / 2) +
rand_int((aiSettings->moveTime / 2) + 1);
85 script->functionTemp[1] = 0;
90 Enemy* enemy = script->owner1.enemy;
112 if (aiSettings->playerSearchInterval >= 0) {
113 if (script->functionTemp[1] <= 0) {
114 script->functionTemp[1] = aiSettings->playerSearchInterval;
115 if (N(MontyMoleAI_CanAttack)(script, territory, aiSettings->alertRadius, aiSettings->alertOffsetDist)) {
121 script->functionTemp[1]--;
134 Enemy* enemy = script->owner1.enemy;
137 npc->
flags &= ~NPC_FLAG_INVISIBLE;
140 npc->
curAnim = ANIM_MontyMole_Anim10;
146 Enemy* enemy = script->owner1.enemy;
154 npc->
curAnim = ANIM_MontyMole_Anim18;
161 Enemy* enemy = script->owner1.enemy;
167 if (!N(MontyMoleAI_CanAttack)(script, territory, aiSettings->alertRadius * 1.1, aiSettings->alertOffsetDist)) {
169 npc->
curAnim = ANIM_MontyMole_Anim01;
173 npc->
curAnim = ANIM_MontyMole_Anim1B;
185 moleEnemy = script->owner1.enemy;
190 rockEnemy->varTable[4] = moleEnemy->
npcID;
191 rockEnemy->varTable[0] = 1;
195 moleNpc->
curAnim = ANIM_MontyMole_Anim15;
199 if (moleNpc->
curAnim != ANIM_MontyMole_Anim15) {
200 moleNpc->
curAnim = ANIM_MontyMole_Anim01;
208 Enemy* enemy = script->owner1.enemy;
215 npc->
curAnim = ANIM_MontyMole_Anim11;
221 Enemy* enemy = script->owner1.enemy;
234API_CALLABLE(N(MontyMoleAI_Main)) {
235 Bytecode* args = script->ptrReadPos;
236 Enemy* enemy = script->owner1.enemy;
254 npc->
flags &= ~NPC_FLAG_JUMPING;
262 enemy->
aiFlags &= ~AI_FLAG_SUSPEND;
265 switch (script->AI_TEMP_STATE) {
267 N(MontyMoleAI_Init)(script, aiSettings, territoryPtr);
270 N(MontyMoleAI_Wander)(script, aiSettings, territoryPtr);
273 N(MontyMoleAI_PreSurface)(script, aiSettings, territoryPtr);
276 N(MontyMoleAI_Surface)(script, aiSettings, territoryPtr);
281 N(MontyMoleAI_DrawRock)(script, aiSettings, territoryPtr);
286 N(MontyMoleAI_ThrowRock)(script, aiSettings, territoryPtr);
291 N(MontyMoleAI_PreBurrow)(script, aiSettings, territoryPtr);
294 N(MontyMoleAI_Burrow)(script, aiSettings, territoryPtr);
#define INTANGIBLE_MONTY_MOLE_NPC_FLAGS
@ AI_STATE_MOLE_DRAW_ROCK
@ AI_STATE_MOLE_PRE_BURROW
@ AI_STATE_MOLE_PRE_SURFACE
@ AI_STATE_MOLE_THROW_ROCK
#define npc_raycast_down_sides
@ AI_FLAG_SKIP_EMOTE_AFTER_FLEE
@ AI_FLAG_SKIP_IDLE_ANIM_AFTER_FLEE
@ NPC_FLAG_COLLDING_FORWARD_WITH_WORLD
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 ai_enemy_play_sound(Npc *npc, s32 arg1, s32 arg2)
f32 dist2D(f32 ax, f32 ay, f32 bx, f32 by)
f32 get_xz_dist_to_player(f32, f32)
f32 get_clamped_angle_diff(f32, f32)
enum TerritoryShape shape
enum TerritoryShape detectShape
s32 basic_ai_check_player_dist(EnemyDetectVolume *arg0, Enemy *arg1, f32 arg2, f32 arg3, b8 arg4)
Enemy * get_enemy(s32 npcID)
Looks for an enemy matching the specified npcID.
Npc * get_npc_unsafe(s32 npcID)
void AIStateHandler(Evt *script, MobileAISettings *settings, EnemyDetectVolume *territory)
enum TerritoryShape wanderShape
void npc_move_heading(Npc *npc, f32 speed, f32 yaw)
s32 skipPlayerDetectChance
EnemyTerritoryWander wander
EnemyTerritory * territory
PlayerStatus * gPlayerStatusPtr
PartnerStatus gPartnerStatus