6API_CALLABLE(N(StoneChompFXA)) {
16 npc->
blur.chomp = blurData;
24 for (i = 0; i < 8; i++, blurData++) {
39API_CALLABLE(N(StoneChompFXB)) {
44 f32 nextX, nextY, nextZ;
49 floorY = (f32) script->owner1.enemy->varTable[0];
51 blurData = ownerNpc->blur.chomp;
52 posX = ownerNpc->pos.x;
53 posY = ownerNpc->pos.y + (ownerNpc->collisionHeight * 0.2f);
54 posZ = ownerNpc->pos.z;
58 for (i = 0; i < 8; i++, blurData++) {
59 childNpc = blurData->
npc;
60 childNpc->
pos.
x = posX;
61 childNpc->pos.y = posY;
62 childNpc->pos.z = posZ;
67 for (i = 0; i < 8; i++, blurData++) {
68 childNpc = blurData->
npc;
69 if (
dist3D(childNpc->pos.x, childNpc->pos.y, childNpc->pos.z, posX, posY, posZ) >= 10.0) {
71 ((childNpc->pos.x - posX) * 0.8f) + posX, childNpc->pos.y, ((childNpc->pos.z - posZ) * 0.8f) + posZ,
74 nextX = posX = ((childNpc->pos.x - posX) * 0.8f * invDist) + posX;
75 nextY = posY = ((childNpc->pos.y - posY) * invDist) + posY;
76 nextZ = posZ = ((childNpc->pos.z - posZ) * 0.8f * invDist) + posZ;
78 blurData->
offset.
x = (nextX - childNpc->pos.x) * 0.7f;
79 blurData->
offset.
y = (nextY - childNpc->pos.y) * 0.7f;
80 blurData->
offset.
z = (nextZ - childNpc->pos.z) * 0.7f;
82 childNpc->pos.x = nextX;
83 childNpc->pos.y = nextY;
84 childNpc->pos.z = nextZ;
86 if (blurData->
offset.
y > 10.0f) {
92 childNpc->pos.x += blurData->
offset.
x;
93 childNpc->pos.z += blurData->
offset.
z;
97 if (blurData->
offset.
y < -10.0f) {
100 childNpc->pos.y += blurData->
offset.
y;
101 if (childNpc->pos.y <= floorY) {
102 childNpc->pos.y = floorY;
106 posX = childNpc->pos.x;
107 posY = childNpc->pos.y;
108 posZ = childNpc->pos.z;
109 childNpc->flags = ownerNpc->flags;
115API_CALLABLE(N(StoneChompFXC)) {
119 for (i = 0; i < 8; i++, blurData++) {
127 Call(N(StoneChompFXA))
136 .alertRadius = 100.0f,
137 .playerSearchInterval = 10,
140 .chaseUpdateInterval = 10,
141 .chaseRadius = 500.0f,
148 Call(N(StoneChompFXB))
153 Call(N(StoneChompAI_Main),
Ref(N(AISettings_StoneChomp)))
190 Call(N(StoneChompFXC))
202 .level = ACTOR_LEVEL_STONE_CHOMP,
203 .otherAI = &N(EVS_NpcAuxAI_StoneChomp),
204 .ai = &N(EVS_NpcAI_StoneChomp),
205 .onHit = &N(EVS_NpcHit_StoneChomp),
206 .onDefeat = &N(EVS_NpcDefeat_StoneChomp),
@ ENCOUNTER_TRIGGER_HAMMER
@ ENCOUNTER_TRIGGER_PARTNER
@ NPC_FLAG_IGNORE_ENTITY_COLLISION
@ NPC_FLAG_IGNORE_WORLD_COLLISION
@ NPC_FLAG_IGNORE_PLAYER_COLLISION
f32 dist3D(f32 ax, f32 ay, f32 az, f32 bx, f32 by, f32 bz)
void add_vec2D_polar(f32 *x, f32 *y, f32 r, f32 theta)
void * heap_malloc(s32 size)
s32 create_basic_npc(NpcBlueprint *blueprint)
void disable_npc_shadow(Npc *npc)
Npc * get_npc_by_index(s32 listIndex)
Npc * get_npc_safe(s32 npcID)
ApiStatus SetBattleMusic(Evt *script, b32 isInitialCall)
ApiStatus SetNpcRotation(Evt *script, b32 isInitialCall)
ApiStatus GetSelfAnimationFromTable(Evt *script, b32 isInitialCall)
ApiStatus DoNpcDefeat(Evt *script, b32 isInitialCall)
ApiStatus GetOwnerEncounterTrigger(Evt *script, b32 isInitialCall)
ApiStatus func_800458CC(Evt *script, b32 isInitialCall)
ApiStatus GetBattleOutcome(Evt *script, b32 isInitialCall)
ApiStatus GetSelfVar(Evt *script, b32 isInitialCall)
#define Switch(LVAR)
Marks the start of a switch statement.
#define Ref(sym)
Address/pointer constant.
#define Set(VAR, INT_VALUE)
Sets the given variable to a given value casted to an integer.
#define CaseEq(RVAR)
Marks the start of a switch case that executes only if LVAR == RVAR. It also marks the end of any pre...
#define EndChildThread
Marks the end of a child thread block.
#define End
Signals the end of EVT script data. A script missing this will likely crash on load.
#define Add(VAR, INT_VALUE)
#define EndLoop
Marks the end of a loop.
#define EndCaseGroup
Marks the end of a switch case group (CaseOrEq and/or CaseAndEq), stopping fallthrough.
#define CaseOrEq(RVAR)
Marks the start of a switch case that executes only if LVAR == RVAR.
#define EndIf
Marks the end of an if statement or an else block.
#define ExecWait(EVT_SOURCE)
Launches a new child thread.
#define Thread
Marks the start of a thread block.
#define EndThread
Marks the end of a thread block.
#define Wait(NUM_FRAMES)
Blocks for the given number of frames.
#define EndSwitch
Marks the end of a switch statement and any case.
#define IfEq(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR == RVAR.
#define Call(FUNC, ARGS...)
Calls a given C EVT API function with any number of arguments.
#define ChildThread
Marks the start of a child thread block.
#define Loop(TIMES)
Marks the beginning of a loop.
#define Return
Kills the current EVT thread.
EvtScript EVS_NpcHitRecoil
void(* onRender)(struct Npc *)
void(* onUpdate)(struct Npc *)