5#include "sprite/player.h"
7#define NAMESPACE battle_move_demo_power_bounce
11s32 N(DifficultyTable)[] = {
12 7, 6, 5, 4, 3, 2, 1, 0
15s32 N(BaseHitChance) = 200;
17API_CALLABLE(N(GetHitChance)) {
19 u32 enemyTargetPowerBounceChance;
21 script->varTable[0] = 99;
26 enemyTargetPowerBounceChance += 7;
29 N(BaseHitChance) *= enemyTargetPowerBounceChance;
30 N(BaseHitChance) /= 100;
32 if (N(BaseHitChance) <
rand_int(100)) {
33 script->varTable[0] = 0;
45 Call(ShowActionHud, TRUE)
65 Call(action_command_jump_init)
66 Call(SetActionDifficultyTable,
Ref(N(DifficultyTable)))
67 ExecWait(N(EVS_JumpSupport_Approach))
68 ExecWait(N(EVS_JumpSupport_CalcJumpTime))
72 Call(SetJumpAnimations,
ACTOR_PLAYER, 0, ANIM_Mario1_Jump, ANIM_Mario1_Fall, ANIM_MarioB1_Stomp)
92 ExecWait(N(EVS_JumpSupport_NoFollowUp))
116 Call(CloseActionCommandInfo)
117 Call(SetActionDifficultyTable,
Ref(N(DifficultyTable)))
119 Call(action_command_jump_init)
123 Call(action_command_jump_start,
LVarA, 1)
125 Call(action_command_jump_start,
LVarA, 2)
127 Call(action_command_jump_start,
LVarA, 3)
129 Call(action_command_jump_start,
LVarA, 4)
131 Call(action_command_jump_start,
LVarA, 5)
134 Call(SetJumpAnimations,
ACTOR_PLAYER, 0, ANIM_Mario1_Jump, ANIM_Mario1_Fall, ANIM_Mario1_SpinFall)
147 Call(N(GetHitChance))
182 ExecWait(N(EVS_JumpSupport_NoFollowUp))
188 ExecWait(N(EVS_JumpSupport_Rebound))
201 Call(action_command_jump_init)
202 Call(SetActionDifficultyTable,
Ref(N(DifficultyTable)))
203 ExecWait(N(EVS_JumpSupport_Approach))
204 ExecWait(N(EVS_JumpSupport_CalcJumpTime))
205 Call(action_command_jump_start,
LVarA, 1)
208 Call(SetJumpAnimations,
ACTOR_PLAYER, 0, ANIM_Mario1_Jump, ANIM_Mario1_Fall, ANIM_MarioB1_Stomp)
228 ExecWait(N(EVS_JumpSupport_NoFollowUp))
246 Call(CloseActionCommandInfo)
247 Call(SetActionDifficultyTable,
Ref(N(DifficultyTable)))
249 Call(action_command_jump_init)
253 Call(action_command_jump_start,
LVarA, 1)
255 Call(action_command_jump_start,
LVarA, 2)
257 Call(action_command_jump_start,
LVarA, 3)
259 Call(action_command_jump_start,
LVarA, 4)
261 Call(action_command_jump_start,
LVarA, 5)
265 Call(SetJumpAnimations,
ACTOR_PLAYER, 0, ANIM_Mario1_Jump, ANIM_Mario1_Sit, ANIM_Mario1_SpinJump)
283 Call(N(GetHitChance))
318 ExecWait(N(EVS_JumpSupport_NoFollowUp))
324 ExecWait(N(EVS_JumpSupport_Rebound))
337 Call(action_command_jump_init)
338 Call(SetActionDifficultyTable,
Ref(N(DifficultyTable)))
339 ExecWait(N(EVS_JumpSupport_Approach))
340 ExecWait(N(EVS_JumpSupport_CalcJumpTime))
341 Call(action_command_jump_start,
LVarA, 1)
344 Call(SetJumpAnimations,
ACTOR_PLAYER, 0, ANIM_Mario1_Jump, ANIM_Mario1_Fall, ANIM_MarioB1_Stomp)
364 ExecWait(N(EVS_JumpSupport_NoFollowUp))
382 Call(CloseActionCommandInfo)
383 Call(SetActionDifficultyTable,
Ref(N(DifficultyTable)))
385 Call(action_command_jump_init)
389 Call(action_command_jump_start,
LVarA, 1)
391 Call(action_command_jump_start,
LVarA, 2)
393 Call(action_command_jump_start,
LVarA, 3)
395 Call(action_command_jump_start,
LVarA, 4)
397 Call(action_command_jump_start,
LVarA, 5)
402 Call(SetJumpAnimations,
ACTOR_PLAYER, 0, ANIM_Mario1_Jump, ANIM_Mario1_Jump, ANIM_Mario1_SpinFall)
415 Call(N(GetHitChance))
450 ExecWait(N(EVS_JumpSupport_NoFollowUp))
456 ExecWait(N(EVS_JumpSupport_Rebound))
struct ActorBlueprint * actorBlueprint
@ BS_FLAGS1_TRIGGER_EVENTS
@ BS_FLAGS1_AUTO_SUCCEED_ACTION
@ 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.