diff --git a/include/battle_message.h b/include/battle_message.h index 914e97d5d6b4..d73dbf386e7d 100644 --- a/include/battle_message.h +++ b/include/battle_message.h @@ -273,7 +273,7 @@ void ExpandBattleTextBuffPlaceholders(const u8 *src, u8 *dst); extern struct BattleMsgData *gBattleMsgDataPtr; extern const u8 *const gBattleStringsTable[]; -extern const u8 *const gStatNamesTable[]; +extern const u8 *const gStatNamesTable[NUM_BATTLE_STATS]; extern const u8 *const gPokeblockWasTooXStringTable[]; extern const u8 *const gRefereeStringsTable[]; extern const u8 *const gRoundsStringTable[]; diff --git a/include/event_data.h b/include/event_data.h index 04287b7ed665..ef229b2ffc35 100644 --- a/include/event_data.h +++ b/include/event_data.h @@ -48,4 +48,6 @@ extern u16 gSpecialVar_MonBoxId; extern u16 gSpecialVar_MonBoxPos; extern u16 gSpecialVar_Unused_0x8014; +extern const u16 gBadgeFlags[NUM_BADGES]; + #endif // GUARD_EVENT_DATA_H diff --git a/src/battle_message.c b/src/battle_message.c index fbc1f6035373..ccb355923398 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -137,9 +137,14 @@ static const u8 sText_Evasiveness[] = _("evasiveness"); const u8 *const gStatNamesTable[NUM_BATTLE_STATS] = { - sText_HP, sText_Attack, sText_Defense, - sText_Speed, sText_SpAttack, sText_SpDefense, - sText_Accuracy, sText_Evasiveness + [STAT_HP] = sText_HP, + [STAT_ATK] = sText_Attack, + [STAT_DEF] = sText_Defense, + [STAT_SPEED] = sText_Speed, + [STAT_SPATK] = sText_SpAttack, + [STAT_SPDEF] = sText_SpDefense, + [STAT_ACC] = sText_Accuracy, + [STAT_EVASION] = sText_Evasiveness, }; const u8 *const gPokeblockWasTooXStringTable[FLAVOR_COUNT] = { diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 34a5a83ed971..8b590900431c 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -299,11 +299,6 @@ static const u16 sTrappingMoves[NUM_TRAPPING_MOVES] = MOVE_THUNDER_CAGE }; -static const u16 sBadgeFlags[8] = { - FLAG_BADGE01_GET, FLAG_BADGE02_GET, FLAG_BADGE03_GET, FLAG_BADGE04_GET, - FLAG_BADGE05_GET, FLAG_BADGE06_GET, FLAG_BADGE07_GET, FLAG_BADGE08_GET, -}; - static const u16 sWhiteOutBadgeMoney[9] = { 8, 16, 24, 36, 48, 64, 80, 100, 120 }; #define STAT_CHANGE_WORKED 0 @@ -8319,9 +8314,9 @@ static void Cmd_getmoneyreward(void) sPartyLevel = GetMonData(&gPlayerParty[i], MON_DATA_LEVEL); } } - for (count = 0, i = 0; i < ARRAY_COUNT(sBadgeFlags); i++) + for (count = 0, i = 0; i < ARRAY_COUNT(gBadgeFlags); i++) { - if (FlagGet(sBadgeFlags[i]) == TRUE) + if (FlagGet(gBadgeFlags[i]) == TRUE) ++count; } money = sWhiteOutBadgeMoney[count] * sPartyLevel; diff --git a/src/battle_setup.c b/src/battle_setup.c index 37204c1d8d80..62eb192b758b 100644 --- a/src/battle_setup.c +++ b/src/battle_setup.c @@ -360,12 +360,6 @@ const struct RematchTrainer gRematchTable[REMATCH_TABLE_ENTRIES] = [REMATCH_WALLACE] = REMATCH(TRAINER_WALLACE, TRAINER_WALLACE, TRAINER_WALLACE, TRAINER_WALLACE, TRAINER_WALLACE, EVER_GRANDE_CITY), }; -static const u16 sBadgeFlags[NUM_BADGES] = -{ - FLAG_BADGE01_GET, FLAG_BADGE02_GET, FLAG_BADGE03_GET, FLAG_BADGE04_GET, - FLAG_BADGE05_GET, FLAG_BADGE06_GET, FLAG_BADGE07_GET, FLAG_BADGE08_GET, -}; - #define tState data[0] #define tTransition data[1] @@ -1920,9 +1914,9 @@ static bool32 HasAtLeastFiveBadges(void) { s32 i, count; - for (count = 0, i = 0; i < ARRAY_COUNT(sBadgeFlags); i++) + for (count = 0, i = 0; i < ARRAY_COUNT(gBadgeFlags); i++) { - if (FlagGet(sBadgeFlags[i]) == TRUE) + if (FlagGet(gBadgeFlags[i]) == TRUE) { if (++count >= 5) return TRUE; diff --git a/src/debug.c b/src/debug.c index d9b382092d56..e529ac696424 100644 --- a/src/debug.c +++ b/src/debug.c @@ -278,25 +278,15 @@ struct DebugMonData bool8 isShiny:1; u8 nature:5; u8 abilityNum:2; - u8 mon_iv_hp; - u8 mon_iv_atk; - u8 mon_iv_def; - u8 mon_iv_speed; - u8 mon_iv_satk; - u8 mon_iv_sdef; + u8 monIVs[NUM_STATS]; u16 mon_move_0; u16 mon_move_1; u16 mon_move_2; u16 mon_move_3; - u8 mon_ev_hp; - u8 mon_ev_atk; - u8 mon_ev_def; - u8 mon_ev_speed; - u8 mon_ev_satk; - u8 mon_ev_sdef; - u8 teraType; - u8 dynamaxLevel:7; - u8 gmaxFactor:1; + u8 monEVs[NUM_STATS]; + u8 teraType; + u8 dynamaxLevel:7; + u8 gmaxFactor:1; }; struct DebugMenuListData @@ -509,133 +499,20 @@ static const u8 sDebugText_Colored_False[] = _("{COLOR RED}FALSE"); static const u8 sDebugText_Dashes[] = _("---"); static const u8 sDebugText_Empty[] = _(""); static const u8 sDebugText_Continue[] = _("Continue…{CLEAR_TO 110}{RIGHT_ARROW}"); -// Main Menu -static const u8 sDebugText_Utilities[] = _("Utilities…{CLEAR_TO 110}{RIGHT_ARROW}"); -static const u8 sDebugText_PCBag[] = _("PC/Bag…{CLEAR_TO 110}{RIGHT_ARROW}"); -static const u8 sDebugText_Party[] = _("Party…{CLEAR_TO 110}{RIGHT_ARROW}"); -static const u8 sDebugText_Scripts[] = _("Scripts…{CLEAR_TO 110}{RIGHT_ARROW}"); -static const u8 sDebugText_FlagsVars[] = _("Flags & Vars…{CLEAR_TO 110}{RIGHT_ARROW}"); -static const u8 sDebugText_Battle[] = _("Battle Test{CLEAR_TO 110}{RIGHT_ARROW}"); -static const u8 sDebugText_Give[] = _("Give X…{CLEAR_TO 110}{RIGHT_ARROW}"); -static const u8 sDebugText_Sound[] = _("Sound…{CLEAR_TO 110}{RIGHT_ARROW}"); -static const u8 sDebugText_Cancel[] = _("Cancel"); -// Script menu -static const u8 sDebugText_Util_Script_1[] = _("Script 1"); -static const u8 sDebugText_Util_Script_2[] = _("Script 2"); -static const u8 sDebugText_Util_Script_3[] = _("Script 3"); -static const u8 sDebugText_Util_Script_4[] = _("Script 4"); -static const u8 sDebugText_Util_Script_5[] = _("Script 5"); -static const u8 sDebugText_Util_Script_6[] = _("Script 6"); -static const u8 sDebugText_Util_Script_7[] = _("Script 7"); -static const u8 sDebugText_Util_Script_8[] = _("Script 8"); // Util Menu -static const u8 sDebugText_Util_FlyToMap[] = _("Fly to map…{CLEAR_TO 110}{RIGHT_ARROW}"); -static const u8 sDebugText_Util_WarpToMap[] = _("Warp to map warp…{CLEAR_TO 110}{RIGHT_ARROW}"); static const u8 sDebugText_Util_WarpToMap_SelectMapGroup[] = _("Group: {STR_VAR_1}{CLEAR_TO 90}\n{CLEAR_TO 90}\n\n{STR_VAR_3}{CLEAR_TO 90}"); static const u8 sDebugText_Util_WarpToMap_SelectMap[] = _("Map: {STR_VAR_1}{CLEAR_TO 90}\nMapSec:{CLEAR_TO 90}\n{STR_VAR_2}{CLEAR_TO 90}\n{STR_VAR_3}{CLEAR_TO 90}"); static const u8 sDebugText_Util_WarpToMap_SelectWarp[] = _("Warp:{CLEAR_TO 90}\n{STR_VAR_1}{CLEAR_TO 90}\n{CLEAR_TO 90}\n{STR_VAR_3}{CLEAR_TO 90}"); static const u8 sDebugText_Util_WarpToMap_SelMax[] = _("{STR_VAR_1} / {STR_VAR_2}"); -static const u8 sDebugText_Util_SaveBlockSpace[] = _("Save Block space…{CLEAR_TO 110}{RIGHT_ARROW}"); -static const u8 sDebugText_Util_ROMSpace[] = _("ROM space…{CLEAR_TO 110}{RIGHT_ARROW}"); -static const u8 sDebugText_Util_Weather[] = _("Set weather…{CLEAR_TO 110}{RIGHT_ARROW}"); static const u8 sDebugText_Util_Weather_ID[] = _("Weather ID: {STR_VAR_3}\n{STR_VAR_1}\n{STR_VAR_2}"); -static const u8 sDebugText_Util_FontTest[] = _("Font Test…{CLEAR_TO 110}{RIGHT_ARROW}"); -static const u8 sDebugText_Util_CheckWallClock[] = _("Check wall clock…{CLEAR_TO 110}{RIGHT_ARROW}"); -static const u8 sDebugText_Util_SetWallClock[] = _("Set wall clock…{CLEAR_TO 110}{RIGHT_ARROW}"); -static const u8 sDebugText_Util_WatchCredits[] = _("Watch credits…{CLEAR_TO 110}{RIGHT_ARROW}"); -static const u8 sDebugText_Util_Player_Name[] = _("Player name"); -static const u8 sDebugText_Util_Player_Gender[] = _("Toggle gender"); -static const u8 sDebugText_Util_Player_Id[] = _("New Trainer ID"); -static const u8 sDebugText_Util_CheatStart[] = _("Cheat start"); -static const u8 sDebugText_Util_ExpansionVersion[] = _("Expansion Version"); -static const u8 sDebugText_Util_BerryFunctions[] = _("Berry Functions…{CLEAR_TO 110}{RIGHT_ARROW}"); -static const u8 sDebugText_Util_EWRAMCounters[] = _("EWRAM Counters…{CLEAR_TO 110}{RIGHT_ARROW}"); -static const u8 sDebugText_Util_Steven_Multi[] = _("Steven Multi"); -// PC/Bag Menu -static const u8 sDebugText_PCBag_Fill[] = _("Fill…{CLEAR_TO 110}{RIGHT_ARROW}"); -static const u8 sDebugText_PCBag_Fill_Pc_Fast[] = _("Fill PC Boxes Fast"); -static const u8 sDebugText_PCBag_Fill_Pc_Slow[] = _("Fill PC Boxes Slow (LAG!)"); -static const u8 sDebugText_PCBag_Fill_Pc_Items[] = _("Fill PC Items"); -static const u8 sDebugText_PCBag_Fill_PocketItems[] = _("Fill Pocket Items"); -static const u8 sDebugText_PCBag_Fill_PocketPokeBalls[] = _("Fill Pocket Poké Balls"); -static const u8 sDebugText_PCBag_Fill_PocketTMHM[] = _("Fill Pocket TMHM"); -static const u8 sDebugText_PCBag_Fill_PocketBerries[] = _("Fill Pocket Berries"); -static const u8 sDebugText_PCBag_Fill_PocketKeyItems[] = _("Fill Pocket Key Items"); -static const u8 sDebugText_PCBag_AccessPC[] = _("Access PC"); -static const u8 sDebugText_PCBag_ClearBag[] = _("Clear Bag"); -static const u8 sDebugText_PCBag_ClearBoxes[] = _("Clear Storage Boxes"); -// Party/Boxes Menu -static const u8 sDebugText_Party_MoveReminder[] = _("Move Reminder"); -static const u8 sDebugText_Party_HatchAnEgg[] = _("Hatch an Egg"); -static const u8 sDebugText_Party_HealParty[] = _("Heal party"); -static const u8 sDebugText_Party_InflictStatus1[] = _("Inflict Status1"); -static const u8 sDebugText_Party_CheckEVs[] = _("Check EVs"); -static const u8 sDebugText_Party_CheckIVs[] = _("Check IVs"); -static const u8 sDebugText_Party_ClearParty[] = _("Clear Party"); // Flags/Vars Menu -static const u8 sDebugText_FlagsVars_Flags[] = _("Set Flag XYZ…{CLEAR_TO 110}{RIGHT_ARROW}"); static const u8 sDebugText_FlagsVars_Flag[] = _("Flag: {STR_VAR_1}{CLEAR_TO 90}\n{STR_VAR_2}{CLEAR_TO 90}\n{STR_VAR_3}"); -static const u8 sDebugText_FlagsVars_FlagHex[] = _("{STR_VAR_1}{CLEAR_TO 90}\n0x{STR_VAR_2}{CLEAR_TO 90}"); -static const u8 sDebugText_FlagsVars_Vars[] = _("Set Var XYZ…{CLEAR_TO 110}{RIGHT_ARROW}"); static const u8 sDebugText_FlagsVars_VariableHex[] = _("{STR_VAR_1}{CLEAR_TO 90}\n0x{STR_VAR_2}{CLEAR_TO 90}"); static const u8 sDebugText_FlagsVars_Variable[] = _("Var: {STR_VAR_1}{CLEAR_TO 90}\nVal: {STR_VAR_3}{CLEAR_TO 90}\n{STR_VAR_2}"); static const u8 sDebugText_FlagsVars_VariableValueSet[] = _("Var: {STR_VAR_1}{CLEAR_TO 90}\nVal: {STR_VAR_3}{CLEAR_TO 90}\n{STR_VAR_2}"); -static const u8 sDebugText_FlagsVars_PokedexFlags_All[] = _("Pokédex Flags All"); -static const u8 sDebugText_FlagsVars_PokedexFlags_Reset[] = _("Pokédex Flags Reset"); -static const u8 sDebugText_FlagsVars_SwitchDex[] = _("Toggle {STR_VAR_1}Pokédex"); -static const u8 sDebugText_FlagsVars_SwitchNationalDex[] = _("Toggle {STR_VAR_1}National Dex"); -static const u8 sDebugText_FlagsVars_SwitchPokeNav[] = _("Toggle {STR_VAR_1}PokéNav"); -static const u8 sDebugText_FlagsVars_SwitchMatchCall[] = _("Toggle {STR_VAR_1}Match Call"); -static const u8 sDebugText_FlagsVars_RunningShoes[] = _("Toggle {STR_VAR_1}Running Shoes"); -static const u8 sDebugText_FlagsVars_ToggleFlyFlags[] = _("Toggle {STR_VAR_1}Fly Flags"); -static const u8 sDebugText_FlagsVars_ToggleAllBadges[] = _("Toggle {STR_VAR_1}All badges"); -static const u8 sDebugText_FlagsVars_ToggleGameClear[] = _("Toggle {STR_VAR_1}Game clear"); -static const u8 sDebugText_FlagsVars_ToggleFrontierPass[] = _("Toggle {STR_VAR_1}Frontier Pass"); -static const u8 sDebugText_FlagsVars_SwitchCollision[] = _("Toggle {STR_VAR_1}Collision OFF"); -static const u8 sDebugText_FlagsVars_SwitchEncounter[] = _("Toggle {STR_VAR_1}Encounter OFF"); -static const u8 sDebugText_FlagsVars_SwitchTrainerSee[] = _("Toggle {STR_VAR_1}Trainer See OFF"); -static const u8 sDebugText_FlagsVars_SwitchBagUse[] = _("Toggle {STR_VAR_1}Bag Use OFF"); -static const u8 sDebugText_FlagsVars_SwitchCatching[] = _("Toggle {STR_VAR_1}Catching OFF"); -// Battle -static const u8 sDebugText_Battle_0_Wild[] = _("Wild…{CLEAR_TO 110}{RIGHT_ARROW}"); -static const u8 sDebugText_Battle_0_WildDouble[] = _("Wild Double…{CLEAR_TO 110}{RIGHT_ARROW}"); -static const u8 sDebugText_Battle_0_Single[] = _("Single…{CLEAR_TO 110}{RIGHT_ARROW}"); -static const u8 sDebugText_Battle_0_Double[] = _("Double…{CLEAR_TO 110}{RIGHT_ARROW}"); -static const u8 sDebugText_Battle_0_Mulit[] = _("Multi…{CLEAR_TO 110}{RIGHT_ARROW}"); -static const u8 sDebugText_Battle_1_AIFlag_00[] = _("{STR_VAR_1}Check bad move"); -static const u8 sDebugText_Battle_1_AIFlag_01[] = _("{STR_VAR_1}Try to faint"); -static const u8 sDebugText_Battle_1_AIFlag_02[] = _("{STR_VAR_1}Check viability"); -static const u8 sDebugText_Battle_1_AIFlag_03[] = _("{STR_VAR_1}Setup first turn"); -static const u8 sDebugText_Battle_1_AIFlag_04[] = _("{STR_VAR_1}Risky"); -static const u8 sDebugText_Battle_1_AIFlag_05[] = _("{STR_VAR_1}Prefer strongest move"); -static const u8 sDebugText_Battle_1_AIFlag_06[] = _("{STR_VAR_1}Prefer Baton Pass"); -static const u8 sDebugText_Battle_1_AIFlag_07[] = _("{STR_VAR_1}Double battle"); -static const u8 sDebugText_Battle_1_AIFlag_08[] = _("{STR_VAR_1}HP aware"); -static const u8 sDebugText_Battle_1_AIFlag_09[] = _("{STR_VAR_1}Negate Unaware"); -static const u8 sDebugText_Battle_1_AIFlag_10[] = _("{STR_VAR_1}Will suicide"); -static const u8 sDebugText_Battle_1_AIFlag_11[] = _("{STR_VAR_1}Help partner"); -static const u8 sDebugText_Battle_1_AIFlag_12[] = _("{STR_VAR_1}Prefer status moves"); -static const u8 sDebugText_Battle_1_AIFlag_13[] = _("{STR_VAR_1}Stall"); -static const u8 sDebugText_Battle_1_AIFlag_14[] = _("{STR_VAR_1}Screener"); -static const u8 sDebugText_Battle_1_AIFlag_15[] = _("{STR_VAR_1}Smart switching"); -static const u8 sDebugText_Battle_1_AIFlag_16[] = _("{STR_VAR_1}Ace pokemon"); -static const u8 sDebugText_Battle_1_AIFlag_17[] = _("{STR_VAR_1}Omniscient"); -static const u8 sDebugText_Battle_2_Terrain_0[] = _("Grass…{CLEAR_TO 110}{RIGHT_ARROW}"); -static const u8 sDebugText_Battle_2_Terrain_1[] = _("Long grass…{CLEAR_TO 110}{RIGHT_ARROW}"); -static const u8 sDebugText_Battle_2_Terrain_2[] = _("Sand…{CLEAR_TO 110}{RIGHT_ARROW}"); -static const u8 sDebugText_Battle_2_Terrain_3[] = _("Underwater…{CLEAR_TO 110}{RIGHT_ARROW}"); -static const u8 sDebugText_Battle_2_Terrain_4[] = _("Water…{CLEAR_TO 110}{RIGHT_ARROW}"); -static const u8 sDebugText_Battle_2_Terrain_5[] = _("Pond…{CLEAR_TO 110}{RIGHT_ARROW}"); -static const u8 sDebugText_Battle_2_Terrain_6[] = _("Mountain…{CLEAR_TO 110}{RIGHT_ARROW}"); -static const u8 sDebugText_Battle_2_Terrain_7[] = _("Cave…{CLEAR_TO 110}{RIGHT_ARROW}"); -static const u8 sDebugText_Battle_2_Terrain_8[] = _("Building…{CLEAR_TO 110}{RIGHT_ARROW}"); -static const u8 sDebugText_Battle_2_Terrain_9[] = _("Plain…{CLEAR_TO 110}{RIGHT_ARROW}"); // Give Menu -static const u8 sDebugText_Give_GiveItem[] = _("Give item XYZ…{CLEAR_TO 110}{RIGHT_ARROW}"); static const u8 sDebugText_ItemQuantity[] = _("Quantity:{CLEAR_TO 90}\n{STR_VAR_1}{CLEAR_TO 90}\n\n{STR_VAR_2}"); static const u8 sDebugText_ItemID[] = _("Item ID: {STR_VAR_3}\n{STR_VAR_1}{CLEAR_TO 90}\n\n{STR_VAR_2}"); -static const u8 sDebugText_Give_GivePokemonSimple[] = _("Pokémon (Basic){CLEAR_TO 110}{RIGHT_ARROW}"); -static const u8 sDebugText_Give_GivePokemonComplex[] = _("Pokémon (Complex){CLEAR_TO 110}{RIGHT_ARROW}"); static const u8 sDebugText_PokemonID[] = _("Species: {STR_VAR_3}\n{STR_VAR_1}{CLEAR_TO 90}\n\n{STR_VAR_2}{CLEAR_TO 90}"); static const u8 sDebugText_PokemonLevel[] = _("Level:{CLEAR_TO 90}\n{STR_VAR_1}{CLEAR_TO 90}\n{CLEAR_TO 90}\n{STR_VAR_2}{CLEAR_TO 90}"); static const u8 sDebugText_PokemonShiny[] = _("Shiny:{CLEAR_TO 90}\n {STR_VAR_2}{CLEAR_TO 90}\n{CLEAR_TO 90}\n{CLEAR_TO 90}"); @@ -644,58 +521,26 @@ static const u8 sDebugText_PokemonAbility[] = _("Ability Num: {STR_VAR static const u8 sDebugText_PokemonTeraType[] = _("Tera Type: {STR_VAR_3}{CLEAR_TO 90}\n{STR_VAR_1}{CLEAR_TO 90}\n{CLEAR_TO 90}\n{STR_VAR_2}{CLEAR_TO 90}"); static const u8 sDebugText_PokemonDynamaxLevel[] = _("Dmax Lvl:{CLEAR_TO 90}\n{STR_VAR_1}{CLEAR_TO 90}\n{CLEAR_TO 90}\n{STR_VAR_2}{CLEAR_TO 90}"); static const u8 sDebugText_PokemonGmaxFactor[] = _("Gmax Factor:{CLEAR_TO 90}\n {STR_VAR_2}{CLEAR_TO 90}\n{CLEAR_TO 90}\n{CLEAR_TO 90}"); -static const u8 sDebugText_PokemonIVs[] = _("All IVs:{CLEAR_TO 90}\n {STR_VAR_3}{CLEAR_TO 90}\n{CLEAR_TO 90}\n{STR_VAR_2}{CLEAR_TO 90}"); -static const u8 sDebugText_PokemonEVs[] = _("All EVs:{CLEAR_TO 90}\n {STR_VAR_3}{CLEAR_TO 90}\n{CLEAR_TO 90}\n{STR_VAR_2}{CLEAR_TO 90}"); -static const u8 sDebugText_IV_HP[] = _("IV HP:{CLEAR_TO 90}\n {STR_VAR_3}{CLEAR_TO 90}\n{CLEAR_TO 90}\n{STR_VAR_2}{CLEAR_TO 90}"); -static const u8 sDebugText_IV_Attack[] = _("IV Attack:{CLEAR_TO 90}\n {STR_VAR_3}{CLEAR_TO 90}\n{CLEAR_TO 90}\n{STR_VAR_2}{CLEAR_TO 90}"); -static const u8 sDebugText_IV_Defense[] = _("IV Defense:{CLEAR_TO 90}\n {STR_VAR_3}{CLEAR_TO 90}\n{CLEAR_TO 90}\n{STR_VAR_2}{CLEAR_TO 90}"); -static const u8 sDebugText_IV_Speed[] = _("IV Speed:{CLEAR_TO 90}\n {STR_VAR_3}{CLEAR_TO 90}\n{CLEAR_TO 90}\n{STR_VAR_2}{CLEAR_TO 90}"); -static const u8 sDebugText_IV_SpAttack[] = _("IV Sp. Attack:{CLEAR_TO 90}\n {STR_VAR_3}{CLEAR_TO 90}\n{CLEAR_TO 90}\n{STR_VAR_2}{CLEAR_TO 90}"); -static const u8 sDebugText_IV_SpDefense[] = _("IV Sp. Defense:{CLEAR_TO 90}\n {STR_VAR_3}{CLEAR_TO 90}\n{CLEAR_TO 90}\n{STR_VAR_2}{CLEAR_TO 90}"); -static const u8 sDebugText_EV_HP[] = _("EV HP:{CLEAR_TO 90}\n {STR_VAR_3}{CLEAR_TO 90}\n{CLEAR_TO 90}\n{STR_VAR_2}{CLEAR_TO 90}"); -static const u8 sDebugText_EV_Attack[] = _("EV Attack:{CLEAR_TO 90}\n {STR_VAR_3}{CLEAR_TO 90}\n{CLEAR_TO 90}\n{STR_VAR_2}{CLEAR_TO 90}"); -static const u8 sDebugText_EV_Defense[] = _("EV Defense:{CLEAR_TO 90}\n {STR_VAR_3}{CLEAR_TO 90}\n{CLEAR_TO 90}\n{STR_VAR_2}{CLEAR_TO 90}"); -static const u8 sDebugText_EV_Speed[] = _("EV Speed:{CLEAR_TO 90}\n {STR_VAR_3}{CLEAR_TO 90}\n{CLEAR_TO 90}\n{STR_VAR_2}{CLEAR_TO 90}"); -static const u8 sDebugText_EV_SpAttack[] = _("EV Sp. Attack:{CLEAR_TO 90}\n {STR_VAR_3}{CLEAR_TO 90}\n{CLEAR_TO 90}\n{STR_VAR_2}{CLEAR_TO 90}"); -static const u8 sDebugText_EV_SpDefense[] = _("EV Sp. Defense:{CLEAR_TO 90}\n {STR_VAR_3}{CLEAR_TO 90}\n{CLEAR_TO 90}\n{STR_VAR_2}{CLEAR_TO 90}"); +static const u8 sDebugText_IVs[] = _("IV {STR_VAR_1}:{CLEAR_TO 90}\n {STR_VAR_3}{CLEAR_TO 90}\n{CLEAR_TO 90}\n{STR_VAR_2}{CLEAR_TO 90}"); +static const u8 sDebugText_EVs[] = _("EV {STR_VAR_1}:{CLEAR_TO 90}\n {STR_VAR_3}{CLEAR_TO 90}\n{CLEAR_TO 90}\n{STR_VAR_2}{CLEAR_TO 90}"); static const u8 sDebugText_PokemonMove_0[] = _("Move 0: {STR_VAR_3}{CLEAR_TO 90}\n{STR_VAR_1}{CLEAR_TO 90}\n{CLEAR_TO 90}\n{STR_VAR_2}{CLEAR_TO 90}"); static const u8 sDebugText_PokemonMove_1[] = _("Move 1: {STR_VAR_3}{CLEAR_TO 90}\n{STR_VAR_1}{CLEAR_TO 90}\n{CLEAR_TO 90}\n{STR_VAR_2}{CLEAR_TO 90}"); static const u8 sDebugText_PokemonMove_2[] = _("Move 2: {STR_VAR_3}{CLEAR_TO 90}\n{STR_VAR_1}{CLEAR_TO 90}\n{CLEAR_TO 90}\n{STR_VAR_2}{CLEAR_TO 90}"); static const u8 sDebugText_PokemonMove_3[] = _("Move 3: {STR_VAR_3}{CLEAR_TO 90}\n{STR_VAR_1}{CLEAR_TO 90}\n{CLEAR_TO 90}\n{STR_VAR_2}{CLEAR_TO 90}"); -static const u8 sDebugText_Give_MaxMoney[] = _("Max Money"); -static const u8 sDebugText_Give_MaxCoins[] = _("Max Coins"); -static const u8 sDebugText_Give_BattlePoints[] = _("Max Battle Points"); -static const u8 sDebugText_Give_DaycareEgg[] = _("Daycare Egg"); // Sound Menu -static const u8 sDebugText_Sound_SFX[] = _("SFX…{CLEAR_TO 110}{RIGHT_ARROW}"); static const u8 sDebugText_Sound_SFX_ID[] = _("SFX ID: {STR_VAR_3} {START_BUTTON} Stop\n{STR_VAR_1} \n{STR_VAR_2}"); -static const u8 sDebugText_Sound_Music[] = _("Music…{CLEAR_TO 110}{RIGHT_ARROW}"); static const u8 sDebugText_Sound_Music_ID[] = _("Music ID: {STR_VAR_3} {START_BUTTON} Stop\n{STR_VAR_1} \n{STR_VAR_2}"); -// Berry Function Menu -static const u8 sDebugText_BerryFunctions_ClearAll[] = _("Clear map trees"); -static const u8 sDebugText_BerryFunctions_Ready[] = _("Ready map trees"); -static const u8 sDebugText_BerryFunctions_NextStage[] = _("Grow map trees"); -static const u8 sDebugText_BerryFunctions_Pests[] = _("Give map trees pests"); -static const u8 sDebugText_BerryFunctions_Weeds[] = _("Give map trees weeds"); - -static const u8 sDebugText_Digit_1[] = _("{LEFT_ARROW}+1{RIGHT_ARROW} "); -static const u8 sDebugText_Digit_10[] = _("{LEFT_ARROW}+10{RIGHT_ARROW} "); -static const u8 sDebugText_Digit_100[] = _("{LEFT_ARROW}+100{RIGHT_ARROW} "); -static const u8 sDebugText_Digit_1000[] = _("{LEFT_ARROW}+1000{RIGHT_ARROW} "); -static const u8 sDebugText_Digit_10000[] = _("{LEFT_ARROW}+10000{RIGHT_ARROW} "); -static const u8 sDebugText_Digit_100000[] = _("{LEFT_ARROW}+100000{RIGHT_ARROW} "); -static const u8 sDebugText_Digit_1000000[] = _("{LEFT_ARROW}+1000000{RIGHT_ARROW} "); -static const u8 sDebugText_Digit_10000000[] = _("{LEFT_ARROW}+10000000{RIGHT_ARROW} "); + const u8 *const gText_DigitIndicator[] = { - sDebugText_Digit_1, - sDebugText_Digit_10, - sDebugText_Digit_100, - sDebugText_Digit_1000, - sDebugText_Digit_10000, - sDebugText_Digit_100000, - sDebugText_Digit_1000000, - sDebugText_Digit_10000000 + COMPOUND_STRING("{LEFT_ARROW}+1{RIGHT_ARROW} "), + COMPOUND_STRING("{LEFT_ARROW}+10{RIGHT_ARROW} "), + COMPOUND_STRING("{LEFT_ARROW}+100{RIGHT_ARROW} "), + COMPOUND_STRING("{LEFT_ARROW}+1000{RIGHT_ARROW} "), + COMPOUND_STRING("{LEFT_ARROW}+10000{RIGHT_ARROW} "), + COMPOUND_STRING("{LEFT_ARROW}+100000{RIGHT_ARROW} "), + COMPOUND_STRING("{LEFT_ARROW}+1000000{RIGHT_ARROW} "), + COMPOUND_STRING("{LEFT_ARROW}+10000000{RIGHT_ARROW} "), }; static const s32 sPowersOfTen[] = @@ -716,173 +561,173 @@ static const s32 sPowersOfTen[] = // List Menu Items static const struct ListMenuItem sDebugMenu_Items_Main[] = { - [DEBUG_MENU_ITEM_UTILITIES] = {sDebugText_Utilities, DEBUG_MENU_ITEM_UTILITIES}, - [DEBUG_MENU_ITEM_PCBAG] = {sDebugText_PCBag, DEBUG_MENU_ITEM_PCBAG}, - [DEBUG_MENU_ITEM_PARTY] = {sDebugText_Party, DEBUG_MENU_ITEM_PARTY}, - [DEBUG_MENU_ITEM_GIVE] = {sDebugText_Give, DEBUG_MENU_ITEM_GIVE}, - [DEBUG_MENU_ITEM_SCRIPTS] = {sDebugText_Scripts, DEBUG_MENU_ITEM_SCRIPTS}, - [DEBUG_MENU_ITEM_FLAGVAR] = {sDebugText_FlagsVars, DEBUG_MENU_ITEM_FLAGVAR}, - //[DEBUG_MENU_ITEM_BATTLE] = {sDebugText_Battle, DEBUG_MENU_ITEM_BATTLE}, - [DEBUG_MENU_ITEM_SOUND] = {sDebugText_Sound, DEBUG_MENU_ITEM_SOUND}, - [DEBUG_MENU_ITEM_CANCEL] = {sDebugText_Cancel, DEBUG_MENU_ITEM_CANCEL}, + [DEBUG_MENU_ITEM_UTILITIES] = {COMPOUND_STRING("Utilities…{CLEAR_TO 110}{RIGHT_ARROW}"), DEBUG_MENU_ITEM_UTILITIES}, + [DEBUG_MENU_ITEM_PCBAG] = {COMPOUND_STRING("PC/Bag…{CLEAR_TO 110}{RIGHT_ARROW}"), DEBUG_MENU_ITEM_PCBAG}, + [DEBUG_MENU_ITEM_PARTY] = {COMPOUND_STRING("Party…{CLEAR_TO 110}{RIGHT_ARROW}"), DEBUG_MENU_ITEM_PARTY}, + [DEBUG_MENU_ITEM_GIVE] = {COMPOUND_STRING("Give X…{CLEAR_TO 110}{RIGHT_ARROW}"), DEBUG_MENU_ITEM_GIVE}, + [DEBUG_MENU_ITEM_SCRIPTS] = {COMPOUND_STRING("Scripts…{CLEAR_TO 110}{RIGHT_ARROW}"), DEBUG_MENU_ITEM_SCRIPTS}, + [DEBUG_MENU_ITEM_FLAGVAR] = {COMPOUND_STRING("Flags & Vars…{CLEAR_TO 110}{RIGHT_ARROW}"), DEBUG_MENU_ITEM_FLAGVAR}, + //[DEBUG_MENU_ITEM_BATTLE] = {COMPOUND_STRING("Battle Test{CLEAR_TO 110}{RIGHT_ARROW}"), DEBUG_MENU_ITEM_BATTLE}, + [DEBUG_MENU_ITEM_SOUND] = {COMPOUND_STRING("Sound…{CLEAR_TO 110}{RIGHT_ARROW}"), DEBUG_MENU_ITEM_SOUND}, + [DEBUG_MENU_ITEM_CANCEL] = {COMPOUND_STRING("Cancel"), DEBUG_MENU_ITEM_CANCEL}, }; static const struct ListMenuItem sDebugMenu_Items_Utilities[] = { - [DEBUG_UTIL_MENU_ITEM_FLY] = {sDebugText_Util_FlyToMap, DEBUG_UTIL_MENU_ITEM_FLY}, - [DEBUG_UTIL_MENU_ITEM_WARP] = {sDebugText_Util_WarpToMap, DEBUG_UTIL_MENU_ITEM_WARP}, - [DEBUG_UTIL_MENU_ITEM_SAVEBLOCK] = {sDebugText_Util_SaveBlockSpace, DEBUG_UTIL_MENU_ITEM_SAVEBLOCK}, - [DEBUG_UTIL_MENU_ITEM_ROM_SPACE] = {sDebugText_Util_ROMSpace, DEBUG_UTIL_MENU_ITEM_ROM_SPACE}, - [DEBUG_UTIL_MENU_ITEM_WEATHER] = {sDebugText_Util_Weather, DEBUG_UTIL_MENU_ITEM_WEATHER}, - [DEBUG_UTIL_MENU_ITEM_FONT_TEST] = {sDebugText_Util_FontTest, DEBUG_UTIL_MENU_ITEM_FONT_TEST}, - [DEBUG_UTIL_MENU_ITEM_CHECKWALLCLOCK] = {sDebugText_Util_CheckWallClock, DEBUG_UTIL_MENU_ITEM_CHECKWALLCLOCK}, - [DEBUG_UTIL_MENU_ITEM_SETWALLCLOCK] = {sDebugText_Util_SetWallClock, DEBUG_UTIL_MENU_ITEM_SETWALLCLOCK}, - [DEBUG_UTIL_MENU_ITEM_WATCHCREDITS] = {sDebugText_Util_WatchCredits, DEBUG_UTIL_MENU_ITEM_WATCHCREDITS}, - [DEBUG_UTIL_MENU_ITEM_PLAYER_NAME] = {sDebugText_Util_Player_Name, DEBUG_UTIL_MENU_ITEM_PLAYER_NAME}, - [DEBUG_UTIL_MENU_ITEM_PLAYER_GENDER] = {sDebugText_Util_Player_Gender, DEBUG_UTIL_MENU_ITEM_PLAYER_GENDER}, - [DEBUG_UTIL_MENU_ITEM_PLAYER_ID] = {sDebugText_Util_Player_Id, DEBUG_UTIL_MENU_ITEM_PLAYER_ID}, - [DEBUG_UTIL_MENU_ITEM_CHEAT] = {sDebugText_Util_CheatStart, DEBUG_UTIL_MENU_ITEM_CHEAT}, - [DEBUG_UTIL_MENU_ITEM_EXPANSION_VER] = {sDebugText_Util_ExpansionVersion, DEBUG_UTIL_MENU_ITEM_EXPANSION_VER}, - [DEBUG_UTIL_MENU_ITEM_BERRY_FUNCTIONS] = {sDebugText_Util_BerryFunctions, DEBUG_UTIL_MENU_ITEM_BERRY_FUNCTIONS}, - [DEBUG_UTIL_MENU_ITEM_EWRAM_COUNTERS] = {sDebugText_Util_EWRAMCounters, DEBUG_UTIL_MENU_ITEM_EWRAM_COUNTERS}, - [DEBUG_UTIL_MENU_ITEM_STEVEN_MULTI] = {sDebugText_Util_Steven_Multi, DEBUG_UTIL_MENU_ITEM_STEVEN_MULTI}, + [DEBUG_UTIL_MENU_ITEM_FLY] = {COMPOUND_STRING("Fly to map…{CLEAR_TO 110}{RIGHT_ARROW}"), DEBUG_UTIL_MENU_ITEM_FLY}, + [DEBUG_UTIL_MENU_ITEM_WARP] = {COMPOUND_STRING("Warp to map warp…{CLEAR_TO 110}{RIGHT_ARROW}"), DEBUG_UTIL_MENU_ITEM_WARP}, + [DEBUG_UTIL_MENU_ITEM_SAVEBLOCK] = {COMPOUND_STRING("Save Block space…{CLEAR_TO 110}{RIGHT_ARROW}"), DEBUG_UTIL_MENU_ITEM_SAVEBLOCK}, + [DEBUG_UTIL_MENU_ITEM_ROM_SPACE] = {COMPOUND_STRING("ROM space…{CLEAR_TO 110}{RIGHT_ARROW}"), DEBUG_UTIL_MENU_ITEM_ROM_SPACE}, + [DEBUG_UTIL_MENU_ITEM_WEATHER] = {COMPOUND_STRING("Set weather…{CLEAR_TO 110}{RIGHT_ARROW}"), DEBUG_UTIL_MENU_ITEM_WEATHER}, + [DEBUG_UTIL_MENU_ITEM_FONT_TEST] = {COMPOUND_STRING("Font Test…{CLEAR_TO 110}{RIGHT_ARROW}"), DEBUG_UTIL_MENU_ITEM_FONT_TEST}, + [DEBUG_UTIL_MENU_ITEM_CHECKWALLCLOCK] = {COMPOUND_STRING("Check wall clock…{CLEAR_TO 110}{RIGHT_ARROW}"), DEBUG_UTIL_MENU_ITEM_CHECKWALLCLOCK}, + [DEBUG_UTIL_MENU_ITEM_SETWALLCLOCK] = {COMPOUND_STRING("Set wall clock…{CLEAR_TO 110}{RIGHT_ARROW}"), DEBUG_UTIL_MENU_ITEM_SETWALLCLOCK}, + [DEBUG_UTIL_MENU_ITEM_WATCHCREDITS] = {COMPOUND_STRING("Watch credits…{CLEAR_TO 110}{RIGHT_ARROW}"), DEBUG_UTIL_MENU_ITEM_WATCHCREDITS}, + [DEBUG_UTIL_MENU_ITEM_PLAYER_NAME] = {COMPOUND_STRING("Player name"), DEBUG_UTIL_MENU_ITEM_PLAYER_NAME}, + [DEBUG_UTIL_MENU_ITEM_PLAYER_GENDER] = {COMPOUND_STRING("Toggle gender"), DEBUG_UTIL_MENU_ITEM_PLAYER_GENDER}, + [DEBUG_UTIL_MENU_ITEM_PLAYER_ID] = {COMPOUND_STRING("New Trainer ID"), DEBUG_UTIL_MENU_ITEM_PLAYER_ID}, + [DEBUG_UTIL_MENU_ITEM_CHEAT] = {COMPOUND_STRING("Cheat start"), DEBUG_UTIL_MENU_ITEM_CHEAT}, + [DEBUG_UTIL_MENU_ITEM_EXPANSION_VER] = {COMPOUND_STRING("Expansion Version"), DEBUG_UTIL_MENU_ITEM_EXPANSION_VER}, + [DEBUG_UTIL_MENU_ITEM_BERRY_FUNCTIONS] = {COMPOUND_STRING("Berry Functions…{CLEAR_TO 110}{RIGHT_ARROW}"), DEBUG_UTIL_MENU_ITEM_BERRY_FUNCTIONS}, + [DEBUG_UTIL_MENU_ITEM_EWRAM_COUNTERS] = {COMPOUND_STRING("EWRAM Counters…{CLEAR_TO 110}{RIGHT_ARROW}"), DEBUG_UTIL_MENU_ITEM_EWRAM_COUNTERS}, + [DEBUG_UTIL_MENU_ITEM_STEVEN_MULTI] = {COMPOUND_STRING("Steven Multi"), DEBUG_UTIL_MENU_ITEM_STEVEN_MULTI}, }; static const struct ListMenuItem sDebugMenu_Items_PCBag[] = { - [DEBUG_PCBAG_MENU_ITEM_ACCESS_PC] = {sDebugText_PCBag_AccessPC, DEBUG_PCBAG_MENU_ITEM_ACCESS_PC}, - [DEBUG_PCBAG_MENU_ITEM_FILL] = {sDebugText_PCBag_Fill, DEBUG_PCBAG_MENU_ITEM_FILL}, - [DEBUG_PCBAG_MENU_ITEM_CLEAR_BAG] = {sDebugText_PCBag_ClearBag, DEBUG_PCBAG_MENU_ITEM_CLEAR_BAG}, - [DEBUG_PCBAG_MENU_ITEM_CLEAR_BOXES] = {sDebugText_PCBag_ClearBoxes, DEBUG_PCBAG_MENU_ITEM_CLEAR_BOXES}, + [DEBUG_PCBAG_MENU_ITEM_ACCESS_PC] = {COMPOUND_STRING("Access PC"), DEBUG_PCBAG_MENU_ITEM_ACCESS_PC}, + [DEBUG_PCBAG_MENU_ITEM_FILL] = {COMPOUND_STRING("Fill…{CLEAR_TO 110}{RIGHT_ARROW}"), DEBUG_PCBAG_MENU_ITEM_FILL}, + [DEBUG_PCBAG_MENU_ITEM_CLEAR_BAG] = {COMPOUND_STRING("Clear Bag"), DEBUG_PCBAG_MENU_ITEM_CLEAR_BAG}, + [DEBUG_PCBAG_MENU_ITEM_CLEAR_BOXES] = {COMPOUND_STRING("Clear Storage Boxes"), DEBUG_PCBAG_MENU_ITEM_CLEAR_BOXES}, }; static const struct ListMenuItem sDebugMenu_Items_PCBag_Fill[] = { - [DEBUG_PCBAG_MENU_ITEM_FILL_PC_BOXES_FAST] = {sDebugText_PCBag_Fill_Pc_Fast, DEBUG_PCBAG_MENU_ITEM_FILL_PC_BOXES_FAST}, - [DEBUG_PCBAG_MENU_ITEM_FILL_PC_BOXES_SLOW] = {sDebugText_PCBag_Fill_Pc_Slow, DEBUG_PCBAG_MENU_ITEM_FILL_PC_BOXES_SLOW}, - [DEBUG_PCBAG_MENU_ITEM_FILL_PC_ITEMS] = {sDebugText_PCBag_Fill_Pc_Items , DEBUG_PCBAG_MENU_ITEM_FILL_PC_ITEMS}, - [DEBUG_PCBAG_MENU_ITEM_FILL_POCKET_ITEMS] = {sDebugText_PCBag_Fill_PocketItems, DEBUG_PCBAG_MENU_ITEM_FILL_POCKET_ITEMS}, - [DEBUG_PCBAG_MENU_ITEM_FILL_POCKET_BALLS] = {sDebugText_PCBag_Fill_PocketPokeBalls, DEBUG_PCBAG_MENU_ITEM_FILL_POCKET_BALLS}, - [DEBUG_PCBAG_MENU_ITEM_FILL_POCKET_TMHM] = {sDebugText_PCBag_Fill_PocketTMHM, DEBUG_PCBAG_MENU_ITEM_FILL_POCKET_TMHM}, - [DEBUG_PCBAG_MENU_ITEM_FILL_POCKET_BERRIES] = {sDebugText_PCBag_Fill_PocketBerries, DEBUG_PCBAG_MENU_ITEM_FILL_POCKET_BERRIES}, - [DEBUG_PCBAG_MENU_ITEM_FILL_POCKET_KEY_ITEMS] = {sDebugText_PCBag_Fill_PocketKeyItems, DEBUG_PCBAG_MENU_ITEM_FILL_POCKET_KEY_ITEMS}, + [DEBUG_PCBAG_MENU_ITEM_FILL_PC_BOXES_FAST] = {COMPOUND_STRING("Fill PC Boxes Fast"), DEBUG_PCBAG_MENU_ITEM_FILL_PC_BOXES_FAST}, + [DEBUG_PCBAG_MENU_ITEM_FILL_PC_BOXES_SLOW] = {COMPOUND_STRING("Fill PC Boxes Slow (LAG!)"), DEBUG_PCBAG_MENU_ITEM_FILL_PC_BOXES_SLOW}, + [DEBUG_PCBAG_MENU_ITEM_FILL_PC_ITEMS] = {COMPOUND_STRING("Fill PC Items") , DEBUG_PCBAG_MENU_ITEM_FILL_PC_ITEMS}, + [DEBUG_PCBAG_MENU_ITEM_FILL_POCKET_ITEMS] = {COMPOUND_STRING("Fill Pocket Items"), DEBUG_PCBAG_MENU_ITEM_FILL_POCKET_ITEMS}, + [DEBUG_PCBAG_MENU_ITEM_FILL_POCKET_BALLS] = {COMPOUND_STRING("Fill Pocket Poké Balls"), DEBUG_PCBAG_MENU_ITEM_FILL_POCKET_BALLS}, + [DEBUG_PCBAG_MENU_ITEM_FILL_POCKET_TMHM] = {COMPOUND_STRING("Fill Pocket TMHM"), DEBUG_PCBAG_MENU_ITEM_FILL_POCKET_TMHM}, + [DEBUG_PCBAG_MENU_ITEM_FILL_POCKET_BERRIES] = {COMPOUND_STRING("Fill Pocket Berries"), DEBUG_PCBAG_MENU_ITEM_FILL_POCKET_BERRIES}, + [DEBUG_PCBAG_MENU_ITEM_FILL_POCKET_KEY_ITEMS] = {COMPOUND_STRING("Fill Pocket Key Items"), DEBUG_PCBAG_MENU_ITEM_FILL_POCKET_KEY_ITEMS}, }; static const struct ListMenuItem sDebugMenu_Items_Party[] = { - [DEBUG_PARTY_MENU_ITEM_MOVE_REMINDER] = {sDebugText_Party_MoveReminder, DEBUG_PARTY_MENU_ITEM_MOVE_REMINDER}, - [DEBUG_PARTY_MENU_ITEM_HATCH_AN_EGG] = {sDebugText_Party_HatchAnEgg, DEBUG_PARTY_MENU_ITEM_HATCH_AN_EGG}, - [DEBUG_PARTY_MENU_ITEM_HEAL_PARTY] = {sDebugText_Party_HealParty, DEBUG_PARTY_MENU_ITEM_HEAL_PARTY}, - [DEBUG_PARTY_MENU_ITEM_INFLICT_STATUS1] = {sDebugText_Party_InflictStatus1, DEBUG_PARTY_MENU_ITEM_INFLICT_STATUS1}, - [DEBUG_PARTY_MENU_ITEM_CHECK_EVS] = {sDebugText_Party_CheckEVs, DEBUG_PARTY_MENU_ITEM_CHECK_EVS}, - [DEBUG_PARTY_MENU_ITEM_CHECK_IVS] = {sDebugText_Party_CheckIVs, DEBUG_PARTY_MENU_ITEM_CHECK_IVS}, - [DEBUG_PARTY_MENU_ITEM_CLEAR_PARTY] = {sDebugText_Party_ClearParty, DEBUG_PARTY_MENU_ITEM_CLEAR_PARTY}, + [DEBUG_PARTY_MENU_ITEM_MOVE_REMINDER] = {COMPOUND_STRING("Move Reminder"), DEBUG_PARTY_MENU_ITEM_MOVE_REMINDER}, + [DEBUG_PARTY_MENU_ITEM_HATCH_AN_EGG] = {COMPOUND_STRING("Hatch an Egg"), DEBUG_PARTY_MENU_ITEM_HATCH_AN_EGG}, + [DEBUG_PARTY_MENU_ITEM_HEAL_PARTY] = {COMPOUND_STRING("Heal party"), DEBUG_PARTY_MENU_ITEM_HEAL_PARTY}, + [DEBUG_PARTY_MENU_ITEM_INFLICT_STATUS1] = {COMPOUND_STRING("Inflict Status1"), DEBUG_PARTY_MENU_ITEM_INFLICT_STATUS1}, + [DEBUG_PARTY_MENU_ITEM_CHECK_EVS] = {COMPOUND_STRING("Check EVs"), DEBUG_PARTY_MENU_ITEM_CHECK_EVS}, + [DEBUG_PARTY_MENU_ITEM_CHECK_IVS] = {COMPOUND_STRING("Check IVs"), DEBUG_PARTY_MENU_ITEM_CHECK_IVS}, + [DEBUG_PARTY_MENU_ITEM_CLEAR_PARTY] = {COMPOUND_STRING("Clear Party"), DEBUG_PARTY_MENU_ITEM_CLEAR_PARTY}, }; static const struct ListMenuItem sDebugMenu_Items_Scripts[] = { - [DEBUG_UTIL_MENU_ITEM_SCRIPT_1] = {sDebugText_Util_Script_1, DEBUG_UTIL_MENU_ITEM_SCRIPT_1}, - [DEBUG_UTIL_MENU_ITEM_SCRIPT_2] = {sDebugText_Util_Script_2, DEBUG_UTIL_MENU_ITEM_SCRIPT_2}, - [DEBUG_UTIL_MENU_ITEM_SCRIPT_3] = {sDebugText_Util_Script_3, DEBUG_UTIL_MENU_ITEM_SCRIPT_3}, - [DEBUG_UTIL_MENU_ITEM_SCRIPT_4] = {sDebugText_Util_Script_4, DEBUG_UTIL_MENU_ITEM_SCRIPT_4}, - [DEBUG_UTIL_MENU_ITEM_SCRIPT_5] = {sDebugText_Util_Script_5, DEBUG_UTIL_MENU_ITEM_SCRIPT_5}, - [DEBUG_UTIL_MENU_ITEM_SCRIPT_6] = {sDebugText_Util_Script_6, DEBUG_UTIL_MENU_ITEM_SCRIPT_6}, - [DEBUG_UTIL_MENU_ITEM_SCRIPT_7] = {sDebugText_Util_Script_7, DEBUG_UTIL_MENU_ITEM_SCRIPT_7}, - [DEBUG_UTIL_MENU_ITEM_SCRIPT_8] = {sDebugText_Util_Script_8, DEBUG_UTIL_MENU_ITEM_SCRIPT_8}, + [DEBUG_UTIL_MENU_ITEM_SCRIPT_1] = {COMPOUND_STRING("Script 1"), DEBUG_UTIL_MENU_ITEM_SCRIPT_1}, + [DEBUG_UTIL_MENU_ITEM_SCRIPT_2] = {COMPOUND_STRING("Script 2"), DEBUG_UTIL_MENU_ITEM_SCRIPT_2}, + [DEBUG_UTIL_MENU_ITEM_SCRIPT_3] = {COMPOUND_STRING("Script 3"), DEBUG_UTIL_MENU_ITEM_SCRIPT_3}, + [DEBUG_UTIL_MENU_ITEM_SCRIPT_4] = {COMPOUND_STRING("Script 4"), DEBUG_UTIL_MENU_ITEM_SCRIPT_4}, + [DEBUG_UTIL_MENU_ITEM_SCRIPT_5] = {COMPOUND_STRING("Script 5"), DEBUG_UTIL_MENU_ITEM_SCRIPT_5}, + [DEBUG_UTIL_MENU_ITEM_SCRIPT_6] = {COMPOUND_STRING("Script 6"), DEBUG_UTIL_MENU_ITEM_SCRIPT_6}, + [DEBUG_UTIL_MENU_ITEM_SCRIPT_7] = {COMPOUND_STRING("Script 7"), DEBUG_UTIL_MENU_ITEM_SCRIPT_7}, + [DEBUG_UTIL_MENU_ITEM_SCRIPT_8] = {COMPOUND_STRING("Script 8"), DEBUG_UTIL_MENU_ITEM_SCRIPT_8}, }; static const struct ListMenuItem sDebugMenu_Items_FlagsVars[] = { - [DEBUG_FLAGVAR_MENU_ITEM_FLAGS] = {sDebugText_FlagsVars_Flags, DEBUG_FLAGVAR_MENU_ITEM_FLAGS}, - [DEBUG_FLAGVAR_MENU_ITEM_VARS] = {sDebugText_FlagsVars_Vars, DEBUG_FLAGVAR_MENU_ITEM_VARS}, - [DEBUG_FLAGVAR_MENU_ITEM_DEXFLAGS_ALL] = {sDebugText_FlagsVars_PokedexFlags_All, DEBUG_FLAGVAR_MENU_ITEM_DEXFLAGS_ALL}, - [DEBUG_FLAGVAR_MENU_ITEM_DEXFLAGS_RESET] = {sDebugText_FlagsVars_PokedexFlags_Reset, DEBUG_FLAGVAR_MENU_ITEM_DEXFLAGS_RESET}, - [DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_POKEDEX] = {sDebugText_FlagsVars_SwitchDex, DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_POKEDEX}, - [DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_NATDEX] = {sDebugText_FlagsVars_SwitchNationalDex, DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_NATDEX}, - [DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_POKENAV] = {sDebugText_FlagsVars_SwitchPokeNav, DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_POKENAV}, - [DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_MATCH_CALL] = {sDebugText_FlagsVars_SwitchMatchCall, DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_MATCH_CALL}, - [DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_RUN_SHOES] = {sDebugText_FlagsVars_RunningShoes, DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_RUN_SHOES}, - [DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_LOCATIONS] = {sDebugText_FlagsVars_ToggleFlyFlags, DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_LOCATIONS}, - [DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_BADGES_ALL] = {sDebugText_FlagsVars_ToggleAllBadges, DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_BADGES_ALL}, - [DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_GAME_CLEAR] = {sDebugText_FlagsVars_ToggleGameClear, DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_GAME_CLEAR}, - [DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_FRONTIER_PASS] = {sDebugText_FlagsVars_ToggleFrontierPass, DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_FRONTIER_PASS}, - [DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_COLLISION] = {sDebugText_FlagsVars_SwitchCollision, DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_COLLISION}, - [DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_ENCOUNTER] = {sDebugText_FlagsVars_SwitchEncounter, DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_ENCOUNTER}, - [DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_TRAINER_SEE] = {sDebugText_FlagsVars_SwitchTrainerSee, DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_TRAINER_SEE}, - [DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_BAG_USE] = {sDebugText_FlagsVars_SwitchBagUse, DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_BAG_USE}, - [DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_CATCHING] = {sDebugText_FlagsVars_SwitchCatching, DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_CATCHING}, + [DEBUG_FLAGVAR_MENU_ITEM_FLAGS] = {COMPOUND_STRING("Set Flag XYZ…{CLEAR_TO 110}{RIGHT_ARROW}"), DEBUG_FLAGVAR_MENU_ITEM_FLAGS}, + [DEBUG_FLAGVAR_MENU_ITEM_VARS] = {COMPOUND_STRING("Set Var XYZ…{CLEAR_TO 110}{RIGHT_ARROW}"), DEBUG_FLAGVAR_MENU_ITEM_VARS}, + [DEBUG_FLAGVAR_MENU_ITEM_DEXFLAGS_ALL] = {COMPOUND_STRING("Pokédex Flags All"), DEBUG_FLAGVAR_MENU_ITEM_DEXFLAGS_ALL}, + [DEBUG_FLAGVAR_MENU_ITEM_DEXFLAGS_RESET] = {COMPOUND_STRING("Pokédex Flags Reset"), DEBUG_FLAGVAR_MENU_ITEM_DEXFLAGS_RESET}, + [DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_POKEDEX] = {COMPOUND_STRING("Toggle {STR_VAR_1}Pokédex"), DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_POKEDEX}, + [DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_NATDEX] = {COMPOUND_STRING("Toggle {STR_VAR_1}National Dex"), DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_NATDEX}, + [DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_POKENAV] = {COMPOUND_STRING("Toggle {STR_VAR_1}PokéNav"), DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_POKENAV}, + [DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_MATCH_CALL] = {COMPOUND_STRING("Toggle {STR_VAR_1}Match Call"), DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_MATCH_CALL}, + [DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_RUN_SHOES] = {COMPOUND_STRING("Toggle {STR_VAR_1}Running Shoes"), DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_RUN_SHOES}, + [DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_LOCATIONS] = {COMPOUND_STRING("Toggle {STR_VAR_1}Fly Flags"), DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_LOCATIONS}, + [DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_BADGES_ALL] = {COMPOUND_STRING("Toggle {STR_VAR_1}All badges"), DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_BADGES_ALL}, + [DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_GAME_CLEAR] = {COMPOUND_STRING("Toggle {STR_VAR_1}Game clear"), DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_GAME_CLEAR}, + [DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_FRONTIER_PASS] = {COMPOUND_STRING("Toggle {STR_VAR_1}Frontier Pass"), DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_FRONTIER_PASS}, + [DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_COLLISION] = {COMPOUND_STRING("Toggle {STR_VAR_1}Collision OFF"), DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_COLLISION}, + [DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_ENCOUNTER] = {COMPOUND_STRING("Toggle {STR_VAR_1}Encounter OFF"), DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_ENCOUNTER}, + [DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_TRAINER_SEE] = {COMPOUND_STRING("Toggle {STR_VAR_1}Trainer See OFF"), DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_TRAINER_SEE}, + [DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_BAG_USE] = {COMPOUND_STRING("Toggle {STR_VAR_1}Bag Use OFF"), DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_BAG_USE}, + [DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_CATCHING] = {COMPOUND_STRING("Toggle {STR_VAR_1}Catching OFF"), DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_CATCHING}, }; static const struct ListMenuItem sDebugMenu_Items_Battle_0[] = { - [DEBUG_BATTLE_0_MENU_ITEM_WILD] = {sDebugText_Battle_0_Wild, DEBUG_BATTLE_0_MENU_ITEM_WILD}, - [DEBUG_BATTLE_0_MENU_ITEM_WILD_DOUBLE] = {sDebugText_Battle_0_WildDouble, DEBUG_BATTLE_0_MENU_ITEM_WILD_DOUBLE}, - [DEBUG_BATTLE_0_MENU_ITEM_SINGLE] = {sDebugText_Battle_0_Single, DEBUG_BATTLE_0_MENU_ITEM_SINGLE}, - [DEBUG_BATTLE_0_MENU_ITEM_DOUBLE] = {sDebugText_Battle_0_Double, DEBUG_BATTLE_0_MENU_ITEM_DOUBLE}, - [DEBUG_BATTLE_0_MENU_ITEM_MULTI] = {sDebugText_Battle_0_Mulit, DEBUG_BATTLE_0_MENU_ITEM_MULTI}, + [DEBUG_BATTLE_0_MENU_ITEM_WILD] = {COMPOUND_STRING("Wild…{CLEAR_TO 110}{RIGHT_ARROW}"), DEBUG_BATTLE_0_MENU_ITEM_WILD}, + [DEBUG_BATTLE_0_MENU_ITEM_WILD_DOUBLE] = {COMPOUND_STRING("Wild Double…{CLEAR_TO 110}{RIGHT_ARROW}"), DEBUG_BATTLE_0_MENU_ITEM_WILD_DOUBLE}, + [DEBUG_BATTLE_0_MENU_ITEM_SINGLE] = {COMPOUND_STRING("Single…{CLEAR_TO 110}{RIGHT_ARROW}"), DEBUG_BATTLE_0_MENU_ITEM_SINGLE}, + [DEBUG_BATTLE_0_MENU_ITEM_DOUBLE] = {COMPOUND_STRING("Double…{CLEAR_TO 110}{RIGHT_ARROW}"), DEBUG_BATTLE_0_MENU_ITEM_DOUBLE}, + [DEBUG_BATTLE_0_MENU_ITEM_MULTI] = {COMPOUND_STRING("Multi…{CLEAR_TO 110}{RIGHT_ARROW}"), DEBUG_BATTLE_0_MENU_ITEM_MULTI}, }; static const struct ListMenuItem sDebugMenu_Items_Battle_1[] = { - [DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_00] = {sDebugText_Battle_1_AIFlag_00, DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_00}, - [DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_01] = {sDebugText_Battle_1_AIFlag_01, DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_01}, - [DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_02] = {sDebugText_Battle_1_AIFlag_02, DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_02}, - [DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_03] = {sDebugText_Battle_1_AIFlag_03, DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_03}, - [DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_04] = {sDebugText_Battle_1_AIFlag_04, DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_04}, - [DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_05] = {sDebugText_Battle_1_AIFlag_05, DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_05}, - [DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_06] = {sDebugText_Battle_1_AIFlag_06, DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_06}, - [DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_07] = {sDebugText_Battle_1_AIFlag_07, DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_07}, - [DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_08] = {sDebugText_Battle_1_AIFlag_08, DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_08}, - [DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_09] = {sDebugText_Battle_1_AIFlag_09, DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_09}, - [DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_10] = {sDebugText_Battle_1_AIFlag_10, DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_10}, - [DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_11] = {sDebugText_Battle_1_AIFlag_11, DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_11}, - [DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_12] = {sDebugText_Battle_1_AIFlag_12, DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_12}, - [DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_13] = {sDebugText_Battle_1_AIFlag_13, DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_13}, - [DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_14] = {sDebugText_Battle_1_AIFlag_14, DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_14}, - [DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_15] = {sDebugText_Battle_1_AIFlag_15, DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_15}, - [DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_16] = {sDebugText_Battle_1_AIFlag_16, DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_16}, - [DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_17] = {sDebugText_Battle_1_AIFlag_17, DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_17}, - [DEBUG_BATTLE_1_MENU_ITEM_CONTINUE] = {sDebugText_Continue, DEBUG_BATTLE_1_MENU_ITEM_CONTINUE}, + [DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_00] = {COMPOUND_STRING("{STR_VAR_1}Check bad move"), DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_00}, + [DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_01] = {COMPOUND_STRING("{STR_VAR_1}Try to faint"), DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_01}, + [DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_02] = {COMPOUND_STRING("{STR_VAR_1}Check viability"), DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_02}, + [DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_03] = {COMPOUND_STRING("{STR_VAR_1}Setup first turn"), DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_03}, + [DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_04] = {COMPOUND_STRING("{STR_VAR_1}Risky"), DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_04}, + [DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_05] = {COMPOUND_STRING("{STR_VAR_1}Prefer strongest move"), DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_05}, + [DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_06] = {COMPOUND_STRING("{STR_VAR_1}Prefer Baton Pass"), DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_06}, + [DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_07] = {COMPOUND_STRING("{STR_VAR_1}Double battle"), DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_07}, + [DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_08] = {COMPOUND_STRING("{STR_VAR_1}HP aware"), DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_08}, + [DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_09] = {COMPOUND_STRING("{STR_VAR_1}Negate Unaware"), DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_09}, + [DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_10] = {COMPOUND_STRING("{STR_VAR_1}Will suicide"), DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_10}, + [DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_11] = {COMPOUND_STRING("{STR_VAR_1}Help partner"), DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_11}, + [DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_12] = {COMPOUND_STRING("{STR_VAR_1}Prefer status moves"), DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_12}, + [DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_13] = {COMPOUND_STRING("{STR_VAR_1}Stall"), DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_13}, + [DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_14] = {COMPOUND_STRING("{STR_VAR_1}Screener"), DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_14}, + [DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_15] = {COMPOUND_STRING("{STR_VAR_1}Smart switching"), DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_15}, + [DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_16] = {COMPOUND_STRING("{STR_VAR_1}Ace pokemon"), DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_16}, + [DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_17] = {COMPOUND_STRING("{STR_VAR_1}Omniscient"), DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_17}, + [DEBUG_BATTLE_1_MENU_ITEM_CONTINUE] = {sDebugText_Continue, DEBUG_BATTLE_1_MENU_ITEM_CONTINUE}, }; static const struct ListMenuItem sDebugMenu_Items_Battle_2[] = { - [DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_0] = {sDebugText_Battle_2_Terrain_0, DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_0}, - [DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_1] = {sDebugText_Battle_2_Terrain_1, DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_1}, - [DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_2] = {sDebugText_Battle_2_Terrain_2, DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_2}, - [DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_3] = {sDebugText_Battle_2_Terrain_3, DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_3}, - [DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_4] = {sDebugText_Battle_2_Terrain_4, DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_4}, - [DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_5] = {sDebugText_Battle_2_Terrain_5, DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_5}, - [DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_6] = {sDebugText_Battle_2_Terrain_6, DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_6}, - [DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_7] = {sDebugText_Battle_2_Terrain_7, DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_7}, - [DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_8] = {sDebugText_Battle_2_Terrain_8, DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_8}, - [DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_9] = {sDebugText_Battle_2_Terrain_9, DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_9}, + [DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_0] = {COMPOUND_STRING("Grass…{CLEAR_TO 110}{RIGHT_ARROW}"), DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_0}, + [DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_1] = {COMPOUND_STRING("Long grass…{CLEAR_TO 110}{RIGHT_ARROW}"), DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_1}, + [DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_2] = {COMPOUND_STRING("Sand…{CLEAR_TO 110}{RIGHT_ARROW}"), DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_2}, + [DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_3] = {COMPOUND_STRING("Underwater…{CLEAR_TO 110}{RIGHT_ARROW}"), DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_3}, + [DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_4] = {COMPOUND_STRING("Water…{CLEAR_TO 110}{RIGHT_ARROW}"), DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_4}, + [DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_5] = {COMPOUND_STRING("Pond…{CLEAR_TO 110}{RIGHT_ARROW}"), DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_5}, + [DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_6] = {COMPOUND_STRING("Mountain…{CLEAR_TO 110}{RIGHT_ARROW}"), DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_6}, + [DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_7] = {COMPOUND_STRING("Cave…{CLEAR_TO 110}{RIGHT_ARROW}"), DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_7}, + [DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_8] = {COMPOUND_STRING("Building…{CLEAR_TO 110}{RIGHT_ARROW}"), DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_8}, + [DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_9] = {COMPOUND_STRING("Plain…{CLEAR_TO 110}{RIGHT_ARROW}"), DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_9}, }; static const struct ListMenuItem sDebugMenu_Items_Give[] = { - [DEBUG_GIVE_MENU_ITEM_ITEM_X] = {sDebugText_Give_GiveItem, DEBUG_GIVE_MENU_ITEM_ITEM_X}, - [DEBUG_GIVE_MENU_ITEM_POKEMON_SIMPLE] = {sDebugText_Give_GivePokemonSimple, DEBUG_GIVE_MENU_ITEM_POKEMON_SIMPLE}, - [DEBUG_GIVE_MENU_ITEM_POKEMON_COMPLEX] = {sDebugText_Give_GivePokemonComplex, DEBUG_GIVE_MENU_ITEM_POKEMON_COMPLEX}, - [DEBUG_GIVE_MENU_ITEM_MAX_MONEY] = {sDebugText_Give_MaxMoney, DEBUG_GIVE_MENU_ITEM_MAX_MONEY}, - [DEBUG_GIVE_MENU_ITEM_MAX_COINS] = {sDebugText_Give_MaxCoins, DEBUG_GIVE_MENU_ITEM_MAX_COINS}, - [DEBUG_GIVE_MENU_ITEM_MAX_BATTLE_POINTS] = {sDebugText_Give_BattlePoints, DEBUG_GIVE_MENU_ITEM_MAX_BATTLE_POINTS}, - [DEBUG_GIVE_MENU_ITEM_DAYCARE_EGG] = {sDebugText_Give_DaycareEgg, DEBUG_GIVE_MENU_ITEM_DAYCARE_EGG}, + [DEBUG_GIVE_MENU_ITEM_ITEM_X] = {COMPOUND_STRING("Give item XYZ…{CLEAR_TO 110}{RIGHT_ARROW}"), DEBUG_GIVE_MENU_ITEM_ITEM_X}, + [DEBUG_GIVE_MENU_ITEM_POKEMON_SIMPLE] = {COMPOUND_STRING("Pokémon (Basic){CLEAR_TO 110}{RIGHT_ARROW}"), DEBUG_GIVE_MENU_ITEM_POKEMON_SIMPLE}, + [DEBUG_GIVE_MENU_ITEM_POKEMON_COMPLEX] = {COMPOUND_STRING("Pokémon (Complex){CLEAR_TO 110}{RIGHT_ARROW}"), DEBUG_GIVE_MENU_ITEM_POKEMON_COMPLEX}, + [DEBUG_GIVE_MENU_ITEM_MAX_MONEY] = {COMPOUND_STRING("Max Money"), DEBUG_GIVE_MENU_ITEM_MAX_MONEY}, + [DEBUG_GIVE_MENU_ITEM_MAX_COINS] = {COMPOUND_STRING("Max Coins"), DEBUG_GIVE_MENU_ITEM_MAX_COINS}, + [DEBUG_GIVE_MENU_ITEM_MAX_BATTLE_POINTS] = {COMPOUND_STRING("Max Battle Points"), DEBUG_GIVE_MENU_ITEM_MAX_BATTLE_POINTS}, + [DEBUG_GIVE_MENU_ITEM_DAYCARE_EGG] = {COMPOUND_STRING("Daycare Egg"), DEBUG_GIVE_MENU_ITEM_DAYCARE_EGG}, }; static const struct ListMenuItem sDebugMenu_Items_Sound[] = { - [DEBUG_SOUND_MENU_ITEM_SE] = {sDebugText_Sound_SFX, DEBUG_SOUND_MENU_ITEM_SE}, - [DEBUG_SOUND_MENU_ITEM_MUS] = {sDebugText_Sound_Music, DEBUG_SOUND_MENU_ITEM_MUS}, + [DEBUG_SOUND_MENU_ITEM_SE] = {COMPOUND_STRING("SFX…{CLEAR_TO 110}{RIGHT_ARROW}"), DEBUG_SOUND_MENU_ITEM_SE}, + [DEBUG_SOUND_MENU_ITEM_MUS] = {COMPOUND_STRING("Music…{CLEAR_TO 110}{RIGHT_ARROW}"), DEBUG_SOUND_MENU_ITEM_MUS}, }; static const struct ListMenuItem sDebugMenu_Items_BerryFunctions[] = { - [DEBUG_BERRY_FUNCTIONS_MENU_CLEAR_ALL] = {sDebugText_BerryFunctions_ClearAll, DEBUG_BERRY_FUNCTIONS_MENU_CLEAR_ALL}, - [DEBUG_BERRY_FUNCTIONS_MENU_READY] = {sDebugText_BerryFunctions_Ready, DEBUG_BERRY_FUNCTIONS_MENU_READY}, - [DEBUG_BERRY_FUNCTIONS_MENU_NEXT_STAGE] = {sDebugText_BerryFunctions_NextStage, DEBUG_BERRY_FUNCTIONS_MENU_NEXT_STAGE}, - [DEBUG_BERRY_FUNCTIONS_MENU_PESTS] = {sDebugText_BerryFunctions_Pests, DEBUG_BERRY_FUNCTIONS_MENU_PESTS}, - [DEBUG_BERRY_FUNCTIONS_MENU_WEEDS] = {sDebugText_BerryFunctions_Weeds, DEBUG_BERRY_FUNCTIONS_MENU_WEEDS}, + [DEBUG_BERRY_FUNCTIONS_MENU_CLEAR_ALL] = {COMPOUND_STRING("Clear map trees"), DEBUG_BERRY_FUNCTIONS_MENU_CLEAR_ALL}, + [DEBUG_BERRY_FUNCTIONS_MENU_READY] = {COMPOUND_STRING("Ready map trees"), DEBUG_BERRY_FUNCTIONS_MENU_READY}, + [DEBUG_BERRY_FUNCTIONS_MENU_NEXT_STAGE] = {COMPOUND_STRING("Grow map trees"), DEBUG_BERRY_FUNCTIONS_MENU_NEXT_STAGE}, + [DEBUG_BERRY_FUNCTIONS_MENU_PESTS] = {COMPOUND_STRING("Give map trees pests"), DEBUG_BERRY_FUNCTIONS_MENU_PESTS}, + [DEBUG_BERRY_FUNCTIONS_MENU_WEEDS] = {COMPOUND_STRING("Give map trees weeds"), DEBUG_BERRY_FUNCTIONS_MENU_WEEDS}, }; // ******************************* @@ -1303,6 +1148,29 @@ static void DebugAction_DestroyExtraWindow(u8 taskId) UnfreezeObjectEvents(); } + +static const u16 sLocationFlags[] = +{ + FLAG_VISITED_LITTLEROOT_TOWN, + FLAG_VISITED_OLDALE_TOWN, + FLAG_VISITED_DEWFORD_TOWN, + FLAG_VISITED_LAVARIDGE_TOWN, + FLAG_VISITED_FALLARBOR_TOWN, + FLAG_VISITED_VERDANTURF_TOWN, + FLAG_VISITED_PACIFIDLOG_TOWN, + FLAG_VISITED_PETALBURG_CITY, + FLAG_VISITED_SLATEPORT_CITY, + FLAG_VISITED_MAUVILLE_CITY, + FLAG_VISITED_RUSTBORO_CITY, + FLAG_VISITED_FORTREE_CITY, + FLAG_VISITED_LILYCOVE_CITY, + FLAG_VISITED_MOSSDEEP_CITY, + FLAG_VISITED_SOOTOPOLIS_CITY, + FLAG_VISITED_EVER_GRANDE_CITY, + FLAG_LANDMARK_POKEMON_LEAGUE, + FLAG_LANDMARK_BATTLE_FRONTIER, +}; + static u8 Debug_CheckToggleFlags(u8 id) { u8 result = FALSE; @@ -1325,34 +1193,26 @@ static u8 Debug_CheckToggleFlags(u8 id) result = FlagGet(FLAG_SYS_B_DASH); break; case DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_LOCATIONS: - result = FlagGet(FLAG_VISITED_LITTLEROOT_TOWN) && - FlagGet(FLAG_VISITED_OLDALE_TOWN) && - FlagGet(FLAG_VISITED_DEWFORD_TOWN) && - FlagGet(FLAG_VISITED_LAVARIDGE_TOWN) && - FlagGet(FLAG_VISITED_FALLARBOR_TOWN) && - FlagGet(FLAG_VISITED_VERDANTURF_TOWN) && - FlagGet(FLAG_VISITED_PACIFIDLOG_TOWN) && - FlagGet(FLAG_VISITED_PETALBURG_CITY) && - FlagGet(FLAG_VISITED_SLATEPORT_CITY) && - FlagGet(FLAG_VISITED_MAUVILLE_CITY) && - FlagGet(FLAG_VISITED_RUSTBORO_CITY) && - FlagGet(FLAG_VISITED_FORTREE_CITY) && - FlagGet(FLAG_VISITED_LILYCOVE_CITY) && - FlagGet(FLAG_VISITED_MOSSDEEP_CITY) && - FlagGet(FLAG_VISITED_SOOTOPOLIS_CITY) && - FlagGet(FLAG_VISITED_EVER_GRANDE_CITY) && - FlagGet(FLAG_LANDMARK_POKEMON_LEAGUE) && - FlagGet(FLAG_LANDMARK_BATTLE_FRONTIER); + result = TRUE; + for (u32 i = 0; i < ARRAY_COUNT(sLocationFlags); i++) + { + if (!FlagGet(sLocationFlags[i])) + { + result = FALSE; + break; + } + } break; case DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_BADGES_ALL: - result = FlagGet(FLAG_BADGE01_GET) && - FlagGet(FLAG_BADGE02_GET) && - FlagGet(FLAG_BADGE03_GET) && - FlagGet(FLAG_BADGE04_GET) && - FlagGet(FLAG_BADGE05_GET) && - FlagGet(FLAG_BADGE06_GET) && - FlagGet(FLAG_BADGE07_GET) && - FlagGet(FLAG_BADGE08_GET); + result = TRUE; + for (u32 i = 0; i < ARRAY_COUNT(gBadgeFlags); i++) + { + if (!FlagGet(gBadgeFlags[i])) + { + result = FALSE; + break; + } + } break; case DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_GAME_CLEAR: result = FlagGet(FLAG_SYS_GAME_CLEAR); @@ -1547,7 +1407,7 @@ static void DebugTask_HandleMenuInput_Main(u8 taskId) } } -static void DebugTask_HandleMenuInput_Utilities(u8 taskId) +static void DebugTask_HandleMenuInput_General(u8 taskId, const void (*const actions[])(u8), void (*callbackInput)(u8), struct ListMenuTemplate callbackMenuTemplate) { void (*func)(u8); u32 input = ListMenu_ProcessInput(gTasks[taskId].tMenuTaskId); @@ -1555,91 +1415,40 @@ static void DebugTask_HandleMenuInput_Utilities(u8 taskId) if (JOY_NEW(A_BUTTON)) { PlaySE(SE_SELECT); - if ((func = sDebugMenu_Actions_Utilities[input]) != NULL) + if ((func = actions[input]) != NULL) func(taskId); } else if (JOY_NEW(B_BUTTON)) { PlaySE(SE_SELECT); Debug_DestroyMenu(taskId); - Debug_ReShowMainMenu(); + Debug_ShowMenu(callbackInput, callbackMenuTemplate); } } -static void DebugTask_HandleMenuInput_PCBag(u8 taskId) +static void DebugTask_HandleMenuInput_Utilities(u8 taskId) { - void (*func)(u8); - u32 input = ListMenu_ProcessInput(gTasks[taskId].tMenuTaskId); + DebugTask_HandleMenuInput_General(taskId, sDebugMenu_Actions_Utilities, DebugTask_HandleMenuInput_Main, sDebugMenu_ListTemplate_Main); +} - if (JOY_NEW(A_BUTTON)) - { - PlaySE(SE_SELECT); - if ((func = sDebugMenu_Actions_PCBag[input]) != NULL) - func(taskId); - } - else if (JOY_NEW(B_BUTTON)) - { - PlaySE(SE_SELECT); - Debug_DestroyMenu(taskId); - Debug_ReShowMainMenu(); - } +static void DebugTask_HandleMenuInput_PCBag(u8 taskId) +{ + DebugTask_HandleMenuInput_General(taskId, sDebugMenu_Actions_PCBag, DebugTask_HandleMenuInput_Main, sDebugMenu_ListTemplate_Main); } static void DebugTask_HandleMenuInput_PCBag_Fill(u8 taskId) { - void (*func)(u8); - u32 input = ListMenu_ProcessInput(gTasks[taskId].tMenuTaskId); - - if (JOY_NEW(A_BUTTON)) - { - PlaySE(SE_SELECT); - if ((func = sDebugMenu_Actions_PCBag_Fill[input]) != NULL) - func(taskId); - } - else if (JOY_NEW(B_BUTTON)) - { - PlaySE(SE_SELECT); - Debug_DestroyMenu(taskId); - Debug_ShowMenu(DebugTask_HandleMenuInput_PCBag, sDebugMenu_ListTemplate_PCBag); - } + DebugTask_HandleMenuInput_General(taskId, sDebugMenu_Actions_PCBag_Fill, DebugTask_HandleMenuInput_PCBag, sDebugMenu_ListTemplate_PCBag); } static void DebugTask_HandleMenuInput_Party(u8 taskId) { - void (*func)(u8); - u32 input = ListMenu_ProcessInput(gTasks[taskId].tMenuTaskId); - - if (JOY_NEW(A_BUTTON)) - { - PlaySE(SE_SELECT); - if ((func = sDebugMenu_Actions_Party[input]) != NULL) - func(taskId); - } - else if (JOY_NEW(B_BUTTON)) - { - PlaySE(SE_SELECT); - Debug_DestroyMenu(taskId); - Debug_ReShowMainMenu(); - } + DebugTask_HandleMenuInput_General(taskId, sDebugMenu_Actions_Party, DebugTask_HandleMenuInput_Main, sDebugMenu_ListTemplate_Main); } static void DebugTask_HandleMenuInput_Scripts(u8 taskId) { - void (*func)(u8); - u32 input = ListMenu_ProcessInput(gTasks[taskId].tMenuTaskId); - - if (JOY_NEW(A_BUTTON)) - { - PlaySE(SE_SELECT); - if ((func = sDebugMenu_Actions_Scripts[input]) != NULL) - func(taskId); - } - else if (JOY_NEW(B_BUTTON)) - { - PlaySE(SE_SELECT); - Debug_DestroyMenu(taskId); - Debug_ReShowMainMenu(); - } + DebugTask_HandleMenuInput_General(taskId, sDebugMenu_Actions_Scripts, DebugTask_HandleMenuInput_Main, sDebugMenu_ListTemplate_Main); } static void DebugTask_HandleMenuInput_FlagsVars(u8 taskId) @@ -1836,59 +1645,17 @@ static void Debug_InitializeBattle(u8 taskId) static void DebugTask_HandleMenuInput_Give(u8 taskId) { - void (*func)(u8); - u32 input = ListMenu_ProcessInput(gTasks[taskId].tMenuTaskId); - - if (JOY_NEW(A_BUTTON)) - { - PlaySE(SE_SELECT); - if ((func = sDebugMenu_Actions_Give[input]) != NULL) - func(taskId); - } - else if (JOY_NEW(B_BUTTON)) - { - PlaySE(SE_SELECT); - Debug_DestroyMenu(taskId); - Debug_ReShowMainMenu(); - } + DebugTask_HandleMenuInput_General(taskId, sDebugMenu_Actions_Give, DebugTask_HandleMenuInput_Main, sDebugMenu_ListTemplate_Main); } static void DebugTask_HandleMenuInput_Sound(u8 taskId) { - void (*func)(u8); - u32 input = ListMenu_ProcessInput(gTasks[taskId].tMenuTaskId); - - if (JOY_NEW(A_BUTTON)) - { - PlaySE(SE_SELECT); - if ((func = sDebugMenu_Actions_Sound[input]) != NULL) - func(taskId); - } - else if (JOY_NEW(B_BUTTON)) - { - PlaySE(SE_SELECT); - Debug_DestroyMenu(taskId); - Debug_ReShowMainMenu(); - } + DebugTask_HandleMenuInput_General(taskId, sDebugMenu_Actions_Sound, DebugTask_HandleMenuInput_Main, sDebugMenu_ListTemplate_Main); } static void DebugTask_HandleMenuInput_BerryFunctions(u8 taskId) { - void (*func)(u8); - u32 input = ListMenu_ProcessInput(gTasks[taskId].tMenuTaskId); - - if (JOY_NEW(A_BUTTON)) - { - PlaySE(SE_SELECT); - if ((func = sDebugMenu_Actions_BerryFunctions[input]) != NULL) - func(taskId); - } - else if (JOY_NEW(B_BUTTON)) - { - PlaySE(SE_SELECT); - Debug_DestroyMenu(taskId); - Debug_ReShowMainMenu(); - } + DebugTask_HandleMenuInput_General(taskId, sDebugMenu_Actions_BerryFunctions, DebugTask_HandleMenuInput_Main, sDebugMenu_ListTemplate_Main); } // ******************************* @@ -2203,7 +1970,7 @@ static void DebugAction_Util_CheckROMSpace(u8 taskId) ScriptContext_SetupScript(Debug_CheckROMSpace); } -static const u8 sWeatherNames[22][24] = { +static const u8 sWeatherNames[WEATHER_COUNT][24] = { [WEATHER_NONE] = _("NONE"), [WEATHER_SUNNY_CLOUDS] = _("SUNNY CLOUDS"), [WEATHER_SUNNY] = _("SUNNY"), @@ -2411,6 +2178,20 @@ static void DebugAction_Util_Script_8(u8 taskId) // ******************************* // Actions Flags and Vars +static void Debug_Display_FlagInfo(u32 flag, u32 digit, u8 windowId) +{ + ConvertIntToDecimalStringN(gStringVar1, flag, STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_FLAGS); + ConvertIntToHexStringN(gStringVar2, flag, STR_CONV_MODE_LEFT_ALIGN, 3); + StringExpandPlaceholders(gStringVar1, COMPOUND_STRING("{STR_VAR_1}{CLEAR_TO 90}\n0x{STR_VAR_2}{CLEAR_TO 90}")); + if (FlagGet(flag)) + StringCopyPadded(gStringVar2, sDebugText_True, CHAR_SPACE, 15); + else + StringCopyPadded(gStringVar2, sDebugText_False, CHAR_SPACE, 15); + StringCopy(gStringVar3, gText_DigitIndicator[digit]); + StringExpandPlaceholders(gStringVar4, sDebugText_FlagsVars_Flag); + AddTextPrinterParameterized(windowId, DEBUG_MENU_FONT, gStringVar4, 0, 0, 0, NULL); +} + static void DebugAction_FlagsVars_Flags(u8 taskId) { u8 windowId; @@ -2426,16 +2207,7 @@ static void DebugAction_FlagsVars_Flags(u8 taskId) CopyWindowToVram(windowId, COPYWIN_FULL); // Display initial flag - ConvertIntToDecimalStringN(gStringVar1, 1, STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_FLAGS); - ConvertIntToHexStringN(gStringVar2, 1, STR_CONV_MODE_LEFT_ALIGN, 3); - StringExpandPlaceholders(gStringVar1, sDebugText_FlagsVars_FlagHex); - if (FlagGet(FLAG_TEMP_1)) - StringCopyPadded(gStringVar2, sDebugText_True, CHAR_SPACE, 15); - else - StringCopyPadded(gStringVar2, sDebugText_False, CHAR_SPACE, 15); - StringCopy(gStringVar3, gText_DigitIndicator[0]); - StringExpandPlaceholders(gStringVar4, sDebugText_FlagsVars_Flag); - AddTextPrinterParameterized(windowId, DEBUG_MENU_FONT, gStringVar4, 0, 0, 0, NULL); + Debug_Display_FlagInfo(FLAG_TEMP_1, 0, windowId); gTasks[taskId].func = DebugAction_FlagsVars_FlagsSelect; gTasks[taskId].tSubWindowId = windowId; @@ -2461,16 +2233,7 @@ static void DebugAction_FlagsVars_FlagsSelect(u8 taskId) if (JOY_NEW(DPAD_ANY) || JOY_NEW(A_BUTTON)) { - ConvertIntToDecimalStringN(gStringVar1, gTasks[taskId].tInput, STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_FLAGS); - ConvertIntToHexStringN(gStringVar2, gTasks[taskId].tInput, STR_CONV_MODE_LEFT_ALIGN, 3); - StringExpandPlaceholders(gStringVar1, sDebugText_FlagsVars_FlagHex); - if (FlagGet(gTasks[taskId].tInput) == TRUE) - StringCopyPadded(gStringVar2, sDebugText_True, CHAR_SPACE, 15); - else - StringCopyPadded(gStringVar2, sDebugText_False, CHAR_SPACE, 15); - StringCopy(gStringVar3, gText_DigitIndicator[gTasks[taskId].tDigit]); - StringExpandPlaceholders(gStringVar4, sDebugText_FlagsVars_Flag); - AddTextPrinterParameterized(gTasks[taskId].tSubWindowId, DEBUG_MENU_FONT, gStringVar4, 0, 0, 0, NULL); + Debug_Display_FlagInfo(gTasks[taskId].tInput, gTasks[taskId].tDigit, gTasks[taskId].tSubWindowId); } } @@ -2729,77 +2492,33 @@ static void DebugAction_FlagsVars_RunningShoes(u8 taskId) static void DebugAction_FlagsVars_ToggleFlyFlags(u8 taskId) { - if (FlagGet(FLAG_LANDMARK_BATTLE_FRONTIER)) + if (FlagGet(sLocationFlags[ARRAY_COUNT(sLocationFlags) - 1])) { PlaySE(SE_PC_OFF); - FlagClear(FLAG_VISITED_LITTLEROOT_TOWN); - FlagClear(FLAG_VISITED_OLDALE_TOWN); - FlagClear(FLAG_VISITED_DEWFORD_TOWN); - FlagClear(FLAG_VISITED_LAVARIDGE_TOWN); - FlagClear(FLAG_VISITED_FALLARBOR_TOWN); - FlagClear(FLAG_VISITED_VERDANTURF_TOWN); - FlagClear(FLAG_VISITED_PACIFIDLOG_TOWN); - FlagClear(FLAG_VISITED_PETALBURG_CITY); - FlagClear(FLAG_VISITED_SLATEPORT_CITY); - FlagClear(FLAG_VISITED_MAUVILLE_CITY); - FlagClear(FLAG_VISITED_RUSTBORO_CITY); - FlagClear(FLAG_VISITED_FORTREE_CITY); - FlagClear(FLAG_VISITED_LILYCOVE_CITY); - FlagClear(FLAG_VISITED_MOSSDEEP_CITY); - FlagClear(FLAG_VISITED_SOOTOPOLIS_CITY); - FlagClear(FLAG_VISITED_EVER_GRANDE_CITY); - FlagClear(FLAG_LANDMARK_POKEMON_LEAGUE); - FlagClear(FLAG_LANDMARK_BATTLE_FRONTIER); + for (u32 i = 0; i < ARRAY_COUNT(sLocationFlags); i++) + FlagClear(sLocationFlags[i]); } else { PlaySE(SE_PC_LOGIN); - FlagSet(FLAG_VISITED_LITTLEROOT_TOWN); - FlagSet(FLAG_VISITED_OLDALE_TOWN); - FlagSet(FLAG_VISITED_DEWFORD_TOWN); - FlagSet(FLAG_VISITED_LAVARIDGE_TOWN); - FlagSet(FLAG_VISITED_FALLARBOR_TOWN); - FlagSet(FLAG_VISITED_VERDANTURF_TOWN); - FlagSet(FLAG_VISITED_PACIFIDLOG_TOWN); - FlagSet(FLAG_VISITED_PETALBURG_CITY); - FlagSet(FLAG_VISITED_SLATEPORT_CITY); - FlagSet(FLAG_VISITED_MAUVILLE_CITY); - FlagSet(FLAG_VISITED_RUSTBORO_CITY); - FlagSet(FLAG_VISITED_FORTREE_CITY); - FlagSet(FLAG_VISITED_LILYCOVE_CITY); - FlagSet(FLAG_VISITED_MOSSDEEP_CITY); - FlagSet(FLAG_VISITED_SOOTOPOLIS_CITY); - FlagSet(FLAG_VISITED_EVER_GRANDE_CITY); - FlagSet(FLAG_LANDMARK_POKEMON_LEAGUE); - FlagSet(FLAG_LANDMARK_BATTLE_FRONTIER); + for (u32 i = 0; i < ARRAY_COUNT(sLocationFlags); i++) + FlagSet(sLocationFlags[i]); } } static void DebugAction_FlagsVars_ToggleBadgeFlags(u8 taskId) { - if (FlagGet(FLAG_BADGE08_GET)) + if (FlagGet(gBadgeFlags[ARRAY_COUNT(gBadgeFlags) - 1])) { PlaySE(SE_PC_OFF); - FlagClear(FLAG_BADGE01_GET); - FlagClear(FLAG_BADGE02_GET); - FlagClear(FLAG_BADGE03_GET); - FlagClear(FLAG_BADGE04_GET); - FlagClear(FLAG_BADGE05_GET); - FlagClear(FLAG_BADGE06_GET); - FlagClear(FLAG_BADGE07_GET); - FlagClear(FLAG_BADGE08_GET); + for (u32 i = 0; i < ARRAY_COUNT(gBadgeFlags); i++) + FlagClear(gBadgeFlags[i]); } else { PlaySE(SE_PC_LOGIN); - FlagSet(FLAG_BADGE01_GET); - FlagSet(FLAG_BADGE02_GET); - FlagSet(FLAG_BADGE03_GET); - FlagSet(FLAG_BADGE04_GET); - FlagSet(FLAG_BADGE05_GET); - FlagSet(FLAG_BADGE06_GET); - FlagSet(FLAG_BADGE07_GET); - FlagSet(FLAG_BADGE08_GET); + for (u32 i = 0; i < ARRAY_COUNT(gBadgeFlags); i++) + FlagSet(gBadgeFlags[i]); } } @@ -2894,6 +2613,17 @@ static void DebugAction_FlagsVars_CatchingOnOff(u8 taskId) #define tItemId data[5] #define tSpriteId data[6] +static void Debug_Display_ItemInfo(u32 itemId, u32 digit, u8 windowId) +{ + StringCopy(gStringVar2, gText_DigitIndicator[digit]); + u8* end = CopyItemName(itemId, gStringVar1); + WrapFontIdToFit(gStringVar1, end, DEBUG_MENU_FONT, WindowWidthPx(windowId)); + StringCopyPadded(gStringVar1, gStringVar1, CHAR_SPACE, 15); + ConvertIntToDecimalStringN(gStringVar3, itemId, STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_ITEMS); + StringExpandPlaceholders(gStringVar4, sDebugText_ItemID); + AddTextPrinterParameterized(windowId, DEBUG_MENU_FONT, gStringVar4, 0, 0, 0, NULL); +} + static void DebugAction_Give_Item(u8 taskId) { u8 windowId; @@ -2909,13 +2639,7 @@ static void DebugAction_Give_Item(u8 taskId) CopyWindowToVram(windowId, COPYWIN_FULL); // Display initial item - StringCopy(gStringVar2, gText_DigitIndicator[0]); - ConvertIntToDecimalStringN(gStringVar3, 1, STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_ITEMS); - u8* end = CopyItemName(1, gStringVar1); - WrapFontIdToFit(gStringVar1, end, DEBUG_MENU_FONT, WindowWidthPx(windowId)); - StringCopyPadded(gStringVar1, gStringVar1, CHAR_SPACE, 15); - StringExpandPlaceholders(gStringVar4, sDebugText_ItemID); - AddTextPrinterParameterized(windowId, DEBUG_MENU_FONT, gStringVar4, 0, 0, 0, NULL); + Debug_Display_ItemInfo(1, 0, windowId); gTasks[taskId].func = DebugAction_Give_Item_SelectId; gTasks[taskId].tSubWindowId = windowId; @@ -2927,25 +2651,31 @@ static void DebugAction_Give_Item(u8 taskId) gSprites[gTasks[taskId].tSpriteId].oam.priority = 0; } +static void DestroyItemIcon(u8 taskId) +{ + FreeSpriteTilesByTag(ITEM_TAG); + FreeSpritePaletteByTag(ITEM_TAG); + FreeSpriteOamMatrix(&gSprites[gTasks[taskId].tSpriteId]); + DestroySprite(&gSprites[gTasks[taskId].tSpriteId]); +} + +static void Debug_Display_ItemQuantity(u32 quantity, u32 digit, u8 windowId) +{ + StringCopy(gStringVar2, gText_DigitIndicator[digit]); + ConvertIntToDecimalStringN(gStringVar1, quantity, STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_ITEM_QUANTITY); + StringCopyPadded(gStringVar1, gStringVar1, CHAR_SPACE, 15); + StringExpandPlaceholders(gStringVar4, sDebugText_ItemQuantity); + AddTextPrinterParameterized(windowId, DEBUG_MENU_FONT, gStringVar4, 0, 0, 0, NULL); +} + static void DebugAction_Give_Item_SelectId(u8 taskId) { if (JOY_NEW(DPAD_ANY)) { PlaySE(SE_SELECT); Debug_HandleInput_Numeric(taskId, 1, ITEMS_COUNT - 1, DEBUG_NUMBER_DIGITS_ITEMS); - - StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].tDigit]); - u8* end = CopyItemName(gTasks[taskId].tInput, gStringVar1); - WrapFontIdToFit(gStringVar1, end, DEBUG_MENU_FONT, WindowWidthPx(gTasks[taskId].tSubWindowId)); - StringCopyPadded(gStringVar1, gStringVar1, CHAR_SPACE, 15); - ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].tInput, STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_ITEMS); - StringExpandPlaceholders(gStringVar4, sDebugText_ItemID); - AddTextPrinterParameterized(gTasks[taskId].tSubWindowId, DEBUG_MENU_FONT, gStringVar4, 0, 0, 0, NULL); - - FreeSpriteTilesByTag(ITEM_TAG); //Destroy item icon - FreeSpritePaletteByTag(ITEM_TAG); //Destroy item icon - FreeSpriteOamMatrix(&gSprites[gTasks[taskId].tSpriteId]); //Destroy item icon - DestroySprite(&gSprites[gTasks[taskId].tSpriteId]); //Destroy item icon + Debug_Display_ItemInfo(gTasks[taskId].tInput, gTasks[taskId].tDigit, gTasks[taskId].tSubWindowId); + DestroyItemIcon(taskId); gTasks[taskId].tSpriteId = AddItemIconSprite(ITEM_TAG, ITEM_TAG, gTasks[taskId].tInput); gSprites[gTasks[taskId].tSpriteId].x2 = DEBUG_NUMBER_ICON_X+10; gSprites[gTasks[taskId].tSpriteId].y2 = DEBUG_NUMBER_ICON_Y+10; @@ -2957,21 +2687,12 @@ static void DebugAction_Give_Item_SelectId(u8 taskId) gTasks[taskId].tItemId = gTasks[taskId].tInput; gTasks[taskId].tInput = 1; gTasks[taskId].tDigit = 0; - - StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].tDigit]); - ConvertIntToDecimalStringN(gStringVar1, gTasks[taskId].tInput, STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_ITEM_QUANTITY); - StringCopyPadded(gStringVar1, gStringVar1, CHAR_SPACE, 15); - StringExpandPlaceholders(gStringVar4, sDebugText_ItemQuantity); - AddTextPrinterParameterized(gTasks[taskId].tSubWindowId, DEBUG_MENU_FONT, gStringVar4, 0, 0, 0, NULL); - + Debug_Display_ItemQuantity(gTasks[taskId].tInput, gTasks[taskId].tDigit, gTasks[taskId].tSubWindowId); gTasks[taskId].func = DebugAction_Give_Item_SelectQuantity; } else if (JOY_NEW(B_BUTTON)) { - FreeSpriteTilesByTag(ITEM_TAG); //Destroy item icon - FreeSpritePaletteByTag(ITEM_TAG); //Destroy item icon - FreeSpriteOamMatrix(&gSprites[gTasks[taskId].tSpriteId]); //Destroy item icon - DestroySprite(&gSprites[gTasks[taskId].tSpriteId]); //Destroy item icon + DestroyItemIcon(taskId); PlaySE(SE_SELECT); DebugAction_DestroyExtraWindow(taskId); @@ -2986,20 +2707,12 @@ static void DebugAction_Give_Item_SelectQuantity(u8 taskId) { PlaySE(SE_SELECT); Debug_HandleInput_Numeric(taskId, 1, MAX_BAG_ITEM_CAPACITY, MAX_ITEM_DIGITS); - - StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].tDigit]); - ConvertIntToDecimalStringN(gStringVar1, gTasks[taskId].tInput, STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_ITEM_QUANTITY); - StringCopyPadded(gStringVar1, gStringVar1, CHAR_SPACE, 15); - StringExpandPlaceholders(gStringVar4, sDebugText_ItemQuantity); - AddTextPrinterParameterized(gTasks[taskId].tSubWindowId, DEBUG_MENU_FONT, gStringVar4, 0, 0, 0, NULL); + Debug_Display_ItemQuantity(gTasks[taskId].tInput, gTasks[taskId].tDigit, gTasks[taskId].tSubWindowId); } if (JOY_NEW(A_BUTTON)) { - FreeSpriteTilesByTag(ITEM_TAG); //Destroy item icon - FreeSpritePaletteByTag(ITEM_TAG); //Destroy item icon - FreeSpriteOamMatrix(&gSprites[gTasks[taskId].tSpriteId]); //Destroy item icon - DestroySprite(&gSprites[gTasks[taskId].tSpriteId]); //Destroy item icon + DestroyItemIcon(taskId); PlaySE(MUS_LEVEL_UP); AddBagItem(itemId, gTasks[taskId].tInput); @@ -3007,10 +2720,7 @@ static void DebugAction_Give_Item_SelectQuantity(u8 taskId) } else if (JOY_NEW(B_BUTTON)) { - FreeSpriteTilesByTag(ITEM_TAG); //Destroy item icon - FreeSpritePaletteByTag(ITEM_TAG); //Destroy item icon - FreeSpriteOamMatrix(&gSprites[gTasks[taskId].tSpriteId]); //Destroy item icon - DestroySprite(&gSprites[gTasks[taskId].tSpriteId]); //Destroy item icon + DestroyItemIcon(taskId); PlaySE(SE_SELECT); DebugAction_DestroyExtraWindow(taskId); @@ -3031,24 +2741,28 @@ static void ResetMonDataStruct(struct DebugMonData *sDebugMonData) sDebugMonData->teraType = TYPE_NONE; sDebugMonData->dynamaxLevel = 0; sDebugMonData->gmaxFactor = FALSE; - sDebugMonData->mon_iv_hp = 0; - sDebugMonData->mon_iv_atk = 0; - sDebugMonData->mon_iv_def = 0; - sDebugMonData->mon_iv_speed = 0; - sDebugMonData->mon_iv_satk = 0; - sDebugMonData->mon_iv_sdef = 0; - sDebugMonData->mon_ev_hp = 0; - sDebugMonData->mon_ev_atk = 0; - sDebugMonData->mon_ev_def = 0; - sDebugMonData->mon_ev_speed = 0; - sDebugMonData->mon_ev_satk = 0; - sDebugMonData->mon_ev_sdef = 0; + for (u32 i = 0; i < NUM_STATS; i++) + { + sDebugMonData->monIVs[i] = 0; + sDebugMonData->monEVs[i] = 0; + } } #define tIsComplex data[5] #define tSpriteId data[6] #define tIterator data[7] +static void Debug_Display_SpeciesInfo(u32 species, u32 digit, u8 windowId) +{ + StringCopy(gStringVar2, gText_DigitIndicator[digit]); + u8 *end = StringCopy(gStringVar1, GetSpeciesName(species)); + WrapFontIdToFit(gStringVar1, end, DEBUG_MENU_FONT, WindowWidthPx(windowId)); + StringCopyPadded(gStringVar1, gStringVar1, CHAR_SPACE, 15); + ConvertIntToDecimalStringN(gStringVar3, species, STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_ITEMS); + StringExpandPlaceholders(gStringVar4, sDebugText_PokemonID); + AddTextPrinterParameterized(windowId, DEBUG_MENU_FONT, gStringVar4, 0, 0, 0, NULL); +} + static void DebugAction_Give_PokemonSimple(u8 taskId) { u8 windowId; @@ -3069,13 +2783,7 @@ static void DebugAction_Give_PokemonSimple(u8 taskId) CopyWindowToVram(windowId, COPYWIN_FULL); // Display initial Pokémon - StringCopy(gStringVar2, gText_DigitIndicator[0]); - ConvertIntToDecimalStringN(gStringVar3, sDebugMonData->species, STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_ITEMS); - u8 *end = StringCopy(gStringVar1, GetSpeciesName(sDebugMonData->species)); - WrapFontIdToFit(gStringVar1, end, DEBUG_MENU_FONT, WindowWidthPx(windowId)); - StringCopyPadded(gStringVar1, gStringVar1, CHAR_SPACE, 15); - StringExpandPlaceholders(gStringVar4, sDebugText_PokemonID); - AddTextPrinterParameterized(windowId, DEBUG_MENU_FONT, gStringVar4, 0, 0, 0, NULL); + Debug_Display_SpeciesInfo(sDebugMonData->species, 0, windowId); //Set task data gTasks[taskId].func = DebugAction_Give_Pokemon_SelectId; @@ -3110,13 +2818,7 @@ static void DebugAction_Give_PokemonComplex(u8 taskId) CopyWindowToVram(windowId, COPYWIN_FULL); // Display initial Pokémon - StringCopy(gStringVar2, gText_DigitIndicator[0]); - ConvertIntToDecimalStringN(gStringVar3, sDebugMonData->species, STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_ITEMS); - u8 *end = StringCopy(gStringVar1, GetSpeciesName(sDebugMonData->species)); - WrapFontIdToFit(gStringVar1, end, DEBUG_MENU_FONT, WindowWidthPx(windowId)); - StringCopyPadded(gStringVar1, gStringVar1, CHAR_SPACE, 15); - StringExpandPlaceholders(gStringVar4, sDebugText_PokemonID); - AddTextPrinterParameterized(windowId, DEBUG_MENU_FONT, gStringVar4, 0, 0, 0, NULL); + Debug_Display_SpeciesInfo(sDebugMonData->species, 0, windowId); gTasks[taskId].func = DebugAction_Give_Pokemon_SelectId; gTasks[taskId].tSubWindowId = windowId; @@ -3137,15 +2839,7 @@ static void DebugAction_Give_Pokemon_SelectId(u8 taskId) { PlaySE(SE_SELECT); Debug_HandleInput_Numeric(taskId, 1, NUM_SPECIES - 1, DEBUG_NUMBER_DIGITS_ITEMS); - - StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].tDigit]); - u8 *end = StringCopy(gStringVar1, GetSpeciesName(gTasks[taskId].tInput)); //CopyItemName(gTasks[taskId].tInput, gStringVar1); - WrapFontIdToFit(gStringVar1, end, DEBUG_MENU_FONT, WindowWidthPx(gTasks[taskId].tSubWindowId)); - StringCopyPadded(gStringVar1, gStringVar1, CHAR_SPACE, 15); - ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].tInput, STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_ITEMS); - StringExpandPlaceholders(gStringVar4, sDebugText_PokemonID); - AddTextPrinterParameterized(gTasks[taskId].tSubWindowId, DEBUG_MENU_FONT, gStringVar4, 0, 0, 0, NULL); - + Debug_Display_SpeciesInfo(gTasks[taskId].tInput, gTasks[taskId].tDigit, gTasks[taskId].tSubWindowId); FreeAndDestroyMonIconSprite(&gSprites[gTasks[taskId].tSpriteId]); FreeMonIconPalettes(); LoadMonIconPalette(gTasks[taskId].tInput); @@ -3468,6 +3162,16 @@ static void DebugAction_Give_Pokemon_SelectDynamaxLevel(u8 taskId) } } +static void Debug_Display_StatInfo(const u8* text, u32 stat, u32 value, u32 digit, u8 windowId) +{ + StringCopy(gStringVar1, gStatNamesTable[stat]); + StringCopy(gStringVar2, gText_DigitIndicator[digit]); + ConvertIntToDecimalStringN(gStringVar3, value, STR_CONV_MODE_LEADING_ZEROS, 2); + StringCopyPadded(gStringVar3, gStringVar3, CHAR_SPACE, 15); + StringExpandPlaceholders(gStringVar4, text); + AddTextPrinterParameterized(windowId, DEBUG_MENU_FONT, gStringVar4, 0, 0, 0, NULL); +} + static void DebugAction_Give_Pokemon_SelectGigantamaxFactor(u8 taskId) { static const u8 *txtStr; @@ -3489,13 +3193,7 @@ static void DebugAction_Give_Pokemon_SelectGigantamaxFactor(u8 taskId) sDebugMonData->gmaxFactor = gTasks[taskId].tInput; gTasks[taskId].tInput = 0; gTasks[taskId].tDigit = 0; - - StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].tDigit]); - ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].tInput, STR_CONV_MODE_LEADING_ZEROS, 2); - StringCopyPadded(gStringVar3, gStringVar3, CHAR_SPACE, 15); - StringExpandPlaceholders(gStringVar4, sDebugText_IV_HP); - AddTextPrinterParameterized(gTasks[taskId].tSubWindowId, DEBUG_MENU_FONT, gStringVar4, 0, 0, 0, NULL); - + Debug_Display_StatInfo(sDebugText_IVs, gTasks[taskId].tIterator, gTasks[taskId].tInput, gTasks[taskId].tDigit, gTasks[taskId].tSubWindowId); gTasks[taskId].func = DebugAction_Give_Pokemon_SelectIVs; } else if (JOY_NEW(B_BUTTON)) @@ -3512,58 +3210,14 @@ static void DebugAction_Give_Pokemon_SelectIVs(u8 taskId) { PlaySE(SE_SELECT); Debug_HandleInput_Numeric(taskId, 0, MAX_PER_STAT_IVS, 3); - - StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].tDigit]); - ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].tInput, STR_CONV_MODE_LEADING_ZEROS, 2); - StringCopyPadded(gStringVar3, gStringVar3, CHAR_SPACE, 15); - switch (gTasks[taskId].tIterator) - { - case STAT_HP: - StringExpandPlaceholders(gStringVar4, sDebugText_IV_HP); - break; - case STAT_ATK: - StringExpandPlaceholders(gStringVar4, sDebugText_IV_Attack); - break; - case STAT_DEF: - StringExpandPlaceholders(gStringVar4, sDebugText_IV_Defense); - break; - case STAT_SPEED: - StringExpandPlaceholders(gStringVar4, sDebugText_IV_Speed); - break; - case STAT_SPATK: - StringExpandPlaceholders(gStringVar4, sDebugText_IV_SpAttack); - break; - case STAT_SPDEF: - StringExpandPlaceholders(gStringVar4, sDebugText_IV_SpDefense); - break; - } - AddTextPrinterParameterized(gTasks[taskId].tSubWindowId, DEBUG_MENU_FONT, gStringVar4, 0, 0, 0, NULL); + Debug_Display_StatInfo(sDebugText_IVs, gTasks[taskId].tIterator, gTasks[taskId].tInput, gTasks[taskId].tDigit, gTasks[taskId].tSubWindowId); } //If A or B button if (JOY_NEW(A_BUTTON)) { - switch (gTasks[taskId].tIterator) - { - case STAT_HP: - sDebugMonData->mon_iv_hp = gTasks[taskId].tInput; - break; - case STAT_ATK: - sDebugMonData->mon_iv_atk = gTasks[taskId].tInput; - break; - case STAT_DEF: - sDebugMonData->mon_iv_def = gTasks[taskId].tInput; - break; - case STAT_SPEED: - sDebugMonData->mon_iv_speed = gTasks[taskId].tInput; - break; - case STAT_SPATK: - sDebugMonData->mon_iv_satk = gTasks[taskId].tInput; - break; - case STAT_SPDEF: - sDebugMonData->mon_iv_sdef = gTasks[taskId].tInput; - break; - } + // Set IVs for stat + sDebugMonData->monIVs[gTasks[taskId].tIterator] = gTasks[taskId].tInput; //Check if all IVs set if (gTasks[taskId].tIterator != NUM_STATS - 1) @@ -3572,32 +3226,7 @@ static void DebugAction_Give_Pokemon_SelectIVs(u8 taskId) gTasks[taskId].tInput = 0; gTasks[taskId].tDigit = 0; - StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].tDigit]); - ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].tInput, STR_CONV_MODE_LEADING_ZEROS, 2); - StringCopyPadded(gStringVar3, gStringVar3, CHAR_SPACE, 15); - switch (gTasks[taskId].tIterator) - { - case STAT_HP: - StringExpandPlaceholders(gStringVar4, sDebugText_IV_HP); - break; - case STAT_ATK: - StringExpandPlaceholders(gStringVar4, sDebugText_IV_Attack); - break; - case STAT_DEF: - StringExpandPlaceholders(gStringVar4, sDebugText_IV_Defense); - break; - case STAT_SPEED: - StringExpandPlaceholders(gStringVar4, sDebugText_IV_Speed); - break; - case STAT_SPATK: - StringExpandPlaceholders(gStringVar4, sDebugText_IV_SpAttack); - break; - case STAT_SPDEF: - StringExpandPlaceholders(gStringVar4, sDebugText_IV_SpDefense); - break; - } - AddTextPrinterParameterized(gTasks[taskId].tSubWindowId, DEBUG_MENU_FONT, gStringVar4, 0, 0, 0, NULL); - + Debug_Display_StatInfo(sDebugText_IVs, gTasks[taskId].tIterator, gTasks[taskId].tInput, gTasks[taskId].tDigit, gTasks[taskId].tSubWindowId); gTasks[taskId].func = DebugAction_Give_Pokemon_SelectIVs; } else @@ -3606,11 +3235,7 @@ static void DebugAction_Give_Pokemon_SelectIVs(u8 taskId) gTasks[taskId].tDigit = 0; gTasks[taskId].tIterator = 0; - StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].tDigit]); - ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].tInput, STR_CONV_MODE_LEADING_ZEROS, 3); - StringCopyPadded(gStringVar3, gStringVar3, CHAR_SPACE, 15); - StringExpandPlaceholders(gStringVar4, sDebugText_EV_HP); - AddTextPrinterParameterized(gTasks[taskId].tSubWindowId, DEBUG_MENU_FONT, gStringVar4, 0, 0, 0, NULL); + Debug_Display_StatInfo(sDebugText_EVs, gTasks[taskId].tIterator, gTasks[taskId].tInput, gTasks[taskId].tDigit, gTasks[taskId].tSubWindowId); gTasks[taskId].func = DebugAction_Give_Pokemon_SelectEVs; } } @@ -3624,12 +3249,10 @@ static void DebugAction_Give_Pokemon_SelectIVs(u8 taskId) static u32 GetDebugPokemonTotalEV(void) { - return (sDebugMonData->mon_ev_hp - + sDebugMonData->mon_ev_atk - + sDebugMonData->mon_ev_def - + sDebugMonData->mon_ev_speed - + sDebugMonData->mon_ev_satk - + sDebugMonData->mon_ev_sdef); + u32 totalEVs = 0; + for (u32 i = 0; i < NUM_STATS; i++) + totalEVs += sDebugMonData->monEVs[i]; + return totalEVs; } static void DebugAction_Give_Pokemon_SelectEVs(u8 taskId) @@ -3640,58 +3263,14 @@ static void DebugAction_Give_Pokemon_SelectEVs(u8 taskId) { PlaySE(SE_SELECT); Debug_HandleInput_Numeric(taskId, 0, MAX_PER_STAT_EVS, 4); - - StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].tDigit]); - ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].tInput, STR_CONV_MODE_LEADING_ZEROS, 3); - StringCopyPadded(gStringVar3, gStringVar3, CHAR_SPACE, 15); - switch (gTasks[taskId].tIterator) - { - case STAT_HP: - StringExpandPlaceholders(gStringVar4, sDebugText_EV_HP); - break; - case STAT_ATK: - StringExpandPlaceholders(gStringVar4, sDebugText_EV_Attack); - break; - case STAT_DEF: - StringExpandPlaceholders(gStringVar4, sDebugText_EV_Defense); - break; - case STAT_SPEED: - StringExpandPlaceholders(gStringVar4, sDebugText_EV_Speed); - break; - case STAT_SPATK: - StringExpandPlaceholders(gStringVar4, sDebugText_EV_SpAttack); - break; - case STAT_SPDEF: - StringExpandPlaceholders(gStringVar4, sDebugText_EV_SpDefense); - break; - } - AddTextPrinterParameterized(gTasks[taskId].tSubWindowId, DEBUG_MENU_FONT, gStringVar4, 0, 0, 0, NULL); + Debug_Display_StatInfo(sDebugText_EVs, gTasks[taskId].tIterator, gTasks[taskId].tInput, gTasks[taskId].tDigit, gTasks[taskId].tSubWindowId); } //If A or B button if (JOY_NEW(A_BUTTON)) { - switch (gTasks[taskId].tIterator) - { - case STAT_HP: - sDebugMonData->mon_ev_hp = gTasks[taskId].tInput; - break; - case STAT_ATK: - sDebugMonData->mon_ev_atk = gTasks[taskId].tInput; - break; - case STAT_DEF: - sDebugMonData->mon_ev_def = gTasks[taskId].tInput; - break; - case STAT_SPEED: - sDebugMonData->mon_ev_speed = gTasks[taskId].tInput; - break; - case STAT_SPATK: - sDebugMonData->mon_ev_satk = gTasks[taskId].tInput; - break; - case STAT_SPDEF: - sDebugMonData->mon_ev_sdef = gTasks[taskId].tInput; - break; - } + // Set EVs for stat + sDebugMonData->monEVs[gTasks[taskId].tIterator] = gTasks[taskId].tInput; //Check if all EVs set if (gTasks[taskId].tIterator != NUM_STATS - 1) @@ -3699,33 +3278,7 @@ static void DebugAction_Give_Pokemon_SelectEVs(u8 taskId) gTasks[taskId].tIterator++; gTasks[taskId].tInput = 0; gTasks[taskId].tDigit = 0; - - StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].tDigit]); - ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].tInput, STR_CONV_MODE_LEADING_ZEROS, 3); - StringCopyPadded(gStringVar3, gStringVar3, CHAR_SPACE, 15); - switch (gTasks[taskId].tIterator) - { - case STAT_HP: - StringExpandPlaceholders(gStringVar4, sDebugText_EV_HP); - break; - case STAT_ATK: - StringExpandPlaceholders(gStringVar4, sDebugText_EV_Attack); - break; - case STAT_DEF: - StringExpandPlaceholders(gStringVar4, sDebugText_EV_Defense); - break; - case STAT_SPEED: - StringExpandPlaceholders(gStringVar4, sDebugText_EV_Speed); - break; - case STAT_SPATK: - StringExpandPlaceholders(gStringVar4, sDebugText_EV_SpAttack); - break; - case STAT_SPDEF: - StringExpandPlaceholders(gStringVar4, sDebugText_EV_SpDefense); - break; - } - AddTextPrinterParameterized(gTasks[taskId].tSubWindowId, DEBUG_MENU_FONT, gStringVar4, 0, 0, 0, NULL); - + Debug_Display_StatInfo(sDebugText_EVs, gTasks[taskId].tIterator, gTasks[taskId].tInput, gTasks[taskId].tDigit, gTasks[taskId].tSubWindowId); gTasks[taskId].func = DebugAction_Give_Pokemon_SelectEVs; } else @@ -3736,20 +3289,13 @@ static void DebugAction_Give_Pokemon_SelectEVs(u8 taskId) if (totalEV > MAX_TOTAL_EVS) { - sDebugMonData->mon_ev_hp = 0; - sDebugMonData->mon_ev_atk = 0; - sDebugMonData->mon_ev_def = 0; - sDebugMonData->mon_ev_speed = 0; - sDebugMonData->mon_ev_satk = 0; - sDebugMonData->mon_ev_sdef = 0; + for (u32 i = 0; i < NUM_STATS; i++) + { + sDebugMonData->monEVs[i] = 0; + } PlaySE(SE_FAILURE); - StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].tDigit]); - ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].tInput, STR_CONV_MODE_LEADING_ZEROS, 3); - StringCopyPadded(gStringVar3, gStringVar3, CHAR_SPACE, 15); - StringExpandPlaceholders(gStringVar4, sDebugText_EV_HP); - AddTextPrinterParameterized(gTasks[taskId].tSubWindowId, DEBUG_MENU_FONT, gStringVar4, 0, 0, 0, NULL); - + Debug_Display_StatInfo(sDebugText_EVs, gTasks[taskId].tIterator, gTasks[taskId].tInput, gTasks[taskId].tDigit, gTasks[taskId].tSubWindowId); gTasks[taskId].func = DebugAction_Give_Pokemon_SelectEVs; } else @@ -3882,9 +3428,9 @@ static void DebugAction_Give_Pokemon_ComplexCreateMon(u8 taskId) //https://githu struct Pokemon mon; u8 i; u16 moves[4]; - u8 IVs[6]; + u8 IVs[NUM_STATS]; u8 iv_val; - u8 EVs[6]; + u8 EVs[NUM_STATS]; u8 ev_val; u16 species = sDebugMonData->species; u8 level = sDebugMonData->level; @@ -3898,18 +3444,11 @@ static void DebugAction_Give_Pokemon_ComplexCreateMon(u8 taskId) //https://githu moves[1] = sDebugMonData->mon_move_1; moves[2] = sDebugMonData->mon_move_2; moves[3] = sDebugMonData->mon_move_3; - IVs[0] = sDebugMonData->mon_iv_hp; - IVs[1] = sDebugMonData->mon_iv_atk; - IVs[2] = sDebugMonData->mon_iv_def; - IVs[3] = sDebugMonData->mon_iv_speed; - IVs[4] = sDebugMonData->mon_iv_satk; - IVs[5] = sDebugMonData->mon_iv_sdef; - EVs[0] = sDebugMonData->mon_ev_hp; - EVs[1] = sDebugMonData->mon_ev_atk; - EVs[2] = sDebugMonData->mon_ev_def; - EVs[3] = sDebugMonData->mon_ev_speed; - EVs[4] = sDebugMonData->mon_ev_satk; - EVs[5] = sDebugMonData->mon_ev_sdef; + for (u32 i = 0; i < NUM_STATS; i++) + { + EVs[i] = sDebugMonData->monEVs[i]; + IVs[i] = sDebugMonData->monIVs[i]; + } //Nature if (nature == NUM_NATURES || nature == 0xFF) diff --git a/src/event_data.c b/src/event_data.c index 33cb02027bd1..ccd0519c512f 100644 --- a/src/event_data.c +++ b/src/event_data.c @@ -29,6 +29,18 @@ EWRAM_DATA static u8 sSpecialFlags[SPECIAL_FLAGS_SIZE] = {0}; extern u16 *const gSpecialVars[]; +const u16 gBadgeFlags[NUM_BADGES] = +{ + FLAG_BADGE01_GET, + FLAG_BADGE02_GET, + FLAG_BADGE03_GET, + FLAG_BADGE04_GET, + FLAG_BADGE05_GET, + FLAG_BADGE06_GET, + FLAG_BADGE07_GET, + FLAG_BADGE08_GET, +}; + void InitEventData(void) { memset(gSaveBlock1Ptr->flags, 0, sizeof(gSaveBlock1Ptr->flags)); diff --git a/src/match_call.c b/src/match_call.c index 662dd209a49b..ea2ab8ed4622 100644 --- a/src/match_call.c +++ b/src/match_call.c @@ -1839,25 +1839,13 @@ static void PopulateBattleFrontierStreak(int matchCallId, u8 *destStr) ConvertIntToDecimalStringN(destStr, sBattleFrontierStreakInfo.streak, STR_CONV_MODE_LEFT_ALIGN, i); } -static const u16 sBadgeFlags[NUM_BADGES] = -{ - FLAG_BADGE01_GET, - FLAG_BADGE02_GET, - FLAG_BADGE03_GET, - FLAG_BADGE04_GET, - FLAG_BADGE05_GET, - FLAG_BADGE06_GET, - FLAG_BADGE07_GET, - FLAG_BADGE08_GET, -}; - static int GetNumOwnedBadges(void) { u32 i; for (i = 0; i < NUM_BADGES; i++) { - if (!FlagGet(sBadgeFlags[i])) + if (!FlagGet(gBadgeFlags[i])) break; }