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

Go to the source code of this file.

Macros

#define AC_TBL_ENTRY(name)    action_cmd_ ## name ## _ROM_START, action_cmd_ ## name ## _ROM_END, action_cmd_ ## name ## _VRAM
 

Functions

s32 adjust_action_command_difficulty (s32 arg0)
 
void draw_mash_meter (s32 posX, s32 posY, s32 fillValue, s32 colorMode)
 
void draw_mash_meter_multicolor (s32 posX, s32 posY, s32 fillValue)
 
void draw_mash_meter_multicolor_with_divisor (s32 posX, s32 posY, s32 fillValue, s32 divisor)
 
void draw_mash_meter_mode (s32 posX, s32 posY, s32 fillValue, s32 colorMode)
 
void draw_mash_meter_mode_with_divisor (s32 posX, s32 posY, s32 fillValue, s32 divisor, s32 colorMode)
 
void draw_mash_meter_blink (s32 posX, s32 posY, s32 fillValue)
 
void draw_mash_meter_blink_with_divisor (s32 posX, s32 posY, s32 fillValue, s32 divisor)
 
void action_command_init_status (void)
 
void action_command_update (void)
 
void action_command_draw (void)
 
void action_command_free (void)
 
void func_80268E88 (void)
 
s32 check_block_input (s32 buttonMask)
 
void func_80269118 (void)
 
void func_80269160 (void)
 

Variables

u8 mashMeter_bgColors [15]
 
u8 mashMeter_fillColors [15]
 
u8 mashMeter_cutOffColors [15]
 
s32 actionCmdTableJump [] = { 7, 6, 5, 4, 3, 2, 1, 0 }
 
s32 actionCmdTableHammer [] = { 11, 10, 9, 8, 7, 6, 5, 4 }
 
s32 actionCmdTableFlee [] = { 130, 120, 110, 100, 90, 80, 70, 60 }
 
s32 actionCmdTableBreakFree [] = { 130, 120, 110, 100, 90, 80, 70, 60 }
 
s32 actionCmdTableWhirlwind [] = { 130, 120, 110, 100, 90, 80, 70, 60 }
 
s32 actionCmdTableStopLeech [] = { 130, 120, 110, 100, 90, 80, 70, 60 }
 
s32 actionCmdTable07 [] = { 130, 120, 110, 100, 90, 80, 70, 60 }
 
s32 actionCmdTableDizzyShell [] = { 130, 120, 110, 100, 90, 80, 70, 60 }
 
s32 actionCmdTableFireShell [] = { 130, 120, 110, 100, 90, 80, 70, 60 }
 
s32 actionCmdTable0A [] = { 130, 120, 110, 100, 90, 80, 70, 60 }
 
s32 actionCmdTableBomb [] = { 130, 120, 110, 100, 90, 80, 70, 60 }
 
s32 actionCmdTableBodySlam [] = { 9, 8, 7, 6, 5, 4, 3, 2 }
 
s32 actionCmdTableAirLift [] = { 130, 120, 110, 100, 90, 80, 70, 60 }
 
s32 actionCmdTableAirRaid [] = { 130, 120, 110, 100, 90, 80, 70, 60 }
 
s32 actionCmdTableSquirt [] = { 130, 120, 110, 100, 90, 80, 70, 60 }
 
s32 actionCmdTablePowerShock [] = { 130, 120, 110, 100, 90, 80, 70, 60 }
 
s32 actionCmdTableMegaShock [] = { 130, 120, 110, 100, 90, 80, 70, 60 }
 
s32 actionCmdTableSmack [] = { 130, 120, 110, 100, 90, 80, 70, 60 }
 
s32 actionCmdTableSpinySurge [] = { 130, 120, 110, 100, 90, 80, 70, 60 }
 
s32 actionCmdTableHurricane [] = { 130, 120, 110, 100, 90, 80, 70, 60 }
 
s32 actionCmdTableSpook [] = { 130, 120, 110, 100, 90, 80, 70, 60 }
 
s32 actionCmdTableWaterBlock [] = { 6, 3, 5, 3, 4, 3, 2, 3, 1, 3, 0, 3, 0, 2, 0, 1 }
 
s32 actionCmdTableTidalWave [] = { 130, 120, 110, 100, 90, 80, 70, 60 }
 
void * actionCommandDmaTable []
 
BSS s32 sMashMeterSmoothDivisor
 
BSS s32 D_8029FBC4_pad [3]
 
BSS s32 IsGroupHeal
 
BSS s8 ApplyingBuff
 
BSS s32 D_8029FBD8_pad [2]
 
BSS ActionCommandStatus gActionCommandStatus
 

Macro Definition Documentation

◆ AC_TBL_ENTRY

#define AC_TBL_ENTRY ( name)     action_cmd_ ## name ## _ROM_START, action_cmd_ ## name ## _ROM_END, action_cmd_ ## name ## _VRAM

Definition at line 52 of file action_cmd.c.

52#define AC_TBL_ENTRY(name) \
53 action_cmd_ ## name ## _ROM_START, action_cmd_ ## name ## _ROM_END, action_cmd_ ## name ## _VRAM

Function Documentation

◆ adjust_action_command_difficulty()

s32 adjust_action_command_difficulty ( s32 arg0)

Definition at line 101 of file action_cmd.c.

101 {
104 }
105
106 if (arg0 < 0) {
107 arg0 = 0;
108 }
109 if (arg0 > 7) {
110 arg0 = 7;
111 }
112
113 return arg0;
114}
@ BS_FLAGS1_PARTNER_ACTING
Definition enums.h:3588
@ ABILITY_DODGE_MASTER
Definition enums.h:436
s32 is_ability_active(s32 arg0)
Definition inventory.c:1725
BattleStatus gBattleStatus
Definition battle.c:11

◆ draw_mash_meter()

void draw_mash_meter ( s32 posX,
s32 posY,
s32 fillValue,
s32 colorMode )

Definition at line 116 of file action_cmd.c.

116 {
117 ActionCommandStatus* actionCommandStatus = &gActionCommandStatus;
118 s32 maxCutOff;
119 s32 i;
120 s32 cutOff;
121 s32 width;
122 s32 offsetX;
123 s32 filledWidth;
124 s32 r, g, b;
125
126 if (!actionCommandStatus->showHud) {
127 return;
128 }
129
130 posX -= 28;
131 posY -= 4;
132
133 maxCutOff = actionCommandStatus->mashMeterCutoffs[actionCommandStatus->mashMeterIntervals];
134
135 if (fillValue < 0) {
136 fillValue = 0;
137 }
138
139 width = 0;
140 for (i = 0; i < actionCommandStatus->mashMeterIntervals; i++) {
141 cutOff = actionCommandStatus->mashMeterCutoffs[i + 1];
142 if (cutOff > fillValue) {
143 cutOff = fillValue;
144 }
145
146 width = (cutOff * 60 / maxCutOff) * 100;
147 if (fillValue == cutOff) {
148 break;
149 }
150 }
151
152 //difference between current and previous filled value
153 offsetX = width - actionCommandStatus->barFillWidth;
154 if (abs(offsetX) >= sMashMeterSmoothDivisor * 100) {
155 actionCommandStatus->barFillWidth += offsetX / sMashMeterSmoothDivisor;
156 } else {
157 actionCommandStatus->barFillWidth = width;
158 }
159
160 offsetX = 0;
161 for (i = 0; i < actionCommandStatus->mashMeterIntervals; i++) {
162 cutOff = actionCommandStatus->mashMeterCutoffs[i + 1];
163 width = (cutOff * 60 / maxCutOff) - offsetX;
164 r = mashMeter_bgColors[3 * i + 0];
165 g = mashMeter_bgColors[3 * i + 1];
166 b = mashMeter_bgColors[3 * i + 2];
167 startup_draw_prim_rect_COPY(posX + offsetX, posY, posX + offsetX + width, posY + 5, r, g, b, 255);
168 if (i < actionCommandStatus->mashMeterIntervals - 1) {
169 r = mashMeter_cutOffColors[3 * i + 0];
170 g = mashMeter_cutOffColors[3 * i + 1];
171 b = mashMeter_cutOffColors[3 * i + 2];
172 startup_draw_prim_rect_COPY(posX + offsetX + width - 1, posY, posX + offsetX + width, posY + 5, r, g, b, 255);
173 offsetX += width;
174 } else {
175 break;
176 }
177 }
178
179 offsetX = 0;
180 for (i = 0; i < actionCommandStatus->mashMeterIntervals; i++) {
181 if (colorMode == 0) {
182 r = mashMeter_fillColors[3 * i + 0];
183 g = mashMeter_fillColors[3 * i + 1];
184 b = mashMeter_fillColors[3 * i + 2];
185 } else if (colorMode > 0) {
186 r = 224;
187 g = 63;
188 b = 0;
189 } else if (gGameStatusPtr->frameCounter % 2 != 0){
190 r = mashMeter_fillColors[3 * i + 0];
191 g = mashMeter_fillColors[3 * i + 1];
192 b = mashMeter_fillColors[3 * i + 2];
193 } else {
194 r = 250;
195 g = 175;
196 b = 0;
197 }
198
199 cutOff = actionCommandStatus->mashMeterCutoffs[i + 1];
200 if (cutOff > fillValue) {
201 cutOff = fillValue;
202 }
203
204 filledWidth = cutOff * 60 / maxCutOff - offsetX;
205 width = actionCommandStatus->barFillWidth / 100 - offsetX;
206
207 if (width < 0) {
208 break;
209 }
210 if (filledWidth == 0) {
211 filledWidth = width;
212 } else if (cutOff == fillValue) {
213 filledWidth = width;
214 } else if (width > filledWidth) {
215 width = filledWidth;
216 }
217
218 startup_draw_prim_rect_COPY(posX + offsetX, posY, posX + offsetX + width, posY + 5, r, g, b, 255);
219 offsetX += filledWidth;
220 if (i >= actionCommandStatus->mashMeterIntervals - 1) {
221 break;
222 }
223 }
224}
u8 mashMeter_cutOffColors[15]
Definition action_cmd.c:20
BSS ActionCommandStatus gActionCommandStatus
Definition action_cmd.c:91
u8 mashMeter_bgColors[15]
Definition action_cmd.c:4
BSS s32 sMashMeterSmoothDivisor
Definition action_cmd.c:82
u8 mashMeter_fillColors[15]
Definition action_cmd.c:12
void startup_draw_prim_rect_COPY(s16 left, s16 top, s16 right, s16 bottom, u16 r, u16 g, u16 b, u16 a)
Definition 43F0.c:805
GameStatus * gGameStatusPtr
Definition main_loop.c:32

Referenced by draw_mash_meter_blink(), draw_mash_meter_blink_with_divisor(), draw_mash_meter_mode(), draw_mash_meter_mode_with_divisor(), draw_mash_meter_multicolor(), and draw_mash_meter_multicolor_with_divisor().

◆ draw_mash_meter_multicolor()

void draw_mash_meter_multicolor ( s32 posX,
s32 posY,
s32 fillValue )

Definition at line 226 of file action_cmd.c.

226 {
228 draw_mash_meter(posX, posY, fillValue, MASH_METER_MODE_MULTI_COLOR);
229}
void draw_mash_meter(s32 posX, s32 posY, s32 fillValue, s32 colorMode)
Definition action_cmd.c:116
@ MASH_METER_MODE_MULTI_COLOR
Definition action_cmd.h:32

Referenced by draw().

◆ draw_mash_meter_multicolor_with_divisor()

void draw_mash_meter_multicolor_with_divisor ( s32 posX,
s32 posY,
s32 fillValue,
s32 divisor )

Definition at line 231 of file action_cmd.c.

231 {
232 sMashMeterSmoothDivisor = divisor;
233 draw_mash_meter(posX, posY, fillValue, MASH_METER_MODE_MULTI_COLOR);
234}

Referenced by draw().

◆ draw_mash_meter_mode()

void draw_mash_meter_mode ( s32 posX,
s32 posY,
s32 fillValue,
s32 colorMode )

Definition at line 236 of file action_cmd.c.

236 {
238 draw_mash_meter(posX, posY, fillValue, colorMode);
239}

◆ draw_mash_meter_mode_with_divisor()

void draw_mash_meter_mode_with_divisor ( s32 posX,
s32 posY,
s32 fillValue,
s32 divisor,
s32 colorMode )

Definition at line 241 of file action_cmd.c.

241 {
242 sMashMeterSmoothDivisor = divisor;
243 draw_mash_meter(posX, posY, fillValue, colorMode);
244}

Referenced by draw().

◆ draw_mash_meter_blink()

void draw_mash_meter_blink ( s32 posX,
s32 posY,
s32 fillValue )

Definition at line 246 of file action_cmd.c.

246 {
248 draw_mash_meter(posX, posY, fillValue, MASH_METER_MODE_BLINK);
249}
@ MASH_METER_MODE_BLINK
Definition action_cmd.h:31

Referenced by draw().

◆ draw_mash_meter_blink_with_divisor()

void draw_mash_meter_blink_with_divisor ( s32 posX,
s32 posY,
s32 fillValue,
s32 divisor )

Definition at line 251 of file action_cmd.c.

251 {
252 sMashMeterSmoothDivisor = divisor;
253 draw_mash_meter(posX, posY, fillValue, MASH_METER_MODE_BLINK);
254}

Referenced by draw().

◆ action_command_init_status()

void action_command_init_status ( void )

Definition at line 256 of file action_cmd.c.

256 {
257 ActionCommandStatus* actionCommandStatus = &gActionCommandStatus;
258
259 actionCommandStatus->autoSucceed = FALSE;
260 actionCommandStatus->berserkerEnabled = FALSE;
261
264 actionCommandStatus->autoSucceed = TRUE;
265 }
266
268 actionCommandStatus->showHud = FALSE;
269 actionCommandStatus->berserkerEnabled = TRUE;
270
271 if (rand_int(100) < 25) {
272 actionCommandStatus->autoSucceed = TRUE;
273 }
274 }
275 }
276
278 actionCommandStatus->autoSucceed = TRUE;
279 }
280
282 actionCommandStatus->autoSucceed = TRUE;
283 actionCommandStatus->showHud = FALSE;
284 }
285}
#define rand_int
@ BS_FLAGS1_AUTO_SUCCEED_ACTION
Definition enums.h:3581
@ DEMO_BTL_FLAG_ENABLED
Definition enums.h:3543
@ ABILITY_BERSERKER
Definition enums.h:457
@ ABILITY_RIGHT_ON
Definition enums.h:458

◆ action_command_update()

void action_command_update ( void )

Definition at line 287 of file action_cmd.c.

287 {
288 ActionCommandStatus* actionCommandStatus = &gActionCommandStatus;
289
292 }
293
294 switch (actionCommandStatus->actionCommandID) {
296 break;
299 break;
302 break;
305 break;
308 break;
311 break;
314 break;
317 break;
320 break;
323 break;
326 break;
329 break;
332 break;
335 break;
338 break;
341 break;
344 break;
347 break;
350 break;
353 break;
356 break;
359 break;
362 break;
365 break;
366 default:
367 break;
368 }
369}
void action_command_07_update(void)
void action_command_0A_update(void)
void action_command_free(void)
Definition action_cmd.c:446
void action_command_air_lift_update(void)
void action_command_air_raid_update(void)
void action_command_body_slam_update(void)
void action_command_bomb_update(void)
void action_command_break_free_update(void)
void action_command_dizzy_shell_update(void)
@ ACTION_COMMAND_BOMB
Definition enums.h:3483
@ ACTION_COMMAND_SPOOK
Definition enums.h:3493
@ ACTION_COMMAND_WATER_BLOCK
Definition enums.h:3494
@ ACTION_COMMAND_MEGA_SHOCK
Definition enums.h:3489
@ ACTION_COMMAND_HURRICANE
Definition enums.h:3492
@ ACTION_COMMAND_FLEE
Definition enums.h:3475
@ ACTION_COMMAND_SMASH
Definition enums.h:3474
@ ACTION_COMMAND_AIR_LIFT
Definition enums.h:3485
@ ACTION_COMMAND_07
Definition enums.h:3479
@ ACTION_COMMAND_BREAK_FREE
Definition enums.h:3476
@ ACTION_COMMAND_SMACK
Definition enums.h:3490
@ ACTION_COMMAND_SQUIRT
Definition enums.h:3487
@ ACTION_COMMAND_AIR_RAID
Definition enums.h:3486
@ ACTION_COMMAND_WHIRLWIND
Definition enums.h:3477
@ ACTION_COMMAND_BODY_SLAM
Definition enums.h:3484
@ ACTION_COMMAND_FIRE_SHELL
Definition enums.h:3481
@ ACTION_COMMAND_DIZZY_SHELL
Definition enums.h:3480
@ ACTION_COMMAND_NONE
Definition enums.h:3472
@ ACTION_COMMAND_SPINY_SURGE
Definition enums.h:3491
@ ACTION_COMMAND_POWER_SHOCK
Definition enums.h:3488
@ ACTION_COMMAND_JUMP
Definition enums.h:3473
@ ACTION_COMMAND_0A
Definition enums.h:3482
@ ACTION_COMMAND_TIDAL_WAVE
Definition enums.h:3495
@ ACTION_COMMAND_STOP_LEECH
Definition enums.h:3478
@ BS_FLAGS1_FREE_ACTION_COMMAND
Definition enums.h:3584
void action_command_fire_shell_update(void)
void action_command_flee_update(void)
void action_command_hammer_update(void)
void action_command_hurricane_update(void)
void action_command_jump_update(void)
void action_command_mega_shock_update(void)
void action_command_power_shock_update(void)
void action_command_smack_update(void)
void action_command_spiny_surge_update(void)
void action_command_spook_update(void)
void action_command_squirt_update(void)
void action_command_stop_leech_update(void)
void action_command_tidal_wave_update(void)
void action_command_water_block_update(void)
void action_command_whirlwind_update(void)

Referenced by func_80268E88().

◆ action_command_draw()

void action_command_draw ( void )

Definition at line 371 of file action_cmd.c.

371 {
374 break;
377 break;
380 break;
383 break;
386 break;
389 break;
392 break;
395 break;
398 break;
401 break;
404 break;
407 break;
410 break;
413 break;
416 break;
419 break;
422 break;
425 break;
428 break;
431 break;
434 break;
437 break;
440 break;
443 }
444}
void action_command_07_draw(void)
void action_command_0A_draw(void)
void action_command_air_lift_draw(void)
void action_command_air_raid_draw(void)
void action_command_body_slam_draw(void)
void action_command_bomb_draw(void)
void action_command_break_free_draw(void)
void action_command_dizzy_shell_draw(void)
void action_command_fire_shell_draw(void)
void action_command_flee_draw(void)
void action_command_hammer_draw(void)
void action_command_hurricane_draw(void)
void action_command_jump_draw(void)
void action_command_mega_shock_draw(void)
void action_command_power_shock_draw(void)
void action_command_smack_draw(void)
void action_command_spiny_surge_draw(void)
void action_command_spook_draw(void)
void action_command_squirt_draw(void)
void action_command_stop_leech_draw(void)
void action_command_tidal_wave_draw(void)
void action_command_water_block_draw(void)
void action_command_whirlwind_draw(void)

Referenced by func_80268E88().

◆ action_command_free()

void action_command_free ( void )

Definition at line 446 of file action_cmd.c.

446 {
447 ActionCommandStatus* actionCommandStatus = &gActionCommandStatus;
448
449 switch (actionCommandStatus->actionCommandID) {
451 break;
454 break;
457 break;
460 break;
463 break;
466 break;
469 break;
472 break;
475 break;
478 break;
481 break;
484 break;
487 break;
490 break;
493 break;
496 break;
499 break;
502 break;
505 break;
508 break;
511 break;
514 break;
517 break;
520 break;
521 }
522
523 actionCommandStatus->actionCommandID = ACTION_COMMAND_NONE;
524 gBattleStatus.flags1 &= ~BS_FLAGS1_2000;
525 gBattleStatus.flags1 &= ~BS_FLAGS1_FREE_ACTION_COMMAND;
526 gBattleStatus.flags1 &= ~BS_FLAGS1_4000;
529}
void action_command_07_free(void)
void action_command_0A_free(void)
void action_command_air_lift_free(void)
void action_command_air_raid_free(void)
void action_command_body_slam_free(void)
void action_command_bomb_free(void)
void action_command_break_free_free(void)
void action_command_dizzy_shell_free(void)
void action_command_fire_shell_free(void)
void action_command_flee_free(void)
void btl_set_popup_duration(s32 duration)
void close_action_command_instruction_popup(void)
void action_command_hammer_free(void)
void action_command_hurricane_free(void)
void action_command_jump_free(void)
void action_command_mega_shock_free(void)
void action_command_power_shock_free(void)
void action_command_smack_free(void)
void action_command_spiny_surge_free(void)
void action_command_spook_free(void)
void action_command_squirt_free(void)
void action_command_stop_leech_free(void)
void action_command_tidal_wave_free(void)
void action_command_water_block_free(void)
void action_command_whirlwind_free(void)

Referenced by action_command_update(), and update().

◆ func_80268E88()

void func_80268E88 ( void )

Definition at line 531 of file action_cmd.c.

531 {
532 ActionCommandStatus* actionCmdStatus = &gActionCommandStatus;
534 actionCmdStatus->actionCommandID = 0;
535}
void action_command_draw(void)
Definition action_cmd.c:371
void action_command_update(void)
Definition action_cmd.c:287
s32 create_worker_frontUI(void(*updateFunc)(void), void(*drawFunc)(void))
Definition worker.c:63

Referenced by initialize_battle().

◆ check_block_input()

s32 check_block_input ( s32 buttonMask)

Definition at line 537 of file action_cmd.c.

537 {
538 BattleStatus* battleStatus = &gBattleStatus;
539 PlayerData* playerData = &gPlayerData;
540 ActionCommandStatus* actionCommandStatus = &gActionCommandStatus;
541 s32 mashWindow;
542 s32 blockWindow;
543 s32 block;
544 s32 mash = FALSE;
545 s32 bufferPos;
546 s32 i;
547 s32 ignoreWindow;
548
549 battleStatus->blockResult = BLOCK_RESULT_FAIL;
550
552 battleStatus->blockResult = BLOCK_RESULT_SUCCESS;
553 return TRUE;
554 }
555
557 return FALSE;
558 }
559
560 if (playerData->hitsTaken < 9999) {
561 playerData->hitsTaken++;
562 actionCommandStatus->hitsTakenIsMax = FALSE;
563 } else {
564 actionCommandStatus->hitsTakenIsMax = TRUE;
565 }
566
567 block = FALSE;
568 blockWindow = 3;
569 mashWindow = 10;
570
572 blockWindow = 5;
573 }
574
575 // Pre-window mashing check
576 bufferPos = battleStatus->inputBufferPos;
577 bufferPos -= mashWindow + blockWindow;
578
579 if (bufferPos < 0) {
580 bufferPos += ARRAY_COUNT(battleStatus->pushInputBuffer);
581 }
582 for (i = 0; i < mashWindow; i++) {
583 if (bufferPos >= ARRAY_COUNT(battleStatus->pushInputBuffer)) {
584 bufferPos -= ARRAY_COUNT(battleStatus->pushInputBuffer);
585 }
586
587 if (battleStatus->pushInputBuffer[bufferPos] & buttonMask) {
588 mash = TRUE;
589 break;
590 }
591 bufferPos++;
592 }
593
594 // Block check
595 bufferPos = battleStatus->inputBufferPos;
596 bufferPos -= blockWindow;
597 if (bufferPos < 0) {
598 bufferPos += ARRAY_COUNT(battleStatus->pushInputBuffer);
599 }
600 for (i = 0; i < blockWindow; i++) {
601 if (bufferPos >= ARRAY_COUNT(battleStatus->pushInputBuffer)) {
602 bufferPos -= ARRAY_COUNT(battleStatus->pushInputBuffer);
603 }
604
605 if (battleStatus->pushInputBuffer[bufferPos] & buttonMask) {
606 battleStatus->blockResult = BLOCK_RESULT_SUCCESS;
607 block = TRUE;
608 break;
609 }
610 bufferPos++;
611 }
612
613 if (mash) {
614 battleStatus->blockResult = BLOCK_RESULT_EARLY;
615 block = FALSE;
616 }
617
618 // Ignore inputs until another mash window has passed, so check_block_input() can be called in quick succession
619 if (block == TRUE) {
620 bufferPos = battleStatus->inputBufferPos;
621 bufferPos -= mashWindow + blockWindow;
622 if (bufferPos < 0) {
623 bufferPos += ARRAY_COUNT(battleStatus->pushInputBuffer);
624 }
625
626 for (i = 0; i < mashWindow + blockWindow; i++) {
627 if (bufferPos >= ARRAY_COUNT(battleStatus->pushInputBuffer)) {
628 bufferPos -= ARRAY_COUNT(battleStatus->pushInputBuffer);
629 }
630 battleStatus->pushInputBuffer[bufferPos] = 0;
631 bufferPos++;
632 }
633 }
634 if (block && !actionCommandStatus->hitsTakenIsMax) {
635 playerData->hitsBlocked++;
636 }
637
638 return block;
639}
@ ACTION_COMMAND_MODE_TUTORIAL_BLOCK
Definition action_cmd.h:37
@ ACTION_COMMAND_MODE_NOT_LEARNED
Definition action_cmd.h:38
@ BS_FLAGS1_TUTORIAL_BATTLE
Definition enums.h:3594
@ BLOCK_RESULT_FAIL
Definition enums.h:1974
@ BLOCK_RESULT_SUCCESS
Definition enums.h:1975
@ BLOCK_RESULT_EARLY
Definition enums.h:1973
#define ARRAY_COUNT(arr)
Definition macros.h:40
s32 pushInputBuffer[64]
PlayerData gPlayerData
Definition 77480.c:40

Referenced by calc_enemy_damage_target().

◆ func_80269118()

void func_80269118 ( void )

Definition at line 641 of file action_cmd.c.

641 {
642 PlayerData* playerData = &gPlayerData;
643 ActionCommandStatus *actionCommandStatus = &gActionCommandStatus;
644
645 if (!actionCommandStatus->autoSucceed) {
646 if (playerData->actionCommandAttempts < 9999) {
647 playerData->actionCommandAttempts++;
648 actionCommandStatus->hitsTakenIsMax = FALSE;
649 } else {
650 actionCommandStatus->hitsTakenIsMax = TRUE;
651 }
652 }
653}
u16 actionCommandAttempts

◆ func_80269160()

void func_80269160 ( void )

Definition at line 655 of file action_cmd.c.

655 {
656 PlayerData* playerData = &gPlayerData;
657
659 playerData->actionCommandSuccesses++;
660 }
661}
u16 actionCommandSuccesses

Referenced by update().

Variable Documentation

◆ mashMeter_bgColors

u8 mashMeter_bgColors[15]
Initial value:
= {
33, 33, 117,
29, 35, 163,
70, 12, 180,
107, 0, 120,
115, 13, 19,
}

Definition at line 4 of file action_cmd.c.

4 {
5 33, 33, 117,
6 29, 35, 163,
7 70, 12, 180,
8 107, 0, 120,
9 115, 13, 19,
10};

Referenced by draw_mash_meter().

◆ mashMeter_fillColors

u8 mashMeter_fillColors[15]
Initial value:
= {
0, 228, 134,
46, 180, 242,
117, 112, 255,
243, 4, 188,
247, 13, 5,
}

Definition at line 12 of file action_cmd.c.

12 {
13 0, 228, 134,
14 46, 180, 242,
15 117, 112, 255,
16 243, 4, 188,
17 247, 13, 5,
18};

Referenced by draw_mash_meter().

◆ mashMeter_cutOffColors

u8 mashMeter_cutOffColors[15]
Initial value:
= {
45, 56, 210,
84, 40, 209,
125, 44, 181,
161, 27, 85,
255, 255, 255,
}

Definition at line 20 of file action_cmd.c.

20 {
21 45, 56, 210,
22 84, 40, 209,
23 125, 44, 181,
24 161, 27, 85,
25 255, 255, 255,
26};

Referenced by draw_mash_meter().

◆ actionCmdTableJump

s32 actionCmdTableJump[] = { 7, 6, 5, 4, 3, 2, 1, 0 }

Definition at line 28 of file action_cmd.c.

28{ 7, 6, 5, 4, 3, 2, 1, 0 };

◆ actionCmdTableHammer

s32 actionCmdTableHammer[] = { 11, 10, 9, 8, 7, 6, 5, 4 }

Definition at line 29 of file action_cmd.c.

29{ 11, 10, 9, 8, 7, 6, 5, 4 };

◆ actionCmdTableFlee

s32 actionCmdTableFlee[] = { 130, 120, 110, 100, 90, 80, 70, 60 }

Definition at line 30 of file action_cmd.c.

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

◆ actionCmdTableBreakFree

s32 actionCmdTableBreakFree[] = { 130, 120, 110, 100, 90, 80, 70, 60 }

Definition at line 31 of file action_cmd.c.

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

◆ actionCmdTableWhirlwind

s32 actionCmdTableWhirlwind[] = { 130, 120, 110, 100, 90, 80, 70, 60 }

Definition at line 32 of file action_cmd.c.

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

◆ actionCmdTableStopLeech

s32 actionCmdTableStopLeech[] = { 130, 120, 110, 100, 90, 80, 70, 60 }

Definition at line 33 of file action_cmd.c.

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

◆ actionCmdTable07

s32 actionCmdTable07[] = { 130, 120, 110, 100, 90, 80, 70, 60 }

Definition at line 34 of file action_cmd.c.

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

◆ actionCmdTableDizzyShell

s32 actionCmdTableDizzyShell[] = { 130, 120, 110, 100, 90, 80, 70, 60 }

Definition at line 35 of file action_cmd.c.

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

◆ actionCmdTableFireShell

s32 actionCmdTableFireShell[] = { 130, 120, 110, 100, 90, 80, 70, 60 }

Definition at line 36 of file action_cmd.c.

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

◆ actionCmdTable0A

s32 actionCmdTable0A[] = { 130, 120, 110, 100, 90, 80, 70, 60 }

Definition at line 37 of file action_cmd.c.

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

◆ actionCmdTableBomb

s32 actionCmdTableBomb[] = { 130, 120, 110, 100, 90, 80, 70, 60 }

Definition at line 38 of file action_cmd.c.

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

◆ actionCmdTableBodySlam

s32 actionCmdTableBodySlam[] = { 9, 8, 7, 6, 5, 4, 3, 2 }

Definition at line 39 of file action_cmd.c.

39{ 9, 8, 7, 6, 5, 4, 3, 2 };

◆ actionCmdTableAirLift

s32 actionCmdTableAirLift[] = { 130, 120, 110, 100, 90, 80, 70, 60 }

Definition at line 40 of file action_cmd.c.

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

◆ actionCmdTableAirRaid

s32 actionCmdTableAirRaid[] = { 130, 120, 110, 100, 90, 80, 70, 60 }

Definition at line 41 of file action_cmd.c.

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

◆ actionCmdTableSquirt

s32 actionCmdTableSquirt[] = { 130, 120, 110, 100, 90, 80, 70, 60 }

Definition at line 42 of file action_cmd.c.

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

◆ actionCmdTablePowerShock

s32 actionCmdTablePowerShock[] = { 130, 120, 110, 100, 90, 80, 70, 60 }

Definition at line 43 of file action_cmd.c.

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

◆ actionCmdTableMegaShock

s32 actionCmdTableMegaShock[] = { 130, 120, 110, 100, 90, 80, 70, 60 }

Definition at line 44 of file action_cmd.c.

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

◆ actionCmdTableSmack

s32 actionCmdTableSmack[] = { 130, 120, 110, 100, 90, 80, 70, 60 }

Definition at line 45 of file action_cmd.c.

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

◆ actionCmdTableSpinySurge

s32 actionCmdTableSpinySurge[] = { 130, 120, 110, 100, 90, 80, 70, 60 }

Definition at line 46 of file action_cmd.c.

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

◆ actionCmdTableHurricane

s32 actionCmdTableHurricane[] = { 130, 120, 110, 100, 90, 80, 70, 60 }

Definition at line 47 of file action_cmd.c.

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

◆ actionCmdTableSpook

s32 actionCmdTableSpook[] = { 130, 120, 110, 100, 90, 80, 70, 60 }

Definition at line 48 of file action_cmd.c.

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

◆ actionCmdTableWaterBlock

s32 actionCmdTableWaterBlock[] = { 6, 3, 5, 3, 4, 3, 2, 3, 1, 3, 0, 3, 0, 2, 0, 1 }

Definition at line 49 of file action_cmd.c.

49{ 6, 3, 5, 3, 4, 3, 2, 3, 1, 3, 0, 3, 0, 2, 0, 1 };

◆ actionCmdTableTidalWave

s32 actionCmdTableTidalWave[] = { 130, 120, 110, 100, 90, 80, 70, 60 }

Definition at line 50 of file action_cmd.c.

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

◆ actionCommandDmaTable

void* actionCommandDmaTable[]
Initial value:
= {
NULL, NULL, NULL,
action_cmd_jump_ROM_START, action_cmd_jump_ROM_END, action_cmd_jump_VRAM,
action_cmd_hammer_ROM_START, action_cmd_hammer_ROM_END, action_cmd_hammer_VRAM,
action_cmd_flee_ROM_START, action_cmd_flee_ROM_END, action_cmd_flee_VRAM,
action_cmd_break_free_ROM_START, action_cmd_break_free_ROM_END, action_cmd_break_free_VRAM,
action_cmd_whirlwind_ROM_START, action_cmd_whirlwind_ROM_END, action_cmd_whirlwind_VRAM,
action_cmd_stop_leech_ROM_START, action_cmd_stop_leech_ROM_END, action_cmd_stop_leech_VRAM,
action_cmd_07_ROM_START, action_cmd_07_ROM_END, action_cmd_07_VRAM,
action_cmd_dizzy_shell_ROM_START, action_cmd_dizzy_shell_ROM_END, action_cmd_dizzy_shell_VRAM,
action_cmd_fire_shell_ROM_START, action_cmd_fire_shell_ROM_END, action_cmd_fire_shell_VRAM,
action_cmd_0A_ROM_START, action_cmd_0A_ROM_END, action_cmd_0A_VRAM,
action_cmd_bomb_ROM_START, action_cmd_bomb_ROM_END, action_cmd_bomb_VRAM,
action_cmd_body_slam_ROM_START, action_cmd_body_slam_ROM_END, action_cmd_body_slam_VRAM,
action_cmd_air_lift_ROM_START, action_cmd_air_lift_ROM_END, action_cmd_air_lift_VRAM,
action_cmd_air_raid_ROM_START, action_cmd_air_raid_ROM_END, action_cmd_air_raid_VRAM,
action_cmd_squirt_ROM_START, action_cmd_squirt_ROM_END, action_cmd_squirt_VRAM,
action_cmd_power_shock_ROM_START, action_cmd_power_shock_ROM_END, action_cmd_power_shock_VRAM,
action_cmd_mega_shock_ROM_START, action_cmd_mega_shock_ROM_END, action_cmd_mega_shock_VRAM,
action_cmd_smack_ROM_START, action_cmd_smack_ROM_END, action_cmd_smack_VRAM,
action_cmd_spiny_surge_ROM_START, action_cmd_spiny_surge_ROM_END, action_cmd_spiny_surge_VRAM,
action_cmd_hurricane_ROM_START, action_cmd_hurricane_ROM_END, action_cmd_hurricane_VRAM,
action_cmd_spook_ROM_START, action_cmd_spook_ROM_END, action_cmd_spook_VRAM,
action_cmd_water_block_ROM_START, action_cmd_water_block_ROM_END, action_cmd_water_block_VRAM,
action_cmd_tidal_wave_ROM_START, action_cmd_tidal_wave_ROM_END, action_cmd_tidal_wave_VRAM,
}

Definition at line 55 of file action_cmd.c.

55 {
56 NULL, NULL, NULL,
57 AC_TBL_ENTRY(jump),
58 AC_TBL_ENTRY(hammer),
59 AC_TBL_ENTRY(flee),
60 AC_TBL_ENTRY(break_free),
61 AC_TBL_ENTRY(whirlwind),
62 AC_TBL_ENTRY(stop_leech),
63 AC_TBL_ENTRY(07),
64 AC_TBL_ENTRY(dizzy_shell),
65 AC_TBL_ENTRY(fire_shell),
67 AC_TBL_ENTRY(bomb),
68 AC_TBL_ENTRY(body_slam),
69 AC_TBL_ENTRY(air_lift),
70 AC_TBL_ENTRY(air_raid),
71 AC_TBL_ENTRY(squirt),
72 AC_TBL_ENTRY(power_shock),
73 AC_TBL_ENTRY(mega_shock),
74 AC_TBL_ENTRY(smack),
75 AC_TBL_ENTRY(spiny_surge),
76 AC_TBL_ENTRY(hurricane),
77 AC_TBL_ENTRY(spook),
78 AC_TBL_ENTRY(water_block),
79 AC_TBL_ENTRY(tidal_wave),
80};
#define AC_TBL_ENTRY(name)
Definition action_cmd.c:52
#define A(sym)
Definition macros.h:36

◆ sMashMeterSmoothDivisor

◆ D_8029FBC4_pad

BSS s32 D_8029FBC4_pad[3]

Definition at line 83 of file action_cmd.c.

◆ IsGroupHeal

BSS s32 IsGroupHeal

Definition at line 85 of file action_cmd.c.

◆ ApplyingBuff

BSS s8 ApplyingBuff

Definition at line 86 of file action_cmd.c.

◆ D_8029FBD8_pad

BSS s32 D_8029FBD8_pad[2]

Definition at line 87 of file action_cmd.c.

◆ gActionCommandStatus