7 Enemy* enemy = script->owner1.enemy;
11 script->AI_TEMP_STATE = 11;
15 Enemy* enemy = script->owner1.enemy;
17 f32 basePosY = (f32)enemy->varTable[1] / 100.0;
20 npc->
pos.
y = basePosY +
sin_deg(enemy->varTable[0]) * 6.0;
21 enemy->varTable[0] =
clamp_angle(enemy->varTable[0] + 10);
24 fx_emote(0, npc, 0.0f, npc->
collisionHeight, 1.0f, 2.0f, -20.0f, 15, &emoteTemp);
27 script->AI_TEMP_STATE = 20;
32 script->AI_TEMP_STATE = 15;
53 Enemy* enemy = arg0->owner1.enemy;
66 if (randomDist > moveDist) {
67 randomDist = moveDist;
71 if (npc->
yaw < 180.0) {
72 baseYaw = (
rand_int(10) + 90.0) - 5.0;
74 baseYaw = (
rand_int(10) + 270.0) - 5.0;
76 angleAdjust = iterations * 5;
79 npc->
yaw = baseYaw + angleAdjust;
81 npc->
yaw = baseYaw - angleAdjust;
90 if (distToHit > 160.0) {
91 if (distToHit < randomDist) {
92 randomDist = distToHit;
112 if (iterations >= 7) {
123 enemy->varTable[4] = npc->
pos.
x * 100.0;
124 enemy->varTable[6] = npc->
pos.
z * 100.0;
125 enemy->varTable[3] =
rand_int(10) + 35;
130 arg0->functionTemp[0] = 0x10;
135 Enemy* enemy = script->owner1.enemy;
137 f32 basePosY = (f32)enemy->varTable[1] / 100.0;
139 enemy->varTable[0] =
clamp_angle(enemy->varTable[0] + 10);
140 npc->
pos.
y = basePosY +
sin_deg(enemy->varTable[0]) * 6.0;
143 enemy->varTable[5] = npc->
pos.
y * 100.0;
144 script->functionTemp[0] = 17;
149 Enemy* enemy = script->owner1.enemy;
151 f32 limitY = (f32)enemy->varTable[1] / 100.0;
152 f32 basePosY = (f32)enemy->varTable[5] / 100.0;
153 f32 startX = (f32)enemy->varTable[4] / 100.0;
154 f32 startZ = (f32)enemy->varTable[6] / 100.0;
160 npc->
pos.
y = basePosY +
sin_deg((s32)(npc->
duration * (180.0 / (f32)enemy->varTable[3])) + 180) * 25.0;
163 if (npc->
duration == (enemy->varTable[3] - 8)) {
166 if (limitY <= npc->
pos.
y) {
168 enemy->varTable[0] = 0;
169 script->functionTemp[0] = 10;
170 }
else if (npc->
duration >= enemy->varTable[3]) {
171 if (enemy->varTable[0] >= 180.0) {
172 if (enemy->varTable[0] < 270.0) {
173 enemy->varTable[0] =
clamp_angle(540 - enemy->varTable[0]);
176 script->functionTemp[0] = 10;
181 Enemy* enemy = script->owner1.enemy;
185 script->functionTemp[0] = 21;
189 Enemy* enemy = script->owner1.enemy;
191 f32 posX, posY, posZ;
197 fx_emote(2, npc, 0.0f, npc->
collisionHeight, 1.0f, 2.0f, -20.0f, 12, &emoteTemp);
200 script->functionTemp[0] = 50;
205 posY = npc->
pos.
y + 29.0f;
206 posZ = npc->
pos.
z + 1.0f;
208 fx_gather_energy_pink(0, posX, posY, posZ, 0.1f, 13);
210 script->functionTemp[0] = 22;
215 Enemy* enemy = script->owner1.enemy;
222 script->functionTemp[0] = 0x17;
227 Enemy* enemy = script->owner1.enemy;
236 fx_emote(2, npc, 0.0f, npc->
collisionHeight, 1.0f, 2.0f, -20.0f, 12, &emoteTemp);
239 script->functionTemp[0] = 50;
244 script->functionTemp[0] = 24;
250 Enemy* enemy = script->owner1.enemy;
252 f32 basePosY = (f32)enemy->varTable[1] / 100.0;
254 npc->
pos.
y = basePosY +
sin_deg(enemy->varTable[0]) * 6.0;
255 enemy->varTable[0] =
clamp_angle(enemy->varTable[0] + 10);
261 script->AI_TEMP_STATE = 50;
266 Enemy* enemy = script->owner1.enemy;
268 f32 basePosY = (f32)enemy->varTable[1] / 100.0;
270 npc->
pos.
y = basePosY +
sin_deg(enemy->varTable[0]) * 6.0;
271 enemy->varTable[0] =
clamp_angle(enemy->varTable[0] + 10);
275 script->AI_TEMP_STATE = 10;
279API_CALLABLE(N(FlyingMagikoopaAI_Main)) {
280 Bytecode* args = script->ptrReadPos;
281 Enemy* enemy = script->owner1.enemy;
297 npc->
flags &= ~NPC_FLAG_GRAVITY;
301 enemy->varTable[1] = npc->
pos.
y * 100.0;
302 enemy->varTable[0] = 0;
303 enemy->varTable[2] = 0;
305 script->AI_TEMP_STATE = 10;
314 enemy->
aiFlags &= ~AI_FLAG_SUSPEND;
317 switch (script->AI_TEMP_STATE) {
326 if (script->AI_TEMP_STATE != 16) {
331 if (script->AI_TEMP_STATE != 17) {
348 if (script->AI_TEMP_STATE != 24) {
361API_CALLABLE(N(FlyingMagikoopaAI_OnHitInit)) {
362 Enemy* enemy = script->owner1.enemy;
368API_CALLABLE(N(FlyingMagikoopaAI_OnHit)) {
369 Enemy* enemy = script->owner1.enemy;
372 if (enemy->varTable[0] == 2) {
void N FlyingMagikoopaAI_22(Evt *script, MobileAISettings *aiSettings, EnemyDetectVolume *territory)
void N FlyingMagikoopaAI_10(Evt *script, MobileAISettings *arg1, EnemyDetectVolume *arg2)
void N FlyingMagikoopaAI_24(Evt *script, MobileAISettings *aiSettings, EnemyDetectVolume *territory)
void N FlyingMagikoopaAI_23(Evt *script, MobileAISettings *aiSettings, EnemyDetectVolume *territory)
void N FlyingMagikoopaAI_16(Evt *script, MobileAISettings *aiSettings, EnemyDetectVolume *territory)
void N FlyingMagikoopaAI_50(Evt *script, MobileAISettings *aiSettings, EnemyDetectVolume *territory)
void N FlyingMagikoopaAI_11(Evt *script, MobileAISettings *aiSettings, EnemyDetectVolume *volume)
void N FlyingMagikoopaAI_20(Evt *script, MobileAISettings *aiSettings, EnemyDetectVolume *territory)
void N FlyingMagikoopaAI_17(Evt *script, MobileAISettings *aiSettings, EnemyDetectVolume *territory)
void N FlyingMagikoopaAI_15(Evt *arg0, MobileAISettings *arg1, EnemyDetectVolume *arg2)
void N FlyingMagikoopaAI_21(Evt *script, MobileAISettings *aiSettings, EnemyDetectVolume *territory)
s32 N MagikoopaAI_CanShootSpell(Evt *script, f32 arg1, f32 arg2, EnemyDetectVolume *territory)
@ ENEMY_FLAG_ACTIVE_WHILE_OFFSCREEN
@ NPC_FLAG_FLIP_INSTANTLY
s32 evt_get_variable(Evt *script, Bytecode var)
f32 update_lerp(s32 easing, f32 start, f32 end, s32 elapsed, s32 duration)
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)
s32 evt_set_variable(Evt *script, Bytecode var, s32 value)
f32 dist2D(f32 ax, f32 ay, f32 bx, f32 by)
b32 npc_test_move_taller_with_slipping(s32, f32 *, f32 *, f32 *, f32, f32, f32, f32)
void add_vec2D_polar(f32 *x, f32 *y, f32 r, f32 theta)
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)
EncounterStatus gCurrentEncounter
enum TerritoryShape wanderShape
s32 skipPlayerDetectChance
EnemyTerritoryWander wander
EnemyTerritory * territory
s16 turnAroundYawAdjustment
PlayerStatus * gPlayerStatusPtr