Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
07.c File Reference

Go to the source code of this file.

Functions

void btl_message_unlock_box_pos (void)
 
void N update (void)
 
void N draw (void)
 

Variables

BSS s32 D_802A9620
 
s32 actionCmdTable07 []
 

Function Documentation

◆ btl_message_unlock_box_pos()

void btl_message_unlock_box_pos ( void )

Definition at line 641 of file popup_messages.c.

641 {
643}
BSS b16 BattleMessage_BoxPosLocked

◆ update()

void N update ( void )

Definition at line 80 of file 07.c.

80 {
81 ActionCommandStatus* actionCommandStatus = &gActionCommandStatus;
82 BattleStatus* battleStatus = &gBattleStatus;
83 s32 id;
84
85 switch (actionCommandStatus->state) {
86 case 0:
88
89 id = actionCommandStatus->hudElements[0];
90 if (actionCommandStatus->showHud) {
92 }
93 hud_element_set_alpha(id, 255);
94
95 id = actionCommandStatus->hudElements[1];
96 hud_element_set_alpha(id, 255);
97 if (actionCommandStatus->showHud) {
99 }
100
101 id = actionCommandStatus->hudElements[2];
102 hud_element_set_alpha(id, 255);
103 if (actionCommandStatus->showHud) {
105 }
106
107 actionCommandStatus->state = 1;
108 break;
109 case 1:
111
112 actionCommandStatus->hudPosX += 20;
113 if (actionCommandStatus->hudPosX > 50) {
114 actionCommandStatus->hudPosX = 50;
115 }
116
117 hud_element_set_render_pos(actionCommandStatus->hudElements[0], actionCommandStatus->hudPosX, actionCommandStatus->hudPosY);
118 hud_element_set_render_pos(actionCommandStatus->hudElements[1], actionCommandStatus->hudPosX, actionCommandStatus->hudPosY + 28);
119 hud_element_set_render_pos(actionCommandStatus->hudElements[2], actionCommandStatus->hudPosX + 31, actionCommandStatus->hudPosY + 14);
120 break;
121 case 10:
123
124 if (actionCommandStatus->prepareTime != 0) {
125 actionCommandStatus->prepareTime--;
126 return;
127 }
128
129 hud_element_set_script(actionCommandStatus->hudElements[0], &HES_MashAButton);
130 battleStatus->actionSuccess = 0;
131 D_802A9620 = 1;
132 actionCommandStatus->unk_5D = 0;
133 actionCommandStatus->state = 11;
134 actionCommandStatus->frameCounter = actionCommandStatus->duration;
135 // fallthrough
136 case 11:
138
139 if (battleStatus->curButtonsPressed & BUTTON_A) {
140 s32 fillAmt = battleStatus->actionCmdDifficultyTable[actionCommandStatus->difficulty] * 6;
141
142 if (actionCommandStatus->unk_5D == 0) {
143 actionCommandStatus->barFillLevel += fillAmt;
144 }
145 }
146
147 if (actionCommandStatus->barFillLevel > 10000) {
148 actionCommandStatus->barFillLevel = 10000;
149 actionCommandStatus->unk_5D = 3;
150 }
151
152 if (actionCommandStatus->unk_5D != 0) {
153 actionCommandStatus->unk_5D--;
154 if (actionCommandStatus->unk_5D == 0) {
155 actionCommandStatus->barFillLevel = 0;
156 battleStatus->actionSuccess++;
157 }
158 }
159
160 battleStatus->actionQuality = actionCommandStatus->barFillLevel / 100;
161
162 if (actionCommandStatus->frameCounter != 0) {
163 actionCommandStatus->frameCounter--;
164 return;
165 }
167 actionCommandStatus->frameCounter = 5;
168 actionCommandStatus->state = 12;
169 break;
170 case 12:
171 if (actionCommandStatus->frameCounter != 0) {
172 actionCommandStatus->frameCounter--;
173 return;
174 }
176 break;
177 }
178}
BSS ActionCommandStatus gActionCommandStatus
Definition action_cmd.c:91
void action_command_free(void)
Definition action_cmd.c:446
HudScript HES_MashAButton
BSS s32 D_802A9620
Definition 07.c:8
@ BUTTON_A
Definition enums.h:2790
void btl_set_popup_duration(s32 duration)
void hud_element_set_alpha(s32 id, s32 opacity)
void hud_element_set_script(s32 id, HudScript *anim)
void hud_element_set_render_pos(s32 id, s32 x, s32 y)
void hud_element_clear_flags(s32 id, s32 flags)
Turns off the given flags.
s32 * actionCmdDifficultyTable
BattleStatus gBattleStatus
Definition battle.c:11

Referenced by func_8004DCB8(), func_8004DE2C(), func_8004E0F4(), and func_80050970().

◆ draw()

void N draw ( void )

Definition at line 180 of file 07.c.

180 {
181 ActionCommandStatus* actionCommandStatus = &gActionCommandStatus;
182 s32 hudX;
183 s32 hudY;
184 s32 hudElement1;
185
186 hud_element_draw_clipped(actionCommandStatus->hudElements[0]);
187 hudElement1 = actionCommandStatus->hudElements[1];
188 hud_element_draw_clipped(hudElement1);
189 hud_element_get_render_pos(hudElement1, &hudX, &hudY);
190
191 if (D_802A9620 == 0) {
192 draw_mash_meter_multicolor_with_divisor(hudX, hudY, actionCommandStatus->barFillLevel / 100, 1);
193 } else {
194 draw_mash_meter_multicolor_with_divisor(hudX, hudY, actionCommandStatus->barFillLevel / 100, 2);
195 }
196
197 hud_element_draw_clipped(actionCommandStatus->hudElements[2]);
198}
void draw_mash_meter_multicolor_with_divisor(s32 posX, s32 posY, s32 fillValue, s32 divisor)
Definition action_cmd.c:231
void hud_element_get_render_pos(s32 id, s32 *x, s32 *y)
void hud_element_draw_clipped(s32 id)

Variable Documentation

◆ D_802A9620

BSS s32 D_802A9620

Definition at line 8 of file 07.c.

Referenced by draw(), and update().

◆ actionCmdTable07

s32 actionCmdTable07[]
extern

Definition at line 34 of file action_cmd.c.

34{ 130, 120, 110, 100, 90, 80, 70, 60 };