5#include "sprite/player.h"
7#define NAMESPACE battle_move_power_bounce
11s32 N(DifficultyTable)[] = {
12 7, 6, 5, 4, 3, 2, 1, 0
15s32 N(BaseHitChance) = 200;
17API_CALLABLE(N(GetHitChance)) {
19 s32 powerBounceChance;
21 script->varTable[0] = 99;
24 powerBounceChance += 7;
26 N(BaseHitChance) = N(BaseHitChance) * powerBounceChance / 100;
28 if (N(BaseHitChance) <
rand_int(100)) {
29 script->varTable[0] = 0;
37API_CALLABLE(N(InitializeHitCounter)) {
42API_CALLABLE(N(IncrementHitCounter)) {
47API_CALLABLE(N(StoreHitCountRecord)) {
63 Call(ShowActionHud, TRUE)
64 Call(N(InitializeHitCounter))
77 Call(N(StoreHitCountRecord))
84 Call(action_command_jump_init)
85 Call(SetActionDifficultyTable,
Ref(N(DifficultyTable)))
86 ExecWait(N(EVS_JumpSupport_Approach))
87 ExecWait(N(EVS_JumpSupport_CalcJumpTime))
91 Call(SetJumpAnimations,
ACTOR_PLAYER, 0, ANIM_Mario1_Jump, ANIM_Mario1_Fall, ANIM_MarioB1_Stomp)
111 ExecWait(N(EVS_JumpSupport_NoFollowUp))
125 Call(N(IncrementHitCounter))
136 Call(CloseActionCommandInfo)
137 Call(SetActionDifficultyTable,
Ref(N(DifficultyTable)))
139 Call(action_command_jump_init)
143 Call(action_command_jump_start,
LVarA, 1)
145 Call(action_command_jump_start,
LVarA, 2)
147 Call(action_command_jump_start,
LVarA, 3)
149 Call(action_command_jump_start,
LVarA, 4)
151 Call(action_command_jump_start,
LVarA, 5)
154 Call(SetJumpAnimations,
ACTOR_PLAYER, 0, ANIM_Mario1_Jump, ANIM_Mario1_Fall, ANIM_Mario1_SpinFall)
167 Call(N(GetHitChance))
203 ExecWait(N(EVS_JumpSupport_Rebound))
206 ExecWait(N(EVS_JumpSupport_NoFollowUp))
212 ExecWait(N(EVS_JumpSupport_Rebound))
218 Call(N(IncrementHitCounter))
226 Call(action_command_jump_init)
227 Call(SetActionDifficultyTable,
Ref(N(DifficultyTable)))
228 ExecWait(N(EVS_JumpSupport_Approach))
229 ExecWait(N(EVS_JumpSupport_CalcJumpTime))
230 Call(action_command_jump_start,
LVarA, 1)
233 Call(SetJumpAnimations,
ACTOR_PLAYER, 0, ANIM_Mario1_Jump, ANIM_Mario1_Fall, ANIM_MarioB1_Stomp)
253 ExecWait(N(EVS_JumpSupport_NoFollowUp))
261 Call(N(IncrementHitCounter))
272 Call(CloseActionCommandInfo)
273 Call(SetActionDifficultyTable,
Ref(N(DifficultyTable)))
275 Call(action_command_jump_init)
279 Call(action_command_jump_start,
LVarA, 1)
281 Call(action_command_jump_start,
LVarA, 2)
283 Call(action_command_jump_start,
LVarA, 3)
285 Call(action_command_jump_start,
LVarA, 4)
287 Call(action_command_jump_start,
LVarA, 5)
291 Call(SetJumpAnimations,
ACTOR_PLAYER, 0, ANIM_Mario1_Jump, ANIM_Mario1_Sit, ANIM_Mario1_SpinJump)
309 Call(N(GetHitChance))
345 ExecWait(N(EVS_JumpSupport_Rebound))
348 ExecWait(N(EVS_JumpSupport_NoFollowUp))
354 ExecWait(N(EVS_JumpSupport_Rebound))
360 Call(N(IncrementHitCounter))
368 Call(action_command_jump_init)
369 Call(SetActionDifficultyTable,
Ref(N(DifficultyTable)))
370 ExecWait(N(EVS_JumpSupport_Approach))
371 ExecWait(N(EVS_JumpSupport_CalcJumpTime))
372 Call(action_command_jump_start,
LVarA, 1)
375 Call(SetJumpAnimations,
ACTOR_PLAYER, 0, ANIM_Mario1_Jump, ANIM_Mario1_Fall, ANIM_MarioB1_Stomp)
395 ExecWait(N(EVS_JumpSupport_NoFollowUp))
403 Call(N(IncrementHitCounter))
415 Call(CloseActionCommandInfo)
416 Call(SetActionDifficultyTable,
Ref(N(DifficultyTable)))
418 Call(action_command_jump_init)
422 Call(action_command_jump_start,
LVarA, 1)
424 Call(action_command_jump_start,
LVarA, 2)
426 Call(action_command_jump_start,
LVarA, 3)
428 Call(action_command_jump_start,
LVarA, 4)
430 Call(action_command_jump_start,
LVarA, 5)
435 Call(SetJumpAnimations,
ACTOR_PLAYER, 0, ANIM_Mario1_Jump, ANIM_Mario1_Jump, ANIM_Mario1_SpinFall)
448 Call(N(GetHitChance))
484 ExecWait(N(EVS_JumpSupport_Rebound))
487 ExecWait(N(EVS_JumpSupport_NoFollowUp))
493 ExecWait(N(EVS_JumpSupport_Rebound))
499 Call(N(IncrementHitCounter))
struct ActorBlueprint * actorBlueprint
@ BS_FLAGS1_TRIGGER_EVENTS
@ BS_FLAGS1_INCLUDE_POWER_UPS
@ HIT_RESULT_NICE_NO_DAMAGE
@ BTL_CAM_PLAYER_PRE_ULTRA_JUMP_FINISH
@ BTL_CAM_PLAYER_PRE_JUMP_FINISH
@ BTL_CAM_PLAYER_JUMP_FINISH
@ BTL_CAM_PLAYER_JUMP_MIDAIR
@ DAMAGE_TYPE_POWER_BOUNCE
s32 is_ability_active(s32 arg0)
Actor * get_actor(s32 actorID)
#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 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 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 Add(VAR, INT_VALUE)
#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 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 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 CaseGt(RVAR)
Marks the start of a switch case that executes only if LVAR <= RVAR. It also marks the end of any pre...
#define Return
Kills the current EVT thread.