Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
snowman_doll.c
Go to the documentation of this file.
1#include "common.h"
2#include "script_api/battle.h"
3#include "effects.h"
4#include "model.h"
5#include "sprite/player.h"
6
7#define NAMESPACE battle_item_snowman_doll
8
10
11API_CALLABLE(N(func_802A123C_71C06C)) {
12 Bytecode* args = script->ptrReadPos;
13 s32 x = evt_get_variable(script, *args++);
14 s32 y = evt_get_variable(script, *args++);
15 s32 z = evt_get_variable(script, *args++);
16
17 fx_sparkles(FX_SPARKLES_2, x, y, z, 30.0f);
18 fx_sparkles(FX_SPARKLES_2, x, y, z, 30.0f);
19
20 return ApiStatus_DONE2;
21}
22
25
27
28EvtScript N(EVS_UseItem) = {
29 SetConst(LVarA, ITEM_SNOWMAN_DOLL)
30 ExecWait(N(UseItemWithEffect))
32 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_WINTERY_JINGLE)
33 Thread
34 Loop(45)
35 Call(RandInt, 300, LVar0)
36 Sub(LVar0, 150)
37 Set(LVar1, 170)
38 Call(RandInt, 50, LVar2)
39 Sub(LVar2, 25)
40 PlayEffect(EFFECT_SNOWFLAKE, LVar0, LVar1, LVar2, 60, 0)
41 Wait(2)
44 Wait(10)
45 Call(UseBattleCamPreset, BTL_CAM_VIEW_ENEMIES)
46 Call(MoveBattleCamOver, 50)
47 Wait(50)
48 PlayEffect(EFFECT_SNOWMAN_DOLL, 0, 0, 0, 20, Float(1.0), 160, 0)
49 Thread
50 Wait(17)
51 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_SNOWMAN_DOLL_JUMP)
52 Call(StartRumble, BTL_RUMBLE_PLAYER_HEAVY)
53 Call(ShakeCam, CAM_BATTLE, 0, 5, Float(1.0))
54 Wait(46)
55 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_SNOWMAN_DOLL_JUMP)
56 Call(StartRumble, BTL_RUMBLE_PLAYER_HEAVY)
57 Call(ShakeCam, CAM_BATTLE, 0, 5, Float(1.0))
58 Wait(25)
59 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_SNOWMAN_DOLL_JUMP)
60 Call(StartRumble, BTL_RUMBLE_PLAYER_HEAVY)
61 Call(ShakeCam, CAM_BATTLE, 0, 5, Float(1.0))
62 Wait(25)
63 Call(PlaySoundAtActor, ACTOR_PLAYER, SOUND_SNOWMAN_DOLL_JUMP)
64 Call(StartRumble, BTL_RUMBLE_PLAYER_HEAVY)
65 Call(ShakeCam, CAM_BATTLE, 0, 5, Float(1.0))
67 Wait(15)
69 Call(ShakeCam, CAM_BATTLE, 0, 5, Float(1.0))
70 Call(ShakeCam, CAM_BATTLE, 0, 10, Float(2.0))
71 Call(ShakeCam, CAM_BATTLE, 0, 5, Float(1.0))
72 Wait(110)
73 Call(InitTargetIterator)
74 Label(0)
75 Call(SetGoalToTarget, ACTOR_SELF)
76 Call(ItemCheckHit, LVar0, DAMAGE_TYPE_NO_CONTACT, 0, LVar0, 0)
78 Goto(1)
79 EndIf
80 Call(GetGoalPos, ACTOR_SELF, LVar0, LVar1, LVar2)
81 Call(N(func_802A123C_71C06C), LVar0, LVar1, LVar2)
82 Call(GetItemPower, ITEM_SNOWMAN_DOLL, LVar0, LVar1)
84 Wait(5)
85 Label(1)
86 Call(ChooseNextTarget, ITER_NEXT, LVar0)
88 Goto(0)
89 EndIf
90 Call(SetAnimation, ACTOR_PLAYER, 0, ANIM_Mario1_Idle)
91 Wait(30)
93 ExecWait(N(PlayerGoHome))
94 Return
95 End
96};
Bytecode EvtScript[]
@ FX_SPARKLES_2
Definition effects.h:236
@ BS_FLAGS1_TRIGGER_EVENTS
Definition enums.h:3575
@ ITER_NO_MORE
Definition enums.h:2030
@ ITER_NEXT
Definition enums.h:2025
@ HIT_RESULT_MISS
Definition enums.h:1956
@ BTL_CAM_VIEW_ENEMIES
Definition enums.h:4825
@ SOUND_WINTERY_JINGLE
Definition enums.h:1171
@ SOUND_SNOWMAN_DOLL_JUMP
Definition enums.h:1351
@ BTL_RUMBLE_PLAYER_HEAVY
Definition enums.h:4261
@ BTL_RUMBLE_PLAYER_EXTREME
Definition enums.h:4262
@ ACTOR_PLAYER
Definition enums.h:2085
@ ACTOR_SELF
Definition enums.h:2084
@ CAM_BATTLE
Definition enums.h:1801
@ DAMAGE_TYPE_ICE
Definition enums.h:2854
@ DAMAGE_TYPE_IGNORE_DEFENSE
Definition enums.h:2877
@ DAMAGE_TYPE_NO_CONTACT
Definition enums.h:2878
@ DAMAGE_TYPE_MULTIPLE_POPUPS
Definition enums.h:2879
#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
ApiStatus FadeBackgroundLighten(Evt *script, b32 isInitialCall)
ApiStatus FadeBackgroundDarken(Evt *script, b32 isInitialCall)
ApiStatus RandInt(Evt *script, b32 isInitialCall)
ApiStatus ShakeCam(Evt *script, b32 isInitialCall)
ApiStatus GetItemPower(Evt *script, b32 isInitialCall)
#define Set(VAR, INT_VALUE)
Sets the given variable to a given value casted to an integer.
Definition macros.h:365
#define Sub(VAR, INT_VALUE)
Definition macros.h:377
#define IfNe(LVAR, RVAR)
Marks the beginning of an if statement that only executes if LVAR != RVAR.
Definition macros.h:272
#define End
Signals the end of EVT script data. A script missing this will likely crash on load.
Definition macros.h:213
#define EndLoop
Marks the end of a loop.
Definition macros.h:248
#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 ExecWait(EVT_SOURCE)
Launches a new child thread.
Definition macros.h:475
#define Thread
Marks the start of a thread block.
Definition macros.h:544
#define EndThread
Marks the end of a thread block.
Definition macros.h:547
#define LVar2
Definition macros.h:150
#define LVar1
Definition macros.h:149
#define LVarA
Definition macros.h:158
#define Wait(NUM_FRAMES)
Blocks for the given number of frames.
Definition macros.h:254
#define PlayEffect(args...)
Definition macros.h:807
#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 Loop(TIMES)
Marks the beginning of a loop.
Definition macros.h:245
#define LVar0
Definition macros.h:148
#define SetConst(VAR, CONST)
Sets the given variable to a given value, skipping the evt_get_variable call.
Definition macros.h:370
#define Return
Kills the current EVT thread.
Definition macros.h:217