9#include "sprite/npc/BattleSushie.h"
11#define NAMESPACE battle_partner_sushie
33API_CALLABLE(N(SetSquirtAngle)) {
55 if (partner->
rot.
z < 0.0f) {
56 partner->
rot.
z = 0.0f;
62API_CALLABLE(N(GetSquirtDamage)) {
64 s32 actionCmdResult = script->varTable[0];
67 script->varTable[0] = 0;
71 if (actionCmdResult <= 40) {
73 }
else if (actionCmdResult <= 75) {
77 script->varTable[0] = 1;
81 if (actionCmdResult <= 35) {
83 }
else if (actionCmdResult <= 60) {
85 }
else if (actionCmdResult <= 80) {
89 script->varTable[0] = 1;
93 if (actionCmdResult <= 20) {
95 }
else if (actionCmdResult <= 30) {
97 }
else if (actionCmdResult <= 60) {
99 }
else if (actionCmdResult <= 80) {
103 script->varTable[0] = 1;
108 script->varTable[15] = damage;
112API_CALLABLE(N(InflateSushie)) {
120 script->functionTemp[0] = 0;
121 script->functionTemp[1] = 6;
124 xScale = partnerActor->
scale.
x;
125 yScale = partnerActor->
scale.
y;
126 zScale = partnerActor->
scale.
z;
127 partnerActor->
scale.
x = xScale + ((1.0 - xScale) / 3.0);
128 partnerActor->
scale.
y = yScale + ((1.0 - yScale) / 3.0);
129 partnerActor->scale.z = zScale + ((1.0 - zScale) / 3.0);
131 if (script->functionTemp[1] != 0) {
132 script->functionTemp[1]--;
136 partnerActor->scale.x = 1.0f;
137 partnerActor->scale.y = 1.0f;
138 partnerActor->scale.z = 1.0f;
142API_CALLABLE(N(GetSquirtTargetPos)) {
143 f32 posX = script->varTable[0];
144 f32 posY = script->varTable[1];
146 add_vec2D_polar(&posX, &posY, 300.0f,
atan2(posX, posY, script->varTable[3], script->varTable[4]));
148 script->varTable[3] = posX;
149 script->varTable[4] = posY;
154API_CALLABLE(N(ApplyWaterBlock)) {
156 s32 var = script->varTable[0];
159 script->varTable[0] = 1;
161 script->varTable[0] = 0;
164 script->varTable[15] = 0;
165 script->varTable[10] = var;
175API_CALLABLE(N(PlaySquirtFX)) {
185API_CALLABLE(N(PlayWaterBlockFX)) {
187 Bytecode* args = script->ptrReadPos;
193 if (effect != NULL) {
202API_CALLABLE(N(ProcessTidalWave)) {
208 script->functionTemp[0] = 0;
211 switch (script->functionTemp[0]) {
216 state->
angle = 315.0f;
219 state->
speed = 32.0f;
220 script->functionTemp[1] = 0;
221 script->functionTemp[2] = 0;
226 script->functionTemp[0] = 1;
230 if (state->
curPos.
x < -160.0f) {
231 if (script->functionTemp[1] != 0) {
232 script->functionTemp[0] = 2;
235 if (state->
angle >= 270.0f && state->
angle < 360.0f) {
239 if (state->
angle >= 180.0f && state->
angle < 270.0f) {
245 if (state->
curPos.
x > 160.0f) {
246 if (script->functionTemp[1] != 0) {
247 script->functionTemp[0] = 2;
252 if (state->
angle >= 0.0f && state->
angle < 90.0f) {
255 }
else if (state->
angle >= 90.0f && state->
angle < 180.0f) {
261 if (script->functionTemp[2] != 0) {
266 script->functionTemp[2] = 1 - script->functionTemp[2];
270 if (script->functionTemp[1] != 0) {
271 script->functionTemp[0] = 2;
276 if (state->
angle >= 270.0f && state->
angle < 360.0f) {
279 }
else if (state->
angle >= 0.0f && state->
angle < 90.0f) {
285 if (script->functionTemp[2] != 0) {
290 script->functionTemp[2] = 1 - script->functionTemp[2];
293 if (state->
curPos.
y > 130.0f) {
294 if (script->functionTemp[1] != 0) {
295 script->functionTemp[0] = 2;
300 if (state->
angle >= 90.0f && state->
angle < 180.0f) {
303 }
else if (state->
angle >= 180.0f && state->
angle < 270.0f) {
309 if (script->functionTemp[2] != 0) {
314 script->functionTemp[2] = 1 - script->functionTemp[2];
320 if (partner->
scale.
x < 1.0) {
336 fx_underwater(0, -50.0f, 20.0f, 0.0f, 1.0f, 120);
342 script->functionTemp[1] = 1;
347 switch (script->functionTemp[0]) {
350 script->functionTemp[0] = 3;
360 partner->
rot.
z = 0.0f;
375API_CALLABLE(N(SetScaleTidalWaveCharge)) {
378 f32 var = script->varTable[0] * 3.0 / 100.0 + 1.0;
379 f32 xScale = partnerActor->
scale.
x;
380 f32 yScale = partnerActor->
scale.
y;
381 f32 zScale = partnerActor->
scale.
z;
383 partnerActor->
scale.
x = xScale + ((var - xScale) / 3);
384 partnerActor->
scale.
y = yScale + ((var - yScale) / 3);
385 partnerActor->
scale.
z = zScale + ((var - zScale) / 3);
390s32 N(DefaultAnims)[] = {
401s32 N(DefenseTable)[] = {
406s32 N(StatusTable)[] = {
435 .posOffset = { 0, 0, 0 },
436 .targetOffset = { 12, 17 },
438 .idleAnimations = N(DefaultAnims),
439 .defenseTable = N(DefenseTable),
441 .elementImmunityFlags = 0,
442 .projectileTargetOffset = { 0, 0 },
448 .type = ACTOR_TYPE_SUSHIE,
449 .level = ACTOR_LEVEL_SUSHIE,
452 .partsData = N(ActorParts),
453 .initScript = &N(EVS_Init),
454 .statusTable = N(StatusTable),
457 .hurricaneChance = 0,
459 .upAndAwayChance = 0,
461 .powerBounceChance = 80,
464 .healthBarOffset = { 0, 0 },
465 .statusIconOffset = { -10, 20 },
466 .statusTextOffset = { 10, 20 },
485 Call(CloseActionCommandInfo)
601 Call(ShowActionHud, TRUE)
606 Call(LoadStarPowerScript)
629EvtScript N(EVS_ReturnHome_BellyFlop_Success) = {
630 Call(PartnerYieldTurn)
658EvtScript N(EVS_ReturnHome_BellyFlop_Miss) = {
659 Call(PartnerYieldTurn)
682EvtScript N(EVS_ReturnHome_Squirt_Success) = {
683 Call(PartnerYieldTurn)
693EvtScript N(EVS_ReturnHome_Squirt_Miss) = {
694 Call(PartnerYieldTurn)
737 Call(action_command_hammer_init)
747 Call(action_command_hammer_start, 0, 57, 3)
748 Call(SetActionQuality, 0)
766 Call(MoveBattleCamOver, 20)
924 ExecWait(N(EVS_ReturnHome_BellyFlop_Miss))
929 Call(MoveBattleCamOver, 8)
930 ExecWait(N(EVS_ReturnHome_BellyFlop_Success))
939 Call(action_command_squirt_init)
943 Call(SetupMashMeter, 3, 40, 75, 100, 0, 0)
945 Call(SetupMashMeter, 4, 35, 60, 80, 100, 0)
947 Call(SetupMashMeter, 5, 20, 40, 60, 80, 100)
951 Call(MoveBattleCamOver, 40)
952 Call(InitTargetIterator)
962 Call(N(SetSquirtAngle))
964 Call(AddBattleCamDist, -80)
965 Call(MoveBattleCamOver, 90 *
DT)
966 Call(action_command_squirt_start, 0, 87 *
DT, 3)
987 Call(MoveBattleCamOver, 10)
996 Call(N(GetSquirtTargetPos))
997 PlayEffect(EFFECT_SQUIRT, 0,
LVar0,
LVar1,
LVar2,
LVar3,
LVar4,
LVar5,
LVarE, 10, 0)
999 ExecWait(N(EVS_ReturnHome_Squirt_Miss))
1004 Call(N(InflateSushie))
1010 PlayEffect(EFFECT_SQUIRT, 0,
LVar0,
LVar1,
LVar2,
LVar3,
LVar4,
LVar5,
LVarE, 10, 0)
1013 Call(N(GetSquirtDamage))
1025 ExecWait(N(EVS_ReturnHome_Squirt_Miss))
1029 ExecWait(N(EVS_ReturnHome_Squirt_Success))
1038 Call(InitTargetIterator)
1040 Call(SetBattleCamTarget, -95, 26, 10)
1041 Call(SetBattleCamOffsetY, 11)
1042 Call(SetBattleCamDist, 238)
1043 Call(MoveBattleCamOver, 30)
1052 Call(action_command_water_block_init, 0)
1053 Call(SetActionHudPrepareTime, 0)
1061 Call(action_command_water_block_start, 0, 100, 3)
1071 Call(SetBattleCamTarget, -95, 27, 10)
1072 Call(SetBattleCamOffsetY, 11)
1073 Call(SetBattleCamDist, 277)
1074 Call(MoveBattleCamOver, 10)
1077 Call(N(PlaySquirtFX))
1109 Call(N(ApplyWaterBlock))
1118 Call(MoveBattleCamOver, 20)
1119 Call(PartnerYieldTurn)
1135 Call(WaitForMessageBoxDone)
1143 Call(action_command_tidal_wave_init)
1144 Call(SetupMashMeter, 5, 20, 30, 60, 80, 100)
1145 Call(InitTargetIterator)
1147 Call(SetBattleCamTarget, -65, 53, 10)
1148 Call(SetBattleCamOffsetY, 16)
1149 Call(SetBattleCamDist, 214)
1150 Call(MoveBattleCamOver, 20)
1161 Call(action_command_tidal_wave_start, 0, 100, 3)
1187 Call(N(SetScaleTidalWaveCharge))
1191 Call(MoveBattleCamOver, 5)
1194 Call(N(ProcessTidalWave))
1199 Call(MoveBattleCamOver, 20)
1203 Call(InitTargetIterator)
1223 Call(PartnerYieldTurn)
struct ActorBlueprint * actorBlueprint
Vec2b projectileTargetOffset
#define sfx_play_sound_at_position
struct WaterFountainFXData * waterFountain
struct PartnerBuffFXData * partnerBuff
@ FX_BUFF_DATA_WATER_BLOCK
@ FX_INSTANCE_FLAG_DISMISS
@ ACTION_COMMAND_WATER_BLOCK
@ ACTION_COMMAND_TIDAL_WAVE
@ BS_FLAGS1_TRIGGER_EVENTS
@ BS_FLAGS1_INCLUDE_POWER_UPS
@ BTL_MSG_WATER_BLOCK_BEGIN
@ BTL_MENU_TYPE_STAR_POWERS
@ STATUS_TURN_MOD_DEFAULT
@ STATUS_TURN_MOD_PARALYZE
@ HIT_RESULT_NICE_NO_DAMAGE
@ BTL_CAM_PARTNER_CLOSE_UP
@ BTL_CAM_PARTNER_MISTAKE
@ SUPPRESS_EVENT_EXPLODE_CONTACT
@ SUPPRESS_EVENT_FLAG_200
@ SUPPRESS_EVENT_SPIKY_FRONT
@ SUPPRESS_EVENT_BURN_CONTACT
@ SOUND_SUSHIE_BELLY_FLOP
@ SOUND_TIDAL_WAVE_LEAP_B
@ SOUND_CREATE_WATER_BLOCK
@ SOUND_TIDAL_WAVE_LEAP_A
@ DAMAGE_TYPE_MULTIPLE_POPUPS
ActorPart * get_actor_part(Actor *actor, s32 partID)
Actor * get_actor(s32 actorID)
void set_goal_pos_to_part(ActorState *state, s32 actorID, s32 partID)
f32 evt_get_float_variable(Evt *script, Bytecode var)
void add_vec2D_polar(f32 *x, f32 *y, f32 r, f32 theta)
EvtScript EVS_Partner_Hit
EvtScript EVS_Partner_Recover
EvtScript EVS_Partner_BurnContact
EvtScript EVS_Partner_Drop
EvtScript EVS_Partner_NoDamageHit
EvtScript EVS_Partner_ShockHit
EvtScript EVS_Partner_BurnHit
EvtScript EVS_RunAwayFail
EvtScript EVS_Partner_SpikeContact
EvtScript EVS_Partner_RunAway
#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 DivF(VAR, FLOAT_VALUE)
#define Set(VAR, INT_VALUE)
Sets the given variable to a given value casted to an integer.
#define AddF(VAR, FLOAT_VALUE)
#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 IfNe(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR != RVAR.
#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 CaseGe(RVAR)
Marks the start of a switch case that executes only if LVAR >= RVAR. It also marks the end of any pre...
#define Goto(LABEL_ID)
Moves execution to the given label.
#define IfGt(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 BreakLoop
Breaks out of the innermost loop.
#define Thread
Marks the start of a thread block.
#define EndThread
Marks the end of a thread block.
#define SetF(VAR, FLOAT_VALUE)
Sets the given variable to a given value, but supports Floats.
#define Wait(NUM_FRAMES)
Blocks for the given number of frames.
#define SubF(VAR, FLOAT_VALUE)
#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 CaseGt(RVAR)
Marks the start of a switch case that executes only if LVAR <= RVAR. It also marks the end of any pre...
#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.
struct EffectInstance * waterBlockEffect
struct Actor * partnerActor
struct Actor * playerActor
struct EffectInstance * buffEffect
BattleStatus gBattleStatus