Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
dizzy_dial.c
Go to the documentation of this file.
1#include "common.h"
2#include "script_api/battle.h"
3
4#define NAMESPACE battle_item_dizzy_dial
5
6static s32 ScreenBlurWorkerID;
7
9
11 draw_prev_frame_buffer_at_screen_pos(0, 0, 320, 240, 160.0f);
12}
13
14API_CALLABLE(N(AnimateDizzyDialCameraFX)) {
16 f32 angle;
17
18 if (isInitialCall) {
19 script->functionTemp[0] = 0;
20 }
21
22 switch (script->functionTemp[0]) {
23 case 0:
24 script->functionTemp[1] = 0;
25 script->functionTemp[2] = 0;
27 camera->params.basic.skipRecalc = FALSE;
29 script->functionTemp[0] = 1;
30 case 1:
32 angle = script->functionTemp[1];
33 guRotateF(camera->mtxViewShaking, angle, 0.0f, 0.0f, 1.0f);
34 script->functionTemp[1] = 2.0 * ((1.0 - sin_rad(DEG_TO_RAD(script->functionTemp[2] + 90))) * 360.0);
35 script->functionTemp[2]++;
36 if (script->functionTemp[2] <= 90) {
37 return ApiStatus_BLOCK;
38 }
39 camera->params.basic.skipRecalc = FALSE;
41 free_worker(ScreenBlurWorkerID);
42 return ApiStatus_DONE2;
43 }
44
45 return ApiStatus_BLOCK;
46}
47
49
55 Wait(10)
56 Thread
57 Wait(5)
61 Wait(80)
67 Thread
69 Call(ShakeCam, CAM_BATTLE, 0, 2, Float(1.0))
70 Call(ShakeCam, CAM_BATTLE, 0, 2, Float(4.0))
71 Call(ShakeCam, CAM_BATTLE, 0, 2, Float(3.0))
72 Call(ShakeCam, CAM_BATTLE, 0, 2, Float(2.0))
73 Call(ShakeCam, CAM_BATTLE, 0, 2, Float(1.0))
74 Call(ShakeCam, CAM_BATTLE, 0, 2, Float(0.5))
75 Wait(10)
81 Label(0)
85 Goto(1)
86 EndIf
90 Label(1)
91 Wait(5)
94 Goto(0)
95 EndIf
96 Wait(30)
98 Return
99 End
100};
BSS s32 PopupMenu_SelectedIndex
Bytecode EvtScript[]
void N worker_render_screen_blur(void)
Definition dizzy_dial.c:10
#define guRotateF
#define draw_prev_frame_buffer_at_screen_pos
@ BTL_CAM_XADJ_NONE
Definition enums.h:4898
@ BS_FLAGS1_TRIGGER_EVENTS
Definition enums.h:3574
@ ITER_NO_MORE
Definition enums.h:2030
@ ITER_NEXT
Definition enums.h:2025
@ CAMERA_FLAG_SHAKING
Definition enums.h:4722
@ HIT_RESULT_MISS
Definition enums.h:1956
@ BTL_CAM_DEFAULT
Definition enums.h:4823
@ BTL_CAM_VIEW_ENEMIES
Definition enums.h:4824
@ STATUS_FLAG_DIZZY
Definition enums.h:2818
@ SOUND_DIZZY_DIAL
Definition enums.h:1356
@ BTL_RUMBLE_PLAYER_LIGHT
Definition enums.h:4259
@ ACTOR_SELF
Definition enums.h:2084
@ BTL_CAM_YADJ_NONE
Definition enums.h:4905
@ CAM_BATTLE
Definition enums.h:1801
@ DAMAGE_TYPE_STATUS_ALWAYS_HITS
Definition enums.h:2880
@ DAMAGE_TYPE_NO_CONTACT
Definition enums.h:2878
#define ApiStatus_DONE2
Definition evt.h:118
#define ApiStatus_BLOCK
Definition evt.h:116
void free_worker(s32)
Definition worker.c:176
f32 sin_rad(f32 x)
Definition 43F0.c:712
s32 create_worker_frontUI(void(*updateFunc)(void), void(*drawFunc)(void))
Definition worker.c:63
void sfx_play_sound(s32 soundID)
Definition sfx.c:517
ApiStatus ShakeCam(Evt *script, b32 isInitialCall)
ApiStatus GetItemPower(Evt *script, b32 isInitialCall)
#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 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 DEG_TO_RAD(deg)
Definition macros.h:138
#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 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 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
Camera gCameras[4]
Definition cam_main.c:17