Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
ToadHouse.inc.c
Go to the documentation of this file.
1#include "common.h"
2#include "npc.h"
3#include "../../partners.h"
4
5API_CALLABLE(N(ToadHouse_DisableStatusBar)) {
7 return ApiStatus_DONE2;
8}
9
10API_CALLABLE(N(ToadHouse_ShowWorldStatusBar)) {
13 return ApiStatus_DONE2;
14}
15
16API_CALLABLE(N(ToadHouse_UpdateScreenOverlay)) {
17 Bytecode* args = script->ptrReadPos;
18 s32 type = evt_get_variable(script, *args++);
19 s32 zoom = evt_get_variable(script, *args++);
20
23 return ApiStatus_DONE2;
24}
25
26API_CALLABLE(N(ToadHouse_CamSetFOV)) {
27 Bytecode* args = script->ptrReadPos;
28 s32 camIdx = evt_get_variable(script, *args++);
29
30 gCameras[camIdx].vfov = evt_get_variable(script, *args++);
31 return ApiStatus_DONE2;
32}
33
34API_CALLABLE(N(ToadHouse_AwaitScriptComplete)) {
35 Bytecode* args = script->ptrReadPos;
36 s32 waitingScriptID = evt_get_variable(script, *args++);
37
38 if (!does_script_exist(waitingScriptID)) {
39 return ApiStatus_DONE2;
40 } else {
41 return ApiStatus_BLOCK;
42 }
43}
44
45API_CALLABLE(N(ToadHouse_PartnerSuspendAbilityScript)) {
47 return ApiStatus_DONE2;
48 }
50 return ApiStatus_DONE2;
51}
52
53API_CALLABLE(N(ToadHouse_PartnerResumeAbilityScript)) {
55 return ApiStatus_DONE2;
56}
57
58API_CALLABLE(N(ToadHouse_DoesPlayerNeedSleep)) {
59 PlayerData* playerData = &gPlayerData;
60
61 script->varTable[1] = FALSE;
62 if (playerData->curMaxHP != playerData->curHP) {
63 return ApiStatus_DONE2;
64 }
65 if (playerData->curMaxFP != playerData->curFP) {
66 return ApiStatus_DONE2;
67 }
68 if (playerData->starPower != playerData->maxStarPower * SP_PER_BAR) {
69 return ApiStatus_DONE2;
70 }
71 script->varTable[1] = TRUE;
72
73 return ApiStatus_DONE2;
74}
75
76API_CALLABLE(N(ToadHouse_InitScreenOverlay)) {
77 Bytecode* args = script->ptrReadPos;
78 s32 r = evt_get_variable(script, *args++);
79 s32 g = evt_get_variable(script, *args++);
80 s32 b = evt_get_variable(script, *args++);
81
83 return ApiStatus_DONE2;
84}
85
86API_CALLABLE(N(ToadHouse_PutPartnerAway)) {
87 Bytecode* args = script->ptrReadPos;
88 Bytecode saveToVar = *args++;
89
90 evt_set_variable(script, saveToVar, gPlayerData.curPartner);
92 return ApiStatus_DONE2;
93}
94
95API_CALLABLE(N(ToadHouse_GetPartnerBackOut)) {
96 Bytecode* args = script->ptrReadPos;
97 Bytecode readFromVar = *args++;
98
99 switch_to_partner((s8)evt_get_variable(script, readFromVar));
100 return ApiStatus_DONE2;
101}
102
103// do nothing (unused)
104API_CALLABLE(N(ToadHouse_Stub)) {
105 return ApiStatus_DONE2;
106}
@ SCREEN_LAYER_FRONT
Definition enums.h:2382
@ PARTNER_NONE
Definition enums.h:2885
#define ApiStatus_DONE2
Definition evt.h:118
s32 Bytecode
Definition evt.h:7
#define ApiStatus_BLOCK
Definition evt.h:116
s32 evt_get_variable(Evt *script, Bytecode var)
Definition evt.c:1690
void status_bar_ignore_changes(void)
Definition inventory.c:1497
void sync_status_bar(void)
Definition inventory.c:1660
s32 evt_set_variable(Evt *script, Bytecode var, s32 value)
Definition evt.c:1847
void set_screen_overlay_params_front(u8, f32)
void switch_to_partner(s32 arg0)
Definition partners.c:906
void set_screen_overlay_center(s32, s32, s32, s32)
void set_screen_overlay_color(s32, u8, u8, u8)
s32 does_script_exist(s32 id)
void status_bar_respond_to_changes(void)
Definition inventory.c:1508
void partner_resume_ability_script(void)
Definition partners.c:1125
void partner_suspend_ability_script(void)
Definition partners.c:1117
#define SP_PER_BAR
Definition macros.h:102
Camera gCameras[4]
Definition cam_main.c:17
PlayerData gPlayerData
Definition 77480.c:40