10 Enemy* enemy = script->owner1.enemy;
16 enemy->varTable[0] = 0;
18 script->functionTemp[1] = 0;
19 script->functionTemp[0] = 1;
24 Enemy* enemy = script->owner1.enemy;
34 script->functionTemp[0] = 10;
39 Enemy* enemy = script->owner1.enemy;
59 if (enemy->varTable[9] >= npc->
duration) {
72 if (enemy->varTable[7] == 0) {
97 if (enemy->varTable[7] == 0) {
98 if (npc->
pos.
x > 380.0) {
101 if (npc->
pos.
x < -380.0) {
102 npc->
pos.
x = -380.0f;
104 if (npc->
pos.
z > 380.0) {
107 if (npc->
pos.
z < -380.0) {
108 npc->
pos.
z = -380.0f;
118 }
else if (sp38 > 375.0) {
134 sp30 = npc->
pos.
y + 100.0;
138 if (!cond1 && cond2 && sp38 > 80.0 && sp38 < 120.0 && npc->
pos.
y != sp30) {
168 switch (territory->shape) {
170 sp38 =
dist2D(npc->
pos.
x, npc->
pos.
z, territory->pointX, territory->pointZ);
172 if (territory->sizeX < sp38) {
173 terSize =
atan2(territory->pointX, territory->pointZ, npc->
pos.
x, npc->
pos.
z);
174 npc->
pos.
x = territory->pointX;
175 npc->
pos.
z = territory->pointZ;
180 terSize = territory->pointX + territory->sizeX;
181 if (npc->
pos.
x > terSize) {
182 npc->
pos.
x = terSize;
185 terSize = territory->pointX - territory->sizeX;
186 if (npc->
pos.
x < terSize) {
187 npc->
pos.
x = terSize;
190 terSize = territory->pointZ + territory->sizeZ;
191 if (npc->
pos.
z > terSize) {
192 npc->
pos.
z = terSize;
195 terSize = territory->pointZ - territory->sizeZ;
196 if (npc->
pos.
z < terSize) {
197 npc->
pos.
z = terSize;
207 sp24 = npc->
pos.
y + 150.0;
217 npc->
duration = enemy->varTable[10];
218 script->functionTemp[0] = 11;
223 Enemy* enemy = script->owner1.enemy;
227 if (enemy->varTable[11] >= npc->
duration) {
233 script->functionTemp[0] = 12;
238 Enemy* enemy = script->owner1.enemy;
243 if (npc->
duration == enemy->varTable[13]) {
246 if (npc->
duration == enemy->varTable[14]) {
247 enemy->varTable[0] = 3;
249 if (npc->
duration >= enemy->varTable[12]) {
250 enemy->varTable[0] = 4;
254 script->functionTemp[0] = 13;
259 Enemy* enemy = script->owner1.enemy;
264 npc->
duration = enemy->varTable[15];
265 script->functionTemp[0] = 14;
270 Enemy* enemy = script->owner1.enemy;
280 script->functionTemp[0] = 0;
287API_CALLABLE(N(PiranhaPlantAI_Main)) {
288 Enemy* enemy = script->owner1.enemy;
290 Bytecode* args = script->ptrReadPos;
313 enemy->
aiFlags &= ~AI_FLAG_SUSPEND;
317 switch (script->AI_TEMP_STATE) {
void N PiranhaPlantAI_01(Evt *script, MobileAISettings *aiSettings, EnemyDetectVolume *territory)
void N PiranhaPlantAI_LosePlayer(Evt *script, MobileAISettings *aiSettings, EnemyDetectVolume *territory)
void N PiranhaPlantAI_00(Evt *script, MobileAISettings *aiSettings, EnemyDetectVolume *territory)
void N PiranhaPlantAI_11(Evt *script, MobileAISettings *aiSettings, EnemyDetectVolume *territory)
void N PiranhaPlantAI_13(Evt *script, MobileAISettings *aiSettings, EnemyDetectVolume *territory)
void N PiranhaPlantAI_10(Evt *script, MobileAISettings *aiSettings, EnemyDetectVolume *territory)
void N PiranhaPlantAI_12(Evt *script, MobileAISettings *aiSettings, EnemyDetectVolume *territory)
#define npc_raycast_down_sides
@ ENEMY_ANIM_INDEX_MELEE_PRE
@ ENEMY_ANIM_INDEX_MELEE_HIT
@ AI_STATE_PIRANHA_PLANT_01
@ AI_STATE_PIRANHA_PLANT_10
@ AI_STATE_PIRANHA_PLANT_12
@ AI_STATE_PIRANHA_PLANT_13
@ AI_STATE_PIRANHA_PLANT_11
@ AI_STATE_PIRANHA_PLANT_00
@ ENEMY_FLAG_IGNORE_HAMMER
@ ENEMY_FLAG_IGNORE_PARTNER
@ ENEMY_FLAG_IGNORE_TOUCH
@ ENEMY_FLAG_CANT_INTERACT
@ MELEE_HITBOX_STATE_NONE
@ NPC_FLAG_IGNORE_WORLD_COLLISION
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)
b32 npc_test_move_simple_with_slipping(s32, f32 *, f32 *, f32 *, f32, f32, f32, f32)
void add_vec2D_polar(f32 *x, f32 *y, f32 r, f32 theta)
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)
Npc * get_npc_unsafe(s32 npcID)
void npc_move_heading(Npc *npc, f32 speed, f32 yaw)
s32 skipPlayerDetectChance
EnemyTerritoryWander wander
EnemyTerritory * territory
PlayerStatus * gPlayerStatusPtr