3#include "sprite/npc/BonyBeetle.h"
6#define NAMESPACE A(bony_beetle)
12extern EvtScript N(EVS_HandleEvent_SmoothUpright);
13extern EvtScript N(EVS_HandleEvent_SpikyUpright);
14extern EvtScript N(EVS_HandleEvent_SmoothToppled);
15extern EvtScript N(EVS_HandleEvent_SpikyToppled);
16extern EvtScript N(EVS_TrySwitchingSpikyState);
17extern EvtScript N(EVS_TryGettingUp_Smooth);
18extern EvtScript N(EVS_TryGettingUp_Spiky);
20extern EvtScript N(EVS_Attack_SpikeBounce);
27 AVAR_IN_OnCeiling = 0,
28 AVAR_ShouldTrySwitching = 1,
30 AVAL_State_SmoothUpright = 0,
31 AVAL_State_SpikyUpright = 1,
32 AVAL_State_SmoothToppled = 2,
33 AVAL_State_SpikyToppled = 3,
42s32 N(DefaultAnims)[] = {
55s32 N(SpikyAnims)[] = {
68s32 N(ToppledAnims)[] = {
81s32 N(ToppledSpikyAnims)[] = {
94s32 N(DefenseTable)[] = {
99s32 N(ToppledDefenseTable)[] = {
104s32 N(StatusTable)[] = {
133 .posOffset = { 0, 0, 0 },
134 .targetOffset = { -3, 21 },
136 .idleAnimations = N(SpikyAnims),
137 .defenseTable = N(DefenseTable),
139 .elementImmunityFlags = 0,
140 .projectileTargetOffset = { 0, -8 },
146 .type = ACTOR_TYPE_BONY_BEETLE,
147 .level = ACTOR_LEVEL_BONY_BEETLE,
150 .partsData = N(ActorParts),
151 .initScript = &N(EVS_Init),
152 .statusTable = N(StatusTable),
155 .hurricaneChance = 60,
157 .upAndAwayChance = 95,
159 .powerBounceChance = 90,
162 .healthBarOffset = { 0, 0 },
163 .statusIconOffset = { -10, 20 },
164 .statusTextOffset = { 10, 20 },
172 Call(SetActorVar,
ACTOR_SELF, AVAR_State, AVAL_State_SpikyUpright)
177 Call(SetActorVar,
ACTOR_SELF, AVAR_State, AVAL_State_SmoothUpright)
185 Call(SetActorVar,
ACTOR_SELF, AVAR_State, AVAL_State_SmoothUpright)
190 Call(SetActorVar,
ACTOR_SELF, AVAR_State, AVAL_State_SpikyUpright)
219 CaseEq(AVAL_State_SmoothUpright)
220 ExecWait(N(EVS_HandleEvent_SmoothUpright))
221 CaseEq(AVAL_State_SpikyUpright)
222 ExecWait(N(EVS_HandleEvent_SpikyUpright))
223 CaseEq(AVAL_State_SmoothToppled)
224 ExecWait(N(EVS_HandleEvent_SmoothToppled))
225 CaseEq(AVAL_State_SpikyToppled)
226 ExecWait(N(EVS_HandleEvent_SpikyToppled))
232 ExecWait(N(EVS_TrySwitchingSpikyState))
242EvtScript N(EVS_TrySwitchingSpikyState) = {
259 CaseEq(AVAL_State_SmoothUpright)
261 Call(SetActorVar,
ACTOR_SELF, AVAR_State, AVAL_State_SpikyUpright)
266 CaseEq(AVAL_State_SpikyUpright)
268 Call(SetActorVar,
ACTOR_SELF, AVAR_State, AVAL_State_SmoothUpright)
273 CaseEq(AVAL_State_SmoothToppled)
274 CaseEq(AVAL_State_SpikyToppled)
283 CaseEq(AVAL_State_SmoothUpright)
285 CaseEq(AVAL_State_SpikyUpright)
287 CaseEq(AVAL_State_SmoothToppled)
288 ExecWait(N(EVS_TryGettingUp_Smooth))
289 CaseEq(AVAL_State_SpikyToppled)
296s32 N(FlipPosOffsets)[] = { 7, 13, 17, 21, 23, 24, 23, 21, 17, 13, 7, 0, 4, 6, 7, 6, 4, 0, 2, 0 };
298EvtScript N(EVS_HandleEvent_SmoothUpright) = {
337 Call(SetActorVar,
ACTOR_SELF, AVAR_State, AVAL_State_SmoothToppled)
520EvtScript N(EVS_HandleEvent_SpikyUpright) = {
559 Call(SetActorVar,
ACTOR_SELF, AVAR_State, AVAL_State_SpikyToppled)
865#include "common/battle/SetAbsoluteStatusOffsets.inc.c"
870 Call(SetActorVar,
ACTOR_SELF, AVAR_State, AVAL_State_SmoothToppled)
877 Call(N(SetAbsoluteStatusOffsets), -10, 20, 10, 20)
900EvtScript N(EVS_HandleEvent_SmoothToppled) = {
936 Call(SetActorVar,
ACTOR_SELF, AVAR_State, AVAL_State_SmoothToppled)
939 Call(N(SetAbsoluteStatusOffsets), -10, 20, 10, 20)
1009 Call(SetBattleCamDist, 350)
1010 Call(SetBattleCamOffsetY, 20)
1020 Call(SetActorVar,
ACTOR_SELF, AVAR_State, AVAL_State_SmoothUpright)
1032EvtScript N(EVS_HandleEvent_SpikyToppled) = {
1068 Call(SetActorVar,
ACTOR_SELF, AVAR_State, AVAL_State_SpikyToppled)
1071 Call(N(SetAbsoluteStatusOffsets), -10, 20, 10, 20)
1077 UseBuf(N(FlipPosOffsets))
1142 Call(SetBattleCamDist, 350)
1143 Call(SetBattleCamOffsetY, 20)
1153 Call(SetActorVar,
ACTOR_SELF, AVAR_State, AVAL_State_SpikyUpright)
#define STATUS_FLAGS_IMMOBILIZED
@ BS_FLAGS1_TRIGGER_EVENTS
@ BS_FLAGS1_INCLUDE_POWER_UPS
@ BS_FLAGS1_EXECUTING_MOVE
@ ACTOR_EVENT_FLAG_FLIPABLE
Actor can be flipped; triggered by jump and quake attacks.
@ ACTOR_EVENT_FLAG_SPIKY_TOP
Player takes spike damage from jump attacks.
@ STATUS_TURN_MOD_DEFAULT
@ STATUS_TURN_MOD_PARALYZE
@ SOUND_BONY_BEETLE_EXTEND_SPIKES
@ SOUND_BONY_BEETLE_RETRACT_SPIKES
@ ACTOR_FLAG_UPSIDE_DOWN
HP bar offset below actor (e.g. Swooper when upside-down).
@ ACTOR_FLAG_FLIPPED
Actor has been flipped over.
@ ACTOR_PART_FLAG_PRIMARY_TARGET
@ DAMAGE_TYPE_TRIGGER_LUCKY
EvtScript EVS_Enemy_ReturnHome
EvtScript EVS_Enemy_Knockback
EvtScript EVS_Enemy_ScareAway
EvtScript EVS_Enemy_Death
EvtScript EVS_Enemy_SpinSmashHit
EvtScript EVS_Enemy_ShockHit
EvtScript EVS_Enemy_AirLift
EvtScript EVS_Enemy_BlowAway
EvtScript EVS_Enemy_Recover
EvtScript EVS_Enemy_BurnHit
EvtScript EVS_Enemy_NoDamageHit
ApiStatus RandInt(Evt *script, b32 isInitialCall)
#define Else
Marks the end of an if statement and the start of the else block.
#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 Sub(VAR, INT_VALUE)
#define End
Signals the end of EVT script data. A script missing this will likely crash on load.
#define UseBuf(INT_PTR)
Loads a s32 pointer for use with subsequent EVT_BUF_READ commands.
#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 Goto(LABEL_ID)
Moves execution to the given label.
#define BufRead1(VAR)
Consumes the next s32 from the buffer and stores it in the given variable.
#define IfGt(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR <= RVAR.
#define IfLt(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR < RVAR.
#define Label(LABEL_ID)
Marks this point in the script as a Goto target.
#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 CaseDefault
Marks the start of a switch case that executes unconditionally. It also marks the end of any previous...
#define ExecWait(EVT_SOURCE)
Launches a new child thread.
#define IfLe(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR > RVAR.
#define Thread
Marks the start of a thread block.
#define EndThread
Marks the end of a thread block.
#define IfFlag(LVAR, RVAR)
Marks the beginning of an if statement that only executes if the RVAR flag is set on LVAR,...
#define IfNotFlag(LVAR, RVAR)
Marks the beginning of an if statement that only executes if the RVAR flag is unset on LVAR,...
#define Wait(NUM_FRAMES)
Blocks for the given number of frames.
#define PlayEffect(args...)
#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 Loop(TIMES)
Marks the beginning of a loop.
#define SetConst(VAR, CONST)
Sets the given variable to a given value, skipping the evt_get_variable call.
#define Return
Kills the current EVT thread.