9#include "sprite/npc/BattleWatt.h"
10#include "sprite/player.h"
12#define NAMESPACE battle_partner_watt
35static s32 sWattEffectData_initialized;
36static s32 sWattEffectData_isBouncing;
37static s32 sWattEffectData_bouncePhase;
38static s32 sWattEffectData_isActive;
39static s32 sWattEffectData_currentEffectIndex;
53 sWattEffectData_isBouncing =
TRUE;
54 sWattEffectData_bouncePhase = 0;
55 sWattEffectData_isActive =
TRUE;
56 sWattEffectData_currentEffectIndex = 0;
59 sWattEffectData_initialized =
TRUE;
62 if (!sWattEffectData_initialized) {
66 if (sWattEffectData_isBouncing) {
67 sWattEffectData_bouncePhase += 15;
68 sWattEffectData_bouncePhase =
clamp_angle(sWattEffectData_bouncePhase);
79 if (sWattEffectData_isActive) {
80 switch (sWattEffectData_currentEffectIndex) {
82 if (sWattEffectData_effect1 ==
NULL) {
85 if (sWattEffectData_effect2 !=
NULL) {
87 sWattEffectData_effect2 =
NULL;
94 if (sWattEffectData_effect1 !=
NULL) {
96 sWattEffectData_effect1 =
NULL;
98 if (sWattEffectData_effect2 ==
NULL) {
107 if (sWattEffectData_effect1 !=
NULL) {
109 sWattEffectData_effect1 =
NULL;
111 if (sWattEffectData_effect2 !=
NULL) {
113 sWattEffectData_effect2 =
NULL;
121 sWattEffectData_initialized =
FALSE;
122 if (sWattEffectData_effect1 !=
NULL) {
125 if (sWattEffectData_effect2 !=
NULL) {
133 sWattEffectData_isBouncing = 1;
138 sWattEffectData_isBouncing = 0;
143 sWattEffectData_isActive = 1;
148 sWattEffectData_isActive = 0;
175 if (effect !=
NULL) {
178 N(radialShimmer) =
NULL;
191 data = N(thunderboltRing)->data.thunderboltRing;
209 script->functionTemp[0]--;
210 if (
script->functionTemp[0] == 0) {
211 N(bulbGlow)->data.bulbGlow->timeLeft = 5;
232 script->varTable[0] = statusChance;
251 script->functionTemp[0] = 0;
254 switch (
script->functionTemp[0]) {
269 partner->state.acceleration = 0.5f;
271 script->functionTemp[1] = 10;
272 script->functionTemp[0] = 1;
289 if (
partner->state.moveTime == 0) {
290 script->functionTemp[0] = 2;
306 if (
partner->state.angle < 45.0f) {
307 script->functionTemp[0] = 3;
325 if (
script->functionTemp[2] == 0) {
327 script->functionTemp[1]++;
340 data = N(thunderboltRing)->data.thunderboltRing;
378 script->functionTemp[0] = 0;
381 switch (
script->functionTemp[0]) {
387 script->functionTemp[2] = 20;
388 script->functionTemp[3] = 10;
390 N(thunderboltRing)->data.thunderboltRing->unk_30 = 3;
392 script->functionTemp[0] = 1;
395 N(thunderboltRing)->data.thunderboltRing->unk_30 =
396 ((
script->functionTemp[3] * 3) + (
script->functionTemp[1] * (10 -
script->functionTemp[3]))) / 10;
397 if (
script->functionTemp[3] != 0) {
398 script->functionTemp[3]--;
400 if (
script->functionTemp[2] == 0) {
404 script->functionTemp[2]--;
494 .posOffset = { 0, 0, 0 },
495 .targetOffset = { 10, 22 },
500 .elementImmunityFlags = 0,
501 .projectileTargetOffset = { 0, 0 },
516 .hurricaneChance = 0,
518 .upAndAwayChance = 0,
520 .powerBounceChance = 80,
523 .healthBarOffset = { 0, 0 },
524 .statusIconOffset = { -10, 20 },
525 .statusTextOffset = { 10, 20 },
BSS s32 PopupMenu_SelectedIndex
struct SelectableTarget targetData[24]
@ FX_BUFF_DATA_TURBO_CHARGE
@ FX_SHOCK_OVERLAY_MEGA_SHOCK
EffectInstanceDataPtr data
struct StaticStatusFXData * staticStatus
#define STATUS_FLAGS_IMMOBILIZED
@ FX_INSTANCE_FLAG_DISMISS
@ ACTION_COMMAND_MEGA_SHOCK
@ ACTION_COMMAND_THREE_CHANCES
@ ACTION_COMMAND_BODY_SLAM
@ ACTION_COMMAND_POWER_SHOCK
@ BS_FLAGS1_TRIGGER_EVENTS
@ BS_FLAGS1_INCLUDE_POWER_UPS
@ BTL_MSG_TURBO_CHARGE_BEGIN
@ ACTOR_PAL_ADJUST_WATT_IDLE
@ ACTOR_PAL_ADJUST_WATT_ATTACK
@ ACTOR_EVENT_FLAG_ELECTRIFIED
Player takes shock damage upon contact.
@ ACTOR_EVENT_FLAG_ILLUSORY
Player attacks pass through and miss.
@ BTL_MENU_TYPE_STAR_POWERS
@ BS_FLAGS2_OVERRIDE_INACTIVE_PARTNER
@ BS_FLAGS2_STORED_TURBO_CHARGE_TURN
@ BS_FLAGS2_PLAYER_TURN_USED
@ BS_FLAGS2_PARTNER_TURN_USED
@ STATUS_TURN_MOD_DEFAULT
@ STATUS_TURN_MOD_PARALYZE
@ HIT_RESULT_NICE_NO_DAMAGE
@ BTL_CAM_CLOSER_PARTNER_APPROACH
@ BTL_CAM_PARTNER_MISTAKE
@ BTL_CAM_PARTNER_APPROACH
@ SUPPRESS_EVENT_SPIKY_TOP
@ SUPPRESS_EVENT_ALT_SPIKY
@ SUPPRESS_EVENT_SHOCK_CONTACT
@ SUPPRESS_EVENT_SPIKY_FRONT
@ SUPPRESS_EVENT_BURN_CONTACT
@ SOUND_WATT_MEGA_DISCHARGE
@ SOUND_WATT_MEGA_CHARGE_WAVE
@ SOUND_WATT_TURBO_CHARGE
@ ACTOR_FLAG_FLYING
Quake Hammer can't hit.
@ ACTOR_FLAG_NO_INACTIVE_ANIM
@ ACTOR_FLAG_UPSIDE_DOWN
HP bar offset below actor (e.g. Swooper when upside-down).
@ ACTOR_PART_FLAG_PRIMARY_TARGET
@ DAMAGE_TYPE_STATUS_ALWAYS_HITS
@ DAMAGE_TYPE_IGNORE_DEFENSE
@ DAMAGE_TYPE_MULTIPLE_POPUPS
s32 evt_get_variable(Evt *script, Bytecode var)
f32 dist2D(f32 ax, f32 ay, f32 bx, f32 by)
ActorPart * get_actor_part(Actor *actor, s32 partID)
Actor * get_actor(s32 actorID)
s32 lookup_status_chance(s32 *, 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
#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 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 SetPriority(PRIORITY)
Sets the current thread's priority. Higher-priority threads execute before lower-priority threads on ...
#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 Goto(LABEL_ID)
Moves execution to the given label.
#define NPC_DISPOSE_POS_Y
#define IfGt(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR <= RVAR.
#define DMG_STATUS_ALWAYS(typeFlag, duration)
#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 KillThread(TID)
Kills a thread by its thread ID.
#define SetF(VAR, FLOAT_VALUE)
Sets the given variable to a given value, but supports Floats.
#define IfFlag(LVAR, RVAR)
Marks the beginning of an if statement that only executes if the RVAR flag is set on LVAR,...
#define ExecGetTID(EVT_SOURCE, OUTVAR)
Identical to Exec, but the newly-launched thread ID is stored in OUTVAR.
#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 Actor * partnerActor
struct Actor * playerActor
@ ACV_THREE_CHANCES_TURBO_CHARGE
BattleStatus gBattleStatus