6#include "sprite/npc/BattleGoombario.h"
8#define NAMESPACE battle_partner_goombario
13static b32 N(isCharged);
14extern s32 N(MultibonkChance);
37API_CALLABLE(N(GetReturnMoveTime)) {
47 script->varTable[0] = (
dist3D(posX, posY, posZ, goalX, goalY, goalZ) * 15.0f) / 100.0f;
49 if (script->varTable[0] >= 21) {
50 script->varTable[0] = 20;
54 if (script->varTable[0] < 10) {
55 script->varTable[0] = 10;
57 }
else if (script->varTable[0] < 15) {
58 script->varTable[0] = 15;
64API_CALLABLE(N(AdjustMultibonkChance)) {
67 script->varTable[0] = 99;
70 N(MultibonkChance) /= 100;
71 if (N(MultibonkChance) <
rand_int(100)) {
72 script->varTable[0] = 0;
78API_CALLABLE(N(ResetMultibonkChance)) {
79 N(MultibonkChance) = 200;
83API_CALLABLE(N(JumpOnTarget)) {
104 script->functionTemp[1] = 0;
105 script->functionTemp[0] = 0;
107 script->functionTemp[0] = 2;
111 if (script->functionTemp[0] == 0) {
116 stateCurrentX = state->
curPos.
x;
117 stateCurrentZ = actor->
curPos.
z;
118 state->
curPos.
z = stateCurrentZ;
119 state->
angle =
atan2(stateCurrentX, stateCurrentZ, stateGoalX, stateGoalZ);
120 state->
dist =
dist2D(stateCurrentX, stateCurrentZ, stateGoalX, stateGoalZ);
174 script->functionTemp[0] = 1;
177 switch (script->functionTemp[0]) {
231 script->functionTemp[0] = 3;
234 currentPosX64 = state->
curPos.
x;
257API_CALLABLE(N(OnMissHeadbonk)) {
263 script->functionTemp[0] = 0;
266 if (script->functionTemp[0] == 0) {
270 script->functionTemp[0] = 1;
288 if (partner->
curPos.
y < 10.0f) {
300API_CALLABLE(N(GetTattleMessage)) {
306 script->varTable[0] = *tattle;
308 if (script->varTable[0] == NULL) {
317API_CALLABLE(N(GetTattleCamPos)) {
322 script->varTable[1] = script->varTable[1] + (((target->
size.
y / 3) & 0xFF) * target->
scalingFactor);
325 script->varTable[1] = script->varTable[1] - (((target->
size.
y / 3) & 0xFF) * target->
scalingFactor);
334 if (xSize < target->size.x) {
335 xSize = target->
size.
x;
338 script->varTable[3] = xSize + 76;
346API_CALLABLE(N(OpenTattleWindow)) {
347 N(TattleWindowEffect) = fx_tattle_window(0, 206, 144, 0, 1.0f, 0);
352API_CALLABLE(N(CloseTattleWindow)) {
361API_CALLABLE(N(CanChargeMore)) {
365 script->varTable[0] = FALSE;
370 script->varTable[0] = TRUE;
375 script->varTable[0] = TRUE;
380 script->varTable[0] = TRUE;
388API_CALLABLE(N(ChargeAtPos)) {
389 Bytecode* args = script->ptrReadPos;
395 N(isCharged) = FALSE;
428 fx_stat_change(boostAmount, x, y, z, 1.0f, 60);
434API_CALLABLE(N(StopCharge)) {
438 battleStatus->
flags1 &= ~BS_FLAGS1_GOOMBARIO_CHARGED;
443API_CALLABLE(N(StopChargeAndGet)) {
450 script->varTable[0] = partner->
isGlowing;
457API_CALLABLE(N(GetChargeAmount)) {
465API_CALLABLE(N(PlayChargeFX)) {
466 Bytecode* args = script->ptrReadPos;
472 fx_energy_in_out(6, var1, var2, var3, var4, 45);
477API_CALLABLE(N(GetChargeMessage)) {
487s32 N(DefaultAnims)[] = {
498s32 N(DefenseTable)[] = {
503s32 N(StatusTable)[] = {
532 .posOffset = { 0, 0, 0 },
533 .targetOffset = { 8, 22 },
535 .idleAnimations = N(DefaultAnims),
536 .defenseTable = N(DefenseTable),
538 .elementImmunityFlags = 0,
544 .type = ACTOR_TYPE_GOOMBARIO,
545 .level = ACTOR_LEVEL_GOOMBARIO,
548 .partsData = N(ActorParts),
549 .initScript = &N(EVS_Init),
550 .statusTable = N(StatusTable),
553 .hurricaneChance = 0,
555 .upAndAwayChance = 0,
557 .powerBounceChance = 80,
560 .healthBarOffset = { 0, 0 },
561 .statusIconOffset = { -10, 20 },
562 .statusTextOffset = { 10, 20 },
581 Call(CloseActionCommandInfo)
677 Call(ShowActionHud, TRUE)
681 Call(LoadStarPowerScript)
741 Call(MoveBattleCamOver, 20)
755 Call(ActorSpeak, MSG_CH0_00BA,
ACTOR_PARTNER, 0, ANIM_BattleGoombario_Talk, ANIM_BattleGoombario_Idle)
777 Call(PartnerYieldTurn)
797 Call(N(GetReturnMoveTime))
799 Call(SetAnimation,
ACTOR_SELF, PRT_MAIN, ANIM_BattleGoombario_PreHeadbonk)
810 Call(SetAnimation,
ACTOR_SELF, PRT_MAIN, ANIM_BattleGoombario_PreHeadbonk)
815 Call(SetAnimation,
ACTOR_SELF, PRT_MAIN, ANIM_BattleGoombario_Idle)
828 Call(PartnerYieldTurn)
836 Call(N(GetReturnMoveTime))
863 Call(SetAnimation,
ACTOR_SELF, PRT_MAIN, ANIM_BattleGoombario_PreHeadbonk)
871 Call(SetAnimation,
ACTOR_SELF, PRT_MAIN, ANIM_BattleGoombario_PreHeadbonk)
878 Call(SetAnimation,
ACTOR_SELF, PRT_MAIN, ANIM_BattleGoombario_PreHeadbonk)
897 Call(InitTargetIterator)
934 Call(action_command_jump_init)
937 Call(SetAnimation,
ACTOR_SELF, PRT_MAIN, ANIM_BattleGoombario_PreHeadbonk)
943 Call(action_command_jump_start,
LVarA, 3)
945 Call(SetAnimation,
ACTOR_SELF, PRT_MAIN, ANIM_BattleGoombario_Headbonk)
948 Call(SetJumpAnimations,
ACTOR_PARTNER, 0, ANIM_BattleGoombario_Headbonk, ANIM_BattleGoombario_Headbonk, ANIM_BattleGoombario_Headbonk)
953 Call(SetJumpAnimations,
ACTOR_PARTNER, 0, ANIM_BattleGoombario_Headbonk, ANIM_BattleGoombario_Headbonk, ANIM_BattleGoombario_Headbonk)
954 Call(N(OnMissHeadbonk))
974 Call(N(GetChargeAmount))
978 Call(N(StopChargeAndGet))
1000 Call(CloseActionCommandInfo)
1002 Call(action_command_jump_init)
1003 Call(ShowActionHud, FALSE)
1004 Call(action_command_jump_start, 24, 3)
1016 Call(SetJumpAnimations,
ACTOR_PARTNER, 0, ANIM_BattleGoombario_Headbonk, ANIM_BattleGoombario_Headbonk, ANIM_BattleGoombario_Headbonk)
1027 Call(N(StopChargeAndGet))
1032 ExecWait(N(EVS_ReturnHome_Success))
1039 Call(action_command_jump_init)
1042 Call(SetAnimation,
ACTOR_SELF, PRT_MAIN, ANIM_BattleGoombario_PreHeadbonk)
1048 Call(action_command_jump_start,
LVarA, 3)
1050 Call(SetAnimation,
ACTOR_SELF, PRT_MAIN, ANIM_BattleGoombario_Headbonk)
1053 Call(SetJumpAnimations,
ACTOR_PARTNER, 0, ANIM_BattleGoombario_Headbonk, ANIM_BattleGoombario_Headbonk, ANIM_BattleGoombario_Headbonk)
1058 Call(SetJumpAnimations,
ACTOR_PARTNER, 0, ANIM_BattleGoombario_Headbonk, ANIM_BattleGoombario_Headbonk, ANIM_BattleGoombario_Headbonk)
1059 Call(N(OnMissHeadbonk))
1079 Call(N(GetChargeAmount))
1083 Call(N(StopChargeAndGet))
1105 Call(CloseActionCommandInfo)
1107 Call(action_command_jump_init)
1108 Call(ShowActionHud, FALSE)
1109 Call(action_command_jump_start, 24, 3)
1122 Call(SetJumpAnimations,
ACTOR_PARTNER, 0, ANIM_BattleGoombario_Headbonk, ANIM_BattleGoombario_Headbonk, ANIM_BattleGoombario_Headbonk)
1134 Call(N(StopChargeAndGet))
1139 ExecWait(N(EVS_ReturnHome_Success))
1146 Call(action_command_jump_init)
1149 Call(SetAnimation,
ACTOR_SELF, PRT_MAIN, ANIM_BattleGoombario_PreHeadbonk)
1155 Call(action_command_jump_start,
LVarA, 3)
1157 Call(SetAnimation,
ACTOR_SELF, PRT_MAIN, ANIM_BattleGoombario_Headbonk)
1160 Call(SetJumpAnimations,
ACTOR_PARTNER, 0, ANIM_BattleGoombario_Headbonk, ANIM_BattleGoombario_Headbonk, ANIM_BattleGoombario_Headbonk)
1165 Call(SetJumpAnimations,
ACTOR_PARTNER, 0, ANIM_BattleGoombario_Headbonk, ANIM_BattleGoombario_Headbonk, ANIM_BattleGoombario_Headbonk)
1166 Call(N(OnMissHeadbonk))
1186 Call(N(GetChargeAmount))
1190 Call(N(StopChargeAndGet))
1212 Call(CloseActionCommandInfo)
1214 Call(action_command_jump_init)
1215 Call(ShowActionHud, FALSE)
1216 Call(action_command_jump_start, 24, 3)
1226 Call(SetAnimation,
ACTOR_SELF, PRT_MAIN, ANIM_BattleGoombario_Headbonk)
1238 Call(SetJumpAnimations,
ACTOR_PARTNER, 0, ANIM_BattleGoombario_Headbonk, ANIM_BattleGoombario_Headbonk, ANIM_BattleGoombario_Headbonk)
1250 Call(N(StopChargeAndGet))
1255 ExecWait(N(EVS_ReturnHome_Success))
1260s32 N(actionCommandTable)[] = { 7, 6, 5, 4, 3, 2, 1, 0 };
1262s32 N(MultibonkChance) = 200;
1266 Call(action_command_jump_init)
1269 Call(SetAnimation,
ACTOR_SELF, PRT_MAIN, ANIM_BattleGoombario_PreHeadbonk)
1275 Call(action_command_jump_start,
LVarA, 1)
1277 Call(SetAnimation,
ACTOR_SELF, PRT_MAIN, ANIM_BattleGoombario_Headbonk)
1280 Call(SetJumpAnimations,
ACTOR_PARTNER, 0, ANIM_BattleGoombario_Headbonk, ANIM_BattleGoombario_Headbonk, ANIM_BattleGoombario_Headbonk)
1285 Call(SetJumpAnimations,
ACTOR_PARTNER, 0, ANIM_BattleGoombario_Headbonk, ANIM_BattleGoombario_Headbonk, ANIM_BattleGoombario_Headbonk)
1286 Call(N(OnMissHeadbonk))
1306 Call(N(GetChargeAmount))
1310 Call(N(StopChargeAndGet))
1342 Call(CloseActionCommandInfo)
1343 Call(SetActionDifficultyTable,
Ref(N(actionCommandTable)))
1345 Call(action_command_jump_init)
1349 Call(action_command_jump_start,
LVarA, 1)
1351 Call(action_command_jump_start,
LVarA, 2)
1353 Call(action_command_jump_start,
LVarA, 3)
1355 Call(action_command_jump_start,
LVarA, 4)
1357 Call(action_command_jump_start,
LVarA, 5)
1367 Call(SetAnimation,
ACTOR_SELF, PRT_MAIN, ANIM_BattleGoombario_Headbonk)
1379 Call(SetJumpAnimations,
ACTOR_PARTNER, 0, ANIM_BattleGoombario_Headbonk, ANIM_BattleGoombario_Headbonk, ANIM_BattleGoombario_Headbonk)
1384 Call(N(AdjustMultibonkChance))
1400 Call(N(GetChargeAmount))
1404 Call(N(StopChargeAndGet))
1409 Call(N(StopChargeAndGet))
1425 ExecWait(N(EVS_ReturnHome_Success))
1444 Call(InitTargetIterator)
1447 Call(N(OpenTattleWindow))
1456 Call(N(GetTattleCamPos))
1464 Call(N(GetTattleMessage))
1465 Call(ActorSpeak,
LVar0,
ACTOR_SELF, PRT_MAIN, ANIM_BattleGoombario_Talk, ANIM_BattleGoombario_Idle)
1466 Call(N(CloseTattleWindow))
1472 Call(PartnerYieldTurn)
1506 Call(MoveBattleCamOver, 10)
1507 Call(N(CanChargeMore))
1518 Call(SetJumpAnimations,
ACTOR_PARTNER, ANIM_BattleGoombario_Jump, 0x00000001, ANIM_BattleGoombario_Jump, ANIM_BattleGoombario_Jump)
1527 Call(N(GetChargeMessage))
@ ACTION_COMMAND_MODE_NOT_LEARNED
struct ActorBlueprint * actorBlueprint
struct TattleWindowFXData * tattleWindow
@ FX_INSTANCE_FLAG_DISMISS
@ BS_FLAGS1_GOOMBARIO_CHARGED
@ BS_FLAGS1_TRIGGER_EVENTS
@ BS_FLAGS1_INCLUDE_POWER_UPS
@ BTL_MSG_CHARGE_GOOMBARIO_MORE
@ BTL_MSG_CHARGE_GOOMBARIO
@ BTL_MENU_TYPE_STAR_POWERS
@ STATUS_TURN_MOD_DEFAULT
@ STATUS_TURN_MOD_PARALYZE
@ HIT_RESULT_NICE_NO_DAMAGE
@ BTL_CAM_GOOMBARIO_BONK_FOLLOWUP_2
@ BTL_CAM_GOOMBARIO_BONK_FOLLOWUP_1
@ BTL_CAM_PARTNER_MISTAKE
@ BTL_CAM_PARTNER_APPROACH
@ SUPPRESS_EVENT_SPIKY_FRONT
@ SUPPRESS_EVENT_BURN_CONTACT
@ SOUND_GOOMBARIO_HEADBONK
@ SOUND_GOOMBARIO_GATHERING
@ SOUND_TATTLE_WINDOW_OPEN
@ ACTOR_FLAG_UPSIDE_DOWN
HP bar offset below actor (e.g. Swooper when upside-down).
@ DAMAGE_TYPE_POWER_BOUNCE
s32 evt_get_variable(Evt *script, Bytecode var)
f32 dist3D(f32 ax, f32 ay, f32 az, f32 bx, f32 by, f32 bz)
f32 dist2D(f32 ax, f32 ay, f32 bx, f32 by)
void add_xz_vec3f(Vec3f *vector, f32 speed, f32 angleDeg)
void set_actor_anim(s32 actorID, s32 partID, AnimID animID)
Actor * get_actor(s32 actorID)
void play_movement_dust_effects(s32 var0, f32 xPos, f32 yPos, f32 zPos, f32 angleDeg)
f32 evt_get_float_variable(Evt *script, Bytecode var)
void save_tattle_flags(s32)
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_Partner_Celebrate
EvtScript EVS_RunAwayFail
EvtScript EVS_Partner_SpikeContact
EvtScript EVS_Partner_RunAway
void sfx_play_sound(s32 soundID)
@ GF_Tutorial_SwapTurnOrder
ApiStatus SetCamEnabled(Evt *script, b32 isInitialCall)
ApiStatus SetCamViewport(Evt *script, b32 isInitialCall)
ApiStatus SetCamLookTarget(Evt *script, b32 isInitialCall)
ApiStatus ShakeCam(Evt *script, b32 isInitialCall)
ApiStatus SetNoInterpCamParams(Evt *script, b32 isInitialCall)
ApiStatus SetCamNoDraw(Evt *script, b32 isInitialCall)
ApiStatus SetCamPerspective(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 DivF(VAR, FLOAT_VALUE)
#define IfGe(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR >= RVAR.
#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 EndChildThread
Marks the end of a child thread block.
#define Sub(VAR, INT_VALUE)
#define End
Signals the end of EVT script data. A script missing this will likely crash on load.
#define Mod(VAR, INT_VALUE)
#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 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 Thread
Marks the start of a thread block.
#define EndThread
Marks the end of a thread block.
#define Div(VAR, INT_VALUE)
#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 ChildThread
Marks the start of a child thread block.
#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.
ActorOffsets bActorOffsets[]
struct Actor * partnerActor
BattleStatus gBattleStatus