Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
jump_charge_0.c
Go to the documentation of this file.
1#include "common.h"
2#include "script_api/battle.h"
4#include "effects.h"
5#include "sprite/player.h"
6
7#define NAMESPACE battle_move_jump_charge_0
8
10
12
13API_CALLABLE(N(func_802A1108_74D678)) {
14 Bytecode* args = script->ptrReadPos;
15 BattleStatus* battleStatus = &gBattleStatus;
16 s32 var1 = evt_get_variable(script, *args++);
17 s32 var2 = evt_get_variable(script, *args++);
18 s32 var3 = evt_get_variable(script, *args++);
19
20 fx_stat_change(0, var1, var2, var3, 1.0f, 60);
21
22 battleStatus->jumpCharge++;
23 if (battleStatus->jumpCharge > 99) {
24 battleStatus->jumpCharge = 99;
25 }
26
27 battleStatus->hammerCharge = 0;
28 battleStatus->flags1 |= BS_FLAGS1_JUMP_CHARGED;
29 battleStatus->flags1 &= ~BS_FLAGS1_HAMMER_CHARGED;
30
31 return ApiStatus_DONE2;
32}
33
34API_CALLABLE(N(func_802A120C_74D77C)) {
35 Bytecode* args = script->ptrReadPos;
36 s32 var0 = evt_get_variable(script, *args++);
37 s32 var1 = evt_get_variable(script, *args++);
38 s32 var2 = evt_get_variable(script, *args++);
39 f32 var3 = evt_get_float_variable(script, *args++);
40
41 fx_energy_in_out(6, var0 + 10, var1 + 18, var2, var3, 45);
42
43 return ApiStatus_DONE2;
44}
45
46EvtScript N(EVS_UseMove1) = {
47 Return
48 End
49};
50
51EvtScript N(EVS_UseMove0) = {
52 Call(UseBattleCamPreset, BTL_CAM_PLAYER_CHARGE_UP)
53 Wait(10)
55 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_PLAYER_CHARGE)
56 Wait(8)
57 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_PLAYER_CHARGE)
58 Wait(8)
60 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario1_FightingStance)
61 Call(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
62 Call(N(func_802A120C_74D77C), LVar0, LVar1, LVar2, Float(1.2))
63 Wait(3)
64 Call(N(func_802A120C_74D77C), LVar0, LVar1, LVar2, Float(0.8))
65 Wait(30)
66 Call(UseBattleCamPreset, BTL_CAM_DEFAULT)
67 Call(MoveBattleCamOver, 5)
68 Call(N(IsJumpMaxCharged))
69 IfEq(LVar0, FALSE)
70 Call(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
71 Add(LVar0, 10)
72 Add(LVar1, 25)
73 Add(LVar2, 5)
74 Call(N(func_802A1108_74D678), LVar0, LVar1, LVar2)
75 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_CHARGE_UP)
76 Wait(4)
77 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_LONG_PLAYER_JUMP)
78 Call(SetActorJumpGravity, ACTOR_PLAYER, Float(1.0))
79 Call(SetActorSpeed, ACTOR_PLAYER, Float(1.0))
80 Call(GetActorPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
81 Call(SetJumpAnimations, ACTOR_PLAYER, 0, ANIM_Mario1_Jump, ANIM_Mario1_Fall, ANIM_Mario1_Land)
82 Call(SetGoalPos, ACTOR_PLAYER, LVar0, LVar1, LVar2)
83 Call(PlayerHopToGoal, 20, 0, 0)
84 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario1_Land)
85 Wait(4)
86 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario1_Idle)
87 Call(UseIdleAnimation, ACTOR_PLAYER, TRUE)
88 Call(ShowVariableMessageBox, BTL_MSG_CHARGE_JUMP, 60, 1)
89 Else
90 Call(ShowMessageBox, BTL_MSG_CANT_CHARGE, 60)
91 EndIf
92 Label(0)
93 Wait(1)
94 Call(IsMessageBoxDisplayed, LVar0)
95 IfEq(LVar0, TRUE)
96 Goto(0)
97 EndIf
98 Call(UseIdleAnimation, ACTOR_PLAYER, FALSE)
99 Call(SetGoalToHome, ACTOR_PLAYER)
100 Call(SetActorSpeed, ACTOR_PLAYER, Float(8.0))
101 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario1_Run)
102 Call(PlayerRunToGoal, 0)
103 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario1_Idle)
104 Return
105 End
106};
Bytecode EvtScript[]
@ BS_FLAGS1_JUMP_CHARGED
Definition enums.h:3598
@ BTL_MSG_CANT_CHARGE
Definition enums.h:4066
@ BTL_MSG_CHARGE_JUMP
Definition enums.h:4064
@ BTL_CAM_DEFAULT
Definition enums.h:4824
@ BTL_CAM_PLAYER_CHARGE_UP
Definition enums.h:4854
@ SOUND_PLAYER_CHARGE
Definition enums.h:774
@ SOUND_CHARGE_UP
Definition enums.h:1436
@ SOUND_LONG_PLAYER_JUMP
Definition enums.h:782
@ ACTOR_PLAYER
Definition enums.h:2085
#define ApiStatus_DONE2
Definition evt.h:118
s32 Bytecode
Definition evt.h:7
s32 evt_get_variable(Evt *script, Bytecode var)
Definition evt.c:1690
f32 evt_get_float_variable(Evt *script, Bytecode var)
Definition evt.c:1930
#define Else
Marks the end of an if statement and the start of the else block.
Definition macros.h:295
#define EndChildThread
Marks the end of a child thread block.
Definition macros.h:563
#define End
Signals the end of EVT script data. A script missing this will likely crash on load.
Definition macros.h:213
#define Add(VAR, INT_VALUE)
Definition macros.h:376
#define Goto(LABEL_ID)
Moves execution to the given label.
Definition macros.h:232
#define Float(DOUBLE)
Definition macros.h:51
#define Label(LABEL_ID)
Marks this point in the script as a Goto target.
Definition macros.h:227
#define EndIf
Marks the end of an if statement or an else block.
Definition macros.h:298
#define LVar2
Definition macros.h:150
#define LVar1
Definition macros.h:149
#define Wait(NUM_FRAMES)
Blocks for the given number of frames.
Definition macros.h:254
#define IfEq(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR == RVAR.
Definition macros.h:269
#define Call(FUNC, ARGS...)
Calls a given C EVT API function with any number of arguments.
Definition macros.h:576
#define ChildThread
Marks the start of a child thread block.
Definition macros.h:560
#define LVar0
Definition macros.h:148
#define Return
Kills the current EVT thread.
Definition macros.h:217
BattleStatus gBattleStatus
Definition battle.c:11