Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
menu_player.c
Go to the documentation of this file.
1#include "states.h"
2#include "battle/battle.h"
4#include "battle/action_cmd.h"
5
6#include "sprite/player.h"
7
9
10enum {
11 // BTL_SUBSTATE_INIT = 0,
12
13 // Main menu
15 // selecting options from jump, hammer, or outermost items submenus
24 // states for target selection when there is no submenu after main
25 // this occurs when there are no additional options for Jump/Hammer apart from the base move
31 // Initial selection and use for Double/Triple dip
33 BTL_SUBSTATE_DIPPING_CHOOSING = 21, // choosing double dip item
34 BTL_SUBSTATE_DIPPING_HANDOVER = 22, // selecting target
38 // Change Partner
46 // Items
53 // Star Spirits
61 // additional item use from Double/Triple dip
68 // Berserker
70 // Strategies
78 // initialize
81};
82
97
104
111
115 Actor* player = battleStatus->playerActor;
116 MoveData* move;
117 s32 i;
120 s32 fpCost;
121
122 // If you don't have boots equipped, disable this menu
123 if (playerData->bootsLevel == GEAR_RANK_NONE) {
124 battleStatus->menuStatus[1] = 0;
125 return;
126 }
127
128 for (i = 0; i < ARRAY_COUNT(battleStatus->submenuMoves); i++) {
129 battleStatus->submenuMoves[i] = MOVE_NONE;
130 }
131
132 // Standard jump move
133 moveCount = 1;
134 battleStatus->submenuMoves[0] = MOVE_JUMP1 + playerData->bootsLevel;
135 battleStatus->submenuIcons[0] = ITEM_PARTNER_ATTACK;
136
137 // Jump badges
138 for (i = 0; i < ARRAY_COUNT(playerData->equippedBadges); i++) {
139 s16 badge = playerData->equippedBadges[i];
140
141 if (badge != ITEM_NONE) {
143 u8 moveID = gItemTable[badge].moveID;
144
145 move = &moveTable[moveID];
146 if (move->category == MOVE_TYPE_JUMP) {
147 battleStatus->submenuMoves[moveCount] = moveID;
148 battleStatus->submenuIcons[moveCount] = playerData->equippedBadges[i];
149 moveCount++;
150 }
151 }
152 }
153
154 battleStatus->submenuMoveCount = moveCount;
155
157 for (i = 0; i < battleStatus->submenuMoveCount; i++) {
158 move = &gMoveTable[battleStatus->submenuMoves[i]];
159
160 // Calculate FP cost
161 fpCost = move->costFP;
162 if (fpCost != 0) {
165 if (fpCost < 1) {
166 fpCost = 1;
167 }
168 }
169
170 // See if there are any targets for this move
171 battleStatus->moveCategory = BTL_MENU_TYPE_JUMP;
172 battleStatus->moveArgument = playerData->bootsLevel;
173 battleStatus->curTargetListFlags = move->flags; // Controls target filters
175
176 // If there are targets, enable the move
177 if (player->targetListLength != 0) {
180 }
181
182 // If you don't have enough FP, disable the move
183 if (playerData->curFP < fpCost) {
185 }
186
187 // If there are no targets available, disable the move
188 if (player->targetListLength == 0) {
190 }
193 }
194 }
195
196 if (!hasAnyBadgeMoves) {
197 // Only the standard jump is available - no badge moves.
198 // Selecting this submenu should immediately pick the standard jump move
199 battleStatus->menuStatus[1] = -1;
200 } else {
201 // Enable this submenu
202 battleStatus->menuStatus[1] = 1;
203 }
204}
205
209 Actor* player = battleStatus->playerActor;
210 MoveData* move;
211 s32 i;
214 s32 fpCost;
215
216 // If you don't have a hammer, disable this menu
217 if (playerData->hammerLevel == -1) {
218 battleStatus->menuStatus[2] = 0;
219 return;
220 }
221
222 for (i = 0; i < ARRAY_COUNT(battleStatus->submenuMoves); i++) {
223 battleStatus->submenuMoves[i] = MOVE_NONE;
224 }
225
226 // Standard hammer move
227 moveCount = 1;
228 battleStatus->submenuMoves[0] = MOVE_HAMMER1 + playerData->hammerLevel;
229 battleStatus->submenuIcons[0] = ITEM_PARTNER_ATTACK;
230
231 // Hammer badges
232 for (i = 0; i < ARRAY_COUNT(playerData->equippedBadges); i++) {
233 s16 badge = playerData->equippedBadges[i];
234 if (badge != MOVE_NONE) {
236 u8 moveID = gItemTable[badge].moveID;
237 move = &moveTable[moveID];
238 if (move->category == MOVE_TYPE_HAMMER) {
239 battleStatus->submenuMoves[moveCount] = moveID;
240 battleStatus->submenuIcons[moveCount] = playerData->equippedBadges[i];
241 moveCount++;
242 }
243 }
244 }
245
246 battleStatus->submenuMoveCount = moveCount;
247
249 for (i = 0; i < battleStatus->submenuMoveCount; i++) {
250 move = &gMoveTable[battleStatus->submenuMoves[i]];
251
252 // Calculate FP cost
253 fpCost = move->costFP;
254 if (fpCost != 0) {
257 if (fpCost < 1) {
258 fpCost = 1;
259 }
260 }
261
262 // See if there are any targets for this move
263 battleStatus->moveCategory = BTL_MENU_TYPE_SMASH;
264 battleStatus->moveArgument = playerData->hammerLevel;
265 battleStatus->curTargetListFlags = move->flags;
267
268 // If there are targets, enable the move
269 if (player->targetListLength != 0) {
271 battleStatus->submenuStatus[i] = 1;
272 }
273
274 // If you don't have enough FP, disable the move
275 if (playerData->curFP < fpCost) {
276 battleStatus->submenuStatus[i] = 0;
277 }
278
279 // If there are no targets available, disable the move
280 if (player->targetListLength == 0) {
282 }
285 }
286 }
287
288 if (!hasAnyBadgeMoves) {
289 // Only the standard hammer is available - no badge moves.
290 // Selecting this submenu should immediately pick the standard hammer move
291 battleStatus->menuStatus[2] = -1;
292 } else {
293 // Enable this submenu
294 battleStatus->menuStatus[2] = 1;
295 }
296}
297
301 Actor* playerActor = battleStatus->playerActor;
302 Actor* partnerActor = battleStatus->partnerActor;
305 s32 entryIdx, initialPos;
306 s32 i;
310 s32 starBeamLevel;
315
316 switch (gBattleSubState) {
318 battleStatus->moveCategory = BTL_MENU_TYPE_INVALID;
319 battleStatus->selectedMoveID = 0;
320 battleStatus->curAttackElement = 0;
321 if (!btl_player_can_act()) {
323 return;
324 }
326 btl_cam_move(10);
327 if (!(battleStatus->flags1 & BS_FLAGS1_PLAYER_IN_BACK)) {
329 } else {
331 partnerActor->state.curPos.x = partnerActor->homePos.x;
332 partnerActor->state.curPos.z = partnerActor->homePos.z;
333 partnerActor->state.goalPos.x = playerActor->homePos.x;
334 partnerActor->state.goalPos.z = playerActor->homePos.z;
335 partnerActor->state.moveTime = 4;
336 partnerActor->state.angle = 0.0f;
337 }
338 break;
340 if (partnerActor->state.moveTime != 0) {
341 partnerActor->curPos.x += (partnerActor->state.goalPos.x - partnerActor->curPos.x) / partnerActor->state.moveTime;
342 partnerActor->curPos.z += (partnerActor->state.goalPos.z - partnerActor->curPos.z) / partnerActor->state.moveTime;
343 playerActor->curPos.x += (partnerActor->state.curPos.x - playerActor->curPos.x) / partnerActor->state.moveTime;
344 playerActor->curPos.z += (partnerActor->state.curPos.z - playerActor->curPos.z) / partnerActor->state.moveTime;
345 }
346 partnerActor->curPos.z -= sin_rad(DEG_TO_RAD(partnerActor->state.angle)) * 16.0f;
347 partnerActor->yaw = clamp_angle(-partnerActor->state.angle);
348 playerActor->curPos.z += sin_rad(DEG_TO_RAD(partnerActor->state.angle)) * 16.0f;
349 playerActor->yaw = clamp_angle(-partnerActor->state.angle);
350 partnerActor->state.angle += 90.0f;
351 if (partnerActor->state.moveTime != 0) {
352 partnerActor->state.moveTime--;
353 } else {
354 partnerActor->curPos.x = partnerActor->state.goalPos.x;
355 partnerActor->curPos.z = partnerActor->state.goalPos.z;
356 playerActor->curPos.x = partnerActor->state.curPos.x;
357 playerActor->curPos.z = partnerActor->state.curPos.z;
358 partnerActor->homePos.x = partnerActor->curPos.x;
359 partnerActor->homePos.z = partnerActor->curPos.z;
360 playerActor->homePos.x = playerActor->curPos.x;
361 playerActor->homePos.z = playerActor->curPos.z;
364 }
365 break;
366 }
367
368 switch (gBattleSubState) {
371 playerActor->flags &= ~ACTOR_FLAG_USING_IDLE_ANIM;
372 playerActor->flags |= ACTOR_FLAG_SHOW_STATUS_ICONS;
373 if (partnerActor != NULL) {
374 partnerActor->flags |= ACTOR_FLAG_USING_IDLE_ANIM;
375 partnerActor->flags |= ACTOR_FLAG_SHOW_STATUS_ICONS;
376 }
383 break;
384 }
385
386 entryIdx = 0;
387 initialPos = 2;
388 if (battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_MAIN] < 0) {
389 battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_MAIN] = 0;
390 }
391
392 // strategies menu category
399 }
401 if (!(battleStatus->enabledMenusFlags & BTL_MENU_ENABLED_STRATEGIES)) {
405 }
406 if (battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_MAIN] == BTL_MENU_TYPE_STRATEGIES) {
407 initialPos = entryIdx;
408 }
409 entryIdx++;
410
411 // items menu category
412 if (battleStatus->menuStatus[0] >= 0) {
417
418 if(battleStatus->menuStatus[0] == 0) {
422 }
423
424 if (!(battleStatus->enabledMenusFlags & BTL_MENU_ENABLED_ITEMS)) {
428 }
429
430 if (battleStatus->itemLossTurns >= 0) {
434 }
435
436 if (battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_MAIN] == BTL_MENU_TYPE_ITEMS) {
437 initialPos = entryIdx;
438 }
439
440 entryIdx++;
441 }
442
443 // jump menu category
448
449 if (battleStatus->menuStatus[1] <= 0) {
453 }
454 if (!(battleStatus->enabledMenusFlags & BTL_MENU_ENABLED_JUMP)) {
458 }
459 if (battleStatus->jumpLossTurns >= 0) {
463 }
464 if (battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_MAIN] == BTL_MENU_TYPE_JUMP) {
465 initialPos = entryIdx;
466 }
467 entryIdx++;
468
469 // hammer menu category
470 if (playerData->hammerLevel >= 0) {
475 if (battleStatus->menuStatus[2] <= 0) {
479 }
480 if (!(battleStatus->enabledMenusFlags & BTL_MENU_ENABLED_SMASH)) {
484 }
485 if (battleStatus->hammerLossTurns >= 0) {
489 }
490 if (battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_MAIN] == BTL_MENU_TYPE_SMASH) {
491 initialPos = entryIdx;
492 }
493 entryIdx++;
494 }
495
496 // star powers menu category
497 if (playerData->maxStarPower != 0) {
503 if (!(battleStatus->enabledMenusFlags & BTL_MENU_ENABLED_STAR_POWERS)) {
507 }
508 if (battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_MAIN] == BTL_MENU_TYPE_STAR_POWERS) {
509 initialPos = entryIdx;
510 }
511 entryIdx++;
512 }
513
515 BattleMenu_PrevSelected = initialPos;
516 BattleMenu_WheelBase = 2 - initialPos;
517 if (btl_partner_can_act()) {
519 } else {
521 }
526 break;
528 if (battleStatus->hustleTurns != 0) {
530 } else {
532 }
534 if (BattleMenu_SwapDelay != 0) {
537 if (btl_partner_can_act() && battleStatus->hustleTurns != 1) {
542 } else if (partnerActor != NULL && !(partnerActor->flags & BS_FLAGS1_YIELD_TURN) && battleStatus->hustleTurns != 1) {
545 }
546 break;
547 }
548
549 if (BattleMenu_ChooseDelay != 0) {
551 break;
552 }
553
554 if (submenuResult == 0) {
555 break;
556 }
557
559 battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_MAIN] = battleStatus->curSubmenu = WheelOptionSubmenu[submenuResult - 1];
560 for (i = 0; i < ARRAY_COUNT(battleStatus->submenuMoves); i++) {
561 battleStatus->submenuMoves[i] = MOVE_NONE;
562 battleStatus->submenuIcons[i] = ITEM_NONE;
563 battleStatus->submenuStatus[i] = 0;
564 }
565
566 switch (battleStatus->curSubmenu) {
568 battleStatus->submenuMoves[0] = MOVE_ITEMS;
569 battleStatus->submenuIcons[0] = ITEM_PARTNER_ATTACK;
570 battleStatus->submenuStatus[0] = 1;
571 for (i = 0; i < ARRAY_COUNT(playerData->invItems); i++) {
572 if (playerData->invItems[i] == ITEM_NONE) {
573 continue;
574 }
575 itemData = &gItemTable[playerData->invItems[i]];
576
577 battleStatus->moveCategory = BTL_MENU_TYPE_ITEMS;
578 battleStatus->moveArgument = playerData->invItems[i];
579 battleStatus->curTargetListFlags = itemData->targetFlags;
581 }
582 entryIdx = 1;
583 for (i = 0; i < ARRAY_COUNT(playerData->equippedBadges); i++) {
584 if (playerData->equippedBadges[i] != 0) {
585 s32 moveID = gItemTable[playerData->equippedBadges[i]].moveID;
586 moveData = &gMoveTable[moveID];
587 if (moveData->category == BattleMenu_CategoryForSubmenu[battleStatus->curSubmenu]) {
589 battleStatus->submenuMoves[entryIdx] = moveID;
590 battleStatus->submenuIcons[entryIdx] = playerData->equippedBadges[i];
591 battleStatus->submenuStatus[entryIdx] = 1;
592
595
596 if (playerData->curFP < cost) {
597 battleStatus->submenuStatus[entryIdx] = 0;
598 }
599 entryIdx++;
600 }
601 }
602 }
603 battleStatus->submenuMoveCount = entryIdx;
604 if (entryIdx == 1) {
605 battleStatus->submenuMoveCount = 0;
606 }
607 break;
610 if (battleStatus->submenuMoveCount == 1) {
611 battleStatus->submenuMoveCount = 0;
612 }
613 if (battleStatus->actionCommandMode == AC_MODE_TUTORIAL) {
614 battleStatus->submenuMoveCount = 0;
615 }
616 break;
619 if (battleStatus->submenuMoveCount == 1) {
620 battleStatus->submenuMoveCount = 0;
621 }
622 if (battleStatus->actionCommandMode == AC_MODE_TUTORIAL) {
623 battleStatus->submenuMoveCount = 0;
624 }
625 break;
627 battleStatus->submenuMoves[0] = MOVE_FOCUS;
628 battleStatus->submenuIcons[0] = ITEM_PARTNER_ATTACK;
629 battleStatus->submenuStatus[0] = 1;
630 entryIdx = 1;
631 initialPos = 8;
632 for (i = 0; i < playerData->maxStarPower; i++) {
634 battleStatus->submenuMoves[entryIdx] = MOVE_REFRESH + i;
635 battleStatus->submenuIcons[entryIdx] = ITEM_NONE;
637 battleStatus->moveArgument = MOVE_REFRESH + i;
638 battleStatus->curTargetListFlags = moveData->flags;
640 battleStatus->submenuStatus[entryIdx] = 1;
641 if (playerActor->targetListLength == 0) {
642 battleStatus->submenuStatus[entryIdx] = -2;
643 }
644 if (playerData->starPower / SP_PER_BAR < moveData->costFP) {
645 battleStatus->submenuStatus[entryIdx] = 0;
646 }
648 battleStatus->submenuStatus[entryIdx] = -1;
649 }
650 entryIdx++;
651 }
652 starBeamLevel = playerData->starBeamLevel;
653 if (starBeamLevel == 1) {
655 battleStatus->submenuMoves[entryIdx] = MOVE_STAR_BEAM;
656 battleStatus->submenuIcons[entryIdx] = 0;
658 battleStatus->moveArgument = MOVE_REFRESH + i;
659 battleStatus->curTargetListFlags = moveData->flags;
661 battleStatus->submenuStatus[entryIdx] = starBeamLevel;
662 if (playerActor->targetListLength == 0) {
663 battleStatus->submenuStatus[entryIdx] = -2;
664 }
665 if (playerData->starPower / SP_PER_BAR < moveData->costFP) {
666 battleStatus->submenuStatus[entryIdx] = 0;
667 }
669 battleStatus->submenuStatus[entryIdx] = -1;
670 }
671 entryIdx++;
672 }
673 if (playerData->starBeamLevel == 2) {
675 battleStatus->submenuMoves[entryIdx] = MOVE_PEACH_BEAM;
676 battleStatus->submenuIcons[entryIdx] = ITEM_NONE;
678 battleStatus->moveArgument = MOVE_REFRESH + i;
679 battleStatus->curTargetListFlags = moveData->flags;
681 battleStatus->submenuStatus[entryIdx] = 1;
682 if (playerActor->targetListLength == 0) {
683 battleStatus->submenuStatus[entryIdx] = -2;
684 }
685 if (playerData->starPower / SP_PER_BAR < moveData->costFP) {
686 battleStatus->submenuStatus[entryIdx] = 0;
687 }
689 battleStatus->submenuStatus[entryIdx] = -1;
690 }
691 entryIdx++;
692 }
693 battleStatus->submenuMoveCount = entryIdx;
694 break;
695 }
696
697 currentSubmenu = battleStatus->curSubmenu;
698
703 break;
704 }
705
711 } else {
713 battleStatus->moveCategory = currentSubmenu;
714 battleStatus->moveArgument = 0;
715 battleStatus->selectedMoveID = 0;
717 }
718 break;
719 }
720
721 // handle menus without multiple options (skipping submenu)
722 if (battleStatus->submenuMoveCount == 0) {
725 } else {
729 }
730 break;
731 }
732
733 initialPos = 0;
735 if (battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_JUMP] < 0) {
736 battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_JUMP] = 0;
737 }
738 initialPos = battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_JUMP];
739 }
740 if (battleStatus->curSubmenu == BTL_MENU_TYPE_SMASH) {
741 if (battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_SMASH] < 0) {
742 battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_SMASH] = 0;
743 }
744 initialPos = battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_SMASH];
745 }
746 if (battleStatus->curSubmenu == BTL_MENU_TYPE_ITEMS) {
747 if (battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_ITEMS] < 0) {
748 battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_ITEMS] = 0;
749 }
750 initialPos = battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_ITEMS];
751 }
752
753 for (i = 0; i < battleStatus->submenuMoveCount; i++) {
754 moveData = &gMoveTable[battleStatus->submenuMoves[i]];
755 itemData = &gItemTable[battleStatus->submenuIcons[i]];
757
758 MovesOptionError[i] = 0;
759 if (battleStatus->submenuStatus[i] == 0) {
760 MovesOptionError[i] = 0;
761 }
762 if (battleStatus->submenuStatus[i] == -1) {
763 battleStatus->submenuStatus[i] = 0;
765 }
766 if (battleStatus->submenuStatus[i] == -2) {
767 battleStatus->submenuStatus[i] = 0;
769 }
770 if (battleStatus->submenuStatus[i] == -3) {
771 battleStatus->submenuStatus[i] = 0;
773 }
775 if (battleStatus->submenuStatus[i] == 0) {
777 }
778
780 MovesOptionBPCosts[i] = moveData->costBP;
784
788 }
792 }
793
794 MovesOptionIndices[i] = i;
795 MovesOptionEnabled[i] = battleStatus->submenuStatus[i];
796 MovesOptionNames[i] = moveData->nameMsg;
797 MovesOptionDesc[i] = moveData->shortDescMsg;
798
799 }
801 MovesOptionCount = battleStatus->submenuMoveCount;
802 MovesPrevSelected = initialPos;
805 break;
808 switch (submenuResult) {
810 // do nothing while player is choosing from menu
811 break;
814 break;
822 break;
823 default: // something has been selected
824 battleStatus->lastSelectedAbility = MovesOptionIndices[submenuResult - 1];
825 battleStatus->selectedMoveID = battleStatus->submenuMoves[battleStatus->lastSelectedAbility];
826 if (battleStatus->curSubmenu == BTL_MENU_TYPE_JUMP) {
827 battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_JUMP] = SelectedMovesIndex;
828 }
829 if (battleStatus->curSubmenu == BTL_MENU_TYPE_SMASH) {
830 battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_SMASH] = SelectedMovesIndex;
831 }
832 currentSubmenu2 = battleStatus->curSubmenu;
833 if (battleStatus->curSubmenu == BTL_MENU_TYPE_ITEMS) {
834 battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_ITEMS] = SelectedMovesIndex;
835 if (battleStatus->curSubmenu == currentSubmenu2) {
839 break;
840 }
841 }
845 break;
846 }
847 break;
850 if ((battleStatus->curButtonsPressed & BUTTON_B) && submenuResult == 0) {
854 break;
855 }
856 if (btl_main_menu_update() == 0) {
857 break;
858 }
859 battleStatus->cancelTargetMenuSubstate = BTL_SUBSTATE_ABILITIES_TARGET_CANCEL;
860 battleStatus->acceptTargetMenuSubstate = BTL_SUBSTATE_ABILITIES_TARGET_CHOSEN;
861 battleStatus->selectedMoveID = battleStatus->submenuMoves[battleStatus->lastSelectedAbility];
862 battleStatus->curTargetListFlags = gMoveTable[battleStatus->submenuMoves[battleStatus->lastSelectedAbility]].flags;
863 currentSubmenu = battleStatus->curSubmenu;
864 switch (currentSubmenu) {
866 battleStatus->moveCategory = BTL_MENU_TYPE_JUMP;
867 battleStatus->moveArgument = playerData->bootsLevel;
869 break;
871 battleStatus->moveCategory = BTL_MENU_TYPE_SMASH;
872 battleStatus->moveArgument = playerData->hammerLevel;
874 break;
876 gBattleSubState = battleStatus->acceptTargetMenuSubstate;
878 battleStatus->moveCategory = BTL_MENU_TYPE_DEFEND;
880 break;
881 }
882 break;
885 if (btl_main_menu_update() == 0) {
886 break;
887 }
889 break;
894 break;
898 break;
900 if (btl_submenu_moves_update() != -1) {
902 }
903 break;
907 } else {
909 }
912 break;
915 break;
916 }
921 break;
925 break;
928
929 if (submenuResult == 0) {
930 if (battleStatus->curButtonsPressed & BUTTON_B) {
933 }
934 break;
935 }
936
937 battleStatus->cancelTargetMenuSubstate = BTL_SUBSTATE_NOSUBMENU_TARGET_CANCEL;
938 battleStatus->acceptTargetMenuSubstate = BTL_SUBSTATE_NOSUBMENU_TARGET_CHOSEN;
939 switch (battleStatus->curSubmenu) {
941 battleStatus->moveCategory = BTL_MENU_TYPE_JUMP;
942 battleStatus->moveArgument = playerData->bootsLevel;
943 battleStatus->selectedMoveID = playerData->bootsLevel + MOVE_JUMP1;
944 battleStatus->curTargetListFlags = gMoveTable[battleStatus->selectedMoveID].flags;
946 break;
948 battleStatus->moveCategory = BTL_MENU_TYPE_SMASH;
949 battleStatus->moveArgument = playerData->hammerLevel;
950 battleStatus->selectedMoveID = playerData->hammerLevel + MOVE_HAMMER1;
951 battleStatus->curTargetListFlags = gMoveTable[battleStatus->selectedMoveID].flags;
953 break;
954 default:
955 ; // fallthrough
956 }
958 if (btl_main_menu_update() == 0) {
959 break;
960 }
964 break;
968 break;
971 break;
973 if (battleStatus->selectedMoveID == MOVE_DOUBLE_DIP) {
974 battleStatus->itemUsesLeft = 2;
975 }
976 if (battleStatus->selectedMoveID == MOVE_TRIPLE_DIP) {
977 battleStatus->itemUsesLeft = 3;
978 }
979 entryIdx = 0;
980 for (i = 0; i < ARRAY_COUNT(playerData->invItems); i++) {
981 if (playerData->invItems[i] == ITEM_NONE) {
982 continue;
983 }
984 itemData = &gItemTable[playerData->invItems[i]];
986 if (!(itemData->typeFlags & ITEM_TYPE_FLAG_BATTLE_USABLE)) {
987 continue;
988 }
989 battleStatus->moveCategory = BTL_MENU_TYPE_ITEMS;
990 battleStatus->moveArgument = playerData->invItems[i];
991 battleStatus->curTargetListFlags = itemData->targetFlags;
993 popup->ptrIcon[entryIdx] = hudScriptPair->enabled;
994 popup->userIndex[entryIdx] = playerData->invItems[i];
995 popup->enabled[entryIdx] = TRUE;
996 popup->nameMsg[entryIdx] = itemData->nameMsg;
997 popup->descMsg[entryIdx] = itemData->shortDescMsg;
998 if (playerActor->targetListLength == 0) {
999 popup->ptrIcon[entryIdx] = hudScriptPair->disabled;
1000 popup->enabled[entryIdx] = 0;
1001 }
1002 entryIdx++;
1003 }
1004 popup->dipMode = 0;
1005 popup->titleNumber = 0;
1006 if (battleStatus->selectedMoveID == MOVE_DOUBLE_DIP) {
1007 popup->dipMode = 1;
1008 popup->titleNumber = battleStatus->itemUsesLeft;
1009 }
1010 if (battleStatus->selectedMoveID == MOVE_TRIPLE_DIP) {
1011 popup->dipMode = 2;
1012 popup->titleNumber = battleStatus->itemUsesLeft;
1013 }
1014 if (battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_DIP] < 0) {
1015 battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_DIP] = 0;
1016 }
1017 popup->popupType = POPUP_MENU_USE_ITEM;
1018 popup->numEntries = entryIdx;
1019 initialPos = battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_DIP];
1020 popup->initialPos = initialPos;
1024 break;
1026 switch (popup->result) {
1028 // do nothing while player is choosing from popup menu
1029 break;
1032 battleStatus->selectedMoveID = 0;
1033 battleStatus->itemUsesLeft = 0;
1037 break;
1038 default:
1039 battleStatus->cancelTargetMenuSubstate = BTL_SUBSTATE_DIPPING_TARGET_CANCEL;
1040 battleStatus->acceptTargetMenuSubstate = BTL_SUBSTATE_DIPPING_TARGET_CHOSEN;
1041 battleStatus->lastSelectedItem = popup->userIndex[popup->result - 1];
1042 battleStatus->moveCategory = BTL_MENU_TYPE_ITEMS;
1043 battleStatus->moveArgument = battleStatus->lastSelectedItem;
1044 battleStatus->curTargetListFlags = gItemTable[battleStatus->moveArgument].targetFlags | TARGET_FLAG_PRIMARY_ONLY;
1045 battleStatus->curAttackElement = 0;
1046 battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_DIP] = popup->result - 1;
1051 break;
1052 }
1053 break;
1055 if ((battleStatus->curButtonsPressed & BUTTON_B) && popup->result == POPUP_RESULT_CHOOSING) {
1059 battleStatus->selectedMoveID = 0;
1061 } else {
1063 if (btl_main_menu_update()) {
1065 }
1066 }
1067 break;
1070 if (btl_main_menu_update() != 0) {
1072 }
1073 break;
1080 break;
1085 break;
1087 entryIdx = 0;
1088 for (i = 0; i < ARRAY_COUNT(playerData->invItems); i++) {
1089 if (playerData->invItems[i] == ITEM_NONE) {
1090 continue;
1091 }
1092 itemData = &gItemTable[playerData->invItems[i]];
1093 hudScriptPair = &gItemHudScripts[itemData->hudElemID];
1094 if (!(itemData->typeFlags & ITEM_TYPE_FLAG_BATTLE_USABLE)) {
1095 continue;
1096 }
1097 battleStatus->moveCategory = BTL_MENU_TYPE_ITEMS;
1098 battleStatus->moveArgument = playerData->invItems[i];
1099 battleStatus->curTargetListFlags = itemData->targetFlags;
1100 create_current_pos_target_list(playerActor);
1101 popup->ptrIcon[entryIdx] = hudScriptPair->enabled;
1102
1103 popup->userIndex[entryIdx] = playerData->invItems[i];
1104 popup->enabled[entryIdx] = TRUE;
1105 popup->nameMsg[entryIdx] = itemData->nameMsg;
1106 popup->descMsg[entryIdx] = itemData->shortDescMsg;
1107 if (playerActor->targetListLength == 0) {
1108 popup->ptrIcon[entryIdx] = hudScriptPair->disabled;
1109 popup->enabled[entryIdx] = 0;
1110 }
1111 entryIdx++;
1112 }
1113 if (battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_DIP] < 0) {
1114 battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_DIP] = 0;
1115 }
1116 initialPos = battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_DIP];
1117 popup->popupType = POPUP_MENU_USE_ITEM;
1118 popup->numEntries = entryIdx;
1119 popup->dipMode = 0;
1120 popup->titleNumber = 0;
1121 popup->initialPos = initialPos;
1125 break;
1127 switch(popup->result) {
1129 // do nothing while player is choosing from popup menu
1130 break;
1138 break;
1139 default:
1140 battleStatus->cancelTargetMenuSubstate = BTL_SUBSTATE_ITEMS_TARGET_CANCEL;
1141 battleStatus->acceptTargetMenuSubstate = BTL_SUBSTATE_ITEMS_TARGET_CHOSEN;
1142 battleStatus->lastSelectedItem = popup->userIndex[popup->result - 1];
1143 battleStatus->moveCategory = BTL_MENU_TYPE_ITEMS;
1144 battleStatus->moveArgument = battleStatus->lastSelectedItem;
1145 battleStatus->selectedMoveID = MOVE_ITEMS;
1146 battleStatus->curTargetListFlags = gItemTable[battleStatus->moveArgument].targetFlags | TARGET_FLAG_PRIMARY_ONLY;
1147 battleStatus->curAttackElement = 0;
1148 battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_DIP] = popup->result - 1;
1152 break;
1153 }
1154 break;
1156 if ((battleStatus->curButtonsPressed & BUTTON_B) && popup->result == POPUP_RESULT_CHOOSING) {
1160 } else {
1161 if (btl_main_menu_update() != 0) {
1163 }
1164 }
1165 break;
1167 if (btl_main_menu_update() != 0) {
1169 }
1170 break;
1175 break;
1179 break;
1181 for (i = 0; i < battleStatus->submenuMoveCount; i++) {
1182 moveData = &gMoveTable[battleStatus->submenuMoves[i]];
1183 MovesOptionError[i] = 0;
1184
1185 if (battleStatus->submenuStatus[i] == 0) {
1186 MovesOptionError[i] = 0;
1187 }
1188
1189 if (battleStatus->submenuStatus[i] == -1) {
1190 battleStatus->submenuStatus[i] = 0;
1192 }
1193 if (battleStatus->submenuStatus[i] == -2) {
1194 battleStatus->submenuStatus[i] = 0;
1196 }
1197 if (!(battleStatus->enabledStarPowersFlags & (1 << i))) {
1198 battleStatus->submenuStatus[i] = 0;
1200 }
1201
1203 if (battleStatus->submenuStatus[i] == 0) {
1205 }
1206 MovesOptionDisplayCosts[i] = moveData->costFP;
1207 MovesOptionBPCosts[i] = moveData->costBP;
1209 MovesOptionIndices[i] = i;
1210 MovesOptionEnabled[i] = battleStatus->submenuStatus[i];
1211 MovesOptionNames[i] = moveData->nameMsg;
1212 MovesOptionDesc[i] = moveData->shortDescMsg;
1213 MovesOptionDiscounts[i] = 0;
1215 }
1216 if (battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_STAR_POWER] < 0) {
1217 battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_STAR_POWER] = 0;
1218 }
1220 MovesOptionCount = battleStatus->submenuMoveCount;
1221 initialPos = battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_STAR_POWER];
1222 MovesPrevSelected = initialPos;
1225 break;
1228 switch(submenuResult) {
1230 // do nothing while player is choosing from menu
1231 break;
1234 break;
1242 break;
1243 default:
1244 battleStatus->lastSelectedAbility = MovesOptionIndices[submenuResult - 1];
1245 battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_STAR_POWER] = SelectedMovesIndex;
1249 break;
1250 }
1251 break;
1254 if ((battleStatus->curButtonsPressed & BUTTON_B) && submenuResult == 0) {
1258 } else if (btl_main_menu_update() != 0) {
1259 battleStatus->cancelTargetMenuSubstate = BTL_SUBSTATE_STAR_SPIRITS_TARGET_CANCEL;
1260 battleStatus->acceptTargetMenuSubstate = BTL_SUBSTATE_STAR_SPIRITS_TARGET_CHOSEN;
1262 battleStatus->selectedMoveID = battleStatus->submenuMoves[battleStatus->lastSelectedAbility];
1263 battleStatus->curTargetListFlags = gMoveTable[battleStatus->submenuMoves[battleStatus->lastSelectedAbility]].flags;
1264 battleStatus->moveArgument = battleStatus->lastSelectedAbility;
1265 if (playerData->starBeamLevel == 2 && battleStatus->moveArgument == 8) {
1266 battleStatus->moveArgument++;
1267 }
1269 }
1270 break;
1273 if (btl_main_menu_update() != 0) {
1275 }
1276 break;
1281 break;
1285 break;
1289 }
1290 break;
1292 if (!btl_player_can_act()) {
1293 battleStatus->itemUsesLeft = 1;
1295 } else {
1296 entryIdx = 0;
1297 for (i = 0; i < ARRAY_COUNT(playerData->invItems); i++) {
1298 if (playerData->invItems[i] == ITEM_NONE) {
1299 continue;
1300 }
1301 itemData = &gItemTable[playerData->invItems[i]];
1302 hudScriptPair = &gItemHudScripts[itemData->hudElemID];
1303 if (!(itemData->typeFlags & ITEM_TYPE_FLAG_BATTLE_USABLE)) {
1304 continue;
1305 }
1306
1307 battleStatus->moveCategory = BTL_MENU_TYPE_ITEMS;
1308 battleStatus->moveArgument = playerData->invItems[i];
1309 battleStatus->curTargetListFlags = itemData->targetFlags;
1310 create_current_pos_target_list(playerActor);
1311 popup->ptrIcon[entryIdx] = hudScriptPair->enabled;
1312 popup->userIndex[entryIdx] = playerData->invItems[i];
1313 popup->enabled[entryIdx] = TRUE;
1314 popup->nameMsg[entryIdx] = itemData->nameMsg;
1315 popup->descMsg[entryIdx] = itemData->shortDescMsg;
1316 if (playerActor->targetListLength == 0) {
1317 popup->ptrIcon[entryIdx] = hudScriptPair->disabled;
1318 popup->enabled[entryIdx] = FALSE;
1319 }
1320 entryIdx++;
1321 }
1322 if (entryIdx == 0) {
1323 battleStatus->itemUsesLeft = 1;
1325 } else {
1326 popup->popupType = POPUP_MENU_USE_ITEM;
1327 if (battleStatus->selectedMoveID == MOVE_DOUBLE_DIP) {
1328 popup->popupType += POPUP_MENU_DOUBLE_DIP;
1329 popup->dipMode = 1;
1330 popup->titleNumber = battleStatus->itemUsesLeft;
1331 }
1332 if (battleStatus->selectedMoveID == MOVE_TRIPLE_DIP) {
1333 popup->popupType += POPUP_MENU_TRIPLE_DIP;
1334 popup->dipMode = 2;
1335 popup->titleNumber = battleStatus->itemUsesLeft;
1336 }
1337 if (battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_DIP] < 0) {
1338 battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_DIP] = 0;
1339 }
1340 popup->numEntries = entryIdx;
1341 initialPos = battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_DIP];
1342 popup->initialPos = initialPos;
1346 }
1347 }
1348 break;
1350 switch(popup->result) {
1352 // do nothing while player is choosing from menu
1353 break;
1355 battleStatus->itemUsesLeft = 1;
1357 break;
1358 default:
1359 battleStatus->cancelTargetMenuSubstate = BTL_SUBSTATE_NEXT_DIP_TARGET_CANCEL;
1360 battleStatus->acceptTargetMenuSubstate = BTL_SUBSTATE_NEXT_DIP_TARGET_CHOSEN;
1361 battleStatus->lastSelectedItem = popup->userIndex[popup->result - 1];
1362 battleStatus->moveCategory = BTL_MENU_TYPE_ITEMS;
1363 battleStatus->moveArgument = battleStatus->lastSelectedItem;
1364 battleStatus->curTargetListFlags = gItemTable[battleStatus->moveArgument].targetFlags | TARGET_FLAG_PRIMARY_ONLY;
1365 battleStatus->curAttackElement = 0;
1366 battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_DIP] = popup->result - 1;
1370 break;
1371 }
1372 break;
1374 if (BattleMenu_ChooseDelay != 0) {
1376 } else {
1378 }
1379 break;
1381 if (BattleMenu_ChooseDelay != 0) {
1383 } else {
1385 }
1386 break;
1391 break;
1394 break;
1396 if (playerData->bootsLevel > GEAR_RANK_NONE) {
1397 battleStatus->curTargetListFlags = gMoveTable[MOVE_BERSERKER_JUMP].flags;
1398 create_current_pos_target_list(playerActor);
1399 jumpTargetCount = playerActor->targetListLength;
1400 } else {
1401 jumpTargetCount = 0;
1402 }
1403
1404 if (playerData->hammerLevel > GEAR_RANK_NONE) {
1405 battleStatus->curTargetListFlags = gMoveTable[MOVE_BERSERKER_HAMMER].flags;
1406 create_current_pos_target_list(playerActor);
1407 hammerTargetCount = playerActor->targetListLength;
1408 } else {
1410 }
1411
1412 if (jumpTargetCount <= 0 && hammerTargetCount <= 0) {
1413 battleStatus->moveCategory = BTL_MENU_TYPE_DO_NOTHING;
1414 battleStatus->waitForState = BATTLE_STATE_NONE;
1416 } else {
1417 jumpChance = 50;
1418 if (jumpTargetCount <= 0) {
1419 jumpChance = 0;
1420 }
1421 if (hammerTargetCount <= 0) {
1422 jumpChance = 101;
1423 }
1424 if (rand_int(100) < jumpChance) {
1425 battleStatus->selectedMoveID = MOVE_BERSERKER_JUMP;
1426 battleStatus->moveCategory = BTL_MENU_TYPE_JUMP;
1427 battleStatus->curTargetListFlags = gMoveTable[MOVE_BERSERKER_JUMP].flags;
1428 battleStatus->moveArgument = playerData->bootsLevel;
1429 create_current_pos_target_list(playerActor);
1430 } else {
1431 battleStatus->selectedMoveID = MOVE_BERSERKER_HAMMER;
1432 battleStatus->moveCategory = BTL_MENU_TYPE_SMASH;
1433 battleStatus->curTargetListFlags = gMoveTable[MOVE_BERSERKER_HAMMER].flags;
1434 battleStatus->moveArgument = playerData->hammerLevel;
1435 create_current_pos_target_list(playerActor);
1436 }
1438 }
1439 break;
1441 entryIdx = 0;
1443
1444 // add 'Change Member' command
1445 if (battleStatus->changePartnerAllowed >= 0) {
1451 if (battleStatus->changePartnerAllowed <= 0) {
1455 }
1456 entryIdx++;
1457 }
1458
1459 // add 'Do Nothing' command
1465 entryIdx++;
1466
1467 // add 'Run Away' command
1477 }
1478 entryIdx++;
1479
1480 if (battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_STRATEGY] < 0) {
1481 battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_STRATEGY] = 0;
1482 }
1483 initialPos = battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_STRATEGY];
1485 StratsPrevSelected = initialPos;
1488 break;
1491 switch(submenuResult) {
1493 // do nothing while player is choosing from menu
1494 break;
1497 break;
1505 break;
1506 default:
1508 battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_STRATEGY] = submenuResult - 1;
1509 if (battleStatus->curSubmenu == BTL_MENU_TYPE_CHANGE_PARTNER) {
1513 } else {
1517 }
1518 break;
1519 }
1520 break;
1523 if ((battleStatus->curButtonsPressed & BUTTON_B) && submenuResult == 0) {
1527 } else if (btl_main_menu_update() != 0) {
1528 battleStatus->cancelTargetMenuSubstate = BTL_SUBSTATE_STRATEGIES_TARGET_CANCEL;
1529 battleStatus->acceptTargetMenuSubstate = BTL_SUBSTATE_STRATEGIES_TARGET_CHOSEN;
1530 switch (battleStatus->curSubmenu) {
1534 battleStatus->moveCategory = BTL_MENU_TYPE_RUN_AWAY;
1535 battleStatus->selectedMoveID = MOVE_RUN_AWAY;
1537 break;
1539 battleStatus->hustleTurns = 0;
1541 gBattleSubState = battleStatus->acceptTargetMenuSubstate;
1544 break;
1548 battleStatus->moveCategory = BTL_MENU_TYPE_DEFEND;
1549 battleStatus->selectedMoveID = MOVE_DEFEND;
1551 break;
1556 break;
1557 }
1558 }
1559 break;
1562 if (btl_main_menu_update() != 0) {
1566 }
1567 break;
1572 break;
1576 break;
1578 if (btl_submenu_strats_update() != -1) {
1580 }
1581 break;
1583 entryIdx = 0;
1584 for (i = 1; i < ARRAY_COUNT(playerData->partners); i++) {
1586 if (playerData->partners[partnerId].enabled) {
1589 popup->enabled[entryIdx] = TRUE;
1590 popup->userIndex[entryIdx] = partnerId;
1591 popup->nameMsg[entryIdx] = prop->nameMsg;
1592 popup->descMsg[entryIdx] = prop->battleDescMsg;
1593 popup->value[entryIdx] = playerData->partners[partnerId].level;
1594 if (playerData->curPartner == partnerId) {
1596 popup->enabled[entryIdx] = FALSE;
1597 }
1598 entryIdx++;
1599 }
1600 }
1601 if (battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_PARTNER] < 0) {
1602 battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_PARTNER] = 0;
1603 }
1604 popup->popupType = POPUP_MENU_SWITCH_PARTNER;
1605 popup->numEntries = entryIdx;
1606 popup->initialPos = MenuIndexFromPartnerID[playerData->curPartner] - 1;
1607 popup->dipMode = 0;
1608 popup->titleNumber = 0;
1612 break;
1614 switch(popup->result) {
1616 // do nothing while player is choosing from menu
1617 break;
1620 break;
1626 break;
1627 default:
1628 battleStatus->cancelTargetMenuSubstate = BTL_SUBSTATE_CHANGE_PARTNER_TARGET_CANCEL;
1629 battleStatus->acceptTargetMenuSubstate = BTL_SUBSTATE_CHANGE_PARTNER_TARGET_CHOSEN;
1630 battleStatus->lastSelectedPartner = popup->userIndex[popup->result - 1];
1632 battleStatus->selectedMoveID = MOVE_CHANGE_PARTNER;
1633 battleStatus->curTargetListFlags = TARGET_FLAG_2;
1634 battleStatus->moveArgument = battleStatus->lastSelectedPartner;
1635 battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_PARTNER] = popup->result - 1;
1640 break;
1641 }
1642 break;
1644 if ((battleStatus->curButtonsPressed & BUTTON_B) && popup->result == POPUP_RESULT_CHOOSING) {
1649 } else {
1651 if (btl_main_menu_update() != 0) {
1652 gBattleSubState = battleStatus->acceptTargetMenuSubstate;
1655 }
1656 }
1657 break;
1660 if (btl_main_menu_update() != 0) {
1662 }
1663 break;
1669 break;
1674 break;
1678 if (popup->result != POPUP_RESULT_INVALID) {
1682 }
1683 break;
1684 }
1685}
1686
1688 switch (gBattleSubState) {
1691 break;
1719 break;
1725 break;
1728 break;
1731 break;
1734 break;
1737 break;
1738 }
1739}
void btl_init_menu_items(void)
Definition 190B20.c:601
void btl_check_can_change_partner(void)
Definition 190B20.c:566
s32 MenuIndexFromPartnerID[]
Definition 5B320.c:316
PartnerPopupProperties gPartnerPopupProperties[]
Definition 5B320.c:331
void create_battle_popup_menu(PopupMenu *popup)
void flush_popup_menu(void)
void show_popup_menu(void)
BSS s32 PopupMenu_SelectedIndex
@ AC_MODE_TUTORIAL
Definition action_cmd.h:62
void btl_main_menu_resume_choose(void)
HudScript HES_MenuBoots2Disabled
void btl_main_menu_destroy(void)
void btl_main_menu_restore_choose(void)
HudScript HES_MenuHammer1
s8 BattleMenu_CurPos
s32 BattleMenu_ChooseDelay
#define MENU_DIPPING_DELAY
Definition battle_menu.h:8
IconHudScriptPair gItemHudScripts[]
HudScript HES_MenuHammer2
s32 MovesOptionNames[24]
Definition menu_moves.c:55
void btl_submenu_moves_restore_locked(void)
Definition menu_moves.c:249
s8 ShowingErrorMessage
Definition menu_strats.c:54
s32 MovesOptionCount
Definition menu_moves.c:65
HudScript HES_MenuHammer1Disabled
s32 MovesOptionIndices[24]
Definition menu_moves.c:61
void btl_submenu_moves_resume_choose(void)
Definition menu_moves.c:167
IconHudScriptPair StarPowersHudScripts
s32 btl_submenu_moves_update(void)
Definition menu_moves.c:254
HudScript HES_MenuHammer3Disabled
HudScript HES_MenuHammer2Disabled
s32 WheelOptionEnabled[]
s32 WheelOptionName[]
s32 MovesOptionEnabled[24]
Definition menu_moves.c:62
void btl_main_menu_init(void)
void btl_submenu_moves_destroy(void)
Definition menu_moves.c:138
s32 btl_main_menu_update(void)
s32 BattleMenu_SwapDelay
void btl_submenu_strats_restore_choose(void)
HudScript * MovesOptionHudScripts[24]
Definition menu_moves.c:52
s32 StratsOptionNames[]
Definition menu_strats.c:38
s32 MovesOptionBPCosts[24]
Definition menu_moves.c:60
HudScript HES_MenuBoots1Disabled
s32 MovesOptionDiscounts[24]
Definition menu_moves.c:58
s32 UsingSpiritsSubmenu
Definition menu_moves.c:82
s32 WheelOptionError[]
HudScript HES_MenuBoots3Disabled
s32 LeftJustMenuMessages[]
s32 WheelOptionSubmenu[]
s32 StratsOptionError[]
Definition menu_strats.c:42
IconHudScriptPair StrategiesHudScripts
s8 MovesOptionSortPriority[24]
Definition menu_moves.c:63
void btl_submenu_moves_restore_choose(void)
Definition menu_moves.c:207
s8 BattleMenu_HomePos
void btl_submenu_strats_restore_locked(void)
void btl_submenu_moves_hide(void)
Definition menu_moves.c:134
s32 StratsOptionMessage[]
Definition menu_strats.c:41
HudScript HES_MenuHammer3
HudScript * StratsOptionHudScripts[]
Definition menu_strats.c:36
s32 MovesPrevSelected
Definition menu_moves.c:46
s32 MovesOptionDesc[24]
Definition menu_moves.c:56
IconHudScriptPair PartnerHudScripts[]
#define MENU_CHANGE_DELAY
Definition battle_menu.h:7
void btl_main_menu_restore_submenu(void)
s32 StratsPrevSelected
Definition menu_strats.c:34
void btl_main_menu_hide(void)
void btl_submenu_moves_init(void)
Definition menu_moves.c:94
HudScript * WheelOptionHudScript[]
b32 btl_partner_can_act(void)
IconHudScriptPair ItemsHudScripts
void btl_submenu_strats_hide(void)
HudScript HES_MenuBoots2
HudScript HES_MenuBoots3
void btl_submenu_strats_destroy(void)
s32 BattleMenu_WheelBase
s32 StratsOptionEnabled[]
Definition menu_strats.c:40
IconHudScriptPair DoNothingHudScripts
s32 BattleMenu_PrevSelected
IconHudScriptPair StarPowerMovesHudScripts[]
PopupMenu BattlePopupMenu
s32 WheelOptionCount
void btl_main_menu_draw(void)
s8 MovesOptionError[24]
Definition menu_moves.c:64
s32 StratsOptionMenuTypes[]
Definition menu_strats.c:39
b32 btl_player_can_act(void)
void btl_menu_strats_init(void)
Definition menu_strats.c:66
IconHudScriptPair FleeHudScripts
b32 BattleMenu_ShowSwapIcons
s32 SelectedMovesIndex
Definition menu_moves.c:83
HudScript HES_MenuBoots1
s32 btl_submenu_strats_update(void)
s32 StratsOptionCount
Definition menu_strats.c:43
s32 MovesOptionDisplayCosts[24]
Definition menu_moves.c:57
s32 MovesOptionDiscountColors[24]
Definition menu_moves.c:59
s32 CenteredBattleMessages[]
void btl_submenu_strats_resume_choose(void)
u32 pressedButtons[4]
ActorState state
Vec3f homePos
Vec3f curPos
s8 targetListLength
#define rand_int
#define clamp_angle
@ BUTTON_B
Definition enums.h:2775
@ BUTTON_Z
Definition enums.h:2774
@ BS_FLAGS1_TUTORIAL_BATTLE
Definition enums.h:3627
@ BS_FLAGS1_PLAYER_IN_BACK
Definition enums.h:3622
@ BS_FLAGS1_MENU_OPEN
Definition enums.h:3599
@ BS_FLAGS1_YIELD_TURN
Definition enums.h:3623
@ BTL_MSG_CANT_SWITCH
Definition enums.h:3782
@ BTL_MSG_CANT_MOVE
Definition enums.h:3783
@ BTL_MSG_NO_JUMP_TARGET
Definition enums.h:3769
@ BTL_MSG_NO_ITEM_TARGET
Definition enums.h:3771
@ BTL_MSG_CANT_SELECT_NOW
Definition enums.h:3774
@ BTL_MSG_CANT_SELECT_NOW_ALT
Definition enums.h:3786
@ BTL_MSG_NO_HAMMER_TARGET
Definition enums.h:3770
@ POPUP_MENU_DOUBLE_DIP
Definition enums.h:3179
@ POPUP_MENU_USE_ITEM
Definition enums.h:3165
@ POPUP_MENU_TRIPLE_DIP
Definition enums.h:3180
@ POPUP_MENU_SWITCH_PARTNER
Definition enums.h:3166
@ WINDOW_UPDATE_9
Definition enums.h:4904
@ WINDOW_UPDATE_HIDE
Definition enums.h:4897
@ BTL_MENU_TYPE_SMASH
Definition enums.h:3827
@ BTL_MENU_TYPE_JUMP
Definition enums.h:3826
@ BTL_MENU_TYPE_ABILITY
Definition enums.h:3832
@ BTL_MENU_TYPE_INVALID
Definition enums.h:3825
@ BTL_MENU_TYPE_RUN_AWAY
Definition enums.h:3829
@ BTL_MENU_TYPE_CHANGE_PARTNER
Definition enums.h:3831
@ BTL_MENU_TYPE_STAR_POWERS
Definition enums.h:3834
@ BTL_MENU_TYPE_ITEMS
Definition enums.h:3828
@ BTL_MENU_TYPE_ACT_LATER
Definition enums.h:3836
@ BTL_MENU_TYPE_DEFEND
Definition enums.h:3830
@ BTL_MENU_TYPE_PARTNER_FOCUS
Definition enums.h:3837
@ BTL_MENU_TYPE_STRATEGIES
Definition enums.h:3833
@ BTL_MENU_TYPE_DO_NOTHING
Definition enums.h:3835
@ BS_FLAGS2_NO_TARGET_AVAILABLE
Definition enums.h:3647
@ BS_FLAGS2_CAN_FLEE
Definition enums.h:3642
@ BS_FLAGS2_PARTNER_TURN_USED
Definition enums.h:3639
@ STATUS_KEY_THINKING
Definition enums.h:2829
@ ITEM_TYPE_FLAG_BATTLE_USABLE
Definition enums.h:1861
@ BTL_CAM_DEFAULT
Definition enums.h:4409
@ BATTLE_SUBMENU_STATUS_ENABLED
Definition enums.h:4812
@ BATTLE_SUBMENU_STATUS_NO_TARGETS
Definition enums.h:4814
@ BATTLE_SUBMENU_STATUS_NOT_ENOUGH_FP
Definition enums.h:4813
@ BATTLE_SUBMENU_STATUS_NO_TARGETS_2
Definition enums.h:4815
@ TARGET_FLAG_PRIMARY_ONLY
Definition enums.h:1889
@ TARGET_FLAG_2
Definition enums.h:1876
@ POPUP_RESULT_CANCEL
Definition enums.h:3212
@ POPUP_RESULT_CHOOSING
Definition enums.h:3211
@ POPUP_RESULT_INVALID
Definition enums.h:3209
@ MOVE_TYPE_JUMP
Definition enums.h:4799
@ MOVE_TYPE_6
Definition enums.h:4803
@ MOVE_TYPE_3
Definition enums.h:4800
@ MOVE_TYPE_SWITCH
Definition enums.h:4802
@ MOVE_TYPE_HAMMER
Definition enums.h:4798
@ MOVE_TYPE_ITEMS
Definition enums.h:4801
@ BATTLE_STATE_RUN_AWAY
Definition enums.h:3688
@ BATTLE_STATE_SWITCH_TO_PARTNER
Definition enums.h:3675
@ BATTLE_STATE_DEFEND
Definition enums.h:3689
@ BATTLE_STATE_PLAYER_MOVE
Definition enums.h:3682
@ BATTLE_STATE_END_PLAYER_TURN
Definition enums.h:3686
@ BATTLE_STATE_NONE
Definition enums.h:3664
@ BATTLE_STATE_SELECT_TARGET
Definition enums.h:3681
@ BATTLE_STATE_CHANGE_PARTNER
Definition enums.h:3692
@ ABILITY_BERSERKER
Definition enums.h:457
@ ABILITY_FLOWER_SAVER
Definition enums.h:460
@ ABILITY_FLOWER_FANATIC
Definition enums.h:474
@ SOUND_PARTNER_SWAP_BATTLE_POS
Definition enums.h:563
@ SOUND_MENU_ERROR
Definition enums.h:936
@ GEAR_RANK_NONE
Definition enums.h:2044
@ BTL_MENU_ENABLED_SMASH
Definition enums.h:3842
@ BTL_MENU_ENABLED_ITEMS
Definition enums.h:3843
@ BTL_MENU_ENABLED_STAR_POWERS
Definition enums.h:3846
@ BTL_MENU_ENABLED_JUMP
Definition enums.h:3841
@ BTL_MENU_ENABLED_STRATEGIES
Definition enums.h:3845
@ ACTOR_PLAYER
Definition enums.h:2118
@ ACTOR_FLAG_SHOW_STATUS_ICONS
Definition enums.h:3377
@ ACTOR_FLAG_USING_IDLE_ANIM
Definition enums.h:3376
@ BTL_MENU_IDX_PARTNER
Definition enums.h:3816
@ BTL_MENU_IDX_STRATEGY
Definition enums.h:3818
@ BTL_MENU_IDX_SMASH
Definition enums.h:3813
@ BTL_MENU_IDX_STAR_POWER
Definition enums.h:3817
@ BTL_MENU_IDX_MAIN
Definition enums.h:3811
@ BTL_MENU_IDX_JUMP
Definition enums.h:3812
@ BTL_MENU_IDX_DIP
Definition enums.h:3815
@ BTL_MENU_IDX_ITEMS
Definition enums.h:3814
@ WIN_BTL_STRATS_MENU
Definition enums.h:4832
@ WIN_BTL_STRATS_TITLE
Definition enums.h:4833
void btl_show_variable_battle_message(s32, s32, s32)
s32 player_team_is_ability_active(Actor *actor, s32 ability)
Definition 190B20.c:2497
void hide_popup_menu(void)
void set_window_update(s32 panelID, s32)
Definition windows.c:434
void destroy_popup_menu(void)
void btl_cam_use_preset(s32)
Definition camera.c:1919
void set_actor_anim(s32 actorID, s32 partID, AnimID animID)
Definition 190B20.c:737
void btl_cam_move(s16)
Definition camera.c:1953
f32 sin_rad(f32 x)
Definition 43F0.c:711
void btl_set_state(s32 battleState)
s32 btl_is_popup_displayed(void)
void create_current_pos_target_list(Actor *actor)
Definition 190B20.c:472
HudScript * disabled
HudScript * enabled
IconHudScriptPair HammerHudScripts[]
void btl_init_menu_hammer(void)
@ BTL_SUBSTATE_DIPPING_HANDOVER
Definition menu_player.c:34
@ BTL_SUBSTATE_STAR_SPIRITS_BUILD_MENU
Definition menu_player.c:54
@ BTL_SUBSTATE_NEXT_DIP_HANDOVER
Definition menu_player.c:64
@ BTL_SUBSTATE_NEXT_DIP_REOPEN_MENU
Definition menu_player.c:65
@ BTL_SUBSTATE_CREATE_MAIN_MENU
Definition menu_player.c:80
@ BTL_SUBSTATE_STAR_SPIRITS_SHOW_ERROR
Definition menu_player.c:60
@ BTL_SUBSTATE_MAIN_AWAIT_CANT_SWAP
Definition menu_player.c:23
@ BTL_SUBSTATE_STRATEGIES_SHOW_ERROR
Definition menu_player.c:77
@ BTL_SUBSTATE_STAR_SPIRITS_TARGET_CHOSEN
Definition menu_player.c:59
@ BTL_SUBSTATE_STAR_SPIRITS_CHOOSING
Definition menu_player.c:55
@ BTL_SUBSTATE_NEXT_DIP_BUILD_MENU
Definition menu_player.c:62
@ BTL_SUBSTATE_ABILITIES_SHOW_ERROR
Definition menu_player.c:21
@ BTL_SUBSTATE_STAR_SPIRITS_HANDOVER
Definition menu_player.c:56
@ BTL_SUBSTATE_CHANGE_PARTNER_HANDOVER
Definition menu_player.c:41
@ BTL_SUBSTATE_NOSUBMENU_TARGET_CANCEL
Definition menu_player.c:29
@ BTL_SUBSTATE_CHANGE_PARTNER_CHOOSING
Definition menu_player.c:40
@ BTL_SUBSTATE_NEXT_DIP_TARGET_CHOSEN
Definition menu_player.c:67
@ BTL_SUBSTATE_CHANGE_PARTNER_REOPEN_MENU
Definition menu_player.c:42
@ BTL_SUBSTATE_ABILITIES_HANDOVER
Definition menu_player.c:17
@ BTL_SUBSTATE_DIPPING_TARGET_CANCEL
Definition menu_player.c:36
@ BTL_SUBSTATE_DIPPING_CHOOSING
Definition menu_player.c:33
@ BTL_SUBSTATE_MAIN_CHOOSING
Definition menu_player.c:14
@ BTL_SUBSTATE_ITEMS_BUILD_MENU
Definition menu_player.c:47
@ BTL_SUBSTATE_STRATEGIES_HANDOVER
Definition menu_player.c:73
@ BTL_SUBSTATE_NEXT_DIP_CHOOSING
Definition menu_player.c:63
@ BTL_SUBSTATE_DIPPING_REOPEN_MENU
Definition menu_player.c:35
@ BTL_SUBSTATE_NOSUBMENU_SHOW
Definition menu_player.c:26
@ BTL_SUBSTATE_ABILITIES_CHOOSING
Definition menu_player.c:16
@ BTL_SUBSTATE_ITEMS_REOPEN_MENU
Definition menu_player.c:50
@ BTL_SUBSTATE_STAR_SPIRITS_TARGET_CANCEL
Definition menu_player.c:58
@ BTL_SUBSTATE_CHANGE_PARTNER_BUILD_MENU
Definition menu_player.c:39
@ BTL_SUBSTATE_STRATEGIES_TARGET_CHOSEN
Definition menu_player.c:76
@ BTL_SUBSTATE_NEXT_DIP_TARGET_CANCEL
Definition menu_player.c:66
@ BTL_SUBSTATE_STRATEGIES_REOPEN_MENU
Definition menu_player.c:74
@ BTL_SUBSTATE_ITEMS_TARGET_CANCEL
Definition menu_player.c:51
@ BTL_SUBSTATE_PERFORM_SWAP
Definition menu_player.c:79
@ BTL_SUBSTATE_CHANGE_PARTNER_ERROR
Definition menu_player.c:45
@ BTL_SUBSTATE_DIPPING_BUILD_MENU
Definition menu_player.c:32
@ BTL_SUBSTATE_NOSUBMENU_TARGET_CHOSEN
Definition menu_player.c:30
@ BTL_SUBSTATE_ITEMS_HANDOVER
Definition menu_player.c:49
@ BTL_SUBSTATE_ABILITIES_REOPEN_MENU
Definition menu_player.c:18
@ BTL_SUBSTATE_CHANGE_PARTNER_TARGET_CANCEL
Definition menu_player.c:43
@ BTL_SUBSTATE_NOSUBMENU_HANDOVER
Definition menu_player.c:27
@ BTL_SUBSTATE_NOSUBMENU_RETURN_MAIN
Definition menu_player.c:28
@ BTL_SUBSTATE_STAR_SPIRITS_REOPEN_MENU
Definition menu_player.c:57
@ BTL_SUBSTATE_MAIN_SHOW_CANT_SWAP
Definition menu_player.c:22
@ BTL_SUBSTATE_DIPPING_TARGET_CHOSEN
Definition menu_player.c:37
@ BTL_SUBSTATE_ITEMS_CHOOSING
Definition menu_player.c:48
@ BTL_SUBSTATE_CHANGE_PARTNER_TARGET_CHOSEN
Definition menu_player.c:44
@ BTL_SUBSTATE_STRATEGIES_BUILD_MENU
Definition menu_player.c:71
@ BTL_SUBSTATE_ABILITIES_TARGET_CHOSEN
Definition menu_player.c:20
@ BTL_SUBSTATE_BERSERKER_CHOOSE
Definition menu_player.c:69
@ BTL_SUBSTATE_STRATEGIES_CHOOSING
Definition menu_player.c:72
@ BTL_SUBSTATE_STRATEGIES_TARGET_CANCEL
Definition menu_player.c:75
@ BTL_SUBSTATE_ITEMS_TARGET_CHOSEN
Definition menu_player.c:52
@ BTL_SUBSTATE_ABILITIES_TARGET_CANCEL
Definition menu_player.c:19
s32 BattleMenu_CategoryForSubmenu[]
Definition menu_player.c:83
void btl_state_update_player_menu(void)
IconHudScriptPair BootsHudScripts[]
Definition menu_player.c:98
s32 get_player_anim_for_status(s32 animID)
Definition 190B20.c:1697
void btl_state_draw_player_menu(void)
void btl_init_menu_boots(void)
void sfx_play_sound(s32 soundID)
#define ARRAY_COUNT(arr)
Definition macros.h:40
#define DEG_TO_RAD(deg)
Definition macros.h:146
@ BTL_SUBSTATE_INIT
Definition states.h:8
@ BTL_SUBSTATE_PLAYER_CONTINUE_DIP
Definition states.h:12
ItemData gItemTable[]
s32 PartnerIDFromMenuIndex[12]
Definition 5B320.c:300
GameStatus * gGameStatusPtr
Definition main_loop.c:31
PlayerData gPlayerData
Definition 77480.c:39
BattleStatus gBattleStatus
Definition battle.cpp:14
s32 gBattleSubState
Definition battle.cpp:17
MoveData gMoveTable[]