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

Go to the source code of this file.

Macros

#define METER_FILL_TICK   1500
 

Enumerations

enum  { HIDX_BUTTON = 0 , HIDX_METER = 1 , HIDX_100_PCT = 2 }
 

Functions

void N update (void)
 

Variables

s32 actionCmdTable0A []
 

Macro Definition Documentation

◆ METER_FILL_TICK

#define METER_FILL_TICK   1500

Definition at line 22 of file unused_mash_a.c.

Referenced by update().

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
HIDX_BUTTON 
HIDX_METER 
HIDX_100_PCT 

Definition at line 15 of file unused_mash_a.c.

15 {
16 HIDX_BUTTON = 0,
17 HIDX_METER = 1,
18 HIDX_100_PCT = 2,
19};
@ HIDX_METER
@ HIDX_BUTTON
@ HIDX_100_PCT

Function Documentation

◆ update()

void N update ( void )

Definition at line 104 of file unused_mash_a.c.

104 {
106 BattleStatus* battleStatus = &gBattleStatus;
107 HudElemID hid;
108 s32 cutoff;
109
110 switch (acs->state) {
111 case AC_STATE_INIT:
113
114 hid = acs->hudElemIDs[HIDX_BUTTON];
115 hud_element_set_alpha(hid, 255);
116 if (acs->showHud) {
118 }
119
120 hid = acs->hudElemIDs[HIDX_METER];
121 hud_element_set_alpha(hid, 255);
122 if (acs->showHud) {
124 }
125
126 acs->state = AC_STATE_APPEAR;
127 break;
128 case AC_STATE_APPEAR:
130
131 acs->hudPosX += 20;
132 if (acs->hudPosX > 50) {
133 acs->hudPosX = 50;
134 }
135
138 break;
139 case AC_STATE_START:
141
142 if (acs->prepareTime != 0) {
143 acs->prepareTime--;
144 return;
145 }
146
148 acs->meterFillLevel = 0;
149 acs->state = AC_STATE_ACTIVE;
150 acs->stateTimer = acs->duration;
151
152 // fallthrough
153 case AC_STATE_ACTIVE:
155
156 // check for meter-filling input
157 if (battleStatus->curButtonsPressed & BUTTON_A) {
159 }
160
161 // handle meter reaching 100%
162 if (acs->meterFillLevel >= MAX_MASH_UNITS) {
164 acs->isMeterFilled = TRUE;
165 hid = acs->hudElemIDs[HIDX_100_PCT];
166 hud_element_set_render_pos(hid, acs->hudPosX + 50, acs->hudPosY + 28);
168 }
169
170 battleStatus->actionProgress = acs->meterFillLevel / ONE_PCT_MASH;
171
172 if (acs->stateTimer != 0) {
173 acs->stateTimer--;
174 break;
175 }
176
177 if (acs->meterFillLevel == 0) {
178 battleStatus->actionQuality = AC_QUALITY_FAILED;
179 } else {
180 battleStatus->actionQuality = acs->meterFillLevel / ONE_PCT_MASH;
181 }
182
183 cutoff = acs->mashMeterCutoffs[acs->mashMeterNumIntervals - 1];
184 if (battleStatus->actionQuality >= cutoff) {
185 battleStatus->actionResult = ACTION_RESULT_SUCCESS;
186 } else {
188 }
189
190 if (battleStatus->actionQuality == 100) {
191 // only count 100% fill as success for this action command
193 }
194
196 acs->stateTimer = 5;
197 acs->state = AC_STATE_DISPOSE;
198 break;
199 case AC_STATE_DISPOSE:
200 if (acs->stateTimer != 0) {
201 acs->stateTimer--;
202 break;
203 }
205 break;
206 }
207}
BSS ActionCommandStatus gActionCommandStatus
Definition action_cmd.c:91
void action_command_free(void)
Definition action_cmd.c:446
void increment_action_command_success_count(void)
Definition action_cmd.c:655
#define AC_QUALITY_FAILED
Definition action_cmd.h:66
HudElemID hudElemIDs[16]
Definition action_cmd.h:83
@ AC_STATE_APPEAR
Definition action_cmd.h:35
@ AC_STATE_DISPOSE
Definition action_cmd.h:38
@ AC_STATE_INIT
Definition action_cmd.h:34
@ AC_STATE_ACTIVE
Definition action_cmd.h:37
@ AC_STATE_START
Definition action_cmd.h:36
#define ONE_PCT_MASH
Definition action_cmd.h:69
#define SCALE_BY_PCT(x, pct)
Definition action_cmd.h:77
HudScript HES_MashAButton
#define MAX_MASH_UNITS
Definition action_cmd.h:75
s32 HudElemID
@ BUTTON_A
Definition enums.h:2790
@ ACTION_RESULT_METER_NOT_ENOUGH
Definition enums.h:1965
@ ACTION_RESULT_SUCCESS
Definition enums.h:1968
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.
@ HUD_ELEMENT_FLAG_DISABLED
Definition hud_element.h:72
#define POPUP_MSG_OFF
Definition battle.h:270
#define POPUP_MSG_ON
Definition battle.h:269
s32 * actionCmdDifficultyTable
#define METER_FILL_TICK
BattleStatus gBattleStatus
Definition battle.c:11

Variable Documentation

◆ actionCmdTable0A

s32 actionCmdTable0A[]
extern

Definition at line 37 of file action_cmd.c.

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