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

Go to the source code of this file.

Macros

#define TABMAX   6
 
#define Y_VAR1   0
 
#define X_VAR1   108
 
#define X_VAR2   93
 
#define Y_VAR2   0
 

Functions

void create_battle_popup_menu (PopupMenu *popup)
 
s32 get_player_anim_for_status (s32 animID)
 
void btl_menu_moves_draw_content (void *data, s32 x, s32 y)
 
void btl_menu_moves_show_title (void *data, s32 x, s32 y)
 
void btl_menu_moves_show_icon (void *data, s32 x, s32 y)
 
void btl_menu_moves_show_desc (void *data, s32 x, s32 y)
 
void btl_menu_moves_show_error (void *data, s32 x, s32 y)
 
void btl_menu_strats_draw_content (void *data, s32 x, s32 y)
 
void btl_menu_strats_show_title (void *data, s32 x, s32 y)
 
void btl_menu_strats_show_desc (void *data, s32 x, s32 y)
 
void btl_menu_strats_show_error (void *data, s32 x, s32 y)
 
void btl_init_menu_items (void)
 
void btl_check_can_change_partner (void)
 
void btl_init_menu_partner (void)
 
void func_800F52BC (void)
 
void func_800F16CC (void)
 
void btl_init_menu_boots (void)
 
void btl_init_menu_hammer (void)
 
void btl_main_menu_init (void)
 
void func_802A1030 (void)
 
void func_802A1050 (void)
 
void func_802A1078 (void)
 
void func_802A1098 (void)
 
void btl_main_menu_destroy (void)
 
s32 btl_main_menu_update (void)
 
void btl_main_menu_draw (void)
 
void func_802A2684 (void)
 
void func_802A27D0 (void)
 
void func_802A27E4 (void)
 
void func_802A2910 (void)
 
void func_802A2AB8 (void)
 
void func_802A2C58 (void)
 
s32 btl_submenu_moves_update (void)
 
void func_802A45D8 (void)
 
void func_802A4718 (void)
 
void func_802A472C (void)
 
void func_802A47E0 (void)
 
void func_802A48FC (void)
 
void func_802A4A10 (void)
 
s32 btl_update_strats_menu (void)
 
s32 can_switch_to_player (void)
 
s32 can_switch_to_partner (void)
 
void btl_state_update_player_menu (void)
 
void btl_state_draw_player_menu (void)
 
void btl_state_update_partner_menu (void)
 
void btl_state_draw_partner_menu (void)
 
s32 btl_menu_show_switch_to_twink (void)
 
void btl_state_update_peach_menu (void)
 
void btl_state_draw_peach_menu (void)
 
s32 btl_menu_show_switch_to_peach (void)
 
void btl_state_update_twink_menu (void)
 
void btl_state_draw_twink_menu (void)
 
void btl_state_update_select_target (void)
 
void btl_state_draw_select_target (void)
 
void btl_state_update_22 (void)
 
void btl_state_draw_22 (void)
 

Variables

HudScript HES_YellowArrow
 
HudScript HES_MenuFlee
 
HudScript HES_MenuFleeDisabled
 
HudScript HES_MenuDefend
 
HudScript HES_MenuDefendDisabled
 
HudScript HES_MenuStrategies
 
HudScript HES_MenuStrategiesDisabled
 
HudScript HES_MenuPouch
 
HudScript HES_MenuPouchDisabled
 
HudScript HES_MenuDoNothing
 
HudScript HES_MenuDoNothingDisabled
 
HudScript HES_Kooper
 
HudScript HES_Bombette
 
HudScript HES_Partner0
 
HudScript HES_Partner0Disabled
 
HudScript HES_Goombario
 
HudScript HES_GoombarioDisabled
 
HudScript HES_KooperDisabled
 
HudScript HES_BombetteDisabled
 
HudScript HES_Parakarry
 
HudScript HES_ParakarryDisabled
 
HudScript HES_Bow
 
HudScript HES_BowDisabled
 
HudScript HES_Watt
 
HudScript HES_WattDisabled
 
HudScript HES_Sushie
 
HudScript HES_SushieDisabled
 
HudScript HES_Lakilester
 
HudScript HES_LakilesterDisabled
 
HudScript HES_PartnerA
 
HudScript HES_PartnerADisabled
 
HudScript HES_MenuBoots1
 
HudScript HES_MenuBoots1Disabled
 
HudScript HES_MenuBoots2
 
HudScript HES_MenuBoots2Disabled
 
HudScript HES_MenuBoots3
 
HudScript HES_MenuBoots3Disabled
 
HudScript HES_MenuHammer1
 
HudScript HES_MenuHammer1Disabled
 
HudScript HES_MenuHammer2
 
HudScript HES_MenuHammer2Disabled
 
HudScript HES_MenuHammer3
 
HudScript HES_MenuHammer3Disabled
 
HudScript HES_MenuItem
 
HudScript HES_MenuItemDisabled
 
HudScript HES_MenuStarPower
 
HudScript HES_MenuStarPowerDisabled
 
HudScript HES_Eldstar
 
HudScript HES_EldstarDisabled
 
HudScript HES_Mamar
 
HudScript HES_MamarDisabled
 
HudScript HES_Skolar
 
HudScript HES_SkolarDisabled
 
HudScript HES_Muskular
 
HudScript HES_MuskularDisabled
 
HudScript HES_Misstar
 
HudScript HES_MisstarDisabled
 
HudScript HES_Klevar
 
HudScript HES_KlevarDisabled
 
HudScript HES_Kalmar
 
HudScript HES_KalmarDisabled
 
HudScript HES_StarBeam
 
HudScript HES_StarBeamDisabled
 
HudScript HES_PeachBeam
 
HudScript HES_PeachBeamDisabled
 
HudScript HES_MoveDiamond
 
HudScript HES_MoveDiamond_disabled
 
HudScript HES_MoveBlueOrb
 
HudScript HES_MoveBlueOrbDisabled
 
HudScript HES_MoveGreenOrb
 
HudScript HES_MoveGreenOrbDisabled
 
HudScript HES_MoveRedOrb
 
HudScript HES_MoveRedOrbDisabled
 
HudScript HES_GreenArrowDown
 
HudScript HES_GreenArrowUp
 
HudScript HES_HandPointer
 
HudScript HES_HandPointDownLoop
 
HudScript HES_HandPointLeftLoop
 
HudScript HES_FPCost
 
HudScript HES_FPCostReduced
 
HudScript HES_FPCostReducedTwice
 
HudScript HES_POWCost
 
HudScript HES_POWCostReduced
 
HudScript HES_POWCostReducedTwice
 
HudScript HES_StatusFlower
 
HudScript HES_NotEnoughFP
 
HudScript HES_NotEnoughPOW
 
HudScript HES_ProjectorBeam
 
HudScript HES_ProjectorReel
 
HudScript HES_ProjectorSpot
 
HudScript HES_SwapArrowLeft
 
HudScript HES_SwapArrowRight
 
HudScript HES_SwapBackground
 
HudScript HES_SwapZ
 
IconHudScriptPair gItemHudScripts []
 
s16 D_802AB340 [] = { 28, 40 }
 
s16 D_802AB344 [] = { 0, -2 }
 
IconHudScriptPair battle_menu_JumpHudScripts []
 
IconHudScriptPair battle_menu_HammerHudScripts []
 
IconHudScriptPair battle_menu_ItemHudScripts = { &HES_MenuItem, &HES_MenuItemDisabled }
 
IconHudScriptPair battle_menu_StarPowerHudScripts = { &HES_MenuStarPower, &HES_MenuStarPowerDisabled }
 
HudScriptbattle_menu_StarPowerMovesHudScripts []
 
HudScriptbattle_menu_PartnerHudScripts []
 
HudScriptbattle_menu_DisabledPartnerHudScripts []
 
IconHudScriptPair battle_menu_StrategiesHudScript = { &HES_MenuStrategies, &HES_MenuStrategiesDisabled }
 
IconHudScriptPair battle_menu_DoNothingHudScripts = { &HES_MenuDoNothing, &HES_MenuDoNothingDisabled }
 
IconHudScriptPair battle_menu_FleeHudScripts = { &HES_MenuFlee, &HES_MenuFleeDisabled }
 
s32 BattleMenu_LeftJustMessages []
 
s32 BattleMenu_CenteredMessages []
 
s32 BattleMenu_CategoryForSubmenu []
 
AnimID BattleMenu_PartnerThinkAnims []
 
AnimID BattleMenu_PartnerIdleAnims []
 
HudScriptbattle_menu_PartnerMoveHudScripts [10][10]
 
IconHudScriptPair battle_menu_PeachStarPowerHudScripts = { &HES_MenuStarPower, &HES_MenuStarPowerDisabled }
 
s32 D_802AB728 []
 
IconHudScriptPair battle_menu_TwinkStarPowerHudScripts = { &HES_MenuStarPower, &HES_MenuStarPowerDisabled }
 
s32 D_802AB734 []
 
s32 PartnerNameMessages []
 
BSS s32 D_802ACC60
 
BSS s32 BattleMenu_TargetPointerAlpha
 
BSS s32 BattleMenu_TargetNameOffsetX
 
BSS s32 BattleMenu_SwapDelay
 
BSS s32 BattleMenu_TargetHudElems [MAX_ENEMY_ACTORS]
 
BSS PopupMenu D_802ACCD0
 
BSS s8 BattleMenuState
 
BSS s8 D_802AD001
 
BSS s8 BattleMenu_CurPos
 
BSS s8 BattleMenu_PrevPos
 
BSS s8 D_802AD004
 
BSS s16 D_802AD006
 
BSS s16 BattleMenuAlpha
 
BSS s16 D_802AD00A
 
BSS s16 D_802AD00C
 
BSS s32 D_802AD010 [6]
 
BSS s32 D_802AD028 [6]
 
BSS s32 D_802AD040
 
BSS s32 D_802AD044
 
BSS s32 D_802AD048
 
BSS s32 D_802AD04C
 
BSS s32 D_802AD050
 
BSS s32 D_802AD054
 
BSS s32 D_802AD058
 
BSS s32 D_802AD05C
 
BSS s32 BattleMenu_BasePosX
 
BSS s32 BattleMenu_BasePosY
 
BSS s8 BattleMenuDisableMsg
 
BSS s8 BattleMenu_MinIdx
 
BSS s8 BattleMenu_MaxIdx
 
BSS s8 BattleMenu_HomePos
 
BSS f32 BattleMenu_WheelAngle
 
BSS f32 D_802AD070
 
BSS s32 D_802AD074
 
BSS HudScriptBattleMenu_HudScripts [6]
 
BSS s32 BattleMenu_TitleMessages [6]
 
BSS s32 D_802AD0A8
 
BSS s32 BattleMenu_NumOptions
 
BSS s32 D_802AD0B0
 
BSS s32 D_802AD0B4
 
BSS s32 battle_menu_submenuIDs [6]
 
BSS s32 BattleMenu_OptionEnabled [6]
 
BSS s32 battle_menu_isMessageDisabled [6]
 
BSS s32 D_802AD100
 
BSS s32 BattleMenu_ShowSwapIcons
 
BSS s8 battle_menu_moveState
 
BSS s8 battle_menu_moveCursorPos
 
BSS s8 D_802AD10A
 
BSS s8 D_802AD10B
 
BSS s8 battle_menu_moveScrollLine
 
BSS s8 D_802AD10D
 
BSS s8 D_802AD10E
 
BSS s8 D_802AD10F
 
BSS s16 battle_menu_moveScrollOffset
 
BSS s16 D_802AD112
 
BSS s16 BattleMenu_Moves_TextColor
 
BSS s16 BattleMenu_Moves_TextAlpha
 
BSS HudElemID BattleMenu_Moves_CursorID
 
BSS HudElemID BattleMenu_Moves_UpArrowID
 
BSS HudElemID BattleMenu_Moves_DownArrowID
 
BSS s32 D_802AD124
 
BSS HudElemID BattleMenu_Moves_OptionIDs [24]
 
BSS HudElemID BattleMenu_Moves_TitleID
 
BSS s32 D_802AD18C
 
BSS HudElemID BattleMenu_Moves_OptionCostUnitIDs [24]
 
BSS s16 BattleMenu_Moves_PosX
 
BSS s16 BattleMenu_Moves_PosY
 
BSS s32 D_802AD1F4
 
BSS s32 BattleMenu_Moves_OptionIndexMap [24]
 
BSS s32 D_802AD258
 
BSS s32 D_802AD25C
 
BSS HudScriptbattle_menu_moveOptionIconScripts [24]
 
BSS s32 battle_menu_moveOptionNames [24]
 
BSS s32 battle_menu_moveOptionDisplayCosts [24]
 
BSS s32 battle_menu_moveOptionDisplayCostReductions [24]
 
BSS s32 battle_menu_moveOptionDisplayCostReductionColors [24]
 
BSS s32 battle_menu_moveOptionBPCosts [24]
 
BSS s32 BattleMenu_UsingSpiritsSubmenu
 
BSS s32 BattleMenu_Moves_OptionCount
 
BSS s32 D_802AD4A8
 
BSS s32 D_802AD4AC
 
BSS s32 BattleMenu_Moves_OptionIndices [24]
 
BSS s32 BattleMenu_Moves_OptionEnabled [24]
 
BSS s32 BattleMenu_Moves_OptionDescMessages [24]
 
BSS s8 BattleMenu_Moves_OptionSortPriority [24]
 
BSS s8 BattleMenu_Moves_OptionCantUseMessages [24]
 
BSS s32 battle_menu_moveOptionActive
 
BSS s8 BattleSubmenuStratsState
 
BSS s8 StratsMenuPos
 
BSS s8 OldStratsMenuPos
 
BSS b8 ShowingErrorMessage
 
BSS s8 D_802AD608
 
BSS s8 D_802AD609
 
BSS s8 StratsMenuLines
 
BSS s8 D_802AD60B
 
BSS s16 D_802AD60C
 
BSS s16 D_802AD60E
 
BSS s16 D_802AD610
 
BSS s16 D_802AD612
 
BSS s8 D_802AD614
 
BSS s32 D_802AD618
 
BSS HudElemID GreenArrowUpID
 
BSS HudElemID GreenArrowDownID
 
BSS s32 D_802AD624
 
BSS s32 D_802AD628 [5]
 
BSS s16 D_802AD63C
 
BSS s16 D_802AD63E
 
BSS HudScriptD_802AD640 [6]
 
BSS s32 D_802AD658 [5]
 
BSS s32 D_802AD66C
 
BSS s32 StratsMenuLastPos
 
BSS s32 D_802AD674
 
BSS s32 D_802AD678 [6]
 
BSS s32 D_802AD690 [6]
 
BSS s32 D_802AD6A8 [6]
 
BSS s32 D_802AD6C0 [5]
 
BSS s32 D_802AD6D4
 
s32 MenuIndexFromPartnerID []
 

Macro Definition Documentation

◆ TABMAX

#define TABMAX   6

Definition at line 424 of file btl_states_menus.c.

◆ Y_VAR1

#define Y_VAR1   0

Definition at line 1446 of file btl_states_menus.c.

Referenced by btl_menu_moves_draw_content().

◆ X_VAR1

#define X_VAR1   108

Definition at line 1447 of file btl_states_menus.c.

Referenced by btl_menu_moves_draw_content().

◆ X_VAR2

#define X_VAR2   93

Definition at line 1448 of file btl_states_menus.c.

Referenced by btl_menu_moves_draw_content().

◆ Y_VAR2

#define Y_VAR2   0

Definition at line 2014 of file btl_states_menus.c.

Referenced by btl_menu_strats_draw_content().

Function Documentation

◆ create_battle_popup_menu()

void create_battle_popup_menu ( PopupMenu * popup)

Definition at line 2324 of file 8a860_len_3f30.c.

2324 {
2325 gPopupMenu = popup;
2326
2328 D_8010D693 = popup->titleNumber;
2330 PopupDipMode = 0;
2331 PopupNotDipping = TRUE;
2334 PopupDipMode = 1;
2337 PopupDipMode = 2;
2338 }
2339 PopupNotDipping = FALSE;
2340 }
2341
2342 PopupNotBattle = FALSE;
2348 }
2352
2355 }
2356
2360 }
2361
2362 PopupMenu_Alpha = 255;
2363 D_8010D691 = 9;
2364 D_8010D692 = 2;
2365 gPopupWorker = create_worker_frontUI((void (*) (void)) popup_menu_update, NULL);
2366}
BSS s32 PopupMenu_PrevSelectedIndex
BSS s8 D_8010D692
BSS s8 PopupNotBattle
BSS s32 PopupMenu_Alpha
BSS s8 PopupMenu_FirstDisplayIndex
BSS s8 PopupMenu_DisplayedEntryCount
s32 popup_menu_update(void)
BSS s8 PopupDipMode
BSS s8 PopupNotDipping
BSS s32 gPopupWorker
BSS s8 PopupMenu_LastDisplayIndex
s8 status_bar_is_ignoring_changes(void)
Definition inventory.c:1512
BSS s8 D_8010D691
BSS s32 gPopupState
BSS s32 PopupMenu_SelectedIndex
BSS s8 PopupMenu_WasStatusBarIgnoringChanges
BSS PopupMenu * gPopupMenu
BSS s8 PopupMenu_MaxDisplayableEntryCount
BSS s8 D_8010D693
@ POPUP_MENU_DOUBLE_DIP
Definition enums.h:3145
@ POPUP_RESULT_CHOOSING
Definition enums.h:3177
@ POPUP_STATE_INIT
Definition enums.h:3150
s32 create_worker_frontUI(void(*updateFunc)(void), void(*drawFunc)(void))
Definition worker.c:63
s32 titleNumber

Referenced by btl_state_update_partner_menu(), and btl_state_update_player_menu().

◆ get_player_anim_for_status()

s32 get_player_anim_for_status ( s32 animID)

Definition at line 1965 of file 190B20.c.

1965 {
1966 BattleStatus* battleStatus = &gBattleStatus;
1967 PlayerData* playerData = &gPlayerData;
1968 Actor* player = battleStatus->playerActor;
1969 u32* anim = &player->partsTable->idleAnimations[0];
1970 s32 ret;
1971
1972 if (anim == NULL) {
1973 return 0;
1974 }
1975 ret = 0;
1976
1977 if (!(battleStatus->flags2 & BS_FLAGS2_PEACH_BATTLE)) {
1978 // switch to danger override animations
1979 if (playerData->curHP <= DANGER_THRESHOLD) {
1980 if (statusKey == STATUS_KEY_NORMAL) {
1981 statusKey = STATUS_KEY_DANGER;
1982 }
1983 if (statusKey == STATUS_KEY_INACTIVE) {
1984 statusKey = STATUS_KEY_INACTIVE_WEARY;
1985 }
1986 if (statusKey == STATUS_KEY_THINKING) {
1987 statusKey = STATUS_KEY_WEARY;
1988 }
1989 }
1990
1991 // switch to poisoned override animations
1992 if (player->debuff == STATUS_KEY_POISON) {
1993 if (statusKey == STATUS_KEY_NORMAL) {
1994 statusKey = STATUS_KEY_DANGER;
1995 }
1996 if (statusKey == STATUS_KEY_INACTIVE) {
1997 statusKey = STATUS_KEY_INACTIVE_WEARY;
1998 }
1999 if (statusKey == STATUS_KEY_THINKING) {
2000 statusKey = STATUS_KEY_WEARY;
2001 }
2002 }
2003
2004 // switch to dizzy override animations
2005 if (player->debuff == STATUS_KEY_DIZZY) {
2006 if (statusKey == STATUS_KEY_INACTIVE) {
2007 statusKey = STATUS_KEY_INACTIVE_DIZZY;
2008 }
2009 }
2010 }
2011
2012 // search IdleAnimations to get animID for key
2013 while (*anim != NULL) {
2014 if (*anim == 1) {
2015 ret = anim[1];
2016 }
2017 if (*anim == statusKey) {
2018 ret = anim[1];
2019 break;
2020 }
2021 anim += 2;
2022 }
2023
2024 return ret;
2025}
u32 * idleAnimations
struct ActorPart * partsTable
@ BS_FLAGS2_PEACH_BATTLE
Definition enums.h:3610
@ STATUS_KEY_INACTIVE_DIZZY
Definition enums.h:2220
@ STATUS_KEY_THINKING
Definition enums.h:2224
@ STATUS_KEY_WEARY
Definition enums.h:2225
@ STATUS_KEY_INACTIVE_WEARY
Definition enums.h:2218
@ STATUS_KEY_DANGER
Definition enums.h:2222
@ STATUS_KEY_INACTIVE
Definition enums.h:2214
@ STATUS_KEY_DIZZY
Definition enums.h:2200
@ STATUS_KEY_POISON
Definition enums.h:2205
@ STATUS_KEY_NORMAL
Definition enums.h:2197
#define DANGER_THRESHOLD
Definition battle.h:266
struct Actor * playerActor
PlayerData gPlayerData
Definition 77480.c:40
BattleStatus gBattleStatus
Definition battle.c:11

Referenced by btl_state_update_player_menu().

◆ btl_menu_moves_draw_content()

void btl_menu_moves_draw_content ( void * data,
s32 x,
s32 y )

Definition at line 1451 of file btl_states_menus.c.

1451 {
1452 s32 var_t0;
1453 s32 temp_f6;
1454 s32 xPos, yPos;
1455 s32 yRenderPos;
1456 s32 palette;
1457 s32 num;
1458 s32 v0;
1459 s32 a0;
1460 s32 idx;
1461 s32 id;
1462 s32 i;
1463
1464 switch (battle_menu_moveState) {
1465 case -1:
1466 case 1:
1467 case 10:
1468 case 20:
1469 case 30:
1470 case 40:
1471 case 41:
1472 yPos = -battle_menu_moveScrollLine * 13;
1474 temp_f6 = (yPos - var_t0) * 0.5;
1475 if (temp_f6 == 0) {
1476 var_t0 = yPos;
1477 } else {
1478 var_t0 += temp_f6;
1479 }
1481
1482 xPos = x + 2;
1483 yPos = y + 18;
1484 var_t0 = yPos + 1 + (D_802AD10E * 13);
1485 gDPSetScissor(
1486 gMainGfxPos++, G_SC_NON_INTERLACE,
1487 xPos,
1488 yPos,
1489 x + 153,
1490 var_t0
1491 );
1492
1493 xPos = x + 31;
1494 yPos = y + 19 + battle_menu_moveScrollOffset;
1495
1496 idx = 0;
1497 for (i = 0; i < BattleMenu_Moves_OptionCount; i++, idx++) {
1500
1502 palette = MSG_PAL_0B;
1503 }
1504
1506 draw_msg(
1508 xPos, yPos - Y_VAR1, BattleMenu_Moves_TextAlpha, palette, 1
1509 );
1510 }
1511
1515 } else {
1518 }
1519 num = v0 - a0;
1520
1521 if (v0 != 0 && num <= 0) {
1522 num = 1;
1523 }
1524
1526 if (i == battle_menu_moveCursorPos) {
1529 } else {
1531 }
1532 }
1533 } else {
1534 if (i == battle_menu_moveCursorPos) {
1537 } else {
1541 );
1542 }
1543 }
1544 }
1545
1547 case 0:
1548 palette = MSG_PAL_STANDARD;
1549 break;
1550 case 1:
1551 palette = MSG_PAL_37;
1552 break;
1553 default:
1554 palette = MSG_PAL_38;
1555 break;
1556 }
1557
1559 palette = MSG_PAL_0B;
1560 }
1561
1564
1567 num, xPos + X_VAR1, yPos, DRAW_NUMBER_CHARSET_THIN, palette, BattleMenu_Moves_TextAlpha,
1569 );
1572 }
1573 yRenderPos = yPos + 7;
1574 hud_element_set_render_pos(id, xPos + 116, yRenderPos);
1575 } else {
1577 num, xPos + X_VAR2, yPos, DRAW_NUMBER_CHARSET_THIN, palette, BattleMenu_Moves_TextAlpha,
1579 );
1582 }
1583 yRenderPos = yPos + 7;
1584 hud_element_set_render_pos(id, xPos + 102, yRenderPos);
1585 }
1588 }
1589 }
1590 yPos += 13;
1591 }
1592
1593 xPos = x + 24;
1594 yPos = battle_menu_moveScrollOffset + y + 24;
1595
1596 idx = 0;
1597 for (i = 0; i < BattleMenu_Moves_OptionCount; i++, idx++) {
1598 if (i < battle_menu_moveScrollLine - 1) {
1599 yPos += 13;
1600 } else if (battle_menu_moveScrollLine + D_802AD10E < i) {
1601 yPos += 13;
1602 } else {
1604 hud_element_set_render_pos(id, xPos, yPos);
1607 yPos += 13;
1608 }
1609 }
1610
1612 var_t0 = D_802AD112;
1613 temp_f6 = (yPos - D_802AD112) * 1.0;
1614 xPos = x + 10;
1615 if (temp_f6 == 0) {
1616 var_t0 = yPos;
1617 } else {
1618 var_t0 += temp_f6;
1619 }
1620 D_802AD112 = var_t0;
1621 yPos = y + 26 + D_802AD112;
1622
1624 hud_element_set_render_pos(id, xPos, yPos);
1627
1630 hud_element_set_render_pos(id, x + 72, y + 15);
1633 }
1634
1637 hud_element_set_render_pos(id, x + 72, y + 100);
1640 }
1641
1642 if (battle_menu_moveState == -1) {
1645 } else {
1647 }
1648 }
1649 break;
1650 }
1651}
BSS s32 battle_menu_moveOptionDisplayCostReductionColors[24]
BSS s8 battle_menu_moveCursorPos
BSS s32 battle_menu_moveOptionNames[24]
BSS s8 D_802AD10D
BSS HudElemID BattleMenu_Moves_UpArrowID
BSS s32 BattleMenu_Moves_OptionCount
#define Y_VAR1
HudScript HES_NotEnoughFP
BSS HudElemID BattleMenu_Moves_CursorID
#define X_VAR2
BSS s32 BattleMenu_UsingSpiritsSubmenu
BSS s32 BattleMenu_Moves_OptionEnabled[24]
BSS s16 BattleMenu_Moves_TextAlpha
BSS s16 battle_menu_moveScrollOffset
BSS s16 BattleMenu_Moves_TextColor
BSS s16 D_802AD112
HudScript HES_NotEnoughPOW
#define X_VAR1
BSS s8 D_802AD10E
BSS s32 BattleMenu_Moves_OptionIndexMap[24]
BSS HudElemID BattleMenu_Moves_DownArrowID
BSS HudElemID BattleMenu_Moves_OptionCostUnitIDs[24]
BSS HudElemID BattleMenu_Moves_OptionIDs[24]
BSS s8 battle_menu_moveScrollLine
BSS s32 battle_menu_moveOptionDisplayCosts[24]
BSS s8 battle_menu_moveState
BSS s32 battle_menu_moveOptionDisplayCostReductions[24]
#define draw_msg
@ DRAW_NUMBER_STYLE_ALIGN_RIGHT
drawn to the left of posX
Definition enums.h:5393
@ DRAW_NUMBER_STYLE_MONOSPACE
Definition enums.h:5394
@ MSG_PAL_38
Definition enums.h:5461
@ MSG_PAL_37
Definition enums.h:5460
@ MSG_PAL_STANDARD
Definition enums.h:5415
@ MSG_PAL_0B
Definition enums.h:5416
@ DRAW_NUMBER_CHARSET_THIN
Definition enums.h:5401
void status_bar_start_blinking_fp(void)
Definition inventory.c:1553
void status_bar_stop_blinking_sp(void)
Definition inventory.c:1609
void status_bar_stop_blinking_fp(void)
Definition inventory.c:1566
void draw_number(s32 value, s32 x, s32 y, s32 variableWidthChars, s32 palette, s32 opacity, u16 style)
Definition msg.c:2223
void status_bar_start_blinking_sp_bars(s32 numBarsToBlink)
Definition inventory.c:1618
void hud_element_set_alpha(s32 id, s32 opacity)
void hud_element_draw_without_clipping(s32 id)
void hud_element_set_script(s32 id, HudScript *anim)
void hud_element_set_render_pos(s32 id, s32 x, s32 y)
void hud_element_draw_clipped(s32 id)
Gfx * gMainGfxPos
Definition cam_main.c:15

Referenced by btl_submenu_moves_update().

◆ btl_menu_moves_show_title()

void btl_menu_moves_show_title ( void * data,
s32 x,
s32 y )

Definition at line 1653 of file btl_states_menus.c.

1653 {
1654 s32 msgID;
1655 s32 posX;
1656 s32 posY;
1657 s32 opacity;
1658 s32 palette;
1659
1661 msgID = MSG_Menus_Abilities;
1662 posX = x + 16;
1663 posY = y + 2;
1665 palette = MSG_PAL_30;
1666 } else {
1667 msgID = MSG_Menus_StarSpirits;
1668 posX = x + 6;
1669 posY = y + 2;
1671 palette = MSG_PAL_31;
1672 }
1673 draw_msg(msgID, posX, posY, opacity, palette, DRAW_MSG_STYLE_MENU);
1674}
@ DRAW_MSG_STYLE_MENU
Definition enums.h:5385
@ MSG_PAL_30
Definition enums.h:5453
@ MSG_PAL_31
Definition enums.h:5454

Referenced by btl_submenu_moves_update().

◆ btl_menu_moves_show_icon()

void btl_menu_moves_show_icon ( void * data,
s32 x,
s32 y )

Definition at line 1676 of file btl_states_menus.c.

1676 {
1677 s32 icon = BattleMenu_Moves_TitleID;
1678
1679 hud_element_set_render_pos(icon, x + 16, y + 15);
1682}
BSS HudElemID BattleMenu_Moves_TitleID

Referenced by btl_submenu_moves_update().

◆ btl_menu_moves_show_desc()

void btl_menu_moves_show_desc ( void * data,
s32 x,
s32 y )

Definition at line 1684 of file btl_states_menus.c.

1684 {
1685 switch (battle_menu_moveState) {
1691 if (D_802AD10F != 0) {
1694 }
1695 break;
1696 }
1697}
BSS s8 D_802AD10F
BSS s32 BattleMenu_Moves_OptionDescMessages[24]
@ BTL_SUBMENU_MOVES_STATE_UNK_NEGATIVE_ONE
Definition enums.h:4184
@ BTL_SUBMENU_MOVES_STATE_UNK_14
Definition enums.h:4189
@ BTL_SUBMENU_MOVES_STATE_UNK_1
Definition enums.h:4186
@ BTL_SUBMENU_MOVES_STATE_UNK_1E
Definition enums.h:4190
@ BTL_SUBMENU_MOVES_STATE_UNK_A
Definition enums.h:4187

Referenced by btl_submenu_moves_update().

◆ btl_menu_moves_show_error()

void btl_menu_moves_show_error ( void * data,
s32 x,
s32 y )

Definition at line 1699 of file btl_states_menus.c.

1699 {
1700 s32 posY = y;
1701 s32 posX;
1702 s32 msgID;
1703
1704 posY += 6;
1705 posX = x + 11;
1706
1707 if (D_802AD258 != 0) {
1708 msgID = MSG_Menus_Battle_CantSelectNow;
1709 } else if (!BattleMenu_UsingSpiritsSubmenu) {
1710 msgID = MSG_Menus_NotEnoughFP;
1711 } else {
1712 msgID = MSG_Menus_NotEnoughStarPower;
1713 }
1714 draw_msg(msgID, posX, posY + D_802AB344[get_msg_lines(msgID) - 1], 255, MSG_PAL_0F, 0);
1715}
BSS s32 D_802AD258
s16 D_802AB344[]
@ MSG_PAL_0F
Definition enums.h:5420
s32 get_msg_lines(s32 messageID)
Definition msg.c:1979

Referenced by btl_submenu_moves_update().

◆ btl_menu_strats_draw_content()

void btl_menu_strats_draw_content ( void * data,
s32 x,
s32 y )

Definition at line 2017 of file btl_states_menus.c.

2017 {
2018 s32 var_t0;
2019 s32 temp_f6;
2020 s32 xPos, yPos;
2021 s32 idx;
2022 s32 id;
2023 s32 i;
2024
2025 switch (BattleSubmenuStratsState) {
2033 yPos = -D_802AD608 * 13;
2034 var_t0 = D_802AD60C;
2035 temp_f6 = (yPos - var_t0) * 0.5;
2036 if (temp_f6 != 0) {
2037 var_t0 += temp_f6;
2038 } else {
2039 var_t0 = yPos;
2040 }
2041 D_802AD60C = var_t0;
2042
2043 xPos = x + 4;
2044 yPos = y + 18;
2045 var_t0 = yPos + 1 + (StratsMenuLines * 13);
2046 gDPSetScissor(gMainGfxPos++, G_SC_NON_INTERLACE, xPos, yPos, x + 142, var_t0);
2047
2048 xPos = x + 33;
2049 yPos = y + 19 + D_802AD60C;
2050
2051 idx = 0;
2052 for (i = 0; i < D_802AD66C; i++, idx++) {
2053 s32 palette = D_802AD614;
2054
2056 palette = MSG_PAL_37;
2057 }
2058 if (D_802AD690[idx] == 0) {
2059 palette = MSG_PAL_0B;
2060 }
2061 draw_msg(D_802AD658[idx], xPos, yPos - Y_VAR2, D_802AD624, palette, DRAW_MSG_STYLE_MENU);
2062 yPos += 13;
2063 }
2064
2065 xPos = x + 24;
2066 yPos = D_802AD60C + y + 24;
2067
2068 idx = 0;
2069 for (i = 0; i < D_802AD66C; i++, idx++) {
2070 id = D_802AD628[idx];
2071 hud_element_set_render_pos(id, xPos, yPos);
2074 yPos += 13;
2075 }
2076
2077 yPos = (StratsMenuPos - D_802AD608) * 13;
2078 var_t0 = D_802AD60E;
2079 temp_f6 = (yPos - var_t0) * 1.0;
2080 xPos = x + 10;
2081 if (temp_f6 != 0) {
2082 var_t0 += temp_f6;
2083 } else {
2084 var_t0 = yPos;
2085 }
2086 D_802AD60E = var_t0;
2087 yPos = y + 26 + D_802AD60E;
2088
2089 id = D_802AD618;
2090 hud_element_set_render_pos(id, xPos, yPos);
2093
2094 if (D_802AD608 > 0) {
2095 id = GreenArrowUpID;
2096 hud_element_set_render_pos(id, x + 67, y + 16);
2099 }
2100 if (D_802AD609 < D_802AD66C) {
2101 id = GreenArrowDownID;
2102 hud_element_set_render_pos(id, x + 67, y + 100);
2105 }
2106 break;
2107 }
2108}
BSS s8 D_802AD614
BSS s8 StratsMenuLines
BSS HudElemID GreenArrowDownID
BSS s32 D_802AD678[6]
BSS s8 D_802AD609
#define Y_VAR2
BSS s16 D_802AD60C
BSS s32 D_802AD690[6]
BSS s32 D_802AD66C
BSS s8 StratsMenuPos
BSS s32 D_802AD658[5]
BSS s8 D_802AD608
BSS s8 BattleSubmenuStratsState
BSS s16 D_802AD60E
BSS HudElemID GreenArrowUpID
BSS s32 D_802AD618
BSS s32 D_802AD624
BSS s32 D_802AD628[5]
@ BTL_SUBMENU_STRATS_STATE_ERROR_INIT
Definition enums.h:4206
@ BTL_SUBMENU_STRATS_STATE_UNK_20
Definition enums.h:4204
@ BTL_SUBMENU_STRATS_STATE_SELECT
Definition enums.h:4199
@ BTL_SUBMENU_STRATS_STATE_UNK_30
Definition enums.h:4205
@ BTL_SUBMENU_STRATS_STATE_ERROR_SHOW
Definition enums.h:4207
@ BTL_SUBMENU_STRATS_STATE_UNK_10
Definition enums.h:4202
@ BTL_SUBMENU_STRATS_STATE_CHOOSE
Definition enums.h:4201
@ ABILITY_QUICK_CHANGE
Definition enums.h:462
s32 is_ability_active(s32 arg0)
Definition inventory.c:1725

Referenced by btl_update_strats_menu().

◆ btl_menu_strats_show_title()

void btl_menu_strats_show_title ( void * data,
s32 x,
s32 y )

Definition at line 2110 of file btl_states_menus.c.

2110 {
2111 draw_msg(MSG_Menus_Strategies, x + 15, y + 2, D_802AD624, MSG_PAL_33, DRAW_MSG_STYLE_MENU);
2112}
@ MSG_PAL_33
Definition enums.h:5456

Referenced by btl_update_strats_menu().

◆ btl_menu_strats_show_desc()

void btl_menu_strats_show_desc ( void * data,
s32 x,
s32 y )

Definition at line 2114 of file btl_states_menus.c.

2114 {
2115 switch (BattleSubmenuStratsState) {
2121 if (D_802AD60B != 0) {
2123 }
2124 break;
2125 }
2126}
BSS s8 D_802AD60B
BSS s32 D_802AD6C0[5]

Referenced by btl_update_strats_menu().

◆ btl_menu_strats_show_error()

void btl_menu_strats_show_error ( void * data,
s32 x,
s32 y )

Definition at line 2128 of file btl_states_menus.c.

2128 {
2129 s32 msgID;
2130 x += 11;
2131 y += 6;
2132
2133 switch (D_802AD610) {
2134 case 0:
2135 msgID = MSG_Menus_Battle_CantSwitch2;
2136 break;
2137 case 1:
2138 msgID = MSG_Menus_Battle_CantRunAway;
2139 break;
2140 default:
2141 msgID = MSG_Menus_Battle_CantRunAway;
2142 break;
2143 }
2144 draw_msg(msgID, x, y, 255, MSG_PAL_0F, 0);
2145}
BSS s16 D_802AD610

Referenced by btl_update_strats_menu().

◆ btl_init_menu_items()

void btl_init_menu_items ( void )

Definition at line 601 of file 190B20.c.

601 {
602 BattleStatus* battleStatus = &gBattleStatus;
603 Actor* player = battleStatus->playerActor;
604 PlayerData* playerData = &gPlayerData;
605 s32 hasValidItem;
606 s32 i;
607
608 battleStatus->menuStatus[0] = 0;
609 hasValidItem = FALSE;
610
611 for (i = 0; i < ARRAY_COUNT(playerData->invItems); i++) {
612 s16 itemID = playerData->invItems[i];
613
614 if (itemID != ITEM_NONE) {
615 ItemData* itemData = &gItemTable[itemID];
616
617 if (itemData->typeFlags & ITEM_TYPE_FLAG_BATTLE_USABLE) {
618 battleStatus->moveCategory = BTL_MENU_TYPE_ITEMS;
619 battleStatus->moveArgument = playerData->invItems[i];
620 battleStatus->curTargetListFlags = itemData->targetFlags;
622
623 if (player->targetListLength != 0) {
624 battleStatus->menuStatus[0]++;
625 hasValidItem = TRUE;
626 }
627 }
628 }
629 }
630
631 if (!hasValidItem) {
632 battleStatus->menuStatus[0] = 0;
633 }
634}
void create_current_pos_target_list(Actor *actor)
Definition 190B20.c:472
s8 targetListLength
s16 invItems[10]
@ BTL_MENU_TYPE_ITEMS
Definition enums.h:4229
@ ITEM_TYPE_FLAG_BATTLE_USABLE
Definition enums.h:1835
#define ARRAY_COUNT(arr)
Definition macros.h:40
s8 moveCategory
0 = jump, 1 = hammer, 5 = partner, ...
s8 menuStatus[4]
-1 = automatically pick the first move, 0 = disabled, 1 = enabled
ItemData gItemTable[]

Referenced by btl_state_update_partner_menu(), and btl_state_update_player_menu().

◆ btl_check_can_change_partner()

void btl_check_can_change_partner ( void )

Definition at line 566 of file 190B20.c.

566 {
567 BattleStatus* battleStatus = &gBattleStatus;
568 PlayerData* playerData = &gPlayerData;
569 Actor* partner = battleStatus->partnerActor;
570
571 battleStatus->changePartnerAllowed = 0;
572 if (partner != NULL) {
573 s32 partnersEnabled;
574 s32 i;
575
576 battleStatus->changePartnerAllowed = 1;
577 partnersEnabled = 0;
578
579 for (i = 0; i < ARRAY_COUNT(playerData->partners); i++) {
580 if (playerData->partners[i].enabled) {
581 partnersEnabled++;
582 }
583 }
584
585 if (partnersEnabled >= 2) {
586 if (partner->koStatus == STATUS_KEY_DAZE) {
587 battleStatus->changePartnerAllowed = 0;
588 } else if (partner->debuff == STATUS_KEY_FROZEN) {
589 battleStatus->changePartnerAllowed = 0;
590 } else if (playerData->curPartner == PARTNER_GOOMPA) {
591 battleStatus->changePartnerAllowed = -1;
592 }
593 } else {
594 battleStatus->changePartnerAllowed = -1;
595 }
596 } else {
597 battleStatus->changePartnerAllowed = -1;
598 }
599}
PartnerData partners[12]
@ STATUS_KEY_FROZEN
Definition enums.h:2203
@ STATUS_KEY_DAZE
Definition enums.h:2209
@ PARTNER_GOOMPA
Definition enums.h:2890
struct Actor * partnerActor

Referenced by btl_state_update_partner_menu(), and btl_state_update_player_menu().

◆ btl_init_menu_partner()

void btl_init_menu_partner ( void )

Definition at line 857 of file 190B20.c.

857 {
858 PlayerData* playerData = &gPlayerData;
859 BattleStatus* battleStatus = &gBattleStatus;
860 Actor* player = battleStatus->playerActor;
861 Actor* partner = battleStatus->partnerActor;
862 s32 fpCost;
863 s32 i;
864 s32 hasAnyBadgeMoves;
865
866 for (i = 0; i < ARRAY_COUNT(battleStatus->submenuMoves); i++) {
867 battleStatus->submenuMoves[i] = 0;
868 }
869
870 // In the move table (enum MoveIDs), partners get move IDs set up like this:
871 //
872 // Move ID offset | Description | Goombario example
873 // ----------------+----------------------+-------------------
874 // 0 | No rank only | Headbonk
875 // 1 | Super rank only | Headbonk (2)
876 // 2 | Ultra rank only | Headbonk (3)
877 // 3 | Always unlocked | Tattle
878 // 4 | Unlocked after super | Charge
879 // 5 | Unlocked after ultra | Multibonk
880
881 battleStatus->submenuMoveCount = partner->actorBlueprint->level + 2;
882
883 // Offsets 0,1,2
884 battleStatus->submenuMoves[0] =
885 playerData->curPartner * 6
886 + (MOVE_HEADBONK1 - 6)
887 + partner->actorBlueprint->level;
888
889 // Offsets 3,4,5
890 for (i = 1; i < battleStatus->submenuMoveCount; i++) {
891 battleStatus->submenuMoves[i] =
892 playerData->curPartner * 6
893 + (MOVE_TATTLE - 6)
894 + (i - 1);
895 }
896
897 hasAnyBadgeMoves = FALSE;
898 for (i = 0; i < battleStatus->submenuMoveCount; i++){
899 MoveData* move = &gMoveTable[battleStatus->submenuMoves[i]];
900
901 fpCost = move->costFP;
902 if (fpCost != 0) {
905 if (fpCost < 1) {
906 fpCost = 1;
907 }
908 }
909
911 battleStatus->moveArgument = partner->actorBlueprint->level;
912 battleStatus->curTargetListFlags = move->flags;
914
915 if (partner->targetListLength != 0){
916 hasAnyBadgeMoves = TRUE;
918 }
919
920 if (partner->targetListLength == 0) {
922 }
923
924 if (playerData->curFP < fpCost) {
926 }
929 }
930 }
931
932 if (!hasAnyBadgeMoves) {
933 battleStatus->menuStatus[3] = -1;
934 } else {
935 battleStatus->menuStatus[3] = 1;
936 }
937}
s32 player_team_is_ability_active(Actor *actor, s32 ability)
Definition 190B20.c:2765
struct ActorBlueprint * actorBlueprint
@ BTL_MENU_TYPE_CHANGE_PARTNER
Definition enums.h:4232
@ BS_FLAGS2_NO_TARGET_AVAILABLE
Definition enums.h:3614
@ BATTLE_SUBMENU_STATUS_ENABLED
Definition enums.h:5227
@ BATTLE_SUBMENU_STATUS_NO_TARGETS
Definition enums.h:5229
@ BATTLE_SUBMENU_STATUS_NOT_ENOUGH_FP
Definition enums.h:5228
@ BATTLE_SUBMENU_STATUS_NO_TARGETS_2
Definition enums.h:5230
@ ABILITY_FLOWER_SAVER
Definition enums.h:460
@ ABILITY_FLOWER_FANATIC
Definition enums.h:474
MoveData gMoveTable[]

Referenced by btl_state_update_partner_menu().

◆ func_800F52BC()

void func_800F52BC ( void )

Definition at line 2368 of file 8a860_len_3f30.c.

2368 {
2370}

Referenced by btl_state_update_partner_menu(), and btl_state_update_player_menu().

◆ func_800F16CC()

void func_800F16CC ( void )

Definition at line 254 of file 8a860_len_3f30.c.

254 {
255 if (PopupNotBattle) {
256 switch (gPopupMenu->popupType) {
269 break;
275 break;
281 break;
282 }
284 } else {
285 switch (gPopupMenu->popupType) {
297 break;
302 break;
307 break;
308 }
309 }
310
314 }
317 }
320 }
326
330 }
334 }
337 }
340 }
344}
BSS s8 D_8010D690
BSS s32 PopupMenu_TimesHEID
BSS s32 PopupMenu_PartnerLevelHEID
BSS s32 PopupMenu_UpArrowHEID
BSS s32 PopupMenu_CursorHEID
BSS s32 PopupMenu_EntryIconHEID
BSS s32 PopupMenu_TitleIconHEID
BSS s32 PopupMenu_DownArrowHEID
BSS s32 PopupMenu_EmptybarHEID
@ POPUP_MENU_TRADE_FOR_BADGE
Definition enums.h:3134
@ POPUP_MENU_READ_DIARY_PAGE
Definition enums.h:3141
@ POPUP_MENU_SELL_ITEM
Definition enums.h:3136
@ POPUP_MENU_CHECK_ITEM
Definition enums.h:3137
@ POPUP_MENU_POST_OFFICE
Definition enums.h:3144
@ POPUP_MENU_USE_ITEM
Definition enums.h:3131
@ POPUP_MENU_TAKE_FROM_CHEST
Definition enums.h:3140
@ POPUP_MENU_USEKEY
Definition enums.h:3143
@ POPUP_MENU_CLAIM_ITEM
Definition enums.h:3138
@ POPUP_MENU_READ_LETTER
Definition enums.h:3139
@ POPUP_MENU_UPGRADE_PARTNER
Definition enums.h:3135
@ POPUP_MENU_THROW_AWAY_ITEM
Definition enums.h:3133
@ POPUP_MENU_SWITCH_PARTNER
Definition enums.h:3132
@ POPUP_MENU_READ_POSTCARD
Definition enums.h:3142
@ WINDOW_UPDATE_SHOW
Definition enums.h:5311
@ SOUND_OPEN_POPUP_1
Definition enums.h:548
@ SOUND_OPEN_POPUP_2
Definition enums.h:549
@ POPUP_STATE_20
Definition enums.h:3154
@ WIN_CURRENCY_COUNTER
Definition enums.h:5261
@ WIN_POPUP_DESC
Definition enums.h:5260
@ WIN_POPUP_CONTENT
Definition enums.h:5255
@ WIN_POPUP_COST
Definition enums.h:5257
@ WIN_POPUP_PROMPT
Definition enums.h:5262
@ WIN_PARTNER_COST
Definition enums.h:5259
void set_window_update(s32 panelID, s32)
Definition windows.c:434
void basic_window_update(s32 windowIndex, s32 *flags, s32 *posX, s32 *posY, s32 *posZ, f32 *scaleX, f32 *scaleY, f32 *rotX, f32 *rotY, f32 *rotZ, s32 *darkening, s32 *opacity)
Definition windows.c:161
HudScript HES_AnimatedHandPointer
void hud_element_set_tint(s32 id, s32 r, s32 g, s32 b)
void sfx_play_sound(s32 soundID)
Definition sfx.c:517

Referenced by btl_state_update_partner_menu(), and btl_state_update_player_menu().

◆ btl_init_menu_boots()

void btl_init_menu_boots ( void )

Definition at line 671 of file 190B20.c.

671 {
672 BattleStatus* battleStatus = &gBattleStatus;
673 PlayerData* playerData = &gPlayerData;
674 Actor* player = battleStatus->playerActor;
675 MoveData* move;
676 s32 i;
677 s32 moveCount;
678 s32 hasAnyBadgeMoves;
679 s32 fpCost;
680
681 // If you don't have boots equipped, disable this menu
682 if (playerData->bootsLevel == -1) {
683 battleStatus->menuStatus[1] = 0;
684 return;
685 }
686
687 for (i = 0; i < ARRAY_COUNT(battleStatus->submenuMoves); i++) {
688 battleStatus->submenuMoves[i] = MOVE_NONE;
689 }
690
691 // Standard jump move
692 moveCount = 1;
693 battleStatus->submenuMoves[0] = playerData->bootsLevel + MOVE_JUMP1;
694 battleStatus->submenuIcons[0] = ITEM_PARTNER_ATTACK;
695
696 // Jump badges
697 for (i = 0; i < ARRAY_COUNT(playerData->equippedBadges); i++) {
698 s16 badge = playerData->equippedBadges[i];
699
700 if (badge != ITEM_NONE) {
701 MoveData* moveTable = gMoveTable;
702 u8 moveID = gItemTable[badge].moveID;
703
704 move = &moveTable[moveID];
705 if (move->category == MOVE_TYPE_JUMP) {
706 battleStatus->submenuMoves[moveCount] = moveID;
707 battleStatus->submenuIcons[moveCount] = playerData->equippedBadges[i];
708 moveCount++;
709 }
710 }
711 }
712
713 battleStatus->submenuMoveCount = moveCount;
714
715 hasAnyBadgeMoves = FALSE;
716 for (i = 0; i < battleStatus->submenuMoveCount; i++) {
717 move = &gMoveTable[battleStatus->submenuMoves[i]];
718
719 // Calculate FP cost
720 fpCost = move->costFP;
721 if (fpCost != 0) {
724 if (fpCost < 1) {
725 fpCost = 1;
726 }
727 }
728
729 // See if there are any targets for this move
730 battleStatus->moveCategory = BTL_MENU_TYPE_JUMP;
731 battleStatus->moveArgument = playerData->bootsLevel;
732 battleStatus->curTargetListFlags = move->flags; // Controls target filters
734
735 // If there are targets, enable the move
736 if (player->targetListLength != 0) {
737 hasAnyBadgeMoves = TRUE;
739 }
740
741 // If you don't have enough FP, disable the move
742 if (playerData->curFP < fpCost) {
744 }
745
746 // If there are no targets available, disable the move
747 if (player->targetListLength == 0) {
749 }
751 battleStatus->submenuStatus[moveCount] = BATTLE_SUBMENU_STATUS_NO_TARGETS;
752 }
753 }
754
755 if (!hasAnyBadgeMoves) {
756 // Only the standard jump is available - no badge moves.
757 // Selecting this submenu should immediately pick the standard jump move
758 battleStatus->menuStatus[1] = -1;
759 } else {
760 // Enable this submenu
761 battleStatus->menuStatus[1] = 1;
762 }
763}
s16 equippedBadges[64]
@ BTL_MENU_TYPE_JUMP
Definition enums.h:4227
@ MOVE_TYPE_JUMP
Definition enums.h:5214
s16 submenuIcons[24]

Referenced by btl_state_update_player_menu().

◆ btl_init_menu_hammer()

void btl_init_menu_hammer ( void )

Definition at line 765 of file 190B20.c.

765 {
766 BattleStatus* battleStatus = &gBattleStatus;
767 PlayerData* playerData = &gPlayerData;
768 Actor* player = battleStatus->playerActor;
769 MoveData* move;
770 s32 i;
771 s32 moveCount;
772 s32 hasAnyBadgeMoves;
773 s32 fpCost;
774
775 // If you don't have a hammer, disable this menu
776 if (playerData->hammerLevel == -1) {
777 battleStatus->menuStatus[2] = 0;
778 return;
779 }
780
781 for (i = 0; i < ARRAY_COUNT(battleStatus->submenuMoves); i++) {
782 battleStatus->submenuMoves[i] = 0;
783 }
784
785 // Standard hammer move
786 moveCount = 1;
787 battleStatus->submenuMoves[0] = playerData->hammerLevel + MOVE_HAMMER1;
788 battleStatus->submenuIcons[0] = ITEM_PARTNER_ATTACK;
789
790 // Hammer badges
791 for (i = 0; i < ARRAY_COUNT(playerData->equippedBadges); i++) {
792 s16 badge = playerData->equippedBadges[i];
793 if (badge != MOVE_NONE) {
794 MoveData* moveTable = gMoveTable;
795 u8 moveID = gItemTable[badge].moveID;
796 move = &moveTable[moveID];
797 if (move->category == MOVE_TYPE_HAMMER) {
798 battleStatus->submenuMoves[moveCount] = moveID;
799 battleStatus->submenuIcons[moveCount] = playerData->equippedBadges[i];
800 moveCount++;
801 }
802 }
803 }
804
805 battleStatus->submenuMoveCount = moveCount;
806
807 hasAnyBadgeMoves = FALSE;
808 for (i = 0; i < battleStatus->submenuMoveCount; i++) {
809 move = &gMoveTable[battleStatus->submenuMoves[i]];
810
811 // Calculate FP cost
812 fpCost = move->costFP;
813 if (fpCost != 0) {
816 if (fpCost < 1) {
817 fpCost = 1;
818 }
819 }
820
821 // See if there are any targets for this move
822 battleStatus->moveCategory = BTL_MENU_TYPE_SMASH;
823 battleStatus->moveArgument = playerData->hammerLevel;
824 battleStatus->curTargetListFlags = move->flags;
826
827 // If there are targets, enable the move
828 if (player->targetListLength != 0) {
829 hasAnyBadgeMoves = TRUE;
830 battleStatus->submenuStatus[i] = 1;
831 }
832
833 // If you don't have enough FP, disable the move
834 if (playerData->curFP < fpCost) {
835 battleStatus->submenuStatus[i] = 0;
836 }
837
838 // If there are no targets available, disable the move
839 if (player->targetListLength == 0) {
841 }
843 battleStatus->submenuStatus[moveCount] = BATTLE_SUBMENU_STATUS_NO_TARGETS;
844 }
845 }
846
847 if (!hasAnyBadgeMoves) {
848 // Only the standard hammer is available - no badge moves.
849 // Selecting this submenu should immediately pick the standard hammer move
850 battleStatus->menuStatus[2] = -1;
851 } else {
852 // Enable this submenu
853 battleStatus->menuStatus[2] = 1;
854 }
855}
@ BTL_MENU_TYPE_SMASH
Definition enums.h:4228
@ MOVE_TYPE_HAMMER
Definition enums.h:5213

Referenced by btl_state_update_player_menu().

◆ btl_main_menu_init()

void btl_main_menu_init ( void )

Definition at line 468 of file btl_states_menus.c.

468 {
469 D_802AD006 = 255;
470 BattleMenuAlpha = 255;
473}
BSS s16 BattleMenuAlpha
BSS s8 BattleMenuDisableMsg
BSS s8 BattleMenuState
BSS s16 D_802AD006
@ BTL_MENU_STATE_CREATE
Definition enums.h:4171

Referenced by btl_state_update_partner_menu(), btl_state_update_peach_menu(), btl_state_update_player_menu(), and btl_state_update_twink_menu().

◆ func_802A1030()

void func_802A1030 ( void )

◆ func_802A1050()

void func_802A1050 ( void )

◆ func_802A1078()

void func_802A1078 ( void )

Definition at line 489 of file btl_states_menus.c.

489 {
490 BattleMenuAlpha = 255;
492}
@ BTL_MENU_STATE_UNK_14
Definition enums.h:4176

Referenced by btl_state_update_partner_menu(), and btl_state_update_player_menu().

◆ func_802A1098()

void func_802A1098 ( void )

Definition at line 495 of file btl_states_menus.c.

495 {
496 BattleMenuAlpha = 100;
498}
@ BTL_MENU_STATE_UNK_1E
Definition enums.h:4177

Referenced by btl_state_update_partner_menu(), and btl_state_update_player_menu().

◆ btl_main_menu_destroy()

void btl_main_menu_destroy ( void )

Definition at line 500 of file btl_states_menus.c.

500 {
501 s32 i;
502
503 for (i = 0; i < BattleMenu_NumOptions; i++) {
504 s32* icons1 = D_802AD010;
505 s32* icons2 = D_802AD028;
506
507 hud_element_free(icons1[i]);
508 hud_element_free(icons2[i]);
509 }
510
519}
BSS s32 D_802AD058
BSS s32 D_802AD050
BSS s32 D_802AD05C
BSS s32 D_802AD040
BSS s32 D_802AD010[6]
BSS s32 D_802AD044
BSS s32 BattleMenu_NumOptions
BSS s32 D_802AD028[6]
BSS s32 D_802AD04C
BSS s32 D_802AD048
BSS s32 D_802AD054
void hud_element_free(s32 id)

Referenced by btl_state_update_partner_menu(), btl_state_update_peach_menu(), btl_state_update_player_menu(), and btl_state_update_twink_menu().

◆ btl_main_menu_update()

s32 btl_main_menu_update ( void )

Definition at line 521 of file btl_states_menus.c.

521 {
522 BattleStatus* battleStatus = &gBattleStatus;
523 f32 theta;
524 s32 id;
525 s32 i;
526 f32 x, y;
527 s32 l, t;
528
529 switch (BattleMenuState) {
533 D_802AD070 = 0.3f;
534 D_802AD004 = 0;
540
541 for (i = 0; i < BattleMenu_NumOptions; i++) {
547 hud_element_set_scale(id, 0.75f);
548
555 }
556
563
567 hud_element_set_render_pos(id, 40, 212);
568 hud_element_set_tint(id, 0, 91, 127);
572 hud_element_set_alpha(id, 240);
573
577 hud_element_set_render_pos(id, 39, 212);
578 hud_element_set_tint(id, 0, 91, 127);
582 hud_element_set_alpha(id, 240);
583
587 hud_element_set_render_pos(id, 78, 178);
588 hud_element_set_tint(id, 255, 255, 255);
590 hud_element_set_transform_rotation(id, 0.0f, 0.0f, -45.0f);
591 hud_element_set_alpha(id, 200);
595
598 hud_element_set_render_pos(id, 97, 208);
599 hud_element_set_tint(id, 255, 255, 255);
602 hud_element_set_alpha(id, 230);
603
608 hud_element_set_render_pos(id, 94, 209);
609
614 hud_element_set_render_pos(id, 81, 210);
615
620 hud_element_set_render_pos(id, 102, 210);
621 D_802AD00A = 100;
622 D_802AD001 = 3;
624 BattleMenu_WheelAngle = theta = D_802AD100 * 28;
625 break;
627 D_802AD00A = (D_802AD001 * 100) / 3;
628
629 switch (D_802AD001) {
630 case 1:
631 if (D_802AD001 == 1) {
632 id = D_802AD04C;
634 }
635 default:
636 D_802AD001--;
637 break;
638 case 0:
641 BattleMenu_WheelAngle = theta = D_802AD100 * 28;
642 for (i = 0; i < BattleMenu_NumOptions; i++, theta += 28.0f) {
643 x = 0.0f;
644 y = 0.0f;
645 add_vec2D_polar(&x, &y, 87.0f, theta);
646
647 l = BattleMenu_BasePosX + x;
648 t = BattleMenu_BasePosY + y;
649 id = D_802AD010[i];
652
653 id = D_802AD028[i];
655 hud_element_set_alpha(id, 100);
657 }
658
659 x = 0.0f;
660 y = 0.0f;
661 theta = D_802AD100 * 28;
662 add_vec2D_polar(&x, &y, 87.0f, theta);
663
664 l = BattleMenu_BasePosX + x;
665 t = BattleMenu_BasePosY + y;
666 id = D_802AD040;
668 hud_element_set_alpha(id, 180);
669 hud_element_set_scale(id, 0.85f);
672 break;
673 }
674 break;
676 if (battleStatus->curButtonsPressed & BUTTON_A) {
680 } else {
684 }
685 } else {
687 if (D_802AD004 == 0) {
688 if ((battleStatus->curButtonsHeld & (BUTTON_STICK_LEFT | BUTTON_STICK_UP)) &&
690 {
692 }
693 if ((battleStatus->curButtonsHeld & (BUTTON_STICK_RIGHT | BUTTON_STICK_DOWN)) &&
695 {
697 }
698 }
699
701 D_802AD004 = 1;
703 }
704 }
705 break;
707 BattleMenuAlpha = 100;
710 D_802AD001 = 0;
711 D_802AD006 = 0;
717 D_802AD001 = 3;
718 D_802AD006 = 255;
722 D_802AD001 = 3;
723 D_802AD006 = 255;
725 break;
729 break;
732 break;
733 }
736 break;
737 }
738 return 0;
739}
BSS s8 BattleMenu_MaxIdx
HudScript HES_SwapArrowRight
BSS s8 BattleMenu_CurPos
HudScript HES_ProjectorBeam
HudScript HES_SwapArrowLeft
BSS s32 BattleMenu_BasePosY
HudScript HES_ProjectorReel
BSS s32 D_802AD0B0
BSS s32 D_802AD100
BSS s32 BattleMenu_OptionEnabled[6]
BSS s32 BattleMenu_BasePosX
BSS f32 BattleMenu_WheelAngle
BSS s8 D_802AD004
BSS f32 D_802AD070
BSS s8 BattleMenu_PrevPos
HudScript HES_SwapBackground
HudScript HES_ProjectorSpot
HudScript HES_SwapZ
BSS HudScript * BattleMenu_HudScripts[6]
BSS s32 battle_menu_isMessageDisabled[6]
BSS s8 BattleMenu_MinIdx
BSS s8 BattleMenu_HomePos
BSS s16 D_802AD00A
@ BUTTON_A
Definition enums.h:2790
@ BUTTON_STICK_UP
Definition enums.h:2791
@ BUTTON_STICK_DOWN
Definition enums.h:2792
@ BUTTON_STICK_LEFT
Definition enums.h:2793
@ BUTTON_STICK_RIGHT
Definition enums.h:2794
@ BTL_MENU_STATE_UNK_1
Definition enums.h:4172
@ BTL_MENU_STATE_SHOW_DISABLED_POPUP
Definition enums.h:4178
@ BTL_MENU_STATE_OPENED_SUBMENU
Definition enums.h:4170
@ BTL_MENU_STATE_UNK_B
Definition enums.h:4175
@ BTL_MENU_STATE_AWAIT_DISABLED_POPUP
Definition enums.h:4179
@ SOUND_MENU_CHANGE_TAB
Definition enums.h:699
@ SOUND_MENU_NEXT
Definition enums.h:700
@ SOUND_MENU_ERROR
Definition enums.h:933
void btl_show_battle_message(s32 messageIndex, s32 duration)
s32 btl_is_popup_displayed(void)
void add_vec2D_polar(f32 *x, f32 *y, f32 r, f32 theta)
Definition 43F0.c:685
void hud_element_set_scale(s32 index, f32 scale)
void hud_element_set_render_depth(s32 id, s32 z)
void hud_element_create_transform_B(s32 id)
void hud_element_set_transform_rotation(s32 id, f32 x, f32 y, f32 z)
void hud_element_set_transform_rotation_pivot(s32 id, s32 dx, s32 dy)
s32 hud_element_create(HudScript *anim)
Creates a new HUD element and returns its ID.
void hud_element_set_flags(s32 id, s32 flags)
Turns on the given flags.
void hud_element_clear_flags(s32 id, s32 flags)
Turns off the given flags.
@ HUD_ELEMENT_FLAG_DISABLED
Definition hud_element.h:74
@ HUD_ELEMENT_FLAG_80
Definition hud_element.h:80
@ HUD_ELEMENT_FLAG_FILTER_TEX
Definition hud_element.h:88

Referenced by btl_state_update_partner_menu(), btl_state_update_peach_menu(), btl_state_update_player_menu(), and btl_state_update_twink_menu().

◆ btl_main_menu_draw()

void btl_main_menu_draw ( void )

Definition at line 741 of file btl_states_menus.c.

741 {
742 s32 id;
743 s32 opacity;
744 f32 theta;
745 s32 cond;
746 f32 x, y;
747 f32 scale;
748 s32 i;
749 s32 l, t;
750
751 switch (BattleMenuState) {
753 func_80144218(-1);
754 id = D_802AD048;
755 hud_element_set_transform_rotation(id, 0.0f, 0.0f, 0.0f);
756 hud_element_set_alpha(id, (D_802AD006 * 254) / 255);
758 func_80144238(id);
759 id = D_802AD044;
760 hud_element_set_alpha(id, (D_802AD006 * 254) / 255);
762 func_80144238(id);
763 break;
769 opacity = (D_802AD006 * BattleMenuAlpha) / 255;
770 func_80144218(-1);
771 theta = (D_802AD100 - BattleMenu_CurPos) * 28;
772
773 cond = FALSE;
774 if (BattleMenu_WheelAngle > theta) {
776 if (BattleMenu_WheelAngle < theta) {
777 BattleMenu_WheelAngle = theta;
778 cond = TRUE;
779 }
780 } else if (BattleMenu_WheelAngle < theta) {
782 if (BattleMenu_WheelAngle > theta) {
783 BattleMenu_WheelAngle = theta;
784 cond = TRUE;
785 }
786 } else {
787 cond = TRUE;
788 }
789
790 if (!cond) {
791 D_802AD070 = (D_802AD070 * (D_802AD070 + 1.0) * (D_802AD070 + 1.0));
792 } else {
793 D_802AD004 = 0;
794 D_802AD070 = 0.3f;
795 }
796
797 theta = BattleMenu_WheelAngle;
798 for (i = 0; i < BattleMenu_NumOptions; i++, theta += 28.0f) {
799 x = 0.0f;
800 y = 0.0f;
801 add_vec2D_polar(&x, &y, 87.0f, theta);
802 id = D_802AD028[i];
803 x = BattleMenu_BasePosX + x;
804 y = BattleMenu_BasePosY + y;
805 hud_element_set_transform_pos(id, x, -y, 0.0f);
807 hud_element_set_alpha(id, (opacity * 150) / 255);
808
809 if (theta == 56.0f && cond == TRUE) {
810 hud_element_set_scale(id, 1.6f);
811 } else {
812 hud_element_set_scale(id, 1.0f);
813 }
814
815 func_80144238(id);
817 x = 0.0f;
818 y = 0.0f;
819 add_vec2D_polar(&x, &y, 87.0f, 56.0f);
820 x = BattleMenu_BasePosX + x;
821 y = BattleMenu_BasePosY + y;
822 id = D_802AD040;
823 hud_element_set_transform_pos(id, x, -y, 0.0f);
825 hud_element_set_alpha(id, (opacity * 180) / 255);
826 hud_element_set_scale(id, 1.2f);
827 if (!cond) {
829 } else {
831 }
832 func_80144238(id);
833 }
834 }
835 theta = (D_802AD100 - BattleMenu_CurPos) * 28;
836 scale = (fabsf(fabsf((BattleMenu_WheelAngle - theta) * (45.0 / 28.0)) - 22.5) / 22.5) + 0.01;
837 if (cond) {
838 scale = 1.0f;
839 }
840
841 id = D_802AD04C;
843 hud_element_set_transform_rotation(id, 0.0f, 0.0f, -43.0f);
844 hud_element_set_scale(id, scale);
845 hud_element_set_transform_scale(id, 1.0f, 1.8f, 1.0f);
846 hud_element_set_alpha(id, (opacity * 200) / 255);
847 hud_element_set_render_pos(id, 79, 176);
848 func_80144238(id);
849
850 id = D_802AD048;
851 theta = (D_802AD100 - BattleMenu_CurPos) * 28;
852 scale = (BattleMenu_WheelAngle - theta) * (45.0 / 28.0);
853 hud_element_set_transform_rotation(id, 0.0f, 0.0f, -scale);
855 hud_element_set_scale(id, 0.95f);
856 hud_element_set_alpha(id, (opacity * 254) / 255);
858 func_80144238(id);
859
860 id = D_802AD044;
861 hud_element_set_alpha(id, (opacity * 254) / 255);
863 hud_element_set_scale(id, 1.0f);
864 func_80144238(id);
865
866 theta = BattleMenu_WheelAngle;
867 for (i = 0; i < BattleMenu_NumOptions; i++, theta += 28.0f) {
868 x = 0.0f;
869 y = 0.0f;
870 add_vec2D_polar(&x, &y, 87.0f, theta);
871 l = x = BattleMenu_BasePosX + x;
872 t = y = BattleMenu_BasePosY + y;
873 btl_draw_prim_quad(0, 0, 0, 0, l - 12, t - 12, 24, 24);
874 id = D_802AD010[i];
876 hud_element_set_alpha(id, (opacity * 180) / 255);
878 hud_element_set_alpha(id, opacity);
879 }
881 }
882
883 if (cond) {
884 l = BattleMenu_BasePosX + 20;
885 t = BattleMenu_BasePosY - 34;
886 btl_draw_prim_quad(0, 0, 0, 0, l + 26, t, 48, 16);
888 }
889
892 }
893
895 id = D_802AD05C;
896 hud_element_set_alpha(id, (opacity * 200) / 255);
898 id = D_802AD050;
899 hud_element_set_alpha(id, opacity);
901 id = D_802AD054;
902 hud_element_set_alpha(id, opacity);
904 id = D_802AD058;
905 hud_element_set_alpha(id, opacity);
907 }
908 break;
909 }
910}
BSS s32 BattleMenu_TitleMessages[6]
BSS s32 BattleMenu_ShowSwapIcons
@ BS_FLAGS1_TUTORIAL_BATTLE
Definition enums.h:3594
@ MSG_PAL_35
Definition enums.h:5458
f32 fabsf(f32 f)
void btl_draw_prim_quad(u8 r, u8 g, u8 b, u8 a, u16 left, u16 top, u16 arg6, u16 arg7)
Definition 190B20.c:2931
void func_80144238(s32 id)
void hud_element_set_transform_pos(s32 id, f32 x, f32 y, f32 z)
void hud_element_set_transform_scale(s32 id, f32 x, f32 y, f32 z)
void func_80144218(s32 id)

Referenced by btl_state_draw_partner_menu(), btl_state_draw_peach_menu(), btl_state_draw_player_menu(), and btl_state_draw_twink_menu().

◆ func_802A2684()

void func_802A2684 ( void )

Definition at line 913 of file btl_states_menus.c.

Referenced by btl_state_update_partner_menu(), and btl_state_update_player_menu().

◆ func_802A27D0()

void func_802A27D0 ( void )

◆ func_802A27E4()

void func_802A27E4 ( void )

Definition at line 957 of file btl_states_menus.c.

Referenced by btl_state_update_partner_menu(), btl_state_update_player_menu(), and btl_submenu_moves_update().

◆ func_802A2910()

void func_802A2910 ( void )

Definition at line 986 of file btl_states_menus.c.

986 {
987 s32* moveOptionIconIDs;
988 s32* moveOptionCostUnitIconIDs;
989 s32 i;
990
991 moveOptionIconIDs = BattleMenu_Moves_OptionIDs;
992
993 for (i = 0; i < BattleMenu_Moves_OptionCount; i++) {
994 hud_element_set_tint(moveOptionIconIDs[i], 255, 255, 255);
995 }
996
1001
1002 moveOptionCostUnitIconIDs = BattleMenu_Moves_OptionCostUnitIDs;
1003
1004 for (i = 0; i < BattleMenu_Moves_OptionCount; i++) {
1005 hud_element_set_tint(moveOptionCostUnitIconIDs[i], 255, 255, 255);
1006 }
1007
1010
1014 } else {
1017 }
1018
1021 D_802AD10F = 1;
1024}
@ WINDOW_UPDATE_TRANSPARENT
Definition enums.h:5315

Referenced by btl_state_update_player_menu().

◆ func_802A2AB8()

void func_802A2AB8 ( void )

Definition at line 1026 of file btl_states_menus.c.

1026 {
1027 s32* moveOptionIconIDs;
1028 s32* moveOptionCostUnitIconIDs;
1029 s32 i;
1030
1032
1036 } else {
1039 }
1041
1042 moveOptionIconIDs = BattleMenu_Moves_OptionIDs;
1043
1044 for (i = 0; i < BattleMenu_Moves_OptionCount; i++) {
1045 hud_element_set_tint(moveOptionIconIDs[i], 255, 255, 255);
1046 }
1047
1052
1053 moveOptionCostUnitIconIDs = BattleMenu_Moves_OptionCostUnitIDs;
1054
1055 for (i = 0; i < BattleMenu_Moves_OptionCount; i++) {
1056 hud_element_set_tint(moveOptionCostUnitIconIDs[i], 255, 255, 255);
1057 }
1058
1061 D_802AD10F = 1;
1063}

Referenced by btl_state_update_partner_menu(), and btl_state_update_player_menu().

◆ func_802A2C58()

void func_802A2C58 ( void )

◆ btl_submenu_moves_update()

s32 btl_submenu_moves_update ( void )

Definition at line 1070 of file btl_states_menus.c.

1070 {
1071 BattleStatus* battleStatus = &gBattleStatus;
1072 s32 moveX;
1073 s32 moveY;
1074 s32 msgWidth;
1075 s32 msgX;
1076 s32 msgID;
1077 s32 cond;
1078 s32 id;
1079 s32 i;
1080 s32 j;
1081
1082 switch (battle_menu_moveState) {
1088
1089 for (i = 0; i < BattleMenu_Moves_OptionCount; i++) {
1091 }
1092
1094 for (i = 0; i < (BattleMenu_Moves_OptionCount - 1); i++) {
1095 for (j = i + 1; j < BattleMenu_Moves_OptionCount; j++) {
1096 s32 temp1 = BattleMenu_Moves_OptionIndexMap[i];
1097 s32 temp2 = BattleMenu_Moves_OptionIndexMap[j];
1098
1100 continue;
1101 }
1102
1103 if (
1108 )
1109 {
1110 s32 swapTmp = BattleMenu_Moves_OptionIndexMap[i];
1113 }
1114 }
1115 }
1116 }
1117
1118 for (i = 0; i < BattleMenu_Moves_OptionCount; i++) {
1121 hud_element_set_scale(id, 0.45f);
1123 }
1124
1129
1134
1139
1144 } else {
1147 hud_element_set_scale(id, 0.75f);
1149 }
1151
1152 for (i = 0; i < BattleMenu_Moves_OptionCount; i++) {
1155 case 0:
1158 break;
1159 case 1:
1162 break;
1163 default:
1166 break;
1167 }
1168 } else {
1170 case 0:
1173 break;
1174 case 1:
1177 break;
1178 default:
1181 break;
1182 }
1183 }
1186 }
1187
1189
1190 moveX = BattleMenu_Moves_PosX;
1191 moveY = BattleMenu_Moves_PosY;
1193 set_window_properties(WIN_BTL_MOVES_MENU, moveX, moveY, 150, (D_802AD10E * 13) + 28, 0, btl_menu_moves_draw_content, NULL, -1);
1194 set_window_properties(WIN_BTL_MOVES_TITLE, moveX + 16, moveY - 6, 90, 16, 1, btl_menu_moves_show_title, NULL, -1);
1195 set_window_properties(WIN_BTL_MOVES_ICON, moveX + 114, moveY - 12, 32, 32, 1, btl_menu_moves_show_icon, NULL, -1);
1196 } else {
1197 set_window_properties(WIN_BTL_MOVES_MENU, moveX, moveY, 144, (D_802AD10E * 13) + 28, 0, btl_menu_moves_draw_content, NULL, -1);
1198 set_window_properties(WIN_BTL_SPIRITS_TITLE, moveX + 10, moveY - 6, 100, 16, 1, btl_menu_moves_show_title, 0, -1);
1199 set_window_properties(WIN_BTL_SPIRITS_ICON, moveX + 110, moveY - 12, 32, 35, 1, btl_menu_moves_show_icon, 0, -1);
1200 }
1201
1207 } else {
1210 }
1212
1213 do {
1214 cond = FALSE;
1221 }
1222 } else {
1223 cond = TRUE;
1224 }
1225 }
1226 } while (cond);
1227
1232 break;
1235 if (battleStatus->curButtonsHeld & (BUTTON_STICK_UP | BUTTON_Z)) {
1236 if (battle_menu_moveCursorPos > 0) {
1238 } else if (battleStatus->curButtonsPressed & (BUTTON_STICK_UP | BUTTON_Z)) {
1240 }
1241 }
1242
1243 if (battleStatus->curButtonsHeld & (BUTTON_STICK_DOWN | BUTTON_R)) {
1246 } else if (battleStatus->curButtonsPressed & (BUTTON_STICK_DOWN | BUTTON_R)) {
1248 }
1249 }
1250
1251 if (battle_menu_moveCursorPos < 0) {
1253 }
1254
1257 }
1258
1262 }
1263
1268 }
1269 }
1270
1277 }
1278 }
1279 }
1280
1282 if (battleStatus->curButtonsPressed & BUTTON_A) {
1286 } else {
1290 }
1291 break;
1292 }
1293
1294 if (battleStatus->curButtonsPressed & BUTTON_B) {
1296 func_802A27E4();
1298 }
1299 break;
1301 for (i = 0; i < BattleMenu_Moves_OptionCount; i++) {
1303 hud_element_set_tint(id, 160, 160, 160);
1304 }
1309
1310 for (i = 0; i < BattleMenu_Moves_OptionCount; i++) {
1312 hud_element_set_tint(id, 160, 160, 160);
1313 }
1314
1321 } else {
1324 }
1328 } else {
1330 }
1336 } else {
1338 }
1339 return 255;
1345 } else {
1348 }
1352 } else {
1354 }
1366 } else {
1369 }
1379 } else {
1382 }
1385 break;
1389 return -1;
1395 } else {
1398 }
1400
1401 msgID = MSG_Menus_Battle_CantSelectNow;
1402 if (D_802AD258 == 0) {
1404 msgID = MSG_Menus_NotEnoughFP;
1405 } else {
1406 msgID = MSG_Menus_NotEnoughStarPower;
1407 }
1408 }
1409
1410 msgWidth = get_msg_width(msgID, 0) + 23;
1411 moveX = (SCREEN_WIDTH / 2) - (msgWidth / 2);
1412 set_window_properties(WIN_BTL_POPUP, moveX, 80, msgWidth, D_802AB340[get_msg_lines(msgID) - 1], 20, btl_menu_moves_show_error, NULL, -1);
1414 D_802AD10B = 60;
1416 return -1;
1419 D_802AD10B = 0;
1420 }
1421 if (D_802AD10B != 0) {
1422 D_802AD10B--;
1423 return -1;
1424 }
1430 } else {
1433 }
1436 break;
1437 }
1438 return 0;
1439}
HudScript HES_POWCostReducedTwice
s16 D_802AB340[]
BSS s32 battle_menu_moveOptionBPCosts[24]
void btl_menu_moves_show_error(void *data, s32 x, s32 y)
HudScript HES_FPCostReducedTwice
HudScript HES_HandPointer
BSS HudScript * battle_menu_moveOptionIconScripts[24]
void btl_menu_moves_show_desc(void *data, s32 x, s32 y)
void btl_menu_moves_show_title(void *data, s32 x, s32 y)
HudScript HES_GreenArrowDown
BSS s16 BattleMenu_Moves_PosX
BSS s8 BattleMenu_Moves_OptionCantUseMessages[24]
HudScript HES_GreenArrowUp
BSS s16 BattleMenu_Moves_PosY
HudScript HES_FPCost
void btl_menu_moves_draw_content(void *data, s32 x, s32 y)
HudScript HES_POWCostReduced
HudScript HES_POWCost
BSS s8 D_802AD10B
void btl_menu_moves_show_icon(void *data, s32 x, s32 y)
void func_802A27E4(void)
HudScript HES_FPCostReduced
HudScript HES_StatusFlower
BSS s8 BattleMenu_Moves_OptionSortPriority[24]
HudScript HES_MenuStarPower
u32 pressedButtons[4]
#define get_msg_width
@ BUTTON_R
Definition enums.h:2781
@ BUTTON_B
Definition enums.h:2789
@ BUTTON_Z
Definition enums.h:2788
@ WINDOW_PRIORITY_20
Definition enums.h:3186
@ MSG_PAL_0D
Definition enums.h:5418
@ WINDOW_UPDATE_9
Definition enums.h:5319
@ WINDOW_UPDATE_DARKENED
Definition enums.h:5314
@ BTL_SUBMENU_MOVES_STATE_UNK_2A
Definition enums.h:4193
@ BTL_SUBMENU_MOVES_STATE_UNK_B
Definition enums.h:4188
@ BTL_SUBMENU_MOVES_STATE_UNK_28
Definition enums.h:4191
@ BTL_SUBMENU_MOVES_STATE_UNK_29
Definition enums.h:4192
@ BTL_SUBMENU_MOVES_STATE_UNK_NEGATIVE_TWO
Definition enums.h:4183
@ SOUND_MENU_BACK
Definition enums.h:701
@ SOUND_MENU_CHANGE_SELECTION
Definition enums.h:698
@ WIN_BTL_POPUP
Definition enums.h:5250
void set_window_properties(s32 panelID, s32 posX, s32 posY, s32 width, s32 height, u8, void *drawContents, void *drawContentsArg, s8 parent)
Definition windows.c:373
@ HUD_ELEMENT_FLAG_DROP_SHADOW
#define SCREEN_WIDTH
Definition macros.h:105
GameStatus * gGameStatusPtr
Definition main_loop.c:32

Referenced by btl_state_update_partner_menu(), and btl_state_update_player_menu().

◆ func_802A45D8()

void func_802A45D8 ( void )

Definition at line 1717 of file btl_states_menus.c.

1717 {
1718 s32 sixTemp;
1719 s8 temp802AD673;
1720
1724 D_802AD608 = 0;
1726
1727 if (StratsMenuLines > 6) {
1728 StratsMenuLines = 6;
1729 }
1730
1731 D_802AD609 = sixTemp = 6;
1732
1733 if (D_802AD609 > D_802AD66C) {
1735 }
1736
1737 D_802AD624 = 255;
1738 D_802AD60B = 1;
1739 temp802AD673 = StratsMenuLastPos;
1740
1741 if ((s8) StratsMenuLastPos < 0) {
1743 }
1744 if ((s8) StratsMenuLastPos >= D_802AD609) {
1745 D_802AD608 = (temp802AD673 + 1 - StratsMenuLines);
1746 }
1747
1748 D_802AD609 = D_802AD608 + sixTemp;
1749 if (D_802AD609 > D_802AD66C) {
1751 }
1752
1753 D_802AD60C = -D_802AD608 * 13;
1754 D_802AD60E = ((s8) StratsMenuLastPos - D_802AD608) * 13;
1755 ShowingErrorMessage = FALSE;
1756 D_802AD6D4 = 0;
1757}
BSS s32 D_802AD6D4
BSS s8 OldStratsMenuPos
BSS s32 StratsMenuLastPos
BSS b8 ShowingErrorMessage
@ BTL_SUBMENU_STRATS_STATE_INIT
Definition enums.h:4200

Referenced by btl_state_update_partner_menu(), and btl_state_update_player_menu().

◆ func_802A4718()

void func_802A4718 ( void )

◆ func_802A472C()

◆ func_802A47E0()

◆ func_802A48FC()

◆ func_802A4A10()

◆ btl_update_strats_menu()

s32 btl_update_strats_menu ( void )

Definition at line 1826 of file btl_states_menus.c.

1826 {
1827 BattleStatus* battleStatus = &gBattleStatus;
1828 s32 id;
1829 s32 x, y;
1830 s32 width;
1831 s32 msgID;
1832 s32 i;
1833
1834 switch (BattleSubmenuStratsState) {
1836 D_802AD63C = 20;
1837 D_802AD63E = 68;
1838 D_802AD60C = -D_802AD608 * 13;
1840
1841 for (i = 0; i < D_802AD66C; i++) {
1843 hud_element_set_scale(id, 0.45f);
1845 }
1846
1850
1854
1858
1860 x = D_802AD63C;
1861 y = D_802AD63E;
1863 set_window_properties(WIN_BTL_STRATS_TITLE, x + 18, y - 6, 108, 16, 1, btl_menu_strats_show_title, NULL, -1);
1864 x = 20;
1865 y = 186;
1871 return 0;
1873 if (!ShowingErrorMessage) {
1875
1876 // only wrap selection on stick press, not when held
1877 if (battleStatus->curButtonsHeld & BUTTON_STICK_UP) {
1878 if (StratsMenuPos > 0) {
1879 StratsMenuPos--;
1880 } else if (battleStatus->curButtonsPressed & BUTTON_STICK_UP) {
1881 StratsMenuPos--;
1882 }
1883 }
1884
1885 if (battleStatus->curButtonsHeld & BUTTON_STICK_DOWN) {
1886 if (StratsMenuPos < D_802AD66C - 1) {
1887 StratsMenuPos++;
1888 } else if (battleStatus->curButtonsPressed & BUTTON_STICK_DOWN) {
1889 StratsMenuPos++;
1890 }
1891 }
1892
1893 // wrap the selected index
1894 if (StratsMenuPos < 0) {
1896 }
1897 if (D_802AD66C - 1 < StratsMenuPos) {
1898 StratsMenuPos = 0;
1899 }
1900
1904 }
1905
1906 if (StratsMenuPos < D_802AD608) {
1908 }
1909 if (StratsMenuPos >= D_802AD609) {
1911 }
1912 D_802AD609 = D_802AD608 + 6;
1913 if (D_802AD609 > D_802AD66C) {
1915 }
1916
1917 if (battleStatus->curButtonsPressed & BUTTON_A) {
1918 if (D_802AD690[StratsMenuPos] == 1) {
1921 } else {
1925 }
1926 } else if (battleStatus->curButtonsPressed & BUTTON_B) {
1928 func_802A472C();
1930 }
1931 }
1932 return 0;
1934 for (i = 0; i < D_802AD66C; i++) {
1935 hud_element_set_tint(D_802AD628[i], 160, 160, 160);
1936 }
1937 hud_element_set_tint(D_802AD618, 160, 160, 160);
1938 hud_element_set_tint(GreenArrowUpID, 160, 160, 160);
1939 hud_element_set_tint(GreenArrowDownID, 160, 160, 160);
1945 return StratsMenuPos + 1;
1947 return 255;
1948 case 10:
1953 return StratsMenuPos + 1;
1954 case 11:
1955 return StratsMenuPos + 1;
1956 case 20:
1961 return StratsMenuPos + 1;
1962 case 30:
1967 return 0;
1969 D_802AD6D4 = -1;
1971 return -1;
1976 switch (D_802AD610) {
1977 case 0:
1978 msgID = MSG_Menus_Battle_CantSwitch2;
1979 break;
1980 case 1:
1981 msgID = MSG_Menus_Battle_CantRunAway;
1982 break;
1983 default:
1984 msgID = MSG_Menus_Battle_CantRunAway;
1985 break;
1986 }
1987 width = get_msg_width(msgID, 0) + 23;
1988 set_window_properties(WIN_BTL_POPUP, (SCREEN_WIDTH / 2) - (width / 2), 80, width, 28, 20, btl_menu_strats_show_error, NULL, -1);
1990 D_802AD612 = 60;
1992 return -1;
1995 D_802AD612 = 0;
1996 }
1997 if (D_802AD612 != 0) {
1998 D_802AD612--;
1999 return -1;
2000 }
2006 return 0;
2007 }
2008 return 0;
2009}
BSS s16 D_802AD612
BSS s32 D_802AD6A8[6]
BSS s16 D_802AD63E
void btl_menu_strats_show_title(void *data, s32 x, s32 y)
void btl_menu_strats_show_desc(void *data, s32 x, s32 y)
void btl_menu_strats_draw_content(void *data, s32 x, s32 y)
void func_802A472C(void)
void btl_menu_strats_show_error(void *data, s32 x, s32 y)
BSS s16 D_802AD63C
BSS HudScript * D_802AD640[6]
@ BTL_SUBMENU_STRATS_STATE_CANCEL
Definition enums.h:4198
@ BTL_SUBMENU_STRATS_STATE_ERROR_DONE
Definition enums.h:4208
@ BTL_SUBMENU_STRATS_STATE_UNK_11
Definition enums.h:4203

Referenced by btl_state_update_partner_menu(), and btl_state_update_player_menu().

◆ can_switch_to_player()

s32 can_switch_to_player ( void )

Definition at line 2147 of file btl_states_menus.c.

2147 {
2148 BattleStatus* battleStatus = &gBattleStatus;
2149 Actor* player = battleStatus->playerActor;
2150
2151 if (battleStatus->flags2 & BS_FLAGS2_PLAYER_TURN_USED) {
2152 return FALSE;
2153 } else {
2154 s8 debuff = player->debuff;
2155 s32 playerCantMove = FALSE;
2156
2157 if (player->koStatus == STATUS_KEY_DAZE) {
2158 playerCantMove = TRUE;
2159 }
2160 if (debuff == STATUS_KEY_POISON) {
2161 playerCantMove = FALSE;
2162 }
2163 if (debuff == STATUS_KEY_SHRINK) {
2164 playerCantMove = FALSE;
2165 }
2166 if (debuff == STATUS_KEY_SLEEP) {
2167 playerCantMove = TRUE;
2168 }
2169 if (debuff == STATUS_KEY_FEAR) {
2170 playerCantMove = TRUE;
2171 }
2172 if (debuff == STATUS_KEY_DIZZY) {
2173 playerCantMove = TRUE;
2174 }
2175 if (debuff == STATUS_KEY_PARALYZE) {
2176 playerCantMove = TRUE;
2177 }
2178 if (debuff == STATUS_KEY_FROZEN) {
2179 playerCantMove = TRUE;
2180 }
2181 if (debuff == STATUS_KEY_STOP) {
2182 playerCantMove = TRUE;
2183 }
2184 if (player->stoneStatus == STATUS_KEY_STONE) {
2185 playerCantMove = TRUE;
2186 }
2187 if (battleStatus->outtaSightActive) {
2188 playerCantMove = TRUE;
2189 }
2190 return !playerCantMove;
2191 }
2192}
@ BS_FLAGS2_PLAYER_TURN_USED
Definition enums.h:3605
@ STATUS_KEY_PARALYZE
Definition enums.h:2201
@ STATUS_KEY_FEAR
Definition enums.h:2199
@ STATUS_KEY_SLEEP
Definition enums.h:2202
@ STATUS_KEY_STONE
Definition enums.h:2208
@ STATUS_KEY_STOP
Definition enums.h:2204
@ STATUS_KEY_SHRINK
Definition enums.h:2206

Referenced by btl_state_update_partner_menu(), and btl_state_update_player_menu().

◆ can_switch_to_partner()

s32 can_switch_to_partner ( void )

Definition at line 2196 of file btl_states_menus.c.

2196 {
2197 BattleStatus* battleStatus = &gBattleStatus;
2198 Actor* partner = battleStatus->partnerActor;
2199 s8 partnerDebuff;
2200 s32 partnerCantMove;
2201
2202 if (battleStatus->flags2 & BS_FLAGS2_PARTNER_TURN_USED || partner == PARTNER_NONE || partner->flags & ACTOR_FLAG_NO_ATTACK) {
2203 return FALSE;
2204 }
2205
2206 partnerDebuff = partner->debuff;
2207 partnerCantMove = FALSE;
2208
2209 if (partner->koStatus == STATUS_KEY_DAZE) {
2210 partnerCantMove = TRUE;
2211 }
2212 if (partnerDebuff == STATUS_KEY_POISON) {
2213 partnerCantMove = FALSE;
2214 }
2215 if (partnerDebuff == STATUS_KEY_SHRINK) {
2216 partnerCantMove = FALSE;
2217 }
2218 if (partnerDebuff == STATUS_KEY_SLEEP) {
2219 partnerCantMove = TRUE;
2220 }
2221 if (partnerDebuff == STATUS_KEY_FEAR) {
2222 partnerCantMove = TRUE;
2223 }
2224 if (partnerDebuff == STATUS_KEY_PARALYZE) {
2225 partnerCantMove = TRUE;
2226 }
2227 if (partnerDebuff == STATUS_KEY_FROZEN) {
2228 partnerCantMove = TRUE;
2229 }
2230 if (partnerDebuff == STATUS_KEY_STOP) {
2231 partnerCantMove = TRUE;
2232 }
2233 if (partner->stoneStatus == STATUS_KEY_STONE) {
2234 partnerCantMove = TRUE;
2235 }
2236 return !partnerCantMove;
2237}
@ BS_FLAGS2_PARTNER_TURN_USED
Definition enums.h:3606
@ ACTOR_FLAG_NO_ATTACK
Skip attack turn.
Definition enums.h:3339
@ PARTNER_NONE
Definition enums.h:2885

Referenced by btl_state_update_partner_menu(), and btl_state_update_player_menu().

◆ btl_state_update_player_menu()

void btl_state_update_player_menu ( void )

Definition at line 2239 of file btl_states_menus.c.

2239 {
2240 BattleStatus* battleStatus = &gBattleStatus;
2241 PlayerData* playerData = &gPlayerData;
2242 Actor* playerActor = battleStatus->playerActor;
2243 Actor* partnerActor = battleStatus->partnerActor;
2244 PopupMenu* popup = &D_802ACCD0;
2245 MoveData* moveData;
2246 s32 entryIdx, initialPos;
2247 s32 i;
2248 s32 submenuResult;
2249 s32 jumpTargetCount, hammerTargetCount, jumpChance;
2250 ItemData* itemData;
2251 s32 starBeamLevel;
2252 s32 currentSubmenu;
2253 s32 currentSubmenu2;
2254 IconHudScriptPair* hudScriptPair;
2256
2257 switch (gBattleSubState) {
2259 battleStatus->moveCategory = BTL_MENU_TYPE_INVALID;
2260 battleStatus->selectedMoveID = 0;
2261 battleStatus->curAttackElement = 0;
2262 if (!can_switch_to_player()) {
2264 return;
2265 }
2267 btl_cam_move(10);
2268 if (!(battleStatus->flags1 & BS_FLAGS1_PLAYER_IN_BACK)) {
2270 } else {
2272 partnerActor->state.curPos.x = partnerActor->homePos.x;
2273 partnerActor->state.curPos.z = partnerActor->homePos.z;
2274 partnerActor->state.goalPos.x = playerActor->homePos.x;
2275 partnerActor->state.goalPos.z = playerActor->homePos.z;
2276 partnerActor->state.moveTime = 4;
2277 partnerActor->state.angle = 0.0f;
2278 }
2279 break;
2281 if (partnerActor->state.moveTime != 0) {
2282 partnerActor->curPos.x += (partnerActor->state.goalPos.x - partnerActor->curPos.x) / partnerActor->state.moveTime;
2283 partnerActor->curPos.z += (partnerActor->state.goalPos.z - partnerActor->curPos.z) / partnerActor->state.moveTime;
2284 playerActor->curPos.x += (partnerActor->state.curPos.x - playerActor->curPos.x) / partnerActor->state.moveTime;
2285 playerActor->curPos.z += (partnerActor->state.curPos.z - playerActor->curPos.z) / partnerActor->state.moveTime;
2286 }
2287 partnerActor->curPos.z -= sin_rad(DEG_TO_RAD(partnerActor->state.angle)) * 16.0f;
2288 partnerActor->yaw = clamp_angle(-partnerActor->state.angle);
2289 playerActor->curPos.z += sin_rad(DEG_TO_RAD(partnerActor->state.angle)) * 16.0f;
2290 playerActor->yaw = clamp_angle(-partnerActor->state.angle);
2291 partnerActor->state.angle += 90.0f;
2292 if (partnerActor->state.moveTime != 0) {
2293 partnerActor->state.moveTime--;
2294 } else {
2295 partnerActor->curPos.x = partnerActor->state.goalPos.x;
2296 partnerActor->curPos.z = partnerActor->state.goalPos.z;
2297 playerActor->curPos.x = partnerActor->state.curPos.x;
2298 playerActor->curPos.z = partnerActor->state.curPos.z;
2299 partnerActor->homePos.x = partnerActor->curPos.x;
2300 partnerActor->homePos.z = partnerActor->curPos.z;
2301 playerActor->homePos.x = playerActor->curPos.x;
2302 playerActor->homePos.z = playerActor->curPos.z;
2304 battleStatus->flags1 &= ~BS_FLAGS1_PLAYER_IN_BACK;
2305 }
2306 break;
2307 }
2308
2309 switch (gBattleSubState) {
2312 playerActor->flags &= ~ACTOR_FLAG_USING_IDLE_ANIM;
2313 playerActor->flags |= ACTOR_FLAG_SHOW_STATUS_ICONS;
2314 if (partnerActor != NULL) {
2315 partnerActor->flags |= ACTOR_FLAG_USING_IDLE_ANIM;
2316 partnerActor->flags |= ACTOR_FLAG_SHOW_STATUS_ICONS;
2317 }
2324 break;
2325 }
2326
2327 entryIdx = 0;
2328 initialPos = 2;
2329 if (battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_MAIN] < 0) {
2330 battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_MAIN] = 0;
2331 }
2332
2333 // strategies menu category
2335 BattleMenu_OptionEnabled[entryIdx] = TRUE;
2339 BattleMenu_TitleMessages[entryIdx] = MSG_Menus_EndTraining_Centered;
2340 }
2341 battle_menu_isMessageDisabled[entryIdx] = 0;
2342 if (!(battleStatus->enabledMenusFlags & BTL_MENU_ENABLED_STRATEGIES)) {
2344 BattleMenu_OptionEnabled[entryIdx] = FALSE;
2346 }
2348 initialPos = entryIdx;
2349 }
2350 entryIdx++;
2351
2352 // items menu category
2353 if (battleStatus->menuStatus[0] >= 0) {
2356 BattleMenu_OptionEnabled[entryIdx] = TRUE;
2358
2359 if(battleStatus->menuStatus[0] == 0) {
2361 BattleMenu_OptionEnabled[entryIdx] = FALSE;
2363 }
2364
2365 if (!(battleStatus->enabledMenusFlags & BTL_MENU_ENABLED_ITEMS)) {
2367 BattleMenu_OptionEnabled[entryIdx] = FALSE;
2369 }
2370
2371 if (battleStatus->itemLossTurns >= 0) {
2373 BattleMenu_OptionEnabled[entryIdx] = FALSE;
2375 }
2376
2378 initialPos = entryIdx;
2379 }
2380
2381 entryIdx++;
2382 }
2383
2384 // jump menu category
2387 BattleMenu_OptionEnabled[entryIdx] = TRUE;
2389
2390 if (battleStatus->menuStatus[1] <= 0) {
2392 BattleMenu_OptionEnabled[entryIdx] = FALSE;
2394 }
2395 if (!(battleStatus->enabledMenusFlags & BTL_MENU_ENABLED_JUMP)) {
2397 BattleMenu_OptionEnabled[entryIdx] = FALSE;
2399 }
2400 if (battleStatus->jumpLossTurns >= 0) {
2402 BattleMenu_OptionEnabled[entryIdx] = FALSE;
2404 }
2406 initialPos = entryIdx;
2407 }
2408 entryIdx++;
2409
2410 // hammer menu category
2411 if (playerData->hammerLevel >= 0) {
2414 BattleMenu_OptionEnabled[entryIdx] = TRUE;
2416 if (battleStatus->menuStatus[2] <= 0) {
2418 BattleMenu_OptionEnabled[entryIdx] = FALSE;
2420 }
2421 if (!(battleStatus->enabledMenusFlags & BTL_MENU_ENABLED_SMASH)) {
2423 BattleMenu_OptionEnabled[entryIdx] = FALSE;
2425 }
2426 if (battleStatus->hammerLossTurns >= 0) {
2428 BattleMenu_OptionEnabled[entryIdx] = FALSE;
2430 }
2432 initialPos = entryIdx;
2433 }
2434 entryIdx++;
2435 }
2436
2437 // star powers menu category
2438 if (playerData->maxStarPower != 0) {
2441 BattleMenu_OptionEnabled[entryIdx] = TRUE;
2443 battle_menu_isMessageDisabled[entryIdx] = 0;
2444 if (!(battleStatus->enabledMenusFlags & BTL_MENU_ENABLED_STAR_POWERS)) {
2446 BattleMenu_OptionEnabled[entryIdx] = FALSE;
2448 }
2450 initialPos = entryIdx;
2451 }
2452 entryIdx++;
2453 }
2454
2455 BattleMenu_NumOptions = entryIdx;
2456 D_802AD0A8 = 0;
2457 D_802AD0B0 = initialPos;
2458 D_802AD100 = 2 - initialPos;
2459 if (can_switch_to_partner()) {
2461 } else {
2463 }
2465 D_802ACC60 = 8;
2468 break;
2470 if (battleStatus->hustleTurns != 0) {
2471 set_actor_anim(ACTOR_PLAYER, 0, ANIM_Mario1_ThinkingRun);
2472 } else {
2474 }
2475 submenuResult = btl_main_menu_update();
2476 if (BattleMenu_SwapDelay != 0) {
2479 if (can_switch_to_partner() && battleStatus->hustleTurns != 1) {
2484 } else if (partnerActor != NULL && !(partnerActor->flags & BS_FLAGS1_YIELD_TURN) && battleStatus->hustleTurns != 1) {
2487 }
2488 break;
2489 }
2490
2491 if (D_802ACC60 != 0) {
2492 D_802ACC60--;
2493 break;
2494 }
2495
2496 if (submenuResult == 0) {
2497 break;
2498 }
2499
2500 set_actor_anim(ACTOR_PLAYER, 0, ANIM_Mario1_Walk);
2501 battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_MAIN] = battleStatus->curSubmenu = battle_menu_submenuIDs[submenuResult - 1];
2502 for (i = 0; i < ARRAY_COUNT(battleStatus->submenuMoves); i++) {
2503 battleStatus->submenuMoves[i] = 0;
2504 battleStatus->submenuIcons[i] = 0;
2505 battleStatus->submenuStatus[i] = 0;
2506 }
2507
2508 switch (battleStatus->curSubmenu) {
2511 battleStatus->submenuIcons[0] = ITEM_PARTNER_ATTACK;
2512 battleStatus->submenuStatus[0] = 1;
2513 for (i = 0; i < ARRAY_COUNT(playerData->invItems); i++) {
2514 if (playerData->invItems[i] == ITEM_NONE) {
2515 continue;
2516 }
2517 itemData = &gItemTable[playerData->invItems[i]];
2518
2519 battleStatus->moveCategory = BTL_MENU_TYPE_ITEMS;
2520 battleStatus->moveArgument = playerData->invItems[i];
2521 battleStatus->curTargetListFlags = itemData->targetFlags;
2522 create_current_pos_target_list(playerActor);
2523 }
2524 entryIdx = 1;
2525 for (i = 0; i < ARRAY_COUNT(playerData->equippedBadges); i++) {
2526 if (playerData->equippedBadges[i] != 0) {
2527 s32 moveID = gItemTable[playerData->equippedBadges[i]].moveID;
2528 moveData = &gMoveTable[moveID];
2529 if (moveData->category == BattleMenu_CategoryForSubmenu[battleStatus->curSubmenu]) {
2530 s32 cost = moveData->costFP;
2531 battleStatus->submenuMoves[entryIdx] = moveID;
2532 battleStatus->submenuIcons[entryIdx] = playerData->equippedBadges[i];
2533 battleStatus->submenuStatus[entryIdx] = 1;
2534
2536 cost -= 2 * player_team_is_ability_active(playerActor, ABILITY_FLOWER_FANATIC);
2537
2538 if (playerData->curFP < cost) {
2539 battleStatus->submenuStatus[entryIdx] = 0;
2540 }
2541 entryIdx++;
2542 }
2543 }
2544 }
2545 battleStatus->submenuMoveCount = entryIdx;
2546 if (entryIdx == 1) {
2547 battleStatus->submenuMoveCount = 0;
2548 }
2549 break;
2552 if (battleStatus->submenuMoveCount == 1) {
2553 battleStatus->submenuMoveCount = 0;
2554 }
2555 if (battleStatus->actionCommandMode == 2) {
2556 battleStatus->submenuMoveCount = 0;
2557 }
2558 break;
2559 case BTL_MENU_TYPE_JUMP:
2561 if (battleStatus->submenuMoveCount == 1) {
2562 battleStatus->submenuMoveCount = 0;
2563 }
2564 if (battleStatus->actionCommandMode == 2) {
2565 battleStatus->submenuMoveCount = 0;
2566 }
2567 break;
2569 battleStatus->submenuMoves[0] = MOVE_FOCUS;
2570 battleStatus->submenuIcons[0] = ITEM_PARTNER_ATTACK;
2571 battleStatus->submenuStatus[0] = 1;
2572 entryIdx = 1;
2573 initialPos = 8;
2574 for (i = 0; i < playerData->maxStarPower; i++) {
2575 moveData = &gMoveTable[MOVE_REFRESH + i];
2576 battleStatus->submenuMoves[entryIdx] = MOVE_REFRESH + i;
2577 battleStatus->submenuIcons[entryIdx] = 0;
2579 battleStatus->moveArgument = MOVE_REFRESH + i;
2580 battleStatus->curTargetListFlags = moveData->flags;
2581 create_current_pos_target_list(playerActor);
2582 battleStatus->submenuStatus[entryIdx] = 1;
2583 if (playerActor->targetListLength == 0) {
2584 battleStatus->submenuStatus[entryIdx] = -2;
2585 }
2586 if (playerData->starPower / SP_PER_BAR < moveData->costFP) {
2587 battleStatus->submenuStatus[entryIdx] = 0;
2588 }
2590 battleStatus->submenuStatus[entryIdx] = -1;
2591 }
2592 entryIdx++;
2593 }
2594 starBeamLevel = playerData->starBeamLevel;
2595 if (starBeamLevel == 1) {
2596 moveData = &gMoveTable[MOVE_STAR_BEAM];
2597 battleStatus->submenuMoves[entryIdx] = MOVE_STAR_BEAM;
2598 battleStatus->submenuIcons[entryIdx] = 0;
2600 battleStatus->moveArgument = MOVE_REFRESH + i;
2601 battleStatus->curTargetListFlags = moveData->flags;
2602 create_current_pos_target_list(playerActor);
2603 battleStatus->submenuStatus[entryIdx] = starBeamLevel;
2604 if (playerActor->targetListLength == 0) {
2605 battleStatus->submenuStatus[entryIdx] = -2;
2606 }
2607 if (playerData->starPower / SP_PER_BAR < moveData->costFP) {
2608 battleStatus->submenuStatus[entryIdx] = 0;
2609 }
2611 battleStatus->submenuStatus[entryIdx] = -1;
2612 }
2613 entryIdx++;
2614 }
2615 if (playerData->starBeamLevel == 2) {
2616 moveData = &gMoveTable[MOVE_PEACH_BEAM];
2617 battleStatus->submenuMoves[entryIdx] = MOVE_PEACH_BEAM;
2618 battleStatus->submenuIcons[entryIdx] = 0;
2620 battleStatus->moveArgument = MOVE_REFRESH + i;
2621 battleStatus->curTargetListFlags = moveData->flags;
2622 create_current_pos_target_list(playerActor);
2623 battleStatus->submenuStatus[entryIdx] = 1;
2624 if (playerActor->targetListLength == 0) {
2625 battleStatus->submenuStatus[entryIdx] = -2;
2626 }
2627 if (playerData->starPower / SP_PER_BAR < moveData->costFP) {
2628 battleStatus->submenuStatus[entryIdx] = 0;
2629 }
2631 battleStatus->submenuStatus[entryIdx] = -1;
2632 }
2633 entryIdx++;
2634 }
2635 battleStatus->submenuMoveCount = entryIdx;
2636 break;
2637 }
2638
2639 currentSubmenu = battleStatus->curSubmenu;
2640 if (currentSubmenu == BTL_MENU_TYPE_STAR_POWERS) {
2644 break;
2645 } else if (currentSubmenu == BTL_MENU_TYPE_STRATEGIES) {
2650 break;
2651 } else {
2653 battleStatus->moveCategory = currentSubmenu;
2654 battleStatus->moveArgument = 0;
2655 battleStatus->selectedMoveID = 0;
2657 break;
2658 }
2659 } else {
2660 if (battleStatus->submenuMoveCount == 0) {
2661 if (currentSubmenu != BTL_MENU_TYPE_ITEMS) {
2663 break;
2664 } else {
2668 break;
2669 }
2670 }
2671
2672 initialPos = 0;
2673 if (currentSubmenu == BTL_MENU_TYPE_JUMP) {
2674 if (battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_JUMP] < 0) {
2675 battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_JUMP] = 0;
2676 }
2677 initialPos = battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_JUMP];
2678 }
2679 if (battleStatus->curSubmenu == BTL_MENU_TYPE_SMASH) {
2680 if (battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_SMASH] < 0) {
2682 }
2683 initialPos = battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_SMASH];
2684 }
2685 if (battleStatus->curSubmenu == BTL_MENU_TYPE_ITEMS) {
2686 if (battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_ITEMS] < 0) {
2688 }
2689 initialPos = battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_ITEMS];
2690 }
2691
2692 for (i = 0; i < battleStatus->submenuMoveCount; i++) {
2693 moveData = &gMoveTable[battleStatus->submenuMoves[i]];
2694 itemData = &gItemTable[battleStatus->submenuIcons[i]];
2695 hudScriptPair = &gItemHudScripts[itemData->hudElemID];
2696
2698 if (battleStatus->submenuStatus[i] == 0) {
2700 }
2701 if (battleStatus->submenuStatus[i] == -1) {
2702 battleStatus->submenuStatus[i] = 0;
2704 }
2705 if (battleStatus->submenuStatus[i] == -2) {
2706 battleStatus->submenuStatus[i] = 0;
2708 }
2709 if (battleStatus->submenuStatus[i] == -3) {
2710 battleStatus->submenuStatus[i] = 0;
2712 }
2713 battle_menu_moveOptionIconScripts[i] = hudScriptPair->enabled;
2714 if (battleStatus->submenuStatus[i] == 0) {
2715 battle_menu_moveOptionIconScripts[i] = hudScriptPair->disabled;
2716 }
2717
2723
2727 }
2731 }
2732
2734 BattleMenu_Moves_OptionEnabled[i] = battleStatus->submenuStatus[i];
2735 battle_menu_moveOptionNames[i] = moveData->nameMsg;
2737
2738 }
2740 D_802AD4A8 = initialPos;
2742 func_802A2684();
2744 break;
2745 }
2746 break;
2748 submenuResult = btl_submenu_moves_update();
2749 if (submenuResult == -1) {
2751 } else if (submenuResult == 0) {
2752 } else if (submenuResult == 255) {
2753 func_802A1050();
2754 D_802ACC60 = 8;
2759 } else {
2760 battleStatus->unk_49 = BattleMenu_Moves_OptionIndices[submenuResult - 1];
2761 battleStatus->selectedMoveID = battleStatus->submenuMoves[battleStatus->unk_49];
2762 if (battleStatus->curSubmenu == BTL_MENU_TYPE_JUMP) {
2764 }
2765 if (battleStatus->curSubmenu == BTL_MENU_TYPE_SMASH) {
2767 }
2768 currentSubmenu2 = battleStatus->curSubmenu;
2769 if (battleStatus->curSubmenu == BTL_MENU_TYPE_ITEMS) {
2771 if (battleStatus->curSubmenu == currentSubmenu2) {
2775 break;
2776 }
2777 }
2778 func_802A27D0();
2779 func_802A1030();
2781 }
2782 break;
2784 submenuResult = btl_submenu_moves_update();
2785 if ((battleStatus->curButtonsPressed & BUTTON_B) && submenuResult == 0) {
2786 func_802A2AB8();
2787 func_802A1098();
2789 break;
2790 }
2791 if (btl_main_menu_update() == 0) {
2792 break;
2793 }
2796 battleStatus->selectedMoveID = battleStatus->submenuMoves[battleStatus->unk_49];
2797 battleStatus->curTargetListFlags = gMoveTable[battleStatus->submenuMoves[battleStatus->unk_49]].flags;
2798 currentSubmenu = battleStatus->curSubmenu;
2799 switch (currentSubmenu) {
2800 case BTL_MENU_TYPE_JUMP:
2801 battleStatus->moveCategory = BTL_MENU_TYPE_JUMP;
2802 battleStatus->moveArgument = playerData->bootsLevel;
2804 break;
2806 battleStatus->moveCategory = BTL_MENU_TYPE_SMASH;
2807 battleStatus->moveArgument = playerData->hammerLevel;
2809 break;
2813 battleStatus->moveCategory = BTL_MENU_TYPE_DEFEND;
2815 break;
2816 }
2817 break;
2820 if (btl_main_menu_update() == 0) {
2821 break;
2822 }
2824 break;
2826 func_802A2AB8();
2827 func_802A1098();
2829 break;
2831 func_802A27E4();
2833 break;
2835 if (btl_submenu_moves_update() != -1) {
2837 }
2838 break;
2842 } else {
2844 }
2845 ShowingErrorMessage = TRUE;
2847 break;
2849 if (btl_is_popup_displayed()) {
2850 break;
2851 }
2852 ShowingErrorMessage = FALSE;
2853 D_802ACC60 = 0;
2856 break;
2858 func_802A1030();
2860 break;
2862 submenuResult = btl_main_menu_update();
2863 if ((battleStatus->curButtonsPressed & BUTTON_B) && submenuResult == 0) {
2864 func_802A1078();
2866 } else if (submenuResult != 0) {
2869 switch (battleStatus->curSubmenu) {
2870 case BTL_MENU_TYPE_JUMP:
2871 battleStatus->moveCategory = BTL_MENU_TYPE_JUMP;
2872 battleStatus->moveArgument = playerData->bootsLevel;
2873 battleStatus->selectedMoveID = playerData->bootsLevel + MOVE_JUMP1;
2874 battleStatus->curTargetListFlags = gMoveTable[battleStatus->selectedMoveID].flags;
2876 break;
2878 battleStatus->moveCategory = BTL_MENU_TYPE_SMASH;
2879 battleStatus->moveArgument = playerData->hammerLevel;
2880 battleStatus->selectedMoveID = playerData->hammerLevel + MOVE_HAMMER1;
2881 battleStatus->curTargetListFlags = gMoveTable[battleStatus->selectedMoveID].flags;
2883 break;
2884 default:
2885 goto CASE_C; // TODO find better match
2886 }
2887 }
2888 break;
2889 CASE_C:
2891 if (btl_main_menu_update() == 0) {
2892 break;
2893 }
2894 D_802ACC60 = 8;
2897 break;
2899 func_802A1078();
2901 break;
2904 break;
2906 if (battleStatus->selectedMoveID == MOVE_DOUBLE_DIP) {
2907 battleStatus->itemUsesLeft = 2;
2908 }
2909 if (battleStatus->selectedMoveID == MOVE_TRIPLE_DIP) {
2910 battleStatus->itemUsesLeft = 3;
2911 }
2912 entryIdx = 0;
2913 for (i = 0; i < ARRAY_COUNT(playerData->invItems); i++) {
2914 if (playerData->invItems[i] == ITEM_NONE) {
2915 continue;
2916 }
2917 itemData = &gItemTable[playerData->invItems[i]];
2918 hudScriptPair = &gItemHudScripts[itemData->hudElemID];
2919 if (!(itemData->typeFlags & ITEM_TYPE_FLAG_BATTLE_USABLE)) {
2920 continue;
2921 }
2922 battleStatus->moveCategory = BTL_MENU_TYPE_ITEMS;
2923 battleStatus->moveArgument = playerData->invItems[i];
2924 battleStatus->curTargetListFlags = itemData->targetFlags;
2925 create_current_pos_target_list(playerActor);
2926 popup->ptrIcon[entryIdx] = hudScriptPair->enabled;
2927 popup->userIndex[entryIdx] = playerData->invItems[i];
2928 popup->enabled[entryIdx] = TRUE;
2929 popup->nameMsg[entryIdx] = itemData->nameMsg;
2930 popup->descMsg[entryIdx] = itemData->shortDescMsg;
2931 if (playerActor->targetListLength == 0) {
2932 popup->ptrIcon[entryIdx] = hudScriptPair->disabled;
2933 popup->enabled[entryIdx] = 0;
2934 }
2935 entryIdx++;
2936 }
2937 popup->dipMode = 0;
2938 popup->titleNumber = 0;
2939 if (battleStatus->selectedMoveID == MOVE_DOUBLE_DIP) {
2940 popup->dipMode = 1;
2941 popup->titleNumber = battleStatus->itemUsesLeft;
2942 }
2943 if (battleStatus->selectedMoveID == MOVE_TRIPLE_DIP) {
2944 popup->dipMode = 2;
2945 popup->titleNumber = battleStatus->itemUsesLeft;
2946 }
2947 if (battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_DIP] < 0) {
2948 battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_DIP] = 0;
2949 }
2951 popup->numEntries = entryIdx;
2952 initialPos = battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_DIP];
2953 popup->initialPos = initialPos;
2955 func_800F52BC();
2957 break;
2959 if (popup->result != POPUP_RESULT_CHOOSING) {
2960 if (popup->result == POPUP_RESULT_CANCEL) {
2961 func_802A2910();
2962 battleStatus->selectedMoveID = 0;
2963 battleStatus->itemUsesLeft = 0;
2967 } else {
2970 battleStatus->unk_1AA = popup->userIndex[popup->result - 1];
2971 battleStatus->moveCategory = BTL_MENU_TYPE_ITEMS;
2972 battleStatus->moveArgument = battleStatus->unk_1AA;
2974 battleStatus->curAttackElement = 0;
2975 battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_DIP] = popup->result - 1;
2977 func_802A27D0();
2978 func_802A1030();
2980 }
2981 }
2982 break;
2984 if ((battleStatus->curButtonsPressed & BUTTON_B) && popup->result == POPUP_RESULT_CHOOSING) {
2985 func_800F16CC();
2986 func_802A2C58();
2987 func_802A1098();
2988 battleStatus->selectedMoveID = 0;
2990 } else {
2992 if (btl_main_menu_update()) {
2994 }
2995 }
2996 break;
2999 if (btl_main_menu_update() != 0) {
3001 }
3002 break;
3004 func_800F16CC();
3005 func_802A2C58();
3006 func_802A1098();
3009 break;
3012 func_802A27E4();
3014 break;
3016 entryIdx = 0;
3017 for (i = 0; i < ARRAY_COUNT(playerData->invItems); i++) {
3018 if (playerData->invItems[i] == ITEM_NONE) {
3019 continue;
3020 }
3021 itemData = &gItemTable[playerData->invItems[i]];
3022 hudScriptPair = &gItemHudScripts[itemData->hudElemID];
3023 if (!(itemData->typeFlags & ITEM_TYPE_FLAG_BATTLE_USABLE)) {
3024 continue;
3025 }
3026 battleStatus->moveCategory = BTL_MENU_TYPE_ITEMS;
3027 battleStatus->moveArgument = playerData->invItems[i];
3028 battleStatus->curTargetListFlags = itemData->targetFlags;
3029 create_current_pos_target_list(playerActor);
3030 popup->ptrIcon[entryIdx] = hudScriptPair->enabled;
3031
3032 popup->userIndex[entryIdx] = playerData->invItems[i];
3033 popup->enabled[entryIdx] = 1;
3034 popup->nameMsg[entryIdx] = itemData->nameMsg;
3035 popup->descMsg[entryIdx] = itemData->shortDescMsg;
3036 if (playerActor->targetListLength == 0) {
3037 popup->ptrIcon[entryIdx] = hudScriptPair->disabled;
3038 popup->enabled[entryIdx] = 0;
3039 }
3040 entryIdx++;
3041 }
3042 if (battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_DIP] < 0) {
3043 battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_DIP] = 0;
3044 }
3045 initialPos = battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_DIP];
3047 popup->numEntries = entryIdx;
3048 popup->dipMode = 0;
3049 popup->titleNumber = 0;
3050 popup->initialPos = initialPos;
3052 func_800F52BC();
3054 break;
3056 if (popup->result != POPUP_RESULT_CHOOSING) {
3057 if (popup->result == POPUP_RESULT_CANCEL) {
3058 func_802A1050();
3059 D_802ACC60 = 8;
3064 } else {
3067 battleStatus->unk_1AA = popup->userIndex[popup->result - 1];
3068 battleStatus->moveCategory = BTL_MENU_TYPE_ITEMS;
3069 battleStatus->moveArgument = battleStatus->unk_1AA;
3070 battleStatus->selectedMoveID = MOVE_ITEMS;
3072 battleStatus->curAttackElement = 0;
3073 battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_DIP] = popup->result - 1;
3075 func_802A1030();
3077 }
3078 }
3079 break;
3081 if ((battleStatus->curButtonsPressed & BUTTON_B) && popup->result == POPUP_RESULT_CHOOSING) {
3082 func_800F16CC();
3083 func_802A1098();
3085 } else {
3086 if (btl_main_menu_update() != 0) {
3088 }
3089 }
3090 break;
3092 if (btl_main_menu_update() != 0) {
3094 }
3095 break;
3097 func_800F16CC();
3098 func_802A1098();
3100 break;
3104 break;
3106 for (i = 0; i < battleStatus->submenuMoveCount; i++) {
3107 moveData = &gMoveTable[battleStatus->submenuMoves[i]];
3109
3110 if (battleStatus->submenuStatus[i] == 0) {
3112 }
3113
3114 if (battleStatus->submenuStatus[i] == -1) {
3115 battleStatus->submenuStatus[i] = 0;
3117 }
3118 if (battleStatus->submenuStatus[i] == -2) {
3119 battleStatus->submenuStatus[i] = 0;
3121 }
3122 if (!(battleStatus->enabledStarPowersFlags & (1 << i))) {
3123 battleStatus->submenuStatus[i] = 0;
3125 }
3126
3127 battle_menu_moveOptionIconScripts[i] = battle_menu_StarPowerMovesHudScripts[2 * STAR_POWER_INDEX(battleStatus->submenuMoves[i]) + 0];
3128 if (battleStatus->submenuStatus[i] == 0) {
3129 battle_menu_moveOptionIconScripts[i] = battle_menu_StarPowerMovesHudScripts[2 * STAR_POWER_INDEX(battleStatus->submenuMoves[i]) + 1];
3130 }
3135 BattleMenu_Moves_OptionEnabled[i] = battleStatus->submenuStatus[i];
3136 battle_menu_moveOptionNames[i] = moveData->nameMsg;
3140 }
3141 if (battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_STAR_POWER] < 0) {
3143 }
3144 initialPos = battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_STAR_POWER];
3146 D_802AD4A8 = initialPos;
3148 func_802A2684();
3150 break;
3152 submenuResult = btl_submenu_moves_update();
3153 if (submenuResult == -1) {
3155 } else if (submenuResult == 0) {
3156 } else if (submenuResult == 255) {
3157 func_802A1050();
3158 D_802ACC60 = 8;
3163 } else {
3164 battleStatus->unk_49 = BattleMenu_Moves_OptionIndices[submenuResult - 1];
3166 func_802A27D0();
3167 func_802A1030();
3169 }
3170 break;
3172 submenuResult = btl_submenu_moves_update();
3173 if ((battleStatus->curButtonsPressed & BUTTON_B) && submenuResult == 0) {
3174 func_802A2AB8();
3175 func_802A1098();
3177 } else if (btl_main_menu_update() != 0) {
3181 battleStatus->selectedMoveID = battleStatus->submenuMoves[battleStatus->unk_49];
3182 battleStatus->curTargetListFlags = gMoveTable[battleStatus->submenuMoves[battleStatus->unk_49]].flags;
3183 battleStatus->moveArgument = battleStatus->unk_49;
3184 if (playerData->starBeamLevel == 2 && battleStatus->moveArgument == 8) {
3185 battleStatus->moveArgument++;
3186 }
3188 }
3189 break;
3192 if (btl_main_menu_update() != 0) {
3194 }
3195 break;
3197 func_802A2AB8();
3198 func_802A1098();
3200 break;
3202 func_802A27E4();
3204 break;
3206 if (btl_submenu_moves_update() != -1) {
3208 }
3209 break;
3211 if (!can_switch_to_player()) {
3212 battleStatus->itemUsesLeft = 1;
3214 } else {
3215 entryIdx = 0;
3216 for (i = 0; i < ARRAY_COUNT(playerData->invItems); i++) {
3217 if (playerData->invItems[i] == ITEM_NONE) {
3218 continue;
3219 }
3220 itemData = &gItemTable[playerData->invItems[i]];
3221 hudScriptPair = &gItemHudScripts[itemData->hudElemID];
3222 if (!(itemData->typeFlags & ITEM_TYPE_FLAG_BATTLE_USABLE)) {
3223 continue;
3224 }
3225
3226 battleStatus->moveCategory = BTL_MENU_TYPE_ITEMS;
3227 battleStatus->moveArgument = playerData->invItems[i];
3228 battleStatus->curTargetListFlags = itemData->targetFlags;
3229 create_current_pos_target_list(playerActor);
3230 popup->ptrIcon[entryIdx] = hudScriptPair->enabled;
3231 popup->userIndex[entryIdx] = playerData->invItems[i];
3232 popup->enabled[entryIdx] = TRUE;
3233 popup->nameMsg[entryIdx] = itemData->nameMsg;
3234 popup->descMsg[entryIdx] = itemData->shortDescMsg;
3235 if (playerActor->targetListLength == 0) {
3236 popup->ptrIcon[entryIdx] = hudScriptPair->disabled;
3237 popup->enabled[entryIdx] = FALSE;
3238 }
3239 entryIdx++;
3240 }
3241 if (entryIdx == 0) {
3242 battleStatus->itemUsesLeft = 1;
3244 } else {
3246 if (battleStatus->selectedMoveID == MOVE_DOUBLE_DIP) {
3248 popup->dipMode = 1;
3249 popup->titleNumber = battleStatus->itemUsesLeft;
3250 }
3251 if (battleStatus->selectedMoveID == MOVE_TRIPLE_DIP) {
3253 popup->dipMode = 2;
3254 popup->titleNumber = battleStatus->itemUsesLeft;
3255 }
3256 if (battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_DIP] < 0) {
3257 battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_DIP] = 0;
3258 }
3259 popup->numEntries = entryIdx;
3260 initialPos = battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_DIP];
3261 popup->initialPos = initialPos;
3263 func_800F52BC();
3265 }
3266 }
3267 break;
3269 if (popup->result != POPUP_RESULT_CHOOSING) {
3270 if (popup->result == POPUP_RESULT_CANCEL) {
3271 battleStatus->itemUsesLeft = 1;
3273 } else {
3276 battleStatus->unk_1AA = popup->userIndex[popup->result - 1];
3277 battleStatus->moveCategory = BTL_MENU_TYPE_ITEMS;
3278 battleStatus->moveArgument = battleStatus->unk_1AA;
3280 battleStatus->curAttackElement = 0;
3281 battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_DIP] = popup->result - 1;
3283 D_802ACC60 = 5;
3285 }
3286 }
3287 break;
3289 if (D_802ACC60 != 0) {
3290 D_802ACC60--;
3291 } else {
3293 }
3294 break;
3296 if (D_802ACC60 != 0) {
3297 D_802ACC60--;
3298 } else {
3300 }
3301 break;
3303 func_800F16CC();
3304 D_802ACC60 = 5;
3306 break;
3309 break;
3311 if (playerData->bootsLevel >= 0) {
3312 battleStatus->curTargetListFlags = gMoveTable[MOVE_BERSERKER_JUMP].flags;
3313 create_current_pos_target_list(playerActor);
3314 jumpTargetCount = playerActor->targetListLength;
3315 } else {
3316 jumpTargetCount = 0;
3317 }
3318
3319 if (playerData->hammerLevel >= 0) {
3320 battleStatus->curTargetListFlags = gMoveTable[MOVE_BERSERKER_HAMMER].flags;
3321 create_current_pos_target_list(playerActor);
3322 hammerTargetCount = playerActor->targetListLength;
3323 } else {
3324 hammerTargetCount = 0;
3325 }
3326
3327 if (jumpTargetCount <= 0 && hammerTargetCount <= 0) {
3328 battleStatus->moveCategory = BTL_MENU_TYPE_DO_NOTHING;
3329 battleStatus->waitForState = BATTLE_STATE_0;
3331 } else {
3332 jumpChance = 50;
3333 if (jumpTargetCount <= 0) {
3334 jumpChance = 0;
3335 }
3336 if (hammerTargetCount <= 0) {
3337 jumpChance = 101;
3338 }
3339 if (rand_int(100) < jumpChance) {
3340 battleStatus->selectedMoveID = MOVE_BERSERKER_JUMP;
3341 battleStatus->moveCategory = BTL_MENU_TYPE_JUMP;
3342 battleStatus->curTargetListFlags = gMoveTable[MOVE_BERSERKER_JUMP].flags;
3343 battleStatus->moveArgument = playerData->bootsLevel;
3344 create_current_pos_target_list(playerActor);
3345 } else {
3346 battleStatus->selectedMoveID = MOVE_BERSERKER_HAMMER;
3347 battleStatus->moveCategory = BTL_MENU_TYPE_SMASH;
3348 battleStatus->curTargetListFlags = gMoveTable[MOVE_BERSERKER_HAMMER].flags;
3349 battleStatus->moveArgument = playerData->hammerLevel;
3350 create_current_pos_target_list(playerActor);
3351 }
3353 }
3354 break;
3356 entryIdx = 0;
3358
3359 // add 'Change Member' command
3360 if (battleStatus->changePartnerAllowed >= 0) {
3363 D_802AD640[entryIdx] = battle_menu_PartnerHudScripts[playerData->curPartner];
3364 D_802AD690[entryIdx] = 1;
3365 D_802AD6C0[entryIdx] = MSG_Menus_Action_ChangePartner;
3366 if (battleStatus->changePartnerAllowed <= 0) {
3368 D_802AD690[entryIdx] = 0;
3369 D_802AD6A8[entryIdx] = 0;
3370 }
3371 entryIdx++;
3372 }
3373
3374 // add 'Do Nothing' command
3377 D_802AD690[entryIdx] = 1;
3379 D_802AD6C0[entryIdx] = MSG_Menus_Action_DoNothing;
3380 entryIdx++;
3381
3382 // add 'Run Away' command
3385 D_802AD690[entryIdx] = 1;
3387 D_802AD6C0[entryIdx] = MSG_Menus_Action_RunAway;
3390 D_802AD690[entryIdx] = 0;
3391 D_802AD6A8[entryIdx] = 1;
3392 }
3393 entryIdx++;
3394
3395 if (battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_STRATEGY] < 0) {
3397 }
3398 initialPos = battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_STRATEGY];
3399 D_802AD66C = entryIdx;
3400 StratsMenuLastPos = initialPos;
3401 func_802A45D8();
3403 break;
3405 submenuResult = btl_update_strats_menu();
3406 if (submenuResult == -1) {
3408 } else if (submenuResult == 0) {
3409 } else if (submenuResult == 255) {
3410 func_802A1050();
3411 D_802ACC60 = 8;
3416 } else {
3417 battleStatus->curSubmenu = D_802AD678[submenuResult - 1];
3418 battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_STRATEGY] = submenuResult - 1;
3419 if (battleStatus->curSubmenu == 5) { // change partner
3423 } else {
3424 func_802A4718();
3425 func_802A1030();
3427 }
3428 }
3429 break;
3431 submenuResult = btl_update_strats_menu();
3432 if ((battleStatus->curButtonsPressed & BUTTON_B) && submenuResult == 0) {
3433 func_802A48FC();
3434 func_802A1098();
3436 } else if (btl_main_menu_update() != 0) {
3439 switch (battleStatus->curSubmenu) {
3440 case 3:
3443 battleStatus->moveCategory = BTL_MENU_TYPE_RUN_AWAY;
3444 battleStatus->selectedMoveID = MOVE_UNUSED_39;
3446 break;
3447 case 9:
3448 battleStatus->hustleTurns = 0;
3449 gBattleStatus.flags1 &= ~BS_FLAGS1_HUSTLED;
3453 break;
3454 case 4:
3457 battleStatus->selectedMoveID = MOVE_UNUSED_DEFEND_PLUS;
3458 battleStatus->moveCategory = BTL_MENU_TYPE_DEFEND;
3460 break;
3461 case 10:
3465 break;
3466 }
3467 }
3468 break;
3471 if (btl_main_menu_update() != 0) {
3472 D_802ACC60 = 8;
3475 }
3476 break;
3478 func_802A48FC();
3479 func_802A1098();
3481 break;
3483 func_802A472C();
3485 break;
3487 if (btl_update_strats_menu() != -1) {
3489 }
3490 break;
3492 entryIdx = 0;
3493 for (i = 1; i < ARRAY_COUNT(playerData->partners); i++) {
3494 s32 partnerId = PartnerIDFromMenuIndex[i];
3495 if (playerData->partners[partnerId].enabled) {
3496 prop = &gPartnerPopupProperties[partnerId];
3497 popup->ptrIcon[entryIdx] = battle_menu_PartnerHudScripts[partnerId];
3498 popup->userIndex[entryIdx] = partnerId;
3499 popup->enabled[entryIdx] = 1;
3500 popup->nameMsg[entryIdx] = prop->nameMsg;
3501 popup->descMsg[entryIdx] = prop->battleDescMsg;
3502 popup->value[entryIdx] = playerData->partners[partnerId].level;
3503 if (playerData->curPartner == partnerId) {
3504 popup->enabled[entryIdx] = 0;
3505 popup->ptrIcon[entryIdx] = battle_menu_DisabledPartnerHudScripts[partnerId];
3506 }
3507 entryIdx++;
3508 }
3509 }
3510 if (battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_PARTNER] < 0) {
3512 }
3514 popup->numEntries = entryIdx;
3515 popup->initialPos = MenuIndexFromPartnerID[playerData->curPartner] - 1;
3516 popup->dipMode = 0;
3517 popup->titleNumber = 0;
3519 func_800F52BC();
3521 break;
3523 if (popup->result == POPUP_RESULT_INVALID) {
3525 } else if (popup->result != POPUP_RESULT_CHOOSING) {
3526 if (popup->result == POPUP_RESULT_CANCEL) {
3527 func_802A47E0();
3531 } else {
3534 battleStatus->unk_1AC = popup->userIndex[popup->result - 1];
3536 battleStatus->selectedMoveID = MOVE_UNUSED_37;
3537 battleStatus->curTargetListFlags = TARGET_FLAG_2;
3538 battleStatus->moveArgument = battleStatus->unk_1AC;
3539 battleStatus->lastPlayerMenuSelection[BTL_MENU_IDX_PARTNER] = popup->result - 1;
3541 func_802A4718();
3542 func_802A1030();
3544 }
3545 }
3546 break;
3548 if ((battleStatus->curButtonsPressed & BUTTON_B) && popup->result == POPUP_RESULT_CHOOSING) {
3549 func_800F16CC();
3550 func_802A4A10();
3551 func_802A1098();
3553 } else {
3555 if (btl_main_menu_update() != 0) {
3559 }
3560 }
3561 break;
3564 if (btl_main_menu_update() != 0) {
3566 }
3567 break;
3569 func_800F16CC();
3570 func_802A4A10();
3571 func_802A1098();
3573 break;
3576 func_802A472C();
3578 break;
3582 if (popup->result != POPUP_RESULT_INVALID) {
3586 }
3587 break;
3588 }
3589}
PartnerPopupProperties gPartnerPopupProperties[]
Definition 5B320.c:331
@ ACTION_COMMAND_MODE_TUTORIAL
Definition action_cmd.h:40
void create_battle_popup_menu(PopupMenu *popup)
void func_802A2684(void)
void btl_main_menu_destroy(void)
HudScript * battle_menu_DisabledPartnerHudScripts[]
HudScript * battle_menu_PartnerHudScripts[]
IconHudScriptPair gItemHudScripts[]
s32 can_switch_to_partner(void)
IconHudScriptPair battle_menu_FleeHudScripts
void btl_init_menu_items(void)
Definition 190B20.c:601
void func_802A1078(void)
s32 btl_submenu_moves_update(void)
s32 btl_update_strats_menu(void)
BSS s32 D_802AD0A8
BSS s32 D_802ACC60
void btl_main_menu_init(void)
s32 btl_main_menu_update(void)
BSS s32 battle_menu_submenuIDs[6]
IconHudScriptPair battle_menu_DoNothingHudScripts
BSS s32 BattleMenu_Moves_OptionIndices[24]
IconHudScriptPair battle_menu_StarPowerHudScripts
void func_802A1098(void)
s32 BattleMenu_CenteredMessages[]
void func_802A45D8(void)
void btl_check_can_change_partner(void)
Definition 190B20.c:566
void btl_init_menu_hammer(void)
Definition 190B20.c:765
void func_802A4A10(void)
IconHudScriptPair battle_menu_JumpHudScripts[]
IconHudScriptPair battle_menu_StrategiesHudScript
IconHudScriptPair battle_menu_ItemHudScripts
void func_802A2910(void)
void func_800F52BC(void)
BSS s32 BattleMenu_SwapDelay
s32 BattleMenu_LeftJustMessages[]
s32 BattleMenu_CategoryForSubmenu[]
s32 can_switch_to_player(void)
s32 MenuIndexFromPartnerID[]
Definition 5B320.c:316
HudScript * battle_menu_StarPowerMovesHudScripts[]
void btl_state_update_player_menu(void)
void func_802A47E0(void)
void func_802A48FC(void)
void func_802A2AB8(void)
s32 get_player_anim_for_status(s32 animID)
Definition 190B20.c:1965
void func_802A2C58(void)
void func_802A1050(void)
void func_802A1030(void)
void func_802A4718(void)
void btl_init_menu_boots(void)
Definition 190B20.c:671
void func_800F16CC(void)
BSS PopupMenu D_802ACCD0
IconHudScriptPair battle_menu_HammerHudScripts[]
void func_802A27D0(void)
ActorState state
Vec3f homePos
Vec3f curPos
#define rand_int
#define clamp_angle
@ BS_FLAGS1_PLAYER_IN_BACK
Definition enums.h:3589
@ BS_FLAGS1_MENU_OPEN
Definition enums.h:3566
@ BS_FLAGS1_YIELD_TURN
Definition enums.h:3590
@ BTL_MSG_CANT_SWITCH
Definition enums.h:4140
@ BTL_MSG_CANT_MOVE
Definition enums.h:4141
@ BTL_MSG_NO_JUMP_TARGET
Definition enums.h:4127
@ BTL_MSG_NO_ITEM_TARGET
Definition enums.h:4129
@ BTL_MSG_CANT_SELECT_NOW
Definition enums.h:4132
@ BTL_MSG_CANT_SELECT_NOW_ALT
Definition enums.h:4144
@ BTL_MSG_NO_HAMMER_TARGET
Definition enums.h:4128
@ POPUP_MENU_TRIPLE_DIP
Definition enums.h:3146
@ BTL_MENU_TYPE_INVALID
Definition enums.h:4226
@ BTL_MENU_TYPE_RUN_AWAY
Definition enums.h:4230
@ BTL_MENU_TYPE_STAR_POWERS
Definition enums.h:4235
@ BTL_MENU_TYPE_DEFEND
Definition enums.h:4231
@ BTL_MENU_TYPE_STRATEGIES
Definition enums.h:4234
@ BTL_MENU_TYPE_DO_NOTHING
Definition enums.h:4236
@ BS_FLAGS2_CAN_FLEE
Definition enums.h:3609
@ BTL_CAM_DEFAULT
Definition enums.h:4824
@ TARGET_FLAG_PRIMARY_ONLY
Definition enums.h:1863
@ TARGET_FLAG_2
Definition enums.h:1850
@ POPUP_RESULT_CANCEL
Definition enums.h:3178
@ POPUP_RESULT_INVALID
Definition enums.h:3175
@ BATTLE_STATE_0
Definition enums.h:3631
@ BATTLE_STATE_RUN_AWAY
Definition enums.h:3655
@ BATTLE_STATE_SWITCH_TO_PARTNER
Definition enums.h:3642
@ BATTLE_STATE_DEFEND
Definition enums.h:3656
@ BATTLE_STATE_PLAYER_MOVE
Definition enums.h:3649
@ BATTLE_STATE_END_PLAYER_TURN
Definition enums.h:3653
@ BATTLE_STATE_SELECT_TARGET
Definition enums.h:3648
@ BATTLE_STATE_CHANGE_PARTNER
Definition enums.h:3660
@ ABILITY_BERSERKER
Definition enums.h:457
@ SOUND_PARTNER_SWAP_BATTLE_POS
Definition enums.h:560
@ BTL_MENU_ENABLED_SMASH
Definition enums.h:4243
@ BTL_MENU_ENABLED_ITEMS
Definition enums.h:4244
@ BTL_MENU_ENABLED_STAR_POWERS
Definition enums.h:4247
@ BTL_MENU_ENABLED_JUMP
Definition enums.h:4242
@ BTL_MENU_ENABLED_STRATEGIES
Definition enums.h:4246
@ ACTOR_PLAYER
Definition enums.h:2085
@ ACTOR_FLAG_SHOW_STATUS_ICONS
Definition enums.h:3343
@ ACTOR_FLAG_USING_IDLE_ANIM
Definition enums.h:3342
@ BTL_MENU_IDX_PARTNER
Definition enums.h:4217
@ BTL_MENU_IDX_STRATEGY
Definition enums.h:4219
@ BTL_MENU_IDX_SMASH
Definition enums.h:4214
@ BTL_MENU_IDX_STAR_POWER
Definition enums.h:4218
@ BTL_MENU_IDX_MAIN
Definition enums.h:4212
@ BTL_MENU_IDX_JUMP
Definition enums.h:4213
@ BTL_MENU_IDX_DIP
Definition enums.h:4216
@ BTL_MENU_IDX_ITEMS
Definition enums.h:4215
@ BTL_SUBSTATE_PLAYER_MENU_STRATEGIES_4
Definition enums.h:3981
@ BTL_SUBSTATE_PLAYER_MENU_CHANGE_MEMBER_3
Definition enums.h:3948
@ BTL_SUBSTATE_PLAYER_MENU_ITEMS_5
Definition enums.h:3958
@ BTL_SUBSTATE_PLAYER_MENU_MAIN_SHOW_CANT_SWAP
Definition enums.h:3931
@ BTL_SUBSTATE_PLAYER_MENU_BERSERKER_CHOOSE
Definition enums.h:3976
@ BTL_SUBSTATE_PLAYER_MENU_STRATEGIES_2
Definition enums.h:3979
@ BTL_SUBSTATE_PLAYER_MENU_DIPPING_5
Definition enums.h:3973
@ BTL_SUBSTATE_PLAYER_MENU_MAIN_AWAIT_CANT_SWAP
Definition enums.h:3932
@ BTL_SUBSTATE_PLAYER_MENU_STAR_SPIRITS_7
Definition enums.h:3967
@ BTL_SUBSTATE_PLAYER_MENU_DIPPING_TARGET_CANCEL
Definition enums.h:3943
@ BTL_SUBSTATE_PLAYER_MENU_ITEMS_1
Definition enums.h:3954
@ BTL_SUBSTATE_PLAYER_MENU_CHANGE_MEMBER_4
Definition enums.h:3949
@ BTL_SUBSTATE_PLAYER_MENU_CHANGE_MEMBER_2
Definition enums.h:3947
@ BTL_SUBSTATE_PLAYER_MENU_UNKNOWN_3
Definition enums.h:3941
@ BTL_SUBSTATE_PLAYER_MENU_STAR_SPIRITS_4
Definition enums.h:3964
@ BTL_SUBSTATE_PLAYER_MENU_DIPPING_4
Definition enums.h:3972
@ BTL_SUBSTATE_PLAYER_MENU_CHOOSE_CATEGORY
Definition enums.h:3924
@ BTL_SUBSTATE_PLAYER_MENU_ITEMS_4
Definition enums.h:3957
@ BTL_SUBSTATE_PLAYER_MENU_CREATE_MAIN_MENU
Definition enums.h:3987
@ BTL_SUBSTATE_PLAYER_MENU_MAIN_MENU_10
Definition enums.h:3933
@ BTL_SUBSTATE_PLAYER_MENU_DIPPING_TARGET_CHOSEN
Definition enums.h:3944
@ BTL_SUBSTATE_PLAYER_MENU_CHANGE_MEMBER_1
Definition enums.h:3946
@ BTL_SUBSTATE_PLAYER_MENU_MOVE_TARGET_CHOSEN
Definition enums.h:3929
@ BTL_SUBSTATE_PLAYER_MENU_MAIN_MENU_13
Definition enums.h:3936
@ BTL_SUBSTATE_PLAYER_MENU_DIPPING_3
Definition enums.h:3971
@ BTL_SUBSTATE_PLAYER_MENU_STAR_SPIRITS_6
Definition enums.h:3966
@ BTL_SUBSTATE_PLAYER_MENU_MOVE_CHOOSE_TARGET
Definition enums.h:3926
@ BTL_SUBSTATE_PLAYER_MENU_PERFORM_SWAP
Definition enums.h:3986
@ BTL_SUBSTATE_PLAYER_MENU_MAIN_MENU_2
Definition enums.h:3925
@ BTL_SUBSTATE_PLAYER_MENU_UNKNOWN_4
Definition enums.h:3942
@ BTL_SUBSTATE_PLAYER_MENU_MAIN_MENU_7
Definition enums.h:3930
@ BTL_SUBSTATE_PLAYER_MENU_STAR_SPIRITS_2
Definition enums.h:3962
@ BTL_SUBSTATE_PLAYER_MENU_DIPPING_CHOOSE_TARGET
Definition enums.h:3940
@ BTL_SUBSTATE_PLAYER_MENU_DIPPING_2
Definition enums.h:3970
@ BTL_SUBSTATE_PLAYER_MENU_ITEMS_6
Definition enums.h:3959
@ BTL_SUBSTATE_PLAYER_MENU_UNKNOWN_1
Definition enums.h:3939
@ BTL_SUBSTATE_PLAYER_MENU_STRATEGIES_3
Definition enums.h:3980
@ BTL_SUBSTATE_PLAYER_MENU_CHANGE_MEMBER_7
Definition enums.h:3952
@ BTL_SUBSTATE_PLAYER_MENU_STAR_SPIRITS_5
Definition enums.h:3965
@ BTL_SUBSTATE_PLAYER_MENU_CHANGE_MEMBER_6
Definition enums.h:3951
@ BTL_SUBSTATE_PLAYER_MENU_MAIN_MENU_4
Definition enums.h:3927
@ BTL_SUBSTATE_PLAYER_MENU_STRATEGIES_8
Definition enums.h:3984
@ BTL_SUBSTATE_PLAYER_MENU_MOVE_TARGET_CANCEL
Definition enums.h:3928
@ BTL_SUBSTATE_PLAYER_MENU_STRATEGIES_6
Definition enums.h:3983
@ BTL_SUBSTATE_PLAYER_MENU_MAIN_MENU_12
Definition enums.h:3935
@ BTL_SUBSTATE_PLAYER_MENU_BUILD_STRATEGIES
Definition enums.h:3978
@ BTL_SUBSTATE_PLAYER_MENU_INIT
Definition enums.h:3922
@ BTL_SUBSTATE_PLAYER_MENU_CHANGE_MEMBER_5
Definition enums.h:3950
@ BTL_SUBSTATE_PLAYER_MENU_DIPPING_1
Definition enums.h:3969
@ BTL_SUBSTATE_PLAYER_MENU_STRATEGIES_5
Definition enums.h:3982
@ BTL_SUBSTATE_PLAYER_MENU_MAIN_MENU_14
Definition enums.h:3937
@ BTL_SUBSTATE_PLAYER_MENU_MAIN_MENU_11
Definition enums.h:3934
@ BTL_SUBSTATE_PLAYER_MENU_ITEMS_3
Definition enums.h:3956
@ BTL_SUBSTATE_PLAYER_MENU_DIPPING_6
Definition enums.h:3974
@ BTL_SUBSTATE_PLAYER_MENU_ITEMS_2
Definition enums.h:3955
@ BTL_SUBSTATE_PLAYER_MENU_STAR_SPIRITS_1
Definition enums.h:3961
@ BTL_SUBSTATE_PLAYER_MENU_STAR_SPIRITS_3
Definition enums.h:3963
void btl_show_variable_battle_message(s32, s32, s32)
s32 player_team_is_ability_active(Actor *actor, s32 ability)
Definition 190B20.c:2765
void hide_popup_menu(void)
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:1005
void btl_cam_move(s16)
Definition camera.c:1953
f32 sin_rad(f32 x)
Definition 43F0.c:713
void btl_set_state(s32 battleState)
void create_current_pos_target_list(Actor *actor)
Definition 190B20.c:472
s32 userIndex[32]
s32 nameMsg[32]
HudScript * disabled
HudScript * ptrIcon[32]
s32 value[32]
s32 enabled[32]
HudScript * enabled
s32 descMsg[32]
#define DEG_TO_RAD(deg)
Definition macros.h:134
s8 lastPlayerMenuSelection[16]
s16 cancelTargetMenuSubstate
s16 acceptTargetMenuSubstate
s32 PartnerIDFromMenuIndex[12]
Definition 5B320.c:300
s32 gBattleSubState
Definition battle.c:14

Referenced by btl_state_update_player_menu(), btl_state_update_select_target(), and btl_update().

◆ btl_state_draw_player_menu()

void btl_state_draw_player_menu ( void )

Definition at line 3591 of file btl_states_menus.c.

3591 {
3592 switch (gBattleSubState) {
3595 break;
3623 break;
3629 break;
3632 break;
3635 break;
3638 break;
3641 break;
3642 }
3643}
void btl_main_menu_draw(void)

Referenced by btl_draw_ui().

◆ btl_state_update_partner_menu()

void btl_state_update_partner_menu ( void )

Definition at line 3645 of file btl_states_menus.c.

3645 {
3646 BattleStatus* battleStatus = &gBattleStatus;
3647 PlayerData* playerData = &gPlayerData;
3648 Actor* playerActor = battleStatus->playerActor;
3649 Actor* partnerActor = battleStatus->partnerActor;
3650 PopupMenu* popupMenu = &D_802ACCD0;
3651 s32 entryIdx;
3652 s32 i;
3653 s32 popupIndex;
3654 s32 initialPos;
3655 MoveData* moveData;
3656 PartnerPopupProperties* popupProps;
3657
3659 battleStatus->moveCategory = BTL_MENU_TYPE_INVALID;
3660 battleStatus->selectedMoveID = MOVE_NONE;
3661 battleStatus->curAttackElement = 0;
3662 if (!can_switch_to_partner()) {
3664 } else {
3666 battleStatus->flags1 |= BS_FLAGS1_MENU_OPEN;
3669 if (battleStatus->flags1 & BS_FLAGS1_PLAYER_IN_BACK) {
3671 } else {
3673 partnerActor->state.curPos.x = partnerActor->homePos.x;
3674 partnerActor->state.curPos.z = partnerActor->homePos.z;
3675 partnerActor->state.goalPos.x = playerActor->homePos.x;
3676 partnerActor->state.goalPos.z = playerActor->homePos.z;
3677 partnerActor->state.moveTime = 4;
3678 partnerActor->state.angle = 0.0f;
3679 }
3680 }
3681 }
3683 if (partnerActor->state.moveTime != 0) {
3684 partnerActor->curPos.x += (partnerActor->state.goalPos.x - partnerActor->curPos.x) / partnerActor->state.moveTime;
3685 partnerActor->curPos.z += (partnerActor->state.goalPos.z - partnerActor->curPos.z) / partnerActor->state.moveTime;
3686 playerActor->curPos.x += (partnerActor->state.curPos.x - playerActor->curPos.x) / partnerActor->state.moveTime;
3687 playerActor->curPos.z += (partnerActor->state.curPos.z - playerActor->curPos.z) / partnerActor->state.moveTime;
3688 }
3689 partnerActor->curPos.z += sin_rad(DEG_TO_RAD(partnerActor->state.angle)) * 16.0f;
3690 partnerActor->yaw = clamp_angle(-partnerActor->state.angle);
3691 playerActor->curPos.z -= sin_rad(DEG_TO_RAD(partnerActor->state.angle)) * 16.0f;
3692 playerActor->yaw = clamp_angle(-partnerActor->state.angle);
3693 partnerActor->state.angle += 90.0f;
3694 if (partnerActor->state.moveTime != 0) {
3695 partnerActor->state.moveTime--;
3696 } else {
3698 partnerActor->curPos.x = partnerActor->state.goalPos.x;
3699 partnerActor->curPos.z = partnerActor->state.goalPos.z;
3700 playerActor->curPos.x = partnerActor->state.curPos.x;
3701 playerActor->curPos.z = partnerActor->state.curPos.z;
3702 partnerActor->homePos.x = partnerActor->curPos.x;
3703 partnerActor->homePos.z = partnerActor->curPos.z;
3704 playerActor->homePos.x = playerActor->curPos.x;
3705 playerActor->homePos.z = playerActor->curPos.z;
3707 }
3708 }
3709 switch (gBattleSubState) {
3711 partnerActor->flags |= ACTOR_FLAG_SHOW_STATUS_ICONS;
3712 partnerActor->flags &= ~ACTOR_FLAG_USING_IDLE_ANIM;
3713 playerActor->flags |= ACTOR_FLAG_USING_IDLE_ANIM;
3714 playerActor->flags |= ACTOR_FLAG_SHOW_STATUS_ICONS;
3717 entryIdx = 0;
3718 initialPos = 1;
3719 if (battleStatus->lastPartnerMenuSelection[BTL_MENU_IDX_MAIN] < 0) {
3721 }
3724
3725 // strategies menu category
3727 BattleMenu_OptionEnabled[entryIdx] = TRUE;
3728 battle_menu_isMessageDisabled[entryIdx] = 0;
3731 if (!(battleStatus->enabledMenusFlags & BTL_MENU_ENABLED_STRATEGIES)) {
3732 BattleMenu_OptionEnabled[entryIdx] = FALSE;
3735 }
3736 if (battleStatus->lastPartnerMenuSelection[entryIdx] == BTL_MENU_TYPE_STRATEGIES) {
3737 initialPos = entryIdx;
3738 }
3739 entryIdx++;
3740
3741 // abilities menu category
3744 BattleMenu_OptionEnabled[entryIdx] = TRUE;
3746 if (battleStatus->menuStatus[3] <= 0) {
3748 BattleMenu_OptionEnabled[entryIdx] = FALSE;
3750 }
3751 if (!(battleStatus->enabledMenusFlags & BTL_MENU_ENABLED_ABILITIES)) {
3753 BattleMenu_OptionEnabled[entryIdx] = FALSE;
3755 }
3757 initialPos = entryIdx;
3758 }
3759 entryIdx++;
3760
3761 // focus menu category
3762 if (playerData->maxStarPower != 0 && is_ability_active(ABILITY_GROUP_FOCUS)) {
3764 BattleMenu_OptionEnabled[entryIdx] = TRUE;
3765 battle_menu_isMessageDisabled[entryIdx] = 0;
3768 if (!(battleStatus->enabledMenusFlags & BTL_MENU_ENABLED_PARTNER_FOCUS)) {
3769 BattleMenu_OptionEnabled[entryIdx] = FALSE;
3772 }
3774 initialPos = entryIdx;
3775 }
3776 entryIdx++;
3777 }
3778
3779 BattleMenu_NumOptions = entryIdx;
3780 D_802AD0A8 = 1;
3781 D_802AD0B0 = initialPos;
3782 D_802AD100 = 2 - initialPos;
3783 if (can_switch_to_player()) {
3785 } else {
3787 }
3789 D_802ACC60 = 8;
3792 return;
3797 entryIdx = btl_main_menu_update();
3798
3799 if (BattleMenu_SwapDelay != 0) {
3802 if (can_switch_to_player()) {
3807 } else {
3810 }
3811 break;
3812 }
3813
3814 if (D_802ACC60 != 0) {
3815 D_802ACC60--;
3816 } else if (entryIdx != 0) {
3818 battleStatus->lastPartnerMenuSelection[BTL_MENU_IDX_MAIN] = battleStatus->curPartnerSubmenu = battle_menu_submenuIDs[entryIdx - 1];
3819 if (battleStatus->curPartnerSubmenu == 7) {
3823 } else if (battleStatus->curPartnerSubmenu == 6) {
3827 } else if (battleStatus->curPartnerSubmenu == 8) {
3831 } else if (battleStatus->curPartnerSubmenu == 2) {
3835 } else if (battleStatus->curPartnerSubmenu == 5) {
3839 } else {
3842 func_802A1030();
3844 }
3845 }
3846 break;
3848 entryIdx = btl_main_menu_update();
3849 if ((battleStatus->curButtonsPressed & BUTTON_B) && entryIdx == 0) {
3850 func_802A1078();
3852 return;
3853 }
3854 if (entryIdx != 0) {
3856 battleStatus->selectedMoveID = MOVE_FOCUS;
3857 battleStatus->moveArgument = 0;
3858 battleStatus->curTargetListFlags = gMoveTable[MOVE_FOCUS].flags;
3860 return;
3861 }
3862 break;
3864 if (btl_main_menu_update() != 0) {
3865 D_802ACC60 = 8;
3868 }
3869 break;
3871 func_802A1078();
3873 break;
3876 break;
3878 if (can_switch_to_player() == 0) {
3880 } else {
3882 }
3883 ShowingErrorMessage = TRUE;
3885 break;
3887 if (btl_is_popup_displayed()) {
3888 break;
3889 }
3890 D_802ACC60 = 0;
3891 ShowingErrorMessage = FALSE;
3894 break;
3896 for (i = 0; i < battleStatus->submenuMoveCount; i++) {
3897 moveData = &gMoveTable[battleStatus->submenuMoves[i]];
3898
3900 if (battleStatus->submenuStatus[i] == 0) {
3902 }
3903 if (battleStatus->submenuStatus[i] == -1) {
3904 battleStatus->submenuStatus[i] = 0;
3906 }
3907 if (battleStatus->submenuStatus[i] == -2) {
3908 battleStatus->submenuStatus[i] = 0;
3910 }
3912 if (battleStatus->submenuStatus[i] == 0) {
3914 }
3915 BattleMenu_Moves_OptionIndices[i] = battleStatus->submenuMoves[i];
3916 BattleMenu_Moves_OptionEnabled[i] = battleStatus->submenuStatus[i];
3917 battle_menu_moveOptionNames[i] = moveData->nameMsg;
3922
3928 }
3932 }
3933 }
3934 if (battleStatus->lastPartnerMenuSelection[BTL_MENU_IDX_ABILITY] < 0) {
3936 }
3939 initialPos = battleStatus->lastPartnerMenuSelection[BTL_MENU_IDX_ABILITY];
3940 D_802AD4A8 = initialPos;
3941 func_802A2684();
3943 break;
3945 entryIdx = btl_submenu_moves_update();
3946 if (entryIdx == -1) {
3948 } else if (entryIdx != 0) {
3949 if (entryIdx == 255) {
3950 func_802A1050();
3951 D_802ACC60 = 8;
3956 } else {
3957 battleStatus->unk_4B = entryIdx - 1;
3958 func_802A27D0();
3959 func_802A1030();
3961 }
3962 }
3963 break;
3965 entryIdx = btl_submenu_moves_update();
3966 if ((battleStatus->curButtonsPressed & BUTTON_B) && entryIdx == 0) {
3967 func_802A2AB8();
3968 func_802A1098();
3970 } else if (btl_main_menu_update() != 0) {
3971 battleStatus->moveCategory = BTL_MENU_TYPE_ABILITY;
3972 battleStatus->selectedMoveID = BattleMenu_Moves_OptionIndices[battleStatus->unk_4B];
3973 battleStatus->curTargetListFlags = gMoveTable[battleStatus->selectedMoveID].flags;
3978 }
3979 break;
3982 if (btl_main_menu_update() != 0) {
3984 }
3985 break;
3987 func_802A2AB8();
3988 func_802A1098();
3990 break;
3992 func_802A27E4();
3994 break;
3996 if (btl_submenu_moves_update() != -1) {
3998 }
3999 break;
4001 popupIndex = 0;
4002 for (i = 0; i < ARRAY_COUNT(playerData->invItems); i++) {
4003 ItemData* item;
4004 HudScript** hudScript;
4005 if (playerData->invItems[i] == ITEM_NONE) {
4006 continue;
4007 }
4008 item = &gItemTable[playerData->invItems[i]];
4009 hudScript = &gItemHudScripts[item->hudElemID].enabled;
4010
4011 if (!(item->typeFlags & ITEM_TYPE_FLAG_BATTLE_USABLE)) {
4012 continue;
4013 }
4014 popupMenu->ptrIcon[popupIndex] = hudScript[0];
4015 popupMenu->userIndex[popupIndex] = playerData->invItems[i];
4016 popupMenu->enabled[popupIndex] = TRUE;
4017 popupMenu->nameMsg[popupIndex] = item->nameMsg;
4018 popupMenu->descMsg[popupIndex] = item->shortDescMsg;
4019 popupIndex++;
4020 }
4021 if (battleStatus->lastPartnerMenuSelection[BTL_MENU_IDX_PARTNER_ITEM] < 0) {
4023 }
4024 popupMenu->popupType = POPUP_MENU_USE_ITEM;
4025 popupMenu->numEntries = popupIndex;
4026 popupMenu->dipMode = 0;
4027 popupMenu->titleNumber = 0;
4028 initialPos = battleStatus->lastPartnerMenuSelection[BTL_MENU_IDX_PARTNER_ITEM];
4029 popupMenu->initialPos = initialPos;
4030 create_battle_popup_menu(popupMenu);
4031 func_800F52BC();
4033 break;
4035 if (popupMenu->result != POPUP_RESULT_CHOOSING) {
4036 if (popupMenu->result == POPUP_RESULT_CANCEL) {
4037 func_802A1050();
4038 D_802ACC60 = 8;
4043 } else {
4046 battleStatus->unk_1AA = popupMenu->userIndex[popupMenu->result - 1];
4047 battleStatus->moveCategory = BTL_MENU_TYPE_ITEMS;
4048 battleStatus->moveArgument = battleStatus->unk_1AA;
4050 battleStatus->curAttackElement = 0;
4051 battleStatus->lastPartnerMenuSelection[BTL_MENU_IDX_PARTNER_ITEM] = popupMenu->result - 1;
4053 func_802A1030();
4055 }
4056 }
4057 break;
4059 if ((battleStatus->curButtonsPressed & BUTTON_B) && popupMenu->result == POPUP_RESULT_CHOOSING) {
4060 func_800F16CC();
4061 func_802A1098();
4063 } else if (btl_main_menu_update() != 0) {
4065 }
4066 break;
4068 if (btl_main_menu_update() != 0) {
4070 }
4071 break;
4073 func_800F16CC();
4074 func_802A1098();
4076 break;
4080 break;
4082 popupIndex = 0;
4083 for (i = 1; i < ARRAY_COUNT(PartnerIDFromMenuIndex); i++) {
4084 s32 partnerId = PartnerIDFromMenuIndex[i];
4085 if (playerData->partners[partnerId].enabled) {
4086 popupProps = &gPartnerPopupProperties[partnerId];
4087 popupMenu->ptrIcon[popupIndex] = battle_menu_PartnerHudScripts[partnerId];
4088 popupMenu->userIndex[popupIndex] = partnerId;
4089 popupMenu->enabled[popupIndex] = 1;
4090 popupMenu->nameMsg[popupIndex] = popupProps->nameMsg;
4091 popupMenu->descMsg[popupIndex] = popupProps->battleDescMsg;
4092 popupMenu->value[popupIndex] = playerData->partners[partnerId].level;
4093 if (playerData->curPartner == partnerId) {
4094 popupMenu->enabled[popupIndex] = 0;
4095 popupMenu->ptrIcon[popupIndex] = battle_menu_DisabledPartnerHudScripts[partnerId];
4096 }
4097 popupIndex++;
4098 }
4099 }
4100 if (battleStatus->lastPartnerMenuSelection[BTL_MENU_IDX_PARTNER] < 0) {
4102 }
4104 popupMenu->numEntries = popupIndex;
4105 popupMenu->initialPos = MenuIndexFromPartnerID[playerData->curPartner] - 1;
4106 popupMenu->dipMode = 0;
4107 popupMenu->titleNumber = 0;
4108 create_battle_popup_menu(popupMenu);
4109 func_800F52BC();
4111 break;
4113 if (popupMenu->result == POPUP_RESULT_INVALID) {
4115 } else if (popupMenu->result != POPUP_RESULT_CHOOSING) {
4116 if (popupMenu->result == POPUP_RESULT_CANCEL) {
4117 func_802A1050();
4118 D_802ACC60 = 8;
4123 } else {
4126 battleStatus->unk_1AC = popupMenu->userIndex[popupMenu->result - 1];
4128 battleStatus->selectedMoveID = MOVE_UNUSED_37;
4129 battleStatus->curTargetListFlags = TARGET_FLAG_2;
4130 battleStatus->moveArgument = battleStatus->unk_1AC;
4131 battleStatus->lastPartnerMenuSelection[BTL_MENU_IDX_PARTNER] = popupMenu->result - 1;
4133 func_802A1030();
4135 }
4136 }
4137 break;
4139 if ((battleStatus->curButtonsPressed & BUTTON_B) && (popupMenu->result == POPUP_RESULT_CHOOSING)) {
4140 func_800F16CC();
4141 func_802A1098();
4143 } else if (btl_main_menu_update() != 0) {
4147 }
4148 break;
4150 if (btl_main_menu_update() != 0) {
4152 }
4153 break;
4155 func_800F16CC();
4156 func_802A1098();
4158 break;
4162 break;
4164 if (popupMenu->result != POPUP_RESULT_INVALID) {
4166 }
4167 break;
4169 entryIdx = 1;
4170 battleStatus->submenuMoves[0] = MOVE_FOCUS;
4171 battleStatus->submenuMoveCount = entryIdx;
4172 battleStatus->submenuIcons[0] = ITEM_PARTNER_ATTACK;
4173 battleStatus->submenuStatus[0] = 1;
4174 for (i = 0; i < battleStatus->submenuMoveCount; i++) {
4175 moveData = &gMoveTable[battleStatus->submenuMoves[i]];
4176 battle_menu_moveOptionIconScripts[i] = battle_menu_StarPowerMovesHudScripts[2 * STAR_POWER_INDEX(battleStatus->submenuMoves[i]) + 0];
4177 if (battleStatus->submenuStatus[i] == 0) {
4178 battle_menu_moveOptionIconScripts[i] = battle_menu_StarPowerMovesHudScripts[2 * STAR_POWER_INDEX(battleStatus->submenuMoves[i]) + 1];
4179 }
4184 BattleMenu_Moves_OptionEnabled[i] = battleStatus->submenuStatus[i];
4185 battle_menu_moveOptionNames[i] = moveData->nameMsg;
4189 }
4190 if (battleStatus->lastPartnerMenuSelection[BTL_MENU_IDX_STAR_POWER] < 0) {
4192 }
4195 initialPos = battleStatus->lastPartnerMenuSelection[BTL_MENU_IDX_STAR_POWER];
4196 D_802AD4A8 = initialPos;
4197 func_802A2684();
4199 break;
4201 entryIdx = btl_submenu_moves_update();
4202 if (entryIdx != 0) {
4203 if (entryIdx == 255) {
4204 func_802A1050();
4205 D_802ACC60 = 8;
4210 } else {
4211 battleStatus->unk_4B = BattleMenu_Moves_OptionIndices[entryIdx - 1];
4212 func_802A27D0();
4213 func_802A1030();
4215 }
4216 }
4217 break;
4219 entryIdx = btl_submenu_moves_update();
4220 if ((battleStatus->curButtonsPressed & BUTTON_B) && (entryIdx == 0)) {
4221 func_802A2AB8();
4222 func_802A1098();
4224 } else if (btl_main_menu_update() != 0) {
4228 battleStatus->selectedMoveID = battleStatus->submenuMoves[battleStatus->unk_4B];
4229 battleStatus->curTargetListFlags = gMoveTable[battleStatus->submenuMoves[battleStatus->unk_4B]].flags;
4230 battleStatus->moveArgument = battleStatus->unk_4B;
4233 }
4234 break;
4237 if (btl_main_menu_update() != 0) {
4239 }
4240 break;
4242 func_802A2AB8();
4243 func_802A1098();
4245 break;
4247 func_802A27E4();
4249 break;
4251 popupIndex = 0;
4253
4254 // add 'Change Member' command
4255 if (battleStatus->changePartnerAllowed >= 0) {
4258 D_802AD640[popupIndex] = battle_menu_PartnerHudScripts[playerData->curPartner];
4259 D_802AD690[popupIndex] = 1;
4260 D_802AD6C0[popupIndex] = MSG_Menus_Action_ChangePartner;
4261 if (battleStatus->changePartnerAllowed <= 0) {
4263 D_802AD690[popupIndex] = 0;
4264 D_802AD6A8[popupIndex] = 0;
4265 }
4266 popupIndex++;
4267 }
4268
4269 // add 'Do Nothing' command
4272 D_802AD690[popupIndex] = 1;
4274 D_802AD6C0[popupIndex] = MSG_Menus_Action_DoNothing;
4275 popupIndex++;
4276
4277 if (battleStatus->lastPartnerMenuSelection[BTL_MENU_IDX_STRATEGY] < 0) {
4279 }
4280 D_802AD66C = popupIndex;
4281 initialPos = battleStatus->lastPartnerMenuSelection[BTL_MENU_IDX_STRATEGY];
4282 StratsMenuLastPos = initialPos;
4283 func_802A45D8();
4285 break;
4287 entryIdx = btl_update_strats_menu();
4288 if (entryIdx == 0) {
4289 } else if (entryIdx == 255) {
4290 func_802A1050();
4291 D_802ACC60 = 8;
4296 } else {
4297 battleStatus->curPartnerSubmenu = D_802AD678[entryIdx - 1];
4298 battleStatus->lastPartnerMenuSelection[BTL_MENU_IDX_STRATEGY] = entryIdx - 1;
4299 if (battleStatus->curPartnerSubmenu == 5) { // change partner
4303 } else {
4304 func_802A4718();
4305 func_802A1030();
4307 }
4308 }
4309 break;
4311 entryIdx = btl_update_strats_menu();
4312 if ((battleStatus->curButtonsPressed & BUTTON_B) && entryIdx == 0) {
4313 func_802A48FC();
4314 func_802A1098();
4316 } else if (btl_main_menu_update() != 0) {
4319 entryIdx = battleStatus->curPartnerSubmenu;
4320 switch (entryIdx) {
4321 case 9:
4325 break;
4326 case 3:
4329 battleStatus->moveCategory = entryIdx;
4330 battleStatus->selectedMoveID = MOVE_UNUSED_39;
4332 break;
4333 case 10:
4337 break;
4338 }
4339 }
4340 break;
4343 if (btl_main_menu_update() != 0) {
4344 D_802ACC60 = 8;
4347 }
4348 break;
4350 func_802A48FC();
4351 func_802A1098();
4353 break;
4355 func_802A472C();
4357 break;
4359 popupIndex = 0;
4360 for (i = 1; i < ARRAY_COUNT(PartnerIDFromMenuIndex); i++) {
4361 s32 partnerId = PartnerIDFromMenuIndex[i];
4362 if (playerData->partners[partnerId].enabled) {
4363 popupProps = &gPartnerPopupProperties[partnerId];
4364 popupMenu->ptrIcon[popupIndex] = battle_menu_PartnerHudScripts[partnerId];
4365 popupMenu->userIndex[popupIndex] = partnerId;
4366 popupMenu->enabled[popupIndex] = 1;
4367 popupMenu->nameMsg[popupIndex] = popupProps->nameMsg;
4368 popupMenu->descMsg[popupIndex] = popupProps->battleDescMsg;
4369 popupMenu->value[popupIndex] = playerData->partners[partnerId].level;
4370 if (playerData->curPartner == partnerId) {
4371 popupMenu->enabled[popupIndex] = 0;
4372 popupMenu->ptrIcon[popupIndex] = battle_menu_DisabledPartnerHudScripts[partnerId];
4373 }
4374 popupIndex++;
4375 }
4376 }
4377 if (battleStatus->lastPartnerMenuSelection[BTL_MENU_IDX_PARTNER] < 0) {
4379 }
4381 popupMenu->numEntries = popupIndex;
4382 popupMenu->initialPos = MenuIndexFromPartnerID[playerData->curPartner] - 1;
4383 popupMenu->dipMode = 0;
4384 popupMenu->titleNumber = 0;
4385 create_battle_popup_menu(popupMenu);
4386 func_800F52BC();
4388 break;
4390 if (popupMenu->result == POPUP_RESULT_INVALID) {
4392 } else if (popupMenu->result != POPUP_RESULT_CHOOSING) {
4393 if (popupMenu->result == POPUP_RESULT_CANCEL) {
4394 func_802A47E0();
4398 } else {
4401 battleStatus->unk_1AC = popupMenu->userIndex[popupMenu->result - 1];
4403 battleStatus->selectedMoveID = MOVE_UNUSED_37;
4404 battleStatus->curTargetListFlags = TARGET_FLAG_2;
4405 battleStatus->moveArgument = battleStatus->unk_1AC;
4406 battleStatus->lastPartnerMenuSelection[BTL_MENU_IDX_PARTNER] = popupMenu->result - 1;
4408 func_802A4718();
4409 func_802A1030();
4411 }
4412 }
4413 break;
4415 if ((battleStatus->curButtonsPressed & BUTTON_B) && popupMenu->result == POPUP_RESULT_CHOOSING) {
4416 func_800F16CC();
4417 func_802A4A10();
4418 func_802A1098();
4420 } else {
4422 if (btl_main_menu_update() != 0) {
4426 }
4427 }
4428 break;
4431 if (btl_main_menu_update() != 0) {
4433 }
4434 break;
4436 func_800F16CC();
4437 func_802A4A10();
4438 func_802A1098();
4440 break;
4443 func_802A472C();
4445 break;
4449 if (popupMenu->result != POPUP_RESULT_INVALID) {
4453 }
4454 break;
4455 }
4456}
void btl_state_update_partner_menu(void)
AnimID BattleMenu_PartnerThinkAnims[]
HudScript * battle_menu_PartnerMoveHudScripts[10][10]
void btl_init_menu_partner(void)
Definition 190B20.c:857
AnimID BattleMenu_PartnerIdleAnims[]
@ BTL_MENU_TYPE_ABILITY
Definition enums.h:4233
@ BTL_MENU_TYPE_PARTNER_FOCUS
Definition enums.h:4238
@ BTL_SUBSTATE_PARTNER_MENU_UNUSED_CHANGE_PARTNER_5
Definition enums.h:4035
@ BTL_SUBSTATE_PARTNER_MENU_MAIN_MENU_1
Definition enums.h:3993
@ BTL_SUBSTATE_PARTNER_MENU_MAIN_MENU_2
Definition enums.h:3994
@ BTL_SUBSTATE_PARTNER_MENU_MAIN_SHOW_CANT_SWAP
Definition enums.h:3999
@ BTL_SUBSTATE_PARTNER_MENU_STRATEGIES_2
Definition enums.h:4047
@ BTL_SUBSTATE_PARTNER_MENU_ABILITIES_6
Definition enums.h:4007
@ BTL_SUBSTATE_PARTNER_MENU_ITEMS_3
Definition enums.h:4026
@ BTL_SUBSTATE_PARTNER_MENU_NONE
Definition enums.h:3991
@ BTL_SUBSTATE_PARTNER_MENU_ABILITIES_2
Definition enums.h:4003
@ BTL_SUBSTATE_PARTNER_MENU_STRATEGIES_3
Definition enums.h:4048
@ BTL_SUBSTATE_PARTNER_MENU_CHANGE_PARTNER_3
Definition enums.h:4018
@ BTL_SUBSTATE_PARTNER_MENU_MAIN_AWAIT_CANT_SWAP
Definition enums.h:4000
@ BTL_SUBSTATE_PARTNER_MENU_STRATEGIES_1
Definition enums.h:4046
@ BTL_SUBSTATE_PARTNER_MENU_FOCUS_4
Definition enums.h:4042
@ BTL_SUBSTATE_PARTNER_MENU_FOCUS_5
Definition enums.h:4043
@ BTL_SUBSTATE_PARTNER_MENU_MAIN_MENU_3
Definition enums.h:3995
@ BTL_SUBSTATE_PARTNER_MENU_FOCUS_3
Definition enums.h:4041
@ BTL_SUBSTATE_PARTNER_MENU_CHANGE_PARTNER_7
Definition enums.h:4022
@ BTL_SUBSTATE_PARTNER_MENU_ITEMS_2
Definition enums.h:4025
@ BTL_SUBSTATE_PARTNER_MENU_ABILITIES_1
Definition enums.h:4002
@ BTL_SUBSTATE_PARTNER_MENU_ITEMS_4
Definition enums.h:4027
@ BTL_SUBSTATE_PARTNER_MENU_CHANGE_PARTNER_5
Definition enums.h:4020
@ BTL_SUBSTATE_PARTNER_MENU_CHANGE_PARTNER_4
Definition enums.h:4019
@ BTL_SUBSTATE_PARTNER_MENU_FOCUS_2
Definition enums.h:4040
@ BTL_SUBSTATE_PARTNER_MENU_CHANGE_PARTNER_2
Definition enums.h:4017
@ BTL_SUBSTATE_PARTNER_MENU_CHANGE_PARTNER_1
Definition enums.h:4016
@ BTL_SUBSTATE_PARTNER_MENU_UNUSED_CHANGE_PARTNER_6
Definition enums.h:4036
@ BTL_SUBSTATE_PARTNER_MENU_ABILITIES_4
Definition enums.h:4005
@ BTL_SUBSTATE_PARTNER_MENU_UNUSED_CHANGE_PARTNER_7
Definition enums.h:4037
@ BTL_SUBSTATE_PARTNER_MENU_FOCUS_6
Definition enums.h:4044
@ BTL_SUBSTATE_PARTNER_MENU_ABILITIES_3
Definition enums.h:4004
@ BTL_SUBSTATE_PARTNER_MENU_UNUSED_CHANGE_PARTNER_4
Definition enums.h:4034
@ BTL_SUBSTATE_PARTNER_MENU_MAIN_MENU_4
Definition enums.h:3996
@ BTL_SUBSTATE_PARTNER_MENU_MAIN_MENU_6
Definition enums.h:3998
@ BTL_SUBSTATE_PARTNER_MENU_CHANGE_PARTNER_6
Definition enums.h:4021
@ BTL_SUBSTATE_PARTNER_MENU_UNUSED_CHANGE_PARTNER_2
Definition enums.h:4032
@ BTL_SUBSTATE_PARTNER_MENU_12D
Definition enums.h:4053
@ BTL_SUBSTATE_PARTNER_MENU_STRATEGIES_6
Definition enums.h:4051
@ BTL_SUBSTATE_PARTNER_MENU_FOCUS_1
Definition enums.h:4039
@ BTL_SUBSTATE_PARTNER_MENU_UNUSED_CHANGE_PARTNER_3
Definition enums.h:4033
@ BTL_SUBSTATE_PARTNER_MENU_INIT_MENU
Definition enums.h:4054
@ BTL_SUBSTATE_PARTNER_MENU_ABILITIES_5
Definition enums.h:4006
@ BTL_SUBSTATE_PARTNER_MENU_STRATEGIES_5
Definition enums.h:4050
@ BTL_SUBSTATE_PARTNER_MENU_STRATEGIES_4
Definition enums.h:4049
@ BTL_SUBSTATE_PARTNER_MENU_MAIN_MENU_5
Definition enums.h:3997
@ BTL_SUBSTATE_PARTNER_MENU_ITEMS_6
Definition enums.h:4029
@ BTL_SUBSTATE_PARTNER_MENU_ABILITIES_7
Definition enums.h:4008
@ BTL_SUBSTATE_PARTNER_MENU_ITEMS_1
Definition enums.h:4024
@ BTL_SUBSTATE_PARTNER_MENU_UNUSED_CHANGE_PARTNER_1
Definition enums.h:4031
@ BTL_SUBSTATE_PARTNER_MENU_ITEMS_5
Definition enums.h:4028
@ BATTLE_STATE_SWITCH_TO_PLAYER
Definition enums.h:3641
@ BATTLE_STATE_END_PARTNER_TURN
Definition enums.h:3654
@ BATTLE_STATE_9
Definition enums.h:3640
@ ABILITY_GROUP_FOCUS
Definition enums.h:489
@ BTL_MENU_ENABLED_PARTNER_FOCUS
Definition enums.h:4248
@ BTL_MENU_ENABLED_ABILITIES
Definition enums.h:4245
@ ACTOR_PARTNER
Definition enums.h:2086
@ BTL_MENU_IDX_PARTNER_ITEM
Definition enums.h:4222
@ BTL_MENU_IDX_ABILITY
Definition enums.h:4221
s32 HudScript[]
Definition hud_element.h:9
s8 lastPartnerMenuSelection[16]

Referenced by btl_state_update_partner_menu(), btl_state_update_select_target(), and btl_update().

◆ btl_state_draw_partner_menu()

void btl_state_draw_partner_menu ( void )

Definition at line 4458 of file btl_states_menus.c.

4458 {
4459 switch (gBattleSubState) {
4462 break;
4499 break;
4502 break;
4505 break;
4508 break;
4511 break;
4512 }
4513}
@ BTL_SUBSTATE_PARTNER_MENU_UNKNOWN_5
Definition enums.h:4014
@ BTL_SUBSTATE_PARTNER_MENU_UNKNOWN_1
Definition enums.h:4010
@ BTL_SUBSTATE_PARTNER_MENU_UNKNOWN_4
Definition enums.h:4013
@ BTL_SUBSTATE_PARTNER_MENU_UNKNOWN_3
Definition enums.h:4012
@ BTL_SUBSTATE_PARTNER_MENU_UNKNOWN_2
Definition enums.h:4011

Referenced by btl_draw_ui().

◆ btl_menu_show_switch_to_twink()

s32 btl_menu_show_switch_to_twink ( void )

Definition at line 4515 of file btl_states_menus.c.

4515 {
4517 return FALSE;
4518 }
4519 return TRUE;
4520}

Referenced by btl_state_update_peach_menu().

◆ btl_state_update_peach_menu()

void btl_state_update_peach_menu ( void )

Definition at line 4522 of file btl_states_menus.c.

4522 {
4523 BattleStatus* battleStatus = &gBattleStatus;
4524 Actor* player = battleStatus->playerActor;
4525 Actor* partner = battleStatus->partnerActor;
4526 s32 selectedOption;
4527 s32 initialPos;
4528 s32 entryIdx;
4529
4530 switch (gBattleSubState) {
4533 btl_cam_move(10);
4536 break;
4537 }
4538 player->state.curPos.x = player->homePos.x;
4539 player->state.curPos.z = player->homePos.z;
4541 player->state.goalPos.x = partner->homePos.x;
4542 player->state.goalPos.z = partner->homePos.z;
4543 player->state.moveTime = 4;
4544 player->state.angle = 0.0f;
4545 break;
4547 if (player->state.moveTime != 0) {
4548 player->curPos.x += (player->state.goalPos.x - player->curPos.x) / player->state.moveTime;
4549 player->curPos.z += (player->state.goalPos.z - player->curPos.z) / player->state.moveTime;
4550 partner->curPos.x += (player->state.curPos.x - partner->curPos.x) / player->state.moveTime;
4551 partner->curPos.z += (player->state.curPos.z - partner->curPos.z) / player->state.moveTime;
4552 }
4553
4554 player->curPos.z -= sin_rad(DEG_TO_RAD(player->state.angle)) * 16.0f;
4555 player->yaw = clamp_angle(-player->state.angle);
4556 partner->curPos.z += sin_rad(DEG_TO_RAD(player->state.angle)) * 16.0f;
4557 partner->yaw = clamp_angle(-player->state.angle);
4558 player->state.angle += 90.0f;
4559
4560 if (player->state.moveTime != 0) {
4561 player->state.moveTime--;
4562 break;
4563 }
4564
4565 player->curPos.x = player->state.goalPos.x;
4566 player->curPos.z = player->state.goalPos.z;
4567 partner->curPos.x = player->state.curPos.x;
4568 partner->curPos.z = player->state.curPos.z;
4569 player->homePos.x = player->curPos.x;
4570 player->homePos.z = player->curPos.z;
4571 partner->homePos.x = partner->curPos.x;
4572 partner->homePos.z = partner->curPos.z;
4573 gBattleStatus.flags1 &= ~BS_FLAGS1_PLAYER_IN_BACK;
4576 player->flags &= ~ACTOR_FLAG_USING_IDLE_ANIM;
4578 if (partner != NULL) {
4581 }
4582
4583 entryIdx = 0;
4584 battleStatus->selectedMoveID = MOVE_NONE;
4586 BattleMenu_OptionEnabled[entryIdx] = TRUE;
4587 battle_menu_isMessageDisabled[entryIdx] = 0;
4589 BattleMenu_TitleMessages[entryIdx] = D_802AB728[entryIdx];
4590 if (!(battleStatus->enabledMenusFlags & BTL_MENU_ENABLED_STAR_POWERS)) {
4591 BattleMenu_OptionEnabled[entryIdx] = FALSE;
4594 }
4595
4596 initialPos = 0;
4597 entryIdx++;
4598
4601 } else {
4603 }
4604 BattleMenu_NumOptions = entryIdx;
4605 D_802AD0A8 = 0;
4606 D_802AD0B0 = initialPos;
4607 D_802AD100 = 2 - initialPos;
4608
4610 D_802ACC60 = 8;
4612 break;
4614 set_actor_anim(ACTOR_PLAYER, 0, ANIM_Peach2_Delighted);
4615 selectedOption = btl_main_menu_update();
4616 if (D_802ACC60 != 0) {
4617 D_802ACC60--;
4618 break;
4619 }
4620 if (selectedOption != 0) {
4621 set_actor_anim(ACTOR_PLAYER, 0, ANIM_Peach1_Walk);
4622 battleStatus->curSubmenu = battle_menu_submenuIDs[selectedOption - 1];
4623 func_802A1030();
4624 D_802ACC60 = 8;
4627 }
4628 break;
4630 if (btl_main_menu_update() != 0) {
4633 battleStatus->curTargetListFlags = gMoveTable[MOVE_PEACH_FOCUS].flags;
4635 battleStatus->selectedMoveID = MOVE_PEACH_FOCUS;
4636 battleStatus->moveArgument = STAR_POWER_INDEX(MOVE_PEACH_FOCUS);
4638 }
4639 break;
4641 func_802A1050();
4645 break;
4648 break;
4651 ShowingErrorMessage = TRUE;
4653 break;
4655 if (btl_is_popup_displayed()) {
4656 break;
4657 }
4658 ShowingErrorMessage = FALSE;
4659 D_802ACC60 = 0;
4661 break;
4662 }
4663}
s32 btl_menu_show_switch_to_twink(void)
IconHudScriptPair battle_menu_PeachStarPowerHudScripts
s32 D_802AB728[]
void btl_state_update_peach_menu(void)
@ BTL_SUBSTATE_PEACH_MENU_TARGET_CHOSEN
Definition enums.h:3758
@ BTL_SUBSTATE_PEACH_MENU_TARGET_CANCEL
Definition enums.h:3757
@ BTL_SUBSTATE_PEACH_MENU_CHOOSE_CATEGORY
Definition enums.h:3754
@ BTL_SUBSTATE_PEACH_CREATE_MAIN_MENU
Definition enums.h:3764
@ BTL_SUBSTATE_PEACH_MENU_SHOW_CANT_SWITCH
Definition enums.h:3761
@ BTL_SUBSTATE_PEACH_MENU_PERFORM_SWAP
Definition enums.h:3763
@ BTL_SUBSTATE_PEACH_MENU_AWAIT_CANT_SWITCH_POPUP
Definition enums.h:3762
@ BTL_SUBSTATE_PEACH_MENU_CHOOSE_TARGET
Definition enums.h:3755
@ BTL_SUBSTATE_PEACH_MENU_INIT
Definition enums.h:3753

Referenced by btl_state_update_peach_menu(), btl_state_update_select_target(), and btl_update().

◆ btl_state_draw_peach_menu()

void btl_state_draw_peach_menu ( void )

Definition at line 4665 of file btl_states_menus.c.

4665 {
4666 switch (gBattleSubState) {
4669 break;
4672 break;
4675 break;
4678 break;
4681 break;
4686 break;
4687 }
4688}
@ BTL_SUBSTATE_PEACH_MENU_UNUSED_6
Definition enums.h:3759
@ BTL_SUBSTATE_PEACH_MENU_UNUSED_7
Definition enums.h:3760
@ BTL_SUBSTATE_PEACH_MENU_UNUSED_3
Definition enums.h:3756

Referenced by btl_draw_ui().

◆ btl_menu_show_switch_to_peach()

s32 btl_menu_show_switch_to_peach ( void )

Definition at line 4690 of file btl_states_menus.c.

4690 {
4692 return FALSE;
4693 }
4694 return TRUE;
4695}

Referenced by btl_state_update_twink_menu().

◆ btl_state_update_twink_menu()

void btl_state_update_twink_menu ( void )

Definition at line 4697 of file btl_states_menus.c.

4697 {
4698 BattleStatus* battleStatus = &gBattleStatus;
4699 Actor* player = battleStatus->playerActor;
4700 Actor* partner = battleStatus->partnerActor;
4701 s32 s1;
4702 s32 selection;
4703 s32 var_v0_2;
4704 s32 shouldSkipTurn;
4705 s32 initialPos;
4706 s32 entryIdx;
4707
4708 switch (gBattleSubState) {
4710 shouldSkipTurn = FALSE;
4711 if (player->debuff == STATUS_KEY_SLEEP) {
4712 shouldSkipTurn = TRUE;
4713 }
4714 if (player->debuff == STATUS_KEY_FEAR) {
4715 shouldSkipTurn = TRUE;
4716 }
4717 if (player->debuff == STATUS_KEY_DIZZY) {
4718 shouldSkipTurn = TRUE;
4719 }
4720 if (player->debuff == STATUS_KEY_PARALYZE) {
4721 shouldSkipTurn = TRUE;
4722 }
4723 if (player->debuff == STATUS_KEY_FROZEN) {
4724 shouldSkipTurn = TRUE;
4725 }
4726 if (player->debuff == STATUS_KEY_STOP) {
4727 shouldSkipTurn = TRUE;
4728 }
4729 if (player->stoneStatus == STATUS_KEY_STONE) {
4730 shouldSkipTurn = TRUE;
4731 }
4732 if (player->koStatus == STATUS_KEY_DAZE) {
4733 shouldSkipTurn = TRUE;
4734 }
4735
4736 if (shouldSkipTurn) {
4738 break;
4739 }
4740
4742 btl_cam_move(10);
4744 player->state.curPos.x = player->homePos.x;
4745 player->state.curPos.z = player->homePos.z;
4746 player->state.goalPos.x = partner->homePos.x;
4747 player->state.goalPos.z = partner->homePos.z;
4749 player->state.moveTime = 4;
4750 player->state.angle = 0.0f;
4751 break;
4752 }
4754 break;
4756 if (player->state.moveTime != 0) {
4757 player->curPos.x += (player->state.goalPos.x - player->curPos.x) / player->state.moveTime;
4758 player->curPos.z += (player->state.goalPos.z - player->curPos.z) / player->state.moveTime;
4759 partner->curPos.x += (player->state.curPos.x - partner->curPos.x) / player->state.moveTime;
4760 partner->curPos.z += (player->state.curPos.z - partner->curPos.z) / player->state.moveTime;
4761 }
4762 player->curPos.z += sin_rad(DEG_TO_RAD(player->state.angle)) * 16.0f;
4763 player->yaw = clamp_angle(-player->state.angle);
4764 partner->curPos.z -= sin_rad(DEG_TO_RAD(player->state.angle)) * 16.0f;
4765 partner->yaw = clamp_angle(-player->state.angle);
4766 player->state.angle += 90.0f;
4767 if (player->state.moveTime != 0) {
4768 player->state.moveTime--;
4769 break;
4770 }
4771 player->curPos.x = player->state.goalPos.x;
4772 player->curPos.z = player->state.goalPos.z;
4773 partner->curPos.x = player->state.curPos.x;
4774 partner->curPos.z = player->state.curPos.z;
4775 player->homePos.x = player->curPos.x;
4776 player->homePos.z = player->curPos.z;
4777 partner->homePos.x = partner->curPos.x;
4778 partner->homePos.z = partner->curPos.z;
4782 player->flags &= ~ACTOR_FLAG_USING_IDLE_ANIM;
4784 if (partner != NULL) {
4787 }
4788
4789 entryIdx = 0;
4790 battleStatus->selectedMoveID = MOVE_NONE;
4792 BattleMenu_OptionEnabled[entryIdx] = TRUE;
4793 battle_menu_isMessageDisabled[entryIdx] = 0;
4795 BattleMenu_TitleMessages[entryIdx] = D_802AB734[entryIdx];
4796 if (!(battleStatus->enabledMenusFlags & BTL_MENU_ENABLED_STAR_POWERS)) {
4797 BattleMenu_OptionEnabled[entryIdx] = FALSE;
4800 }
4801
4802 initialPos = 0;
4803 entryIdx++;
4804
4807 } else {
4809 }
4810 BattleMenu_NumOptions = entryIdx;
4811 D_802AD0A8 = 0;
4812 D_802AD0B0 = initialPos;
4813 D_802AD100 = 2 - initialPos;
4814
4816 D_802ACC60 = 8;
4818 break;
4820 set_actor_anim(ACTOR_PARTNER, 0, ANIM_Twink_Idle);
4821 selection = btl_main_menu_update();
4822 if (D_802ACC60 != 0) {
4823 D_802ACC60--;
4824 break;
4825 }
4826 if (selection != 0) {
4827 set_actor_anim(ACTOR_PARTNER, 0, ANIM_Twink_Angry);
4828 battleStatus->curSubmenu = battle_menu_submenuIDs[selection - 1];
4829 func_802A1030();
4830 D_802ACC60 = 8;
4833 }
4834 break;
4836 if (btl_main_menu_update() != 0) {
4840 battleStatus->selectedMoveID = MOVE_TWINK_DASH;
4841 battleStatus->moveArgument = 0;
4842 battleStatus->curTargetListFlags = gMoveTable[MOVE_TWINK_DASH].flags;
4844 }
4845 break;
4847 func_802A1050();
4851 break;
4854 break;
4857 ShowingErrorMessage = TRUE;
4859 break;
4861 if (btl_is_popup_displayed()) {
4862 break;
4863 }
4864 ShowingErrorMessage = FALSE;
4865 D_802ACC60 = 0;
4867 break;
4868 }
4869}
IconHudScriptPair battle_menu_TwinkStarPowerHudScripts
s32 btl_menu_show_switch_to_peach(void)
s32 D_802AB734[]
void btl_state_update_twink_menu(void)
@ BTL_SUBSTATE_TWINK_MENU_CREATE_MAIN_MENU
Definition enums.h:3778
@ BTL_SUBSTATE_TWINK_MENU_AWAIT_CANT_SWITCH_POPUP
Definition enums.h:3776
@ BTL_SUBSTATE_TWINK_MENU_TARGET_CANCEL
Definition enums.h:3771
@ BTL_SUBSTATE_TWINK_MENU_INIT
Definition enums.h:3767
@ BTL_SUBSTATE_TWINK_MENU_PERFORM_SWAP
Definition enums.h:3777
@ BTL_SUBSTATE_TWINK_MENU_CHOOSE_TARGET
Definition enums.h:3769
@ BTL_SUBSTATE_TWINK_MENU_TARGET_CHOSEN
Definition enums.h:3772
@ BTL_SUBSTATE_TWINK_MENU_CHOOSE_CATEGORY
Definition enums.h:3768
@ BTL_SUBSTATE_TWINK_MENU_SHOW_CANT_SWITCH
Definition enums.h:3775

Referenced by btl_state_update_select_target(), btl_state_update_twink_menu(), and btl_update().

◆ btl_state_draw_twink_menu()

void btl_state_draw_twink_menu ( void )

Definition at line 4871 of file btl_states_menus.c.

4871 {
4872 switch (gBattleSubState) {
4875 break;
4878 break;
4881 break;
4884 break;
4887 break;
4892 break;
4893 }
4894}
@ BTL_SUBSTATE_TWINK_MENU_UNUSED_3
Definition enums.h:3770
@ BTL_SUBSTATE_TWINK_MENU_UNUSED_6
Definition enums.h:3773
@ BTL_SUBSTATE_TWINK_MENU_UNUSED_7
Definition enums.h:3774

Referenced by btl_draw_ui().

◆ btl_state_update_select_target()

void btl_state_update_select_target ( void )

Definition at line 4896 of file btl_states_menus.c.

4896 {
4897 BattleStatus* battleStatus = &gBattleStatus;
4898 Actor* actor;
4899 s32 targetListLength;
4900 s32 selectedTargetIndex;
4901 s32 id;
4902 s8* targetIndexList;
4903 SelectableTarget* target;
4904 s32 i;
4905
4907 actor = battleStatus->playerActor;
4908 } else {
4909 actor = battleStatus->partnerActor;
4910 }
4911 targetListLength = actor->targetListLength;
4912 selectedTargetIndex = actor->selectedTargetIndex;
4913
4914 actor->flags &= ~ACTOR_FLAG_SHOW_STATUS_ICONS;
4915 targetIndexList = actor->targetIndexList;
4916 switch (gBattleSubState) {
4920 gBattleStatus.flags1 &= ~BS_FLAGS1_MENU_OPEN;
4921
4922 // prepare the action command tip for the selected move
4924 if (battleStatus->selectedMoveID != MOVE_NONE) {
4925 s8 actionTip = gMoveTable[battleStatus->selectedMoveID].actionTip;
4926
4927 if (actionTip >= 0) {
4929 }
4930 }
4931 }
4932
4933 // create the target list
4935 targetListLength = actor->targetListLength;
4936 if (battleStatus->curTargetListFlags & TARGET_FLAG_SELECT_ONE) {
4937 targetIndexList = actor->targetIndexList;
4938 for (i = 0; i < targetListLength; i++) {
4939 target = &actor->targetData[targetIndexList[i]];
4941 actor->selectedTargetIndex = i;
4942 break;
4943 }
4944 }
4945 }
4946
4947 // when TARGET_FLAG_OVERRIDE is set, skip selecting a target and begin executing the move
4948 if (battleStatus->curTargetListFlags & TARGET_FLAG_OVERRIDE) {
4953 } else {
4955 }
4957 } else {
4961 } else {
4963 }
4965 }
4966 break;
4967 }
4968
4969 // if the target list is empty, skip selecting a target and begin executing the move
4970 if (targetListLength == 0) {
4975 } else {
4977 }
4979 } else {
4983 } else {
4985 }
4987 }
4988 break;
4989 }
4990
4991 // create the HUD elements for the target pointers
4992 for (i = 0; i < targetListLength; i++) {
4996 hud_element_set_render_pos(id, 0, -100);
4997 }
4999 break;
5001 // animate the target name sliding into view
5006 }
5007 }
5008
5009 if (battleStatus->curButtonsPressed & BUTTON_B) {
5012 break;
5013 }
5014
5015 if (battleStatus->curButtonsPressed & BUTTON_A) {
5017 D_802ACC60 = 8;
5020 break;
5021 }
5022
5024 if (battleStatus->curButtonsDown & (BUTTON_Z | BUTTON_R)) {
5025 gBattleStatus.flags1 &= ~BS_FLAGS1_MENU_OPEN;
5026 break;
5027 }
5028
5029 if (battleStatus->curTargetListFlags & TARGET_FLAG_SELECT_ONE) {
5030 s32 oldSelectedTargetIndex = selectedTargetIndex;
5031
5032 if (battleStatus->curButtonsHeld & BUTTON_STICK_LEFT) {
5033 selectedTargetIndex--;
5034 }
5035 if (battleStatus->curButtonsHeld & BUTTON_STICK_RIGHT) {
5036 selectedTargetIndex++;
5037 }
5038 if (selectedTargetIndex < 0) {
5039 selectedTargetIndex = targetListLength - 1;
5040 }
5041 if (selectedTargetIndex >= targetListLength) {
5042 selectedTargetIndex = 0;
5043 }
5044 if (selectedTargetIndex != oldSelectedTargetIndex) {
5045 s32 actorFlags;
5046
5047 target = &actor->targetData[targetIndexList[selectedTargetIndex]];
5048 actorFlags = get_actor(target->actorID)->flags;
5050
5051 if (actorFlags & ACTOR_FLAG_UPSIDE_DOWN) {
5053 } else {
5055 }
5057 }
5058 actor->selectedTargetIndex = selectedTargetIndex;
5059 }
5060 break;
5062 gBattleStatus.flags1 &= ~BS_FLAGS1_MENU_OPEN;
5063 target = &actor->targetData[targetIndexList[actor->selectedTargetIndex]];
5064 actor->targetActorID = target->actorID;
5065 actor->targetPartID = target->partID;
5066
5067 // free the HUD elements for the target pointers
5068 for (i = 0; i < targetListLength; i++) {
5070 }
5071
5072 // begin executing the move
5077 } else {
5079 }
5081 } else {
5085 } else {
5087 }
5089 }
5090 break;
5092 // free the HUD elements for the target pointers
5093 for (i = 0; i < targetListLength; i++) {
5095 }
5096
5099
5100 if (battleStatus->itemUsesLeft != 0) {
5105 } else {
5107 }
5113 } else {
5115 }
5116 } else {
5121 } else {
5123 }
5124 }
5125 break;
5126 }
5127}
HudScript HES_HandPointDownLoop
Definition 5B320.c:173
HudScript HES_HandPointLeftLoop
Definition 5B320.c:234
BSS s32 BattleMenu_TargetHudElems[MAX_ENEMY_ACTORS]
BSS s32 BattleMenu_TargetNameOffsetX
BSS s32 BattleMenu_TargetPointerAlpha
s8 selectedTargetIndex
struct SelectableTarget targetData[24]
s16 targetActorID
s8 targetIndexList[24]
@ BS_FLAGS1_10000
Definition enums.h:3585
@ BS_FLAGS1_PARTNER_ACTING
Definition enums.h:3588
@ BTL_MSG_ACTION_TIP_PRESS_BEFORE_LANDING
Definition enums.h:4105
@ TARGET_FLAG_OVERRIDE
Definition enums.h:1871
@ TARGET_FLAG_SELECT_ONE
Definition enums.h:1849
@ BTL_SUBSTATE_SELECT_TARGET_INIT
Definition enums.h:3781
@ BTL_SUBSTATE_SELECT_TARGET_CHOOSE
Definition enums.h:3782
@ BTL_SUBSTATE_SELECT_TARGET_DONE
Definition enums.h:3783
@ BTL_SUBSTATE_SELECT_TARGET_CANCEL
Definition enums.h:3784
@ BATTLE_STATE_PLAYER_MENU
Definition enums.h:3644
@ BATTLE_STATE_PARTNER_MOVE
Definition enums.h:3650
@ BATTLE_STATE_PARTNER_MENU
Definition enums.h:3645
@ ACTOR_FLAG_UPSIDE_DOWN
HP bar offset below actor (e.g. Swooper when upside-down).
Definition enums.h:3331
@ ACTOR_PART_FLAG_DEFAULT_TARGET
Definition enums.h:3353
ActorPart * get_actor_part(Actor *actor, s32 partID)
Definition 190B20.c:1191
Actor * get_actor(s32 actorID)
Definition actor_api.c:155

Referenced by btl_update().

◆ btl_state_draw_select_target()

void btl_state_draw_select_target ( void )

Definition at line 5129 of file btl_states_menus.c.

5129 {
5130 BattleStatus* battleStatus = &gBattleStatus;
5131 PlayerData* playerData = &gPlayerData;
5132 s32 msgID;
5133 s32 msgX;
5134 s32 msgY;
5135 s32 targetListLength;
5136 s32 currentPartner;
5137 s32 actorID;
5138 SelectableTarget* target;
5139 Actor* choosingActor;
5140 Actor* enemyActor;
5141 s32 id;
5142 s32 i;
5143 s32 nameWidth;
5144 s32 xOffset, yOffset;
5145 f32 targetX, targetY, targetZ;
5146 s32 screenX, screenY, screenZ;
5147 s32 selectedTargetIndex;
5148 s8* targetIndexList;
5149 s32* tmpPtr; // TODO required to match and CURSED
5150
5152 choosingActor = battleStatus->playerActor;
5153 } else {
5154 choosingActor = battleStatus->partnerActor;
5155 }
5156
5157 targetListLength = choosingActor->targetListLength;
5158 target = choosingActor->targetData;
5159 selectedTargetIndex = choosingActor->selectedTargetIndex;
5160 targetIndexList = choosingActor->targetIndexList;
5161
5163
5164 if (targetListLength == 0) {
5165 return;
5166 }
5167
5168 // draw target pointers
5169 if (battleStatus->curTargetListFlags & TARGET_FLAG_SELECT_ONE) {
5170 target = &choosingActor->targetData[targetIndexList[selectedTargetIndex]];
5171 enemyActor = get_actor(target->actorID);
5173 targetX = target->truePos.x;
5174 targetY = target->truePos.y;
5175 targetZ = target->truePos.z;
5176
5177 // select target pointer style based on target actor orientation
5178 if (enemyActor->flags & ACTOR_FLAG_UPSIDE_DOWN) {
5179 xOffset = 16;
5180 yOffset = 2;
5183 }
5184 } else {
5185 xOffset = 5;
5186 yOffset = -11;
5189 }
5190 }
5191
5192 get_screen_coords(CAM_BATTLE, targetX, targetY, targetZ, &screenX, &screenY, &screenZ);
5193 hud_element_set_render_pos(id, screenX + xOffset, screenY + yOffset);
5195 } else {
5196 for (i = 0; i < targetListLength; i++) {
5197 target = &choosingActor->targetData[targetIndexList[i]];
5198 enemyActor = get_actor(target->actorID);
5200 targetX = target->truePos.x;
5201 targetY = target->truePos.y;
5202 targetZ = target->truePos.z;
5203
5204 // select target pointer style based on target actor orientation
5205 if (enemyActor->flags & ACTOR_FLAG_UPSIDE_DOWN) {
5206 xOffset = 16;
5207 yOffset = 2;
5210 }
5211 } else {
5212 xOffset = 5;
5213 yOffset = -11;
5216 }
5217 }
5218
5219 get_screen_coords(CAM_BATTLE, targetX, targetY, targetZ, &screenX, &screenY, &screenZ);
5220 hud_element_set_render_pos(id, screenX + xOffset, screenY + yOffset);
5222 }
5223 }
5224
5225 currentPartner = playerData->curPartner;
5226 screenX = 52;
5227 screenY = 64;
5229 currentPartner = PARTNER_TWINK;
5230 }
5231
5232 // get target name width
5233 if ((battleStatus->curTargetListFlags & TARGET_FLAG_SELECT_ONE) || targetListLength == 1) {
5234 actorID = target->actorID;
5235 if (actorID == ACTOR_PLAYER) {
5236 nameWidth = get_msg_width(MSG_Menus_Battle_TargetMario, 0) + 10;
5237 } else if (actorID == ACTOR_PARTNER) {
5238 nameWidth = get_msg_width(PartnerNameMessages[currentPartner], 0) + 10;
5239 } else {
5240 target = &choosingActor->targetData[targetIndexList[selectedTargetIndex]];
5241 enemyActor = get_actor(target->actorID);
5242 msgID = get_actor_part(enemyActor, target->partID)->staticData->overrideNameMsg;
5243 if (msgID == MSG_NONE) {
5244 msgID = bActorNames[enemyActor->actorType];
5245 }
5246 nameWidth = get_msg_width(msgID, 0) + 10;
5247 }
5248 } else {
5249 target = &choosingActor->targetData[targetIndexList[selectedTargetIndex]];
5250 actorID = target->actorID;
5251 if (actorID == ACTOR_PLAYER) {
5252 nameWidth = get_msg_width(MSG_Menus_Battle_TargetMario, 0) + 10;
5253 } else if (actorID == ACTOR_PARTNER) {
5254 nameWidth = get_msg_width(PartnerNameMessages[currentPartner], 0) + 10;
5255 } else {
5256 nameWidth = get_msg_width(MSG_Menus_Battle_TargetAllEnemies, 0) + 10;
5257 }
5258 }
5259
5260 // draw target name box
5261 draw_box(0, WINDOW_STYLE_4, screenX + BattleMenu_TargetNameOffsetX, screenY, 0, nameWidth, 20, 255, 0,
5262 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, NULL, NULL, NULL, SCREEN_WIDTH, SCREEN_HEIGHT, NULL);
5263
5264 // draw target name text
5265 screenX += 4;
5266 screenY += 2;
5267 if ((battleStatus->curTargetListFlags & TARGET_FLAG_SELECT_ONE) || targetListLength == 1) {
5268 actorID = target->actorID;
5269 if (actorID == ACTOR_PLAYER) {
5270 draw_msg(MSG_Menus_Battle_TargetMario, screenX + BattleMenu_TargetNameOffsetX, screenY, 255, MSG_PAL_36, 0);
5271 } else if (actorID == ACTOR_PARTNER) {
5272 draw_msg(PartnerNameMessages[currentPartner], screenX + BattleMenu_TargetNameOffsetX, screenY, 255, MSG_PAL_36, 0);
5273 } else {
5274 target = &choosingActor->targetData[targetIndexList[selectedTargetIndex]];
5275 enemyActor = get_actor(target->actorID);
5276 msgID = get_actor_part(enemyActor, target->partID)->staticData->overrideNameMsg;
5277 if (msgID == MSG_NONE) {
5278 msgID = bActorNames[enemyActor->actorType];
5279 }
5280 draw_msg(msgID, screenX + *tmpPtr, screenY, 255, MSG_PAL_36, 0); // TODO required to match
5281 }
5282 } else {
5283 target = &choosingActor->targetData[targetIndexList[selectedTargetIndex]];
5284 actorID = target->actorID;
5285 if (actorID == ACTOR_PLAYER) {
5286 draw_msg(MSG_Menus_Battle_TargetMario, screenX + BattleMenu_TargetNameOffsetX, screenY, 255, MSG_PAL_36, 0);
5287 } else if (actorID == ACTOR_PARTNER) {
5288 draw_msg(PartnerNameMessages[currentPartner], screenX + BattleMenu_TargetNameOffsetX, screenY, 255, MSG_PAL_36, 0);
5289 } else {
5290 draw_msg(MSG_Menus_Battle_TargetAllEnemies, screenX + BattleMenu_TargetNameOffsetX, screenY, 255, MSG_PAL_36, 0);
5291 }
5292 }
5293}
s32 PartnerNameMessages[]
ActorPartBlueprint * staticData
#define draw_box
@ WINDOW_STYLE_4
Definition enums.h:6374
@ MSG_PAL_36
Definition enums.h:5459
@ PARTNER_TWINK
Definition enums.h:2896
@ CAM_BATTLE
Definition enums.h:1801
void get_screen_coords(s32 camID, f32 x, f32 y, f32 z, s32 *screenX, s32 *screenY, s32 *screenZ)
Definition cam_main.c:410
HudScript * hud_element_get_script(s32 id)
#define SCREEN_HEIGHT
Definition macros.h:106
s32 bActorNames[]

Referenced by btl_draw_ui().

◆ btl_state_update_22()

void btl_state_update_22 ( void )

Definition at line 5295 of file btl_states_menus.c.

5295 {
5296}

Referenced by btl_update().

◆ btl_state_draw_22()

void btl_state_draw_22 ( void )

Definition at line 5298 of file btl_states_menus.c.

5298 {
5299}

Referenced by btl_draw_ui().

Variable Documentation

◆ HES_YellowArrow

HudScript HES_YellowArrow
extern

Definition at line 273 of file battle_ui_gfx.c.

◆ HES_MenuFlee

HudScript HES_MenuFlee
extern

Definition at line 275 of file battle_ui_gfx.c.

◆ HES_MenuFleeDisabled

HudScript HES_MenuFleeDisabled
extern

Definition at line 277 of file battle_ui_gfx.c.

◆ HES_MenuDefend

HudScript HES_MenuDefend
extern

Definition at line 279 of file battle_ui_gfx.c.

◆ HES_MenuDefendDisabled

HudScript HES_MenuDefendDisabled
extern

Definition at line 281 of file battle_ui_gfx.c.

◆ HES_MenuStrategies

HudScript HES_MenuStrategies
extern

Definition at line 283 of file battle_ui_gfx.c.

◆ HES_MenuStrategiesDisabled

HudScript HES_MenuStrategiesDisabled
extern

Definition at line 285 of file battle_ui_gfx.c.

◆ HES_MenuPouch

HudScript HES_MenuPouch
extern

Definition at line 287 of file battle_ui_gfx.c.

◆ HES_MenuPouchDisabled

HudScript HES_MenuPouchDisabled
extern

Definition at line 289 of file battle_ui_gfx.c.

◆ HES_MenuDoNothing

HudScript HES_MenuDoNothing
extern

Definition at line 291 of file battle_ui_gfx.c.

◆ HES_MenuDoNothingDisabled

HudScript HES_MenuDoNothingDisabled
extern

Definition at line 293 of file battle_ui_gfx.c.

◆ HES_Kooper

HudScript HES_Kooper
extern

Definition at line 1950 of file global_hud_scripts.c.

◆ HES_Bombette

HudScript HES_Bombette
extern

Definition at line 1954 of file global_hud_scripts.c.

◆ HES_Partner0

HudScript HES_Partner0
extern

Definition at line 1942 of file global_hud_scripts.c.

◆ HES_Partner0Disabled

HudScript HES_Partner0Disabled
extern

Definition at line 1944 of file global_hud_scripts.c.

◆ HES_Goombario

HudScript HES_Goombario
extern

Definition at line 1946 of file global_hud_scripts.c.

◆ HES_GoombarioDisabled

HudScript HES_GoombarioDisabled
extern

Definition at line 1948 of file global_hud_scripts.c.

◆ HES_KooperDisabled

HudScript HES_KooperDisabled
extern

Definition at line 1952 of file global_hud_scripts.c.

◆ HES_BombetteDisabled

HudScript HES_BombetteDisabled
extern

Definition at line 1956 of file global_hud_scripts.c.

◆ HES_Parakarry

HudScript HES_Parakarry
extern

Definition at line 1958 of file global_hud_scripts.c.

◆ HES_ParakarryDisabled

HudScript HES_ParakarryDisabled
extern

Definition at line 1960 of file global_hud_scripts.c.

◆ HES_Bow

HudScript HES_Bow
extern

Definition at line 1962 of file global_hud_scripts.c.

◆ HES_BowDisabled

HudScript HES_BowDisabled
extern

Definition at line 1964 of file global_hud_scripts.c.

◆ HES_Watt

HudScript HES_Watt
extern

Definition at line 1966 of file global_hud_scripts.c.

◆ HES_WattDisabled

HudScript HES_WattDisabled
extern

Definition at line 1968 of file global_hud_scripts.c.

◆ HES_Sushie

HudScript HES_Sushie
extern

Definition at line 1970 of file global_hud_scripts.c.

◆ HES_SushieDisabled

HudScript HES_SushieDisabled
extern

Definition at line 1972 of file global_hud_scripts.c.

◆ HES_Lakilester

HudScript HES_Lakilester
extern

Definition at line 1974 of file global_hud_scripts.c.

◆ HES_LakilesterDisabled

HudScript HES_LakilesterDisabled
extern

Definition at line 1976 of file global_hud_scripts.c.

◆ HES_PartnerA

HudScript HES_PartnerA
extern

Definition at line 1982 of file global_hud_scripts.c.

◆ HES_PartnerADisabled

HudScript HES_PartnerADisabled
extern

Definition at line 1984 of file global_hud_scripts.c.

◆ HES_MenuBoots1

HudScript HES_MenuBoots1
extern

Definition at line 2140 of file global_hud_scripts.c.

◆ HES_MenuBoots1Disabled

HudScript HES_MenuBoots1Disabled
extern

Definition at line 2142 of file global_hud_scripts.c.

◆ HES_MenuBoots2

HudScript HES_MenuBoots2
extern

Definition at line 2144 of file global_hud_scripts.c.

◆ HES_MenuBoots2Disabled

HudScript HES_MenuBoots2Disabled
extern

Definition at line 2146 of file global_hud_scripts.c.

◆ HES_MenuBoots3

HudScript HES_MenuBoots3
extern

Definition at line 2148 of file global_hud_scripts.c.

◆ HES_MenuBoots3Disabled

HudScript HES_MenuBoots3Disabled
extern

Definition at line 2150 of file global_hud_scripts.c.

◆ HES_MenuHammer1

HudScript HES_MenuHammer1
extern

Definition at line 2152 of file global_hud_scripts.c.

◆ HES_MenuHammer1Disabled

HudScript HES_MenuHammer1Disabled
extern

Definition at line 2154 of file global_hud_scripts.c.

◆ HES_MenuHammer2

HudScript HES_MenuHammer2
extern

Definition at line 2156 of file global_hud_scripts.c.

◆ HES_MenuHammer2Disabled

HudScript HES_MenuHammer2Disabled
extern

Definition at line 2158 of file global_hud_scripts.c.

◆ HES_MenuHammer3

HudScript HES_MenuHammer3
extern

Definition at line 2160 of file global_hud_scripts.c.

◆ HES_MenuHammer3Disabled

HudScript HES_MenuHammer3Disabled
extern

Definition at line 2162 of file global_hud_scripts.c.

◆ HES_MenuItem

HudScript HES_MenuItem
extern

Definition at line 2164 of file global_hud_scripts.c.

◆ HES_MenuItemDisabled

HudScript HES_MenuItemDisabled
extern

Definition at line 2166 of file global_hud_scripts.c.

◆ HES_MenuStarPower

HudScript HES_MenuStarPower
extern

Definition at line 2168 of file global_hud_scripts.c.

Referenced by btl_submenu_moves_update().

◆ HES_MenuStarPowerDisabled

HudScript HES_MenuStarPowerDisabled
extern

Definition at line 2170 of file global_hud_scripts.c.

◆ HES_Eldstar

HudScript HES_Eldstar
extern

Definition at line 1906 of file global_hud_scripts.c.

◆ HES_EldstarDisabled

HudScript HES_EldstarDisabled
extern

Definition at line 1908 of file global_hud_scripts.c.

◆ HES_Mamar

HudScript HES_Mamar
extern

Definition at line 1910 of file global_hud_scripts.c.

◆ HES_MamarDisabled

HudScript HES_MamarDisabled
extern

Definition at line 1912 of file global_hud_scripts.c.

◆ HES_Skolar

HudScript HES_Skolar
extern

Definition at line 1914 of file global_hud_scripts.c.

◆ HES_SkolarDisabled

HudScript HES_SkolarDisabled
extern

Definition at line 1916 of file global_hud_scripts.c.

◆ HES_Muskular

HudScript HES_Muskular
extern

Definition at line 1918 of file global_hud_scripts.c.

◆ HES_MuskularDisabled

HudScript HES_MuskularDisabled
extern

Definition at line 1920 of file global_hud_scripts.c.

◆ HES_Misstar

HudScript HES_Misstar
extern

Definition at line 1922 of file global_hud_scripts.c.

◆ HES_MisstarDisabled

HudScript HES_MisstarDisabled
extern

Definition at line 1924 of file global_hud_scripts.c.

◆ HES_Klevar

HudScript HES_Klevar
extern

Definition at line 1926 of file global_hud_scripts.c.

◆ HES_KlevarDisabled

HudScript HES_KlevarDisabled
extern

Definition at line 1928 of file global_hud_scripts.c.

◆ HES_Kalmar

HudScript HES_Kalmar
extern

Definition at line 1930 of file global_hud_scripts.c.

◆ HES_KalmarDisabled

HudScript HES_KalmarDisabled
extern

Definition at line 1932 of file global_hud_scripts.c.

◆ HES_StarBeam

HudScript HES_StarBeam
extern

Definition at line 1934 of file global_hud_scripts.c.

◆ HES_StarBeamDisabled

HudScript HES_StarBeamDisabled
extern

Definition at line 1936 of file global_hud_scripts.c.

◆ HES_PeachBeam

HudScript HES_PeachBeam
extern

Definition at line 1938 of file global_hud_scripts.c.

◆ HES_PeachBeamDisabled

HudScript HES_PeachBeamDisabled
extern

Definition at line 1940 of file global_hud_scripts.c.

◆ HES_MoveDiamond

HudScript HES_MoveDiamond
extern

Definition at line 2591 of file global_hud_scripts.c.

◆ HES_MoveDiamond_disabled

HudScript HES_MoveDiamond_disabled
extern

Definition at line 2599 of file global_hud_scripts.c.

◆ HES_MoveBlueOrb

HudScript HES_MoveBlueOrb
extern

Definition at line 2593 of file global_hud_scripts.c.

◆ HES_MoveBlueOrbDisabled

HudScript HES_MoveBlueOrbDisabled
extern

Definition at line 2601 of file global_hud_scripts.c.

◆ HES_MoveGreenOrb

HudScript HES_MoveGreenOrb
extern

Definition at line 2595 of file global_hud_scripts.c.

◆ HES_MoveGreenOrbDisabled

HudScript HES_MoveGreenOrbDisabled
extern

Definition at line 2603 of file global_hud_scripts.c.

◆ HES_MoveRedOrb

HudScript HES_MoveRedOrb
extern

Definition at line 2597 of file global_hud_scripts.c.

◆ HES_MoveRedOrbDisabled

HudScript HES_MoveRedOrbDisabled
extern

Definition at line 2605 of file global_hud_scripts.c.

◆ HES_GreenArrowDown

HudScript HES_GreenArrowDown
extern

Definition at line 1866 of file global_hud_scripts.c.

1866 {
1868 hs_SetCustomSize(16, 8)
1869 hs_Loop
1871 hs_SetCI(9, ui_green_arrow_down)
1873 hs_SetCI(6, ui_green_arrow_down)
1875 hs_End
1876};
#define hs_SetCustomSize(arg0, arg1)
#define hs_SetVisible
#define hs_End
@ HUD_ELEMENT_FLAG_200000
Definition hud_element.h:94
#define hs_Restart
#define hs_Loop
#define hs_SetCI(time, name)
#define hs_ClearFlags(arg0)
#define hs_SetFlags(arg0)

Referenced by btl_submenu_moves_update(), and btl_update_strats_menu().

◆ HES_GreenArrowUp

HudScript HES_GreenArrowUp
extern

Definition at line 1878 of file global_hud_scripts.c.

1878 {
1880 hs_SetCustomSize(16, 8)
1881 hs_Loop
1883 hs_SetCI(9, ui_green_arrow_up)
1885 hs_SetCI(6, ui_green_arrow_up)
1887 hs_End
1888};

Referenced by btl_submenu_moves_update(), and btl_update_strats_menu().

◆ HES_HandPointer

HudScript HES_HandPointer
extern

Definition at line 727 of file global_hud_scripts.c.

Referenced by btl_submenu_moves_update(), and btl_update_strats_menu().

◆ HES_HandPointDownLoop

HudScript HES_HandPointDownLoop
extern

Definition at line 173 of file 5B320.c.

173 {
176 hs_Loop
177 hs_SetTexelOffset(0, -1)
178 hs_SetIcon(1, anim_hand_0)
179 hs_SetTexelOffset(0, -1)
180 hs_SetIcon(1, anim_hand_0)
181 hs_SetTexelOffset(0, -1)
182 hs_SetIcon(1, anim_hand_0)
183 hs_SetTexelOffset(0, -1)
184 hs_SetIcon(1, anim_hand_0)
185 hs_SetTexelOffset(2, -1)
186 hs_SetIcon(1, anim_hand_1)
187 hs_SetTexelOffset(2, -1)
188 hs_SetIcon(1, anim_hand_2)
189 hs_SetTexelOffset(2, -1)
190 hs_SetIcon(4, anim_hand_3)
192 hs_SetIcon(1, anim_hand_1)
194 hs_SetIcon(1, anim_hand_0)
195 hs_SetTexelOffset(0, -1)
196 hs_SetIcon(14, anim_hand_4)
198 hs_End
199};
#define hs_SetTileSize(size)
#define hs_SetTexelOffset(x, y)
#define hs_SetIcon(time, icon)
@ HUD_ELEMENT_SIZE_24x24
Definition hud_element.h:47

Referenced by btl_state_draw_select_target(), and btl_state_update_select_target().

◆ HES_HandPointLeftLoop

HudScript HES_HandPointLeftLoop
extern

Definition at line 234 of file 5B320.c.

234 {
237 hs_Loop
239 hs_SetIcon(1, anim_hand_5)
241 hs_SetIcon(1, anim_hand_5)
243 hs_SetIcon(1, anim_hand_5)
245 hs_SetIcon(1, anim_hand_5)
246 hs_SetTexelOffset(0, -1)
247 hs_SetIcon(1, anim_hand_6)
248 hs_SetTexelOffset(0, -1)
249 hs_SetIcon(1, anim_hand_7)
250 hs_SetTexelOffset(1, -3)
251 hs_SetIcon(4, anim_hand_8)
253 hs_SetIcon(1, anim_hand_6)
255 hs_SetIcon(1, anim_hand_5)
257 hs_SetIcon(14, anim_hand_9)
259 hs_End
260};

Referenced by btl_state_draw_select_target(), and btl_state_update_select_target().

◆ HES_FPCost

HudScript HES_FPCost
extern

Definition at line 1821 of file global_hud_scripts.c.

Referenced by btl_submenu_moves_update().

◆ HES_FPCostReduced

HudScript HES_FPCostReduced
extern

Definition at line 1823 of file global_hud_scripts.c.

Referenced by btl_submenu_moves_update().

◆ HES_FPCostReducedTwice

HudScript HES_FPCostReducedTwice
extern

Definition at line 1825 of file global_hud_scripts.c.

Referenced by btl_submenu_moves_update().

◆ HES_POWCost

HudScript HES_POWCost
extern

Definition at line 1829 of file global_hud_scripts.c.

Referenced by btl_submenu_moves_update().

◆ HES_POWCostReduced

HudScript HES_POWCostReduced
extern

Definition at line 1831 of file global_hud_scripts.c.

Referenced by btl_submenu_moves_update().

◆ HES_POWCostReducedTwice

HudScript HES_POWCostReducedTwice
extern

Definition at line 1833 of file global_hud_scripts.c.

Referenced by btl_submenu_moves_update().

◆ HES_StatusFlower

HudScript HES_StatusFlower
extern

Definition at line 2069 of file global_hud_scripts.c.

2069 {
2071 hs_Loop
2072 hs_SetRGBA(60, ui_stat_flower_png)
2074 hs_End
2075};
#define hs_SetRGBA(time, image)
@ HUD_ELEMENT_SIZE_16x16
Definition hud_element.h:46

Referenced by btl_submenu_moves_update().

◆ HES_NotEnoughFP

HudScript HES_NotEnoughFP
extern

Definition at line 1827 of file global_hud_scripts.c.

Referenced by btl_menu_moves_draw_content().

◆ HES_NotEnoughPOW

HudScript HES_NotEnoughPOW
extern

Definition at line 1835 of file global_hud_scripts.c.

Referenced by btl_menu_moves_draw_content().

◆ HES_ProjectorBeam

HudScript HES_ProjectorBeam
extern

Definition at line 532 of file battle_ui_gfx.c.

532 {
534 hs_SetCustomSize(64, 64)
535 hs_Loop
536 hs_SetRGBA(60, ui_battle_projector_beam_png)
538 hs_End
539};
#define hs_UseIA8

Referenced by btl_main_menu_update().

◆ HES_ProjectorReel

HudScript HES_ProjectorReel
extern

Definition at line 514 of file battle_ui_gfx.c.

514 {
516 hs_SetCustomSize(64, 64)
517 hs_Loop
518 hs_SetRGBA(60, ui_battle_projector_reel_png)
520 hs_End
521};

Referenced by btl_main_menu_update().

◆ HES_ProjectorSpot

HudScript HES_ProjectorSpot
extern

Definition at line 523 of file battle_ui_gfx.c.

523 {
525 hs_SetCustomSize(32, 32)
526 hs_Loop
527 hs_SetRGBA(60, ui_battle_projector_spot_png)
529 hs_End
530};

Referenced by btl_main_menu_update().

◆ HES_SwapArrowLeft

HudScript HES_SwapArrowLeft
extern

Definition at line 543 of file battle_ui_gfx.c.

543 {
545 hs_SetCustomSize(8, 16)
546 hs_Loop
547 hs_SetCI(12, ui_battle_swap_arrow_left)
548 hs_SetCI(8, ui_battle_swap_arrow_left)
550 hs_End
551};

Referenced by btl_main_menu_update().

◆ HES_SwapArrowRight

HudScript HES_SwapArrowRight
extern

Definition at line 553 of file battle_ui_gfx.c.

553 {
555 hs_SetCustomSize(8, 16)
556 hs_Loop
557 hs_SetCI(10, ui_battle_swap_arrow_right)
558 hs_SetCI(10, ui_battle_swap_arrow_right)
560 hs_End
561};

Referenced by btl_main_menu_update().

◆ HES_SwapBackground

HudScript HES_SwapBackground
extern

Definition at line 563 of file battle_ui_gfx.c.

563 {
565 hs_SetCustomSize(48, 16)
566 hs_Loop
567 hs_SetRGBA(60, ui_battle_swap_background_png)
569 hs_End
570};

Referenced by btl_main_menu_update().

◆ HES_SwapZ

HudScript HES_SwapZ
extern

Definition at line 541 of file battle_ui_gfx.c.

Referenced by btl_main_menu_update().

◆ gItemHudScripts

◆ D_802AB340

s16 D_802AB340[] = { 28, 40 }

Definition at line 124 of file btl_states_menus.c.

124{ 28, 40 };

Referenced by btl_submenu_moves_update().

◆ D_802AB344

s16 D_802AB344[] = { 0, -2 }

Definition at line 126 of file btl_states_menus.c.

126{ 0, -2 };

Referenced by btl_menu_moves_show_error().

◆ battle_menu_JumpHudScripts

IconHudScriptPair battle_menu_JumpHudScripts[]
Initial value:
= {
}
HudScript HES_MenuBoots2Disabled
HudScript HES_MenuBoots1Disabled
HudScript HES_MenuBoots3Disabled
HudScript HES_MenuBoots2
HudScript HES_MenuBoots3
HudScript HES_MenuBoots1

Definition at line 128 of file btl_states_menus.c.

Referenced by btl_state_update_player_menu().

◆ battle_menu_HammerHudScripts

IconHudScriptPair battle_menu_HammerHudScripts[]

◆ battle_menu_ItemHudScripts

IconHudScriptPair battle_menu_ItemHudScripts = { &HES_MenuItem, &HES_MenuItemDisabled }

Definition at line 142 of file btl_states_menus.c.

HudScript HES_MenuItemDisabled
HudScript HES_MenuItem

Referenced by btl_state_update_player_menu().

◆ battle_menu_StarPowerHudScripts

IconHudScriptPair battle_menu_StarPowerHudScripts = { &HES_MenuStarPower, &HES_MenuStarPowerDisabled }

◆ battle_menu_StarPowerMovesHudScripts

HudScript* battle_menu_StarPowerMovesHudScripts[]
Initial value:
= {
}
HudScript HES_Muskular
HudScript HES_MuskularDisabled
HudScript HES_Mamar
HudScript HES_MisstarDisabled
HudScript HES_Misstar
HudScript HES_MamarDisabled
HudScript HES_EldstarDisabled
HudScript HES_Kalmar
HudScript HES_Eldstar
HudScript HES_KalmarDisabled
HudScript HES_StarBeam
HudScript HES_PeachBeamDisabled
HudScript HES_PeachBeam
HudScript HES_Klevar
HudScript HES_StarBeamDisabled
HudScript HES_Skolar
HudScript HES_SkolarDisabled
HudScript HES_KlevarDisabled

Definition at line 147 of file btl_states_menus.c.

Referenced by btl_state_update_partner_menu(), and btl_state_update_player_menu().

◆ battle_menu_PartnerHudScripts

HudScript* battle_menu_PartnerHudScripts[]

◆ battle_menu_DisabledPartnerHudScripts

HudScript* battle_menu_DisabledPartnerHudScripts[]
Initial value:

Definition at line 169 of file btl_states_menus.c.

Referenced by btl_state_update_partner_menu(), and btl_state_update_player_menu().

◆ battle_menu_StrategiesHudScript

IconHudScriptPair battle_menu_StrategiesHudScript = { &HES_MenuStrategies, &HES_MenuStrategiesDisabled }

Definition at line 176 of file btl_states_menus.c.

HudScript HES_MenuStrategiesDisabled
HudScript HES_MenuStrategies

Referenced by btl_state_update_partner_menu(), and btl_state_update_player_menu().

◆ battle_menu_DoNothingHudScripts

IconHudScriptPair battle_menu_DoNothingHudScripts = { &HES_MenuDoNothing, &HES_MenuDoNothingDisabled }

Definition at line 178 of file btl_states_menus.c.

HudScript HES_MenuDoNothing
HudScript HES_MenuDoNothingDisabled

Referenced by btl_state_update_partner_menu(), and btl_state_update_player_menu().

◆ battle_menu_FleeHudScripts

IconHudScriptPair battle_menu_FleeHudScripts = { &HES_MenuFlee, &HES_MenuFleeDisabled }

Definition at line 180 of file btl_states_menus.c.

HudScript HES_MenuFlee
HudScript HES_MenuFleeDisabled

Referenced by btl_state_update_player_menu().

◆ BattleMenu_LeftJustMessages

s32 BattleMenu_LeftJustMessages[]
Initial value:
= {
MSG_Menus_Jump,
MSG_Menus_Hammer,
MSG_Menus_Items,
MSG_Menus_RunAway,
MSG_Menus_Defense,
MSG_Menus_ChangeMember,
MSG_Menus_Abilities,
MSG_Menus_Strategies,
MSG_Menus_StarSpirits,
MSG_Menus_DoNothing,
MSG_Menus_ActLater,
MSG_Menus_Focus,
}

Definition at line 182 of file btl_states_menus.c.

182 {
183 MSG_Menus_Jump,
184 MSG_Menus_Hammer,
185 MSG_Menus_Items,
186 MSG_Menus_RunAway,
187 MSG_Menus_Defense,
188 MSG_Menus_ChangeMember,
189 MSG_Menus_Abilities,
190 MSG_Menus_Strategies,
191 MSG_Menus_StarSpirits,
192 MSG_Menus_DoNothing,
193 MSG_Menus_ActLater,
194 MSG_Menus_Focus,
195};

Referenced by btl_state_update_partner_menu(), and btl_state_update_player_menu().

◆ BattleMenu_CenteredMessages

s32 BattleMenu_CenteredMessages[]
Initial value:
= {
MSG_Menus_Jump_Centered,
MSG_Menus_Hammer_Centered,
MSG_Menus_Items_Centered,
MSG_Menus_RunAway_Centered,
MSG_Menus_Defense_Centered,
MSG_Menus_ChangeMember_Centered,
MSG_Menus_Abilities_Centered,
MSG_Menus_Strategies_Centered,
MSG_Menus_StarSpirits_Centered,
MSG_Menus_DoNothing_Centered,
MSG_Menus_ActLater_Centered,
MSG_Menus_Focus_Centered,
}

Definition at line 197 of file btl_states_menus.c.

197 {
198 MSG_Menus_Jump_Centered,
199 MSG_Menus_Hammer_Centered,
200 MSG_Menus_Items_Centered,
201 MSG_Menus_RunAway_Centered,
202 MSG_Menus_Defense_Centered,
203 MSG_Menus_ChangeMember_Centered,
204 MSG_Menus_Abilities_Centered,
205 MSG_Menus_Strategies_Centered,
206 MSG_Menus_StarSpirits_Centered,
207 MSG_Menus_DoNothing_Centered,
208 MSG_Menus_ActLater_Centered,
209 MSG_Menus_Focus_Centered,
210};

Referenced by btl_state_update_partner_menu(), and btl_state_update_player_menu().

◆ BattleMenu_CategoryForSubmenu

◆ BattleMenu_PartnerThinkAnims

AnimID BattleMenu_PartnerThinkAnims[]
Initial value:
= {
[PARTNER_GOOMBARIO] ANIM_BattleGoombario_Think,
[PARTNER_KOOPER] ANIM_BattleKooper_Think,
[PARTNER_BOMBETTE] ANIM_BattleBombette_Think,
[PARTNER_PARAKARRY] ANIM_BattleParakarry_Think,
[PARTNER_GOOMPA] ANIM_Goompa_Idle,
[PARTNER_WATT] ANIM_BattleWatt_Think,
[PARTNER_SUSHIE] ANIM_BattleSushie_Think,
[PARTNER_LAKILESTER] ANIM_BattleLakilester_Run,
[PARTNER_BOW] ANIM_BattleBow_Still,
0x00000000,
0x00000000
}
@ PARTNER_BOMBETTE
Definition enums.h:2888
@ PARTNER_LAKILESTER
Definition enums.h:2893
@ PARTNER_WATT
Definition enums.h:2891
@ PARTNER_BOW
Definition enums.h:2894
@ PARTNER_SUSHIE
Definition enums.h:2892
@ PARTNER_PARAKARRY
Definition enums.h:2889
@ PARTNER_GOOMBARIA
Definition enums.h:2895
@ PARTNER_KOOPER
Definition enums.h:2887
@ PARTNER_GOOMBARIO
Definition enums.h:2886

Definition at line 227 of file btl_states_menus.c.

227 {
228 [PARTNER_GOOMBARIO] ANIM_BattleGoombario_Think,
229 [PARTNER_KOOPER] ANIM_BattleKooper_Think,
230 [PARTNER_BOMBETTE] ANIM_BattleBombette_Think,
231 [PARTNER_PARAKARRY] ANIM_BattleParakarry_Think,
232 [PARTNER_GOOMPA] ANIM_Goompa_Idle,
233 [PARTNER_WATT] ANIM_BattleWatt_Think,
234 [PARTNER_SUSHIE] ANIM_BattleSushie_Think,
235 [PARTNER_LAKILESTER] ANIM_BattleLakilester_Run,
236 [PARTNER_BOW] ANIM_BattleBow_Still,
238 [PARTNER_TWINK] 0,
239 0x00000000,
240 0x00000000
241};

Referenced by btl_state_update_partner_menu().

◆ BattleMenu_PartnerIdleAnims

AnimID BattleMenu_PartnerIdleAnims[]
Initial value:
= {
[PARTNER_GOOMBARIO] ANIM_BattleGoombario_Walk,
[PARTNER_KOOPER] ANIM_BattleKooper_Walk,
[PARTNER_BOMBETTE] ANIM_BattleBombette_Walk,
[PARTNER_PARAKARRY] ANIM_BattleParakarry_Walk,
[PARTNER_GOOMPA] ANIM_Goompa_Walk,
[PARTNER_WATT] ANIM_BattleWatt_Walk,
[PARTNER_SUSHIE] ANIM_BattleSushie_Walk,
[PARTNER_LAKILESTER] ANIM_BattleLakilester_Walk,
[PARTNER_BOW] ANIM_BattleBow_Walk,
0x00000000,
0x00000000
}

Definition at line 243 of file btl_states_menus.c.

243 {
244 [PARTNER_GOOMBARIO] ANIM_BattleGoombario_Walk,
245 [PARTNER_KOOPER] ANIM_BattleKooper_Walk,
246 [PARTNER_BOMBETTE] ANIM_BattleBombette_Walk,
247 [PARTNER_PARAKARRY] ANIM_BattleParakarry_Walk,
248 [PARTNER_GOOMPA] ANIM_Goompa_Walk,
249 [PARTNER_WATT] ANIM_BattleWatt_Walk,
250 [PARTNER_SUSHIE] ANIM_BattleSushie_Walk,
251 [PARTNER_LAKILESTER] ANIM_BattleLakilester_Walk,
252 [PARTNER_BOW] ANIM_BattleBow_Walk,
254 [PARTNER_TWINK] 0,
255 0x00000000,
256 0x00000000
257};

Referenced by btl_state_update_partner_menu().

◆ battle_menu_PartnerMoveHudScripts

HudScript* battle_menu_PartnerMoveHudScripts[10][10]
Initial value:
= {
}
HudScript HES_MoveGreenOrbDisabled
HudScript HES_MoveBlueOrb
HudScript HES_MoveRedOrbDisabled
HudScript HES_MoveDiamond
HudScript HES_MoveBlueOrbDisabled
HudScript HES_MoveDiamond_disabled
HudScript HES_MoveGreenOrb
HudScript HES_MoveRedOrb

Definition at line 259 of file btl_states_menus.c.

259 {
269};

Referenced by btl_state_update_partner_menu().

◆ battle_menu_PeachStarPowerHudScripts

IconHudScriptPair battle_menu_PeachStarPowerHudScripts = { &HES_MenuStarPower, &HES_MenuStarPowerDisabled }

◆ D_802AB728

s32 D_802AB728[]
Initial value:
= {
MSG_Menus_Focus_Centered,
}

Definition at line 273 of file btl_states_menus.c.

273 {
274 MSG_Menus_Focus_Centered,
275};

Referenced by btl_state_update_peach_menu().

◆ battle_menu_TwinkStarPowerHudScripts

IconHudScriptPair battle_menu_TwinkStarPowerHudScripts = { &HES_MenuStarPower, &HES_MenuStarPowerDisabled }

◆ D_802AB734

s32 D_802AB734[]
Initial value:
= {
MSG_Menus_Dash_Centered,
}

Definition at line 279 of file btl_states_menus.c.

279 {
280 MSG_Menus_Dash_Centered,
281};

Referenced by btl_state_update_twink_menu().

◆ PartnerNameMessages

s32 PartnerNameMessages[]
Initial value:
= {
MSG_NONE,
MSG_Menus_Party_Goombario,
MSG_Menus_Party_Kooper,
MSG_Menus_Party_Bombette,
MSG_Menus_Party_Parakarry,
MSG_Menus_Party_Goompa,
MSG_Menus_Party_Watt,
MSG_Menus_Party_Sushie,
MSG_Menus_Party_Lakilester,
MSG_Menus_Party_Bow,
MSG_Menus_Party_Goombaria,
MSG_Menus_Party_Twink,
MSG_Menus_Party_Peach,
MSG_NONE
}

Definition at line 283 of file btl_states_menus.c.

283 {
284 MSG_NONE,
285 MSG_Menus_Party_Goombario,
286 MSG_Menus_Party_Kooper,
287 MSG_Menus_Party_Bombette,
288 MSG_Menus_Party_Parakarry,
289 MSG_Menus_Party_Goompa,
290 MSG_Menus_Party_Watt,
291 MSG_Menus_Party_Sushie,
292 MSG_Menus_Party_Lakilester,
293 MSG_Menus_Party_Bow,
294 MSG_Menus_Party_Goombaria,
295 MSG_Menus_Party_Twink,
296 MSG_Menus_Party_Peach,
297 MSG_NONE
298};

Referenced by btl_state_draw_select_target().

◆ D_802ACC60

◆ BattleMenu_TargetPointerAlpha

BSS s32 BattleMenu_TargetPointerAlpha

◆ BattleMenu_TargetNameOffsetX

BSS s32 BattleMenu_TargetNameOffsetX

◆ BattleMenu_SwapDelay

◆ BattleMenu_TargetHudElems

BSS s32 BattleMenu_TargetHudElems[MAX_ENEMY_ACTORS]

◆ D_802ACCD0

BSS PopupMenu D_802ACCD0

◆ BattleMenuState

◆ D_802AD001

BSS s8 D_802AD001

Definition at line 307 of file btl_states_menus.c.

Referenced by btl_main_menu_update(), and func_802A1030().

◆ BattleMenu_CurPos

◆ BattleMenu_PrevPos

BSS s8 BattleMenu_PrevPos

Definition at line 309 of file btl_states_menus.c.

Referenced by btl_main_menu_update().

◆ D_802AD004

BSS s8 D_802AD004

Definition at line 310 of file btl_states_menus.c.

Referenced by btl_main_menu_draw(), and btl_main_menu_update().

◆ D_802AD006

BSS s16 D_802AD006

◆ BattleMenuAlpha

◆ D_802AD00A

BSS s16 D_802AD00A

Definition at line 313 of file btl_states_menus.c.

Referenced by btl_main_menu_draw(), and btl_main_menu_update().

◆ D_802AD00C

BSS s16 D_802AD00C

Definition at line 315 of file btl_states_menus.c.

◆ D_802AD010

BSS s32 D_802AD010[6]

◆ D_802AD028

BSS s32 D_802AD028[6]

◆ D_802AD040

BSS s32 D_802AD040

◆ D_802AD044

BSS s32 D_802AD044

◆ D_802AD048

BSS s32 D_802AD048

◆ D_802AD04C

BSS s32 D_802AD04C

◆ D_802AD050

BSS s32 D_802AD050

◆ D_802AD054

BSS s32 D_802AD054

◆ D_802AD058

BSS s32 D_802AD058

◆ D_802AD05C

BSS s32 D_802AD05C

◆ BattleMenu_BasePosX

BSS s32 BattleMenu_BasePosX

Definition at line 327 of file btl_states_menus.c.

Referenced by btl_main_menu_draw(), and btl_main_menu_update().

◆ BattleMenu_BasePosY

BSS s32 BattleMenu_BasePosY

Definition at line 328 of file btl_states_menus.c.

Referenced by btl_main_menu_draw(), and btl_main_menu_update().

◆ BattleMenuDisableMsg

BSS s8 BattleMenuDisableMsg

Definition at line 329 of file btl_states_menus.c.

Referenced by btl_main_menu_init(), and btl_main_menu_update().

◆ BattleMenu_MinIdx

BSS s8 BattleMenu_MinIdx

Definition at line 330 of file btl_states_menus.c.

Referenced by btl_main_menu_update().

◆ BattleMenu_MaxIdx

BSS s8 BattleMenu_MaxIdx

Definition at line 331 of file btl_states_menus.c.

Referenced by btl_main_menu_update().

◆ BattleMenu_HomePos

◆ BattleMenu_WheelAngle

BSS f32 BattleMenu_WheelAngle

Definition at line 333 of file btl_states_menus.c.

Referenced by btl_main_menu_draw(), and btl_main_menu_update().

◆ D_802AD070

BSS f32 D_802AD070

Definition at line 334 of file btl_states_menus.c.

Referenced by btl_main_menu_draw(), and btl_main_menu_update().

◆ D_802AD074

BSS s32 D_802AD074

Definition at line 336 of file btl_states_menus.c.

◆ BattleMenu_HudScripts

◆ BattleMenu_TitleMessages

◆ D_802AD0A8

◆ BattleMenu_NumOptions

◆ D_802AD0B0

◆ D_802AD0B4

BSS s32 D_802AD0B4

Definition at line 344 of file btl_states_menus.c.

◆ battle_menu_submenuIDs

◆ BattleMenu_OptionEnabled

◆ battle_menu_isMessageDisabled

◆ D_802AD100

◆ BattleMenu_ShowSwapIcons

◆ battle_menu_moveState

◆ battle_menu_moveCursorPos

BSS s8 battle_menu_moveCursorPos

◆ D_802AD10A

BSS s8 D_802AD10A

Definition at line 353 of file btl_states_menus.c.

Referenced by btl_submenu_moves_update(), and func_802A2684().

◆ D_802AD10B

BSS s8 D_802AD10B

Definition at line 354 of file btl_states_menus.c.

Referenced by btl_submenu_moves_update().

◆ battle_menu_moveScrollLine

BSS s8 battle_menu_moveScrollLine

◆ D_802AD10D

BSS s8 D_802AD10D

◆ D_802AD10E

BSS s8 D_802AD10E

◆ D_802AD10F

BSS s8 D_802AD10F

◆ battle_menu_moveScrollOffset

BSS s16 battle_menu_moveScrollOffset

◆ D_802AD112

BSS s16 D_802AD112

◆ BattleMenu_Moves_TextColor

BSS s16 BattleMenu_Moves_TextColor

◆ BattleMenu_Moves_TextAlpha

◆ BattleMenu_Moves_CursorID

◆ BattleMenu_Moves_UpArrowID

◆ BattleMenu_Moves_DownArrowID

BSS HudElemID BattleMenu_Moves_DownArrowID

◆ D_802AD124

BSS s32 D_802AD124

Definition at line 367 of file btl_states_menus.c.

◆ BattleMenu_Moves_OptionIDs

BSS HudElemID BattleMenu_Moves_OptionIDs[24]

◆ BattleMenu_Moves_TitleID

◆ D_802AD18C

BSS s32 D_802AD18C

Definition at line 372 of file btl_states_menus.c.

◆ BattleMenu_Moves_OptionCostUnitIDs

BSS HudElemID BattleMenu_Moves_OptionCostUnitIDs[24]

◆ BattleMenu_Moves_PosX

BSS s16 BattleMenu_Moves_PosX

Definition at line 375 of file btl_states_menus.c.

Referenced by btl_submenu_moves_update().

◆ BattleMenu_Moves_PosY

BSS s16 BattleMenu_Moves_PosY

Definition at line 376 of file btl_states_menus.c.

Referenced by btl_submenu_moves_update().

◆ D_802AD1F4

BSS s32 D_802AD1F4

Definition at line 378 of file btl_states_menus.c.

◆ BattleMenu_Moves_OptionIndexMap

BSS s32 BattleMenu_Moves_OptionIndexMap[24]

◆ D_802AD258

BSS s32 D_802AD258

Definition at line 381 of file btl_states_menus.c.

Referenced by btl_menu_moves_show_error(), and btl_submenu_moves_update().

◆ D_802AD25C

BSS s32 D_802AD25C

Definition at line 383 of file btl_states_menus.c.

◆ battle_menu_moveOptionIconScripts

BSS HudScript* battle_menu_moveOptionIconScripts[24]

◆ battle_menu_moveOptionNames

BSS s32 battle_menu_moveOptionNames[24]

◆ battle_menu_moveOptionDisplayCosts

BSS s32 battle_menu_moveOptionDisplayCosts[24]

◆ battle_menu_moveOptionDisplayCostReductions

BSS s32 battle_menu_moveOptionDisplayCostReductions[24]

◆ battle_menu_moveOptionDisplayCostReductionColors

BSS s32 battle_menu_moveOptionDisplayCostReductionColors[24]

◆ battle_menu_moveOptionBPCosts

BSS s32 battle_menu_moveOptionBPCosts[24]

◆ BattleMenu_UsingSpiritsSubmenu

◆ BattleMenu_Moves_OptionCount

◆ D_802AD4A8

BSS s32 D_802AD4A8

◆ D_802AD4AC

BSS s32 D_802AD4AC

Definition at line 395 of file btl_states_menus.c.

◆ BattleMenu_Moves_OptionIndices

BSS s32 BattleMenu_Moves_OptionIndices[24]

◆ BattleMenu_Moves_OptionEnabled

BSS s32 BattleMenu_Moves_OptionEnabled[24]

◆ BattleMenu_Moves_OptionDescMessages

BSS s32 BattleMenu_Moves_OptionDescMessages[24]

◆ BattleMenu_Moves_OptionSortPriority

BSS s8 BattleMenu_Moves_OptionSortPriority[24]

◆ BattleMenu_Moves_OptionCantUseMessages

BSS s8 BattleMenu_Moves_OptionCantUseMessages[24]

◆ battle_menu_moveOptionActive

BSS s32 battle_menu_moveOptionActive

◆ BattleSubmenuStratsState

◆ StratsMenuPos

◆ OldStratsMenuPos

BSS s8 OldStratsMenuPos

Definition at line 405 of file btl_states_menus.c.

Referenced by btl_update_strats_menu(), and func_802A45D8().

◆ ShowingErrorMessage

◆ D_802AD608

BSS s8 D_802AD608

◆ D_802AD609

BSS s8 D_802AD609

◆ StratsMenuLines

BSS s8 StratsMenuLines

◆ D_802AD60B

BSS s8 D_802AD60B

◆ D_802AD60C

BSS s16 D_802AD60C

◆ D_802AD60E

BSS s16 D_802AD60E

◆ D_802AD610

BSS s16 D_802AD610

Definition at line 413 of file btl_states_menus.c.

Referenced by btl_menu_strats_show_error(), and btl_update_strats_menu().

◆ D_802AD612

BSS s16 D_802AD612

Definition at line 414 of file btl_states_menus.c.

Referenced by btl_update_strats_menu().

◆ D_802AD614

◆ D_802AD618

◆ GreenArrowUpID

◆ GreenArrowDownID

◆ D_802AD624

◆ D_802AD628

◆ D_802AD63C

BSS s16 D_802AD63C

Definition at line 428 of file btl_states_menus.c.

Referenced by btl_update_strats_menu().

◆ D_802AD63E

BSS s16 D_802AD63E

Definition at line 429 of file btl_states_menus.c.

Referenced by btl_update_strats_menu().

◆ D_802AD640

◆ D_802AD658

◆ D_802AD66C

◆ StratsMenuLastPos

BSS s32 StratsMenuLastPos

◆ D_802AD674

BSS s32 D_802AD674

Definition at line 436 of file btl_states_menus.c.

◆ D_802AD678

◆ D_802AD690

◆ D_802AD6A8

BSS s32 D_802AD6A8[6]

◆ D_802AD6C0

◆ D_802AD6D4

BSS s32 D_802AD6D4

Definition at line 442 of file btl_states_menus.c.

Referenced by btl_update_strats_menu(), and func_802A45D8().

◆ MenuIndexFromPartnerID

s32 MenuIndexFromPartnerID[]
extern

Definition at line 316 of file 5B320.c.

316 {
317 [PARTNER_NONE] 0,
319 [PARTNER_KOOPER] 2,
322 [PARTNER_GOOMPA] 0,
323 [PARTNER_WATT] 6,
324 [PARTNER_SUSHIE] 7,
326 [PARTNER_BOW] 5,
328 [PARTNER_TWINK] 0,
329};

Referenced by btl_state_update_partner_menu(), and btl_state_update_player_menu().