diff --git a/data/scripts/debug.inc b/data/scripts/debug.inc index f9ec4eeffdfc..d7f486907df9 100644 --- a/data/scripts/debug.inc +++ b/data/scripts/debug.inc @@ -1,14 +1,15 @@ .if DEBUG_OVERWORLD_MENU == TRUE - -Debug_ShowFieldMessageStringVar4:: - special ShowFieldMessageStringVar4 +Debug_MessageEnd: waitmessage waitbuttonpress releaseall end +Debug_ShowFieldMessageStringVar4:: + special ShowFieldMessageStringVar4 + goto Debug_MessageEnd + Debug_CheatStart:: - lockall setflag FLAG_SYS_POKEMON_GET setflag FLAG_RESCUED_BIRCH setflag FLAG_HIDE_ROUTE_101_BIRCH_ZIGZAGOON_BATTLE @@ -44,12 +45,8 @@ Debug_CheatStart:: end Debug_FlagsNotSetOverworldConfigMessage:: - lockall message Debug_FlagsNotSetOverworldConfigMessage_Text - waitmessage - waitbuttonpress - releaseall - end + goto Debug_MessageEnd Debug_FlagsNotSetOverworldConfigMessage_Text: .string "Feature unavailable!\n" @@ -57,18 +54,21 @@ Debug_FlagsNotSetOverworldConfigMessage_Text: .string "'include/config/overworld.h'!$" Debug_FlagsNotSetBattleConfigMessage:: - lockall message Debug_FlagsNotSetBattleConfigMessage_Text - waitmessage - waitbuttonpress - releaseall - end + goto Debug_MessageEnd Debug_FlagsNotSetBattleConfigMessage_Text: .string "Feature unavailable!\n" .string "Please define a usable flag in:\l" .string "'include/config/battle.h'!$" +Debug_BoxFilledMessage:: + message Debug_BoxFilledMessage_Text + goto Debug_MessageEnd + +Debug_BoxFilledMessage_Text: + .string "Storage boxes filled!$" + Debug_Script_1:: end diff --git a/include/battle_setup.h b/include/battle_setup.h index e29b3155fe01..96aeb4b761a4 100644 --- a/include/battle_setup.h +++ b/include/battle_setup.h @@ -68,4 +68,7 @@ bool8 IsTrainerReadyForRematch(void); void ShouldTryGetTrainerScript(void); u16 CountBattledRematchTeams(u16 trainerId); +void DoStandardWildBattle_Debug(void); +void BattleSetup_StartTrainerBattle_Debug(void); + #endif // GUARD_BATTLE_SETUP_H diff --git a/include/constants/battle_ai.h b/include/constants/battle_ai.h index 81dbdad16393..32b7f7d10c3c 100644 --- a/include/constants/battle_ai.h +++ b/include/constants/battle_ai.h @@ -60,6 +60,8 @@ #define AI_FLAG_ACE_POKEMON (1 << 16) // AI has an Ace Pokemon. The last Pokemon in the party will not be used until it's the last one remaining. #define AI_FLAG_OMNISCIENT (1 << 17) // AI has full knowledge of player moves, abilities, hold items +#define AI_FLAG_COUNT 18 + // 'other' ai logic flags #define AI_FLAG_ROAMING (1 << 29) #define AI_FLAG_SAFARI (1 << 30) diff --git a/include/debug.h b/include/debug.h index 88f5f666205c..d89c7994b860 100644 --- a/include/debug.h +++ b/include/debug.h @@ -3,4 +3,7 @@ void Debug_ShowMainMenu(void); +extern EWRAM_DATA bool8 gIsDebugBattle; +extern EWRAM_DATA u32 gDebugAIFlags; + #endif // GUARD_DEBUG_H diff --git a/include/pokemon.h b/include/pokemon.h index c33e7bb81853..90a6999b6dce 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -485,6 +485,8 @@ void SetMonMoveSlot(struct Pokemon *mon, u16 move, u8 slot); void SetBattleMonMoveSlot(struct BattlePokemon *mon, u16 move, u8 slot); void GiveMonInitialMoveset(struct Pokemon *mon); void GiveBoxMonInitialMoveset(struct BoxPokemon *boxMon); +void GiveMonInitialMoveset_Fast(struct Pokemon *mon); +void GiveBoxMonInitialMoveset_Fast(struct BoxPokemon *boxMon); u16 MonTryLearningNewMove(struct Pokemon *mon, bool8 firstMove); void DeleteFirstMoveAndGiveMoveToMon(struct Pokemon *mon, u16 move); void DeleteFirstMoveAndGiveMoveToBoxMon(struct BoxPokemon *boxMon, u16 move); diff --git a/include/wild_encounter.h b/include/wild_encounter.h index e853efbadc89..bef89d8950a7 100644 --- a/include/wild_encounter.h +++ b/include/wild_encounter.h @@ -39,5 +39,6 @@ u16 GetLocalWildMon(bool8 *isWaterMon); u16 GetLocalWaterMon(void); bool8 UpdateRepelCounter(void); bool8 TryDoDoubleWildBattle(void); +bool8 StandardWildEncounter_Debug(void); #endif // GUARD_WILD_ENCOUNTER_H diff --git a/src/battle_ai_main.c b/src/battle_ai_main.c index f17111cd3700..290b713b6c53 100644 --- a/src/battle_ai_main.c +++ b/src/battle_ai_main.c @@ -8,6 +8,7 @@ #include "battle_setup.h" #include "battle_z_move.h" #include "data.h" +#include "debug.h" #include "event_data.h" #include "item.h" #include "pokemon.h" @@ -152,6 +153,11 @@ static u32 GetWildAiFlags(void) void BattleAI_SetupFlags(void) { +#if DEBUG_OVERWORLD_MENU == TRUE + if (gIsDebugBattle) + AI_THINKING_STRUCT->aiFlags = gDebugAIFlags; + else +#endif if (gBattleTypeFlags & BATTLE_TYPE_RECORDED) AI_THINKING_STRUCT->aiFlags = GetAiScriptsInRecordedBattle(); else if (gBattleTypeFlags & BATTLE_TYPE_SAFARI) diff --git a/src/battle_main.c b/src/battle_main.c index 6ba91a5bb82b..2c191512d013 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -16,6 +16,7 @@ #include "berry.h" #include "bg.h" #include "data.h" +#include "debug.h" #include "decompress.h" #include "dma3.h" #include "event_data.h" @@ -565,7 +566,13 @@ static void CB2_InitBattleInternal(void) gBattle_BG3_X = 0; gBattle_BG3_Y = 0; +#if DEBUG_OVERWORLD_MENU == FALSE + gBattleTerrain = BattleSetup_GetTerrainId(); +#else + if (!gIsDebugBattle) + gBattleTerrain = BattleSetup_GetTerrainId(); +#endif if (gBattleTypeFlags & BATTLE_TYPE_RECORDED) gBattleTerrain = BATTLE_TERRAIN_BUILDING; @@ -588,6 +595,7 @@ static void CB2_InitBattleInternal(void) else SetMainCallback2(CB2_HandleStartBattle); +#if DEBUG_OVERWORLD_MENU == FALSE if (!(gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_RECORDED))) { CreateNPCTrainerParty(&gEnemyParty[0], gTrainerBattleOpponent_A, TRUE); @@ -596,6 +604,18 @@ static void CB2_InitBattleInternal(void) SetWildMonHeldItem(); CalculateEnemyPartyCount(); } +#else + if (!gIsDebugBattle) + { + if (!(gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_RECORDED))) + { + CreateNPCTrainerParty(&gEnemyParty[0], gTrainerBattleOpponent_A, TRUE); + if (gBattleTypeFlags & BATTLE_TYPE_TWO_OPPONENTS) + CreateNPCTrainerParty(&gEnemyParty[PARTY_SIZE / 2], gTrainerBattleOpponent_B, FALSE); + SetWildMonHeldItem(); + } + } +#endif gMain.inBattle = TRUE; gSaveBlock2Ptr->frontier.disableRecordBattle = FALSE; diff --git a/src/battle_setup.c b/src/battle_setup.c index 2b8e63e76683..f26c690819e4 100644 --- a/src/battle_setup.c +++ b/src/battle_setup.c @@ -380,6 +380,41 @@ static void CreateBattleStartTask(u8 transition, u16 song) PlayMapChosenOrBattleBGM(song); } +static void Task_BattleStart_Debug(u8 taskId) +{ + s16 *data = gTasks[taskId].data; + + switch (tState) + { + case 0: + if (!FldEffPoison_IsActive()) // is poison not active? + { + BattleTransition_StartOnField(tTransition); + ClearMirageTowerPulseBlendEffect(); + tState++; // go to case 1. + } + break; + case 1: + if (IsBattleTransitionDone() == TRUE) + { + CleanupOverworldWindowsAndTilemaps(); + SetMainCallback2(CB2_InitBattle); + RestartWildEncounterImmunitySteps(); + ClearPoisonStepCounter(); + DestroyTask(taskId); + } + break; + } +} + +static void CreateBattleStartTask_Debug(u8 transition, u16 song) +{ + u8 taskId = CreateTask(Task_BattleStart_Debug, 1); + + gTasks[taskId].tTransition = transition; + PlayMapChosenOrBattleBGM(song); +} + #undef tState #undef tTransition @@ -422,6 +457,25 @@ static void DoStandardWildBattle(bool32 isDouble) TryUpdateGymLeaderRematchFromWild(); } +void DoStandardWildBattle_Debug(void) +{ + LockPlayerFieldControls(); + FreezeObjectEvents(); + StopPlayerAvatar(); + gMain.savedCallback = CB2_EndWildBattle; + gBattleTypeFlags = 0; + if (InBattlePyramid()) + { + VarSet(VAR_TEMP_E, 0); + gBattleTypeFlags |= BATTLE_TYPE_PYRAMID; + } + CreateBattleStartTask_Debug(GetWildBattleTransition(), 0); + //IncrementGameStat(GAME_STAT_TOTAL_BATTLES); + //IncrementGameStat(GAME_STAT_WILD_BATTLES); + //IncrementDailyWildBattles(); + //TryUpdateGymLeaderRematchFromWild(); +} + void BattleSetup_StartRoamerBattle(void) { LockPlayerFieldControls(); @@ -1349,6 +1403,19 @@ void BattleSetup_StartTrainerBattle(void) ScriptContext_Stop(); } +void BattleSetup_StartTrainerBattle_Debug(void) +{ + sNoOfPossibleTrainerRetScripts = gNoOfApproachingTrainers; + gNoOfApproachingTrainers = 0; + sShouldCheckTrainerBScript = FALSE; + gWhichTrainerToFaceAfterBattle = 0; + gMain.savedCallback = CB2_EndTrainerBattle; + + CreateBattleStartTask_Debug(GetWildBattleTransition(), 0); + + ScriptContext_Stop(); +} + static void CB2_EndTrainerBattle(void) { if (gTrainerBattleOpponent_A == TRAINER_SECRET_BASE) diff --git a/src/debug.c b/src/debug.c index d98699b6e09f..ffacba9daf99 100644 --- a/src/debug.c +++ b/src/debug.c @@ -8,6 +8,7 @@ //Jaizu: https://jaizu.moe/ #include "global.h" #include "battle.h" +#include "battle_setup.h" #include "coins.h" #include "credits.h" #include "data.h" @@ -48,7 +49,9 @@ #include "string_util.h" #include "task.h" #include "pokemon_summary_screen.h" +#include "wild_encounter.h" #include "constants/abilities.h" +#include "constants/battle_ai.h" #include "constants/battle_frontier.h" #include "constants/flags.h" #include "constants/items.h" @@ -65,9 +68,10 @@ enum { // Main DEBUG_MENU_ITEM_UTILITIES, DEBUG_MENU_ITEM_SCRIPTS, - DEBUG_MENU_ITEM_FLAGS, - DEBUG_MENU_ITEM_VARS, + DEBUG_MENU_ITEM_FLAGVAR, + //DEBUG_MENU_ITEM_BATTLE, DEBUG_MENU_ITEM_GIVE, + DEBUG_MENU_ITEM_FILL, DEBUG_MENU_ITEM_SOUND, DEBUG_MENU_ITEM_ACCESS_PC, DEBUG_MENU_ITEM_CANCEL @@ -76,7 +80,6 @@ enum { // Util DEBUG_UTIL_MENU_ITEM_HEAL_PARTY, DEBUG_UTIL_MENU_ITEM_FLY, DEBUG_UTIL_MENU_ITEM_WARP, - DEBUG_UTIL_MENU_ITEM_RUNNING_SHOES, DEBUG_UTIL_MENU_ITEM_POISON_MONS, DEBUG_UTIL_MENU_ITEM_SAVEBLOCK, DEBUG_UTIL_MENU_ITEM_WEATHER, @@ -87,6 +90,7 @@ enum { // Util DEBUG_UTIL_MENU_ITEM_TRAINER_GENDER, DEBUG_UTIL_MENU_ITEM_TRAINER_ID, DEBUG_UTIL_MENU_ITEM_CLEAR_BOXES, + DEBUG_UTIL_MENU_ITEM_CHEAT, }; enum { // Scripts DEBUG_UTIL_MENU_ITEM_SCRIPT_1, @@ -98,24 +102,64 @@ enum { // Scripts DEBUG_UTIL_MENU_ITEM_SCRIPT_7, DEBUG_UTIL_MENU_ITEM_SCRIPT_8, }; -enum { // Flags - DEBUG_FLAG_MENU_ITEM_FLAGS, - DEBUG_FLAG_MENU_ITEM_POKEDEXFLAGS, - DEBUG_FLAG_MENU_ITEM_POKEDEXONOFF, - DEBUG_FLAG_MENU_ITEM_NATDEXONOFF, - DEBUG_FLAG_MENU_ITEM_POKENAVONOFF, - DEBUG_FLAG_MENU_ITEM_FLYANYWHERE, - DEBUG_FLAG_MENU_ITEM_GETALLBADGES, - DEBUG_FLAG_MENU_ITEM_FRONTIER_PASS, - DEBUG_FLAG_MENU_ITEM_COLISSION_ONOFF, - DEBUG_FLAG_MENU_ITEM_ENCOUNTER_ONOFF, - DEBUG_FLAG_MENU_ITEM_TRAINER_SEE_ONOFF, - DEBUG_FLAG_MENU_ITEM_BAG_USE_ONOFF, - DEBUG_FLAG_MENU_ITEM_CATCHING_ONOFF, +enum { // Flags and Vars + DEBUG_FLAGVAR_MENU_ITEM_FLAGS, + DEBUG_FLAGVAR_MENU_ITEM_VARS, + DEBUG_FLAGVAR_MENU_ITEM_DEXFLAGS_ALL, + DEBUG_FLAGVAR_MENU_ITEM_DEXFLAGS_RESET, + DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_POKEDEX, + DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_NATDEX, + DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_POKENAV, + DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_RUN_SHOES, + DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_LOCATIONS, + DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_BADGES_ALL, + DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_FRONTIER_PASS, + DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_COLISSION, + DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_ENCOUNTER, + DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_TRAINER_SEE, + DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_BAG_USE, + DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_CATCHING, }; -enum { // Vars - DEBUG_VARS_MENU_ITEM_VARS, +enum { // Battle 0 Type + DEBUG_BATTLE_0_MENU_ITEM_WILD, + DEBUG_BATTLE_0_MENU_ITEM_WILD_DOUBLE, + DEBUG_BATTLE_0_MENU_ITEM_SINGLE, + DEBUG_BATTLE_0_MENU_ITEM_DOUBLE, + DEBUG_BATTLE_0_MENU_ITEM_MULTI, }; +enum { // Battle 1 AI FLags + DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_00, + DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_01, + DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_02, + DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_03, + DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_04, + DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_05, + DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_06, + DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_07, + DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_08, + DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_09, + DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_10, + DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_11, + DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_12, + DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_13, + DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_14, + DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_15, + DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_16, + DEBUG_BATTLE_1_MENU_ITEM_AI_FLAG_17, + DEBUG_BATTLE_1_MENU_ITEM_CONTINUE, +}; +enum { // Battle 2 Terrain + DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_0, + DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_1, + DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_2, + DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_3, + DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_4, + DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_5, + DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_6, + DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_7, + DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_8, + DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_9, +}; enum { // Give DEBUG_GIVE_MENU_ITEM_ITEM_X, DEBUG_GIVE_MENU_ITEM_ALLTMS, @@ -125,8 +169,16 @@ enum { // Give DEBUG_GIVE_MENU_ITEM_MAX_COINS, DEBUG_GIVE_MENU_ITEM_MAX_BATTLE_POINTS, DEBUG_GIVE_MENU_ITEM_DAYCARE_EGG, - DEBUG_GIVE_MENU_ITEM_FILL_PC, - DEBUG_GIVE_MENU_ITEM_CHEAT, +}; +enum { // Give Fill + DEBUG_FILL_MENU_ITEM_PC_BOXES_FAST, + DEBUG_FILL_MENU_ITEM_PC_BOXES_SLOW, + DEBUG_FILL_MENU_ITEM_PC_ITEMS, + DEBUG_FILL_MENU_ITEM_POCKET_ITEMS, + DEBUG_FILL_MENU_ITEM_POCKET_BALLS, + DEBUG_FILL_MENU_ITEM_POCKET_TMHM, + DEBUG_FILL_MENU_ITEM_POCKET_BERRIES, + DEBUG_FILL_MENU_ITEM_POCKET_KEY_ITEMS, }; enum { //Sound DEBUG_SOUND_MENU_ITEM_SE, @@ -135,15 +187,20 @@ enum { //Sound // ******************************* // Constants -#define DEBUG_MAIN_MENU_WIDTH 15 -#define DEBUG_MAIN_MENU_HEIGHT 8 +#define DEBUG_MENU_WIDTH_MAIN 16 +#define DEBUG_MENU_HEIGHT_MAIN 9 + +#define DEBUG_MENU_WIDTH_EXTRA 10 +#define DEBUG_MENU_HEIGHT_EXTRA 4 + +#define DEBUG_MENU_WIDTH_WEATHER 15 +#define DEBUG_MENU_HEIGHT_WEATHER 3 -#define DEBUG_NUMBER_DISPLAY_WIDTH 10 -#define DEBUG_NUMBER_DISPLAY_HEIGHT 4 -#define DEBUG_NUMBER_DISPLAY_MEDIUM_WIDTH 15 -#define DEBUG_NUMBER_DISPLAY_MEDIUM_HEIGHT 3 -#define DEBUG_NUMBER_DISPLAY_SOUND_WIDTH 20 -#define DEBUG_NUMBER_DISPLAY_SOUND_HEIGHT 6 +#define DEBUG_MENU_WIDTH_SOUND 20 +#define DEBUG_MENU_HEIGHT_SOUND 6 + +#define DEBUG_MENU_WIDTH_FLAGVAR 4 +#define DEBUG_MENU_HEIGHT_FLAGVAR 2 #define DEBUG_NUMBER_DIGITS_FLAGS 4 #define DEBUG_NUMBER_DIGITS_VARIABLES 5 @@ -154,9 +211,6 @@ enum { //Sound #define DEBUG_NUMBER_ICON_X 210 #define DEBUG_NUMBER_ICON_Y 50 -// EWRAM -static EWRAM_DATA struct DebugMonData *sDebugMonData = NULL; - // ******************************* struct DebugMonData { @@ -177,14 +231,41 @@ struct DebugMonData u16 mon_move_3; }; +struct DebugMenuListData +{ + struct ListMenuItem listItems[20 + 1]; + u8 itemNames[PC_ITEMS_COUNT + 1][26]; + u8 listId; +}; + +struct DebugBattleData +{ + u8 submenu; + u8 battleType; + u8 battleTerrain; + bool8 aiFlags[AI_FLAG_COUNT]; +}; + +// EWRAM +static EWRAM_DATA struct DebugMonData *sDebugMonData = NULL; +static EWRAM_DATA struct DebugMenuListData *sDebugMenuListData = NULL; +static EWRAM_DATA struct DebugBattleData *sDebugBattleData = NULL; +EWRAM_DATA bool8 gIsDebugBattle = FALSE; +EWRAM_DATA u32 gDebugAIFlags = 0; + // ******************************* // Define functions +static void Debug_ReShowMainMenu(void); static void Debug_ShowMenu(void (*HandleInput)(u8), struct ListMenuTemplate LMtemplate); -void Debug_ShowMainMenu(void); +static void Debug_ShowMenuDynamic(u8 taskId); static void Debug_DestroyMenu(u8 taskId); static void Debug_DestroyMenu_Full(u8 taskId); static void DebugAction_Cancel(u8 taskId); static void DebugAction_DestroyExtraWindow(u8 taskId); +static void DebugTask_HandleMenuInput(u8 taskId, void (*HandleInput)(u8)); +static void Debug_InitDebugBattleData(void); +static void Debug_RefreshListMenu(u8 taskId); +static void Debug_RedrawListMenu(u8 taskId); static void DebugAction_Util_Script_1(u8 taskId); static void DebugAction_Util_Script_2(u8 taskId); @@ -197,16 +278,19 @@ static void DebugAction_Util_Script_8(u8 taskId); static void DebugAction_OpenUtilitiesMenu(u8 taskId); static void DebugAction_OpenScriptsMenu(u8 taskId); -static void DebugAction_OpenFlagsMenu(u8 taskId); -static void DebugAction_OpenVariablesMenu(u8 taskId); +static void DebugAction_OpenFlagsVarsMenu(u8 taskId); +static void DebugAction_OpenBattleMenu(u8 taskId); static void DebugAction_OpenGiveMenu(u8 taskId); +static void DebugAction_OpenFillMenu(u8 taskId); static void DebugAction_OpenSoundMenu(u8 taskId); +static void DebugAction_AccessPC(u8 taskId); static void DebugTask_HandleMenuInput_Main(u8 taskId); static void DebugTask_HandleMenuInput_Utilities(u8 taskId); static void DebugTask_HandleMenuInput_Scripts(u8 taskId); -static void DebugTask_HandleMenuInput_Flags(u8 taskId); -static void DebugTask_HandleMenuInput_Vars(u8 taskId); +static void DebugTask_HandleMenuInput_FlagsVars(u8 taskId); +static void DebugTask_HandleMenuInput_Battle(u8 taskId); static void DebugTask_HandleMenuInput_Give(u8 taskId); +static void DebugTask_HandleMenuInput_Fill(u8 taskId); static void DebugTask_HandleMenuInput_Sound(u8 taskId); static void DebugAction_Util_HealParty(u8 taskId); @@ -215,7 +299,7 @@ static void DebugAction_Util_Warp_Warp(u8 taskId); static void DebugAction_Util_Warp_SelectMapGroup(u8 taskId); static void DebugAction_Util_Warp_SelectMap(u8 taskId); static void DebugAction_Util_Warp_SelectWarp(u8 taskId); -static void DebugAction_Util_RunningShoes(u8 taskId); +static void DebugAction_FlagsVars_RunningShoes(u8 taskId); static void DebugAction_Util_PoisonMons(u8 taskId); static void DebugAction_Util_CheckSaveBlock(u8 taskId); static void DebugAction_Util_Weather(u8 taskId); @@ -227,26 +311,28 @@ static void DebugAction_Util_Trainer_Name(u8 taskId); static void DebugAction_Util_Trainer_Gender(u8 taskId); static void DebugAction_Util_Trainer_Id(u8 taskId); static void DebugAction_Util_Clear_Boxes(u8 taskId); - -static void DebugAction_Flags_Flags(u8 taskId); -static void DebugAction_Flags_FlagsSelect(u8 taskId); - -static void DebugAction_Flags_SetPokedexFlags(u8 taskId); -static void DebugAction_Flags_SwitchDex(u8 taskId); -static void DebugAction_Flags_SwitchNatDex(u8 taskId); -static void DebugAction_Flags_SwitchPokeNav(u8 taskId); -static void DebugAction_Flags_ToggleFlyFlags(u8 taskId); -static void DebugAction_Flags_ToggleBadgeFlags(u8 taskId); -static void DebugAction_Flags_ToggleFrontierPass(u8 taskId); -static void DebugAction_Flags_CollisionOnOff(u8 taskId); -static void DebugAction_Flags_EncounterOnOff(u8 taskId); -static void DebugAction_Flags_TrainerSeeOnOff(u8 taskId); -static void DebugAction_Flags_BagUseOnOff(u8 taskId); -static void DebugAction_Flags_CatchingOnOff(u8 taskId); - -static void DebugAction_Vars_Vars(u8 taskId); -static void DebugAction_Vars_Select(u8 taskId); -static void DebugAction_Vars_SetValue(u8 taskId); +static void DebugAction_Util_CheatStart(u8 taskId); + +static void DebugAction_FlagsVars_Flags(u8 taskId); +static void DebugAction_FlagsVars_FlagsSelect(u8 taskId); +static void DebugAction_FlagsVars_Vars(u8 taskId); +static void DebugAction_FlagsVars_Select(u8 taskId); +static void DebugAction_FlagsVars_SetValue(u8 taskId); +static void DebugAction_FlagsVars_PokedexFlags_All(u8 taskId); +static void DebugAction_FlagsVars_PokedexFlags_Reset(u8 taskId); +static void DebugAction_FlagsVars_SwitchDex(u8 taskId); +static void DebugAction_FlagsVars_SwitchNatDex(u8 taskId); +static void DebugAction_FlagsVars_SwitchPokeNav(u8 taskId); +static void DebugAction_FlagsVars_ToggleFlyFlags(u8 taskId); +static void DebugAction_FlagsVars_ToggleBadgeFlags(u8 taskId); +static void DebugAction_FlagsVars_ToggleFrontierPass(u8 taskId); +static void DebugAction_FlagsVars_CollisionOnOff(u8 taskId); +static void DebugAction_FlagsVars_EncounterOnOff(u8 taskId); +static void DebugAction_FlagsVars_TrainerSeeOnOff(u8 taskId); +static void DebugAction_FlagsVars_BagUseOnOff(u8 taskId); +static void DebugAction_FlagsVars_CatchingOnOff(u8 taskId); + +static void Debug_InitializeBattle(u8 taskId); static void DebugAction_Give_Item(u8 taskId); static void DebugAction_Give_Item_SelectId(u8 taskId); @@ -266,17 +352,21 @@ static void DebugAction_Give_MaxMoney(u8 taskId); static void DebugAction_Give_MaxCoins(u8 taskId); static void DebugAction_Give_MaxBattlePoints(u8 taskId); static void DebugAction_Give_DayCareEgg(u8 taskId); -static void DebugAction_Give_FillPC(u8 taskId); -static void DebugAction_Give_CHEAT(u8 taskId); -static void DebugAction_AccessPC(u8 taskId); + +static void DebugAction_Fill_PCBoxes_Fast(u8 taskId); +static void DebugAction_Fill_PCBoxes_Slow(u8 taskId); +static void DebugAction_Fill_PCItemStorage(u8 taskId); +static void DebugAction_Fill_PocketItems(u8 taskId); +static void DebugAction_Fill_PocketPokeBalls(u8 taskId); +static void DebugAction_Fill_PocketTMHM(u8 taskId); +static void DebugAction_Fill_PocketBerries(u8 taskId); +static void DebugAction_Fill_PocketKeyItems(u8 taskId); static void DebugAction_Sound_SE(u8 taskId); static void DebugAction_Sound_SE_SelectId(u8 taskId); static void DebugAction_Sound_MUS(u8 taskId); static void DebugAction_Sound_MUS_SelectId(u8 taskId); -static void DebugTask_HandleMenuInput(u8 taskId, void (*HandleInput)(u8)); -static void DebugAction_OpenSubMenu(u8 taskId, struct ListMenuTemplate LMtemplate); extern u8 Debug_FlagsNotSetOverworldConfigMessage[]; extern u8 Debug_FlagsNotSetBattleConfigMessage[]; @@ -294,106 +384,155 @@ extern u8 Debug_CheatStart[]; extern u8 PlayersHouse_2F_EventScript_SetWallClock[]; extern u8 PlayersHouse_2F_EventScript_CheckWallClock[]; extern u8 Debug_CheckSaveBlock[]; +extern u8 Debug_BoxFilledMessage[]; #include "data/map_group_count.h" // Text +// General +static const u8 sDebugText_True[] = _("TRUE"); +static const u8 sDebugText_False[] = _("FALSE"); +static const u8 sDebugText_Colored_True[] = _("{COLOR GREEN}TRUE"); +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"); -static const u8 sDebugText_Scripts[] = _("Scripts"); -static const u8 sDebugText_Flags[] = _("Flags"); -static const u8 sDebugText_Vars[] = _("Variables"); -static const u8 sDebugText_Give[] = _("Give X"); -static const u8 sDebugText_Sound[] = _("Sound"); -static const u8 sDebugText_Cancel[] = _("Cancel"); +static const u8 sDebugText_Utilities[] = _("Utilities…{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_Fill[] = _("Fill PC/Pockets…{CLEAR_TO 110}{RIGHT_ARROW}"); +static const u8 sDebugText_Sound[] = _("Sound…{CLEAR_TO 110}{RIGHT_ARROW}"); +static const u8 sDebugText_AccessPC[] = _("Access PC…{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"); +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_HealParty[] = _("Heal Party"); -static const u8 sDebugText_Util_Fly[] = _("Fly to map"); -static const u8 sDebugText_Util_WarpToMap[] = _("Warp to map warp"); -static const u8 sDebugText_Util_WarpToMap_SelectMapGroup[] = _("Group: {STR_VAR_1} \n \n\n{STR_VAR_3} "); -static const u8 sDebugText_Util_WarpToMap_SelectMap[] = _("Map: {STR_VAR_1} \nMapSec: \n{STR_VAR_2} \n{STR_VAR_3} "); -static const u8 sDebugText_Util_WarpToMap_SelectWarp[] = _("Warp: \n{STR_VAR_1} \n \n{STR_VAR_3} "); -static const u8 sDebugText_Util_WarpToMap_SelMax[] = _("{STR_VAR_1} / {STR_VAR_2}"); -static const u8 sDebugText_Util_RunningShoes[] = _("Toggle Running Shoes"); -static const u8 sDebugText_Util_PoisonMons[] = _("Poison all mons"); -static const u8 sDebugText_Util_SaveBlockSpace[] = _("SaveBlock Space"); -static const u8 sDebugText_Util_Weather[] = _("Set weather"); -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_CheckWallClock[] = _("Check Wall Clock"); -static const u8 sDebugText_Util_SetWallClock[] = _("Set Wall Clock"); -static const u8 sDebugText_Util_WatchCredits[] = _("Watch Credits"); -static const u8 sDebugText_Util_Trainer_Name[] = _("Trainer name"); -static const u8 sDebugText_Util_Trainer_Gender[] = _("Toggle T. Gender"); -static const u8 sDebugText_Util_Trainer_Id[] = _("New Trainer Id"); -static const u8 sDebugText_Util_Clear_Boxes[] = _("Clear Storage Boxes"); -// Flags Menu -static const u8 sDebugText_Flags_Flags[] = _("Set Flag XXXX"); -static const u8 sDebugText_Flags_SetPokedexFlags[] = _("All Pokédex Flags"); -static const u8 sDebugText_Flags_SwitchDex[] = _("Pokédex ON/OFF"); -static const u8 sDebugText_Flags_SwitchNationalDex[] = _("NatDex ON/OFF"); -static const u8 sDebugText_Flags_SwitchPokeNav[] = _("PokéNav ON/OFF"); -static const u8 sDebugText_Flags_ToggleFlyFlags[] = _("Fly Flags ON/OFF"); -static const u8 sDebugText_Flags_ToggleAllBadges[] = _("All badges ON/OFF"); -static const u8 sDebugText_Flags_ToggleFrontierPass[] = _("Frontier Pass ON/OFF"); -static const u8 sDebugText_Flags_SwitchCollision[] = _("Collision ON/OFF"); -static const u8 sDebugText_Flags_SwitchEncounter[] = _("Encounter ON/OFF"); -static const u8 sDebugText_Flags_SwitchTrainerSee[] = _("TrainerSee ON/OFF"); -static const u8 sDebugText_Flags_SwitchBagUse[] = _("BagUse ON/OFF"); -static const u8 sDebugText_Flags_SwitchCatching[] = _("Catching ON/OFF"); -static const u8 sDebugText_Flags_Flag[] = _("Flag: {STR_VAR_1} \n{STR_VAR_2} \n{STR_VAR_3}"); -static const u8 sDebugText_Flags_FlagHex[] = _("{STR_VAR_1} \n0x{STR_VAR_2} "); -static const u8 sDebugText_Flags_FlagSet[] = _("TRUE"); -static const u8 sDebugText_Flags_FlagUnset[] = _("FALSE"); -// Variables Menu -static const u8 sDebugText_Vars_Vars[] = _("Set Vars XXXX"); -static const u8 sDebugText_Vars_VariableHex[] = _("{STR_VAR_1} \n0x{STR_VAR_2} "); -static const u8 sDebugText_Vars_Variable[] = _("Var: {STR_VAR_1} \nVal: {STR_VAR_3} \n{STR_VAR_2}"); -static const u8 sDebugText_Vars_VariableValueSet[] = _("Var: {STR_VAR_1} \nVal: {STR_VAR_3} \n{STR_VAR_2}"); +static const u8 sDebugText_Util_HealParty[] = _("Heal Party"); +static const u8 sDebugText_Util_Fly[] = _("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_PoisonMons[] = _("Poison all mons"); +static const u8 sDebugText_Util_SaveBlockSpace[] = _("SaveBlock 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_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_Trainer_Name[] = _("Trainer name"); +static const u8 sDebugText_Util_Trainer_Gender[] = _("Toggle T. Gender"); +static const u8 sDebugText_Util_Trainer_Id[] = _("New Trainer Id"); +static const u8 sDebugText_Util_Clear_Boxes[] = _("Clear Storage Boxes"); +static const u8 sDebugText_Util_CheatStart[] = _("CHEAT Start"); +// 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}NatDex"); +static const u8 sDebugText_FlagsVars_SwitchPokeNav[] = _("Toggle {STR_VAR_1}PokéNav"); +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_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}TrainerSee OFF"); +static const u8 sDebugText_FlagsVars_SwitchBagUse[] = _("Toggle {STR_VAR_1}BagUse 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 XXXX"); -static const u8 sDebugText_ItemQuantity[] = _("Quantity: \n{STR_VAR_1} \n\n{STR_VAR_2}"); -static const u8 sDebugText_ItemID[] = _("Item Id: {STR_VAR_3}\n{STR_VAR_1} \n\n{STR_VAR_2}"); -static const u8 sDebugText_Give_AllTMs[] = _("Give all TMs"); -static const u8 sDebugText_Give_GivePokemonSimple[] = _("Pkm(lvl)"); -static const u8 sDebugText_Give_GivePokemonComplex[] = _("Pkm(l,s,n,a,IV,mov)"); -static const u8 sDebugText_PokemonID[] = _("Species: {STR_VAR_3}\n{STR_VAR_1} \n\n{STR_VAR_2}"); -static const u8 sDebugText_PokemonLevel[] = _("Level: \n{STR_VAR_1} \n \n{STR_VAR_2}"); -static const u8 sDebugText_PokemonShiny[] = _("Shiny: \n {STR_VAR_2} \n \n "); -static const u8 sDebugText_PokemonNature[] = _("NatureId: {STR_VAR_3} \n{STR_VAR_1} \n \n{STR_VAR_2}"); -static const u8 sDebugText_PokemonAbility[] = _("AbilityNum: {STR_VAR_3} \n{STR_VAR_1} \n \n{STR_VAR_2}"); -static const u8 sDebugText_PokemonIVs[] = _("All IVs: \n {STR_VAR_3} \n \n{STR_VAR_2} "); -static const u8 sDebugText_PokemonIV_0[] = _("IV HP: \n {STR_VAR_3} \n \n{STR_VAR_2} "); -static const u8 sDebugText_PokemonIV_1[] = _("IV Attack: \n {STR_VAR_3} \n \n{STR_VAR_2} "); -static const u8 sDebugText_PokemonIV_2[] = _("IV Defense: \n {STR_VAR_3} \n \n{STR_VAR_2} "); -static const u8 sDebugText_PokemonIV_3[] = _("IV Speed: \n {STR_VAR_3} \n \n{STR_VAR_2} "); -static const u8 sDebugText_PokemonIV_4[] = _("IV Sp. Attack: \n {STR_VAR_3} \n \n{STR_VAR_2} "); -static const u8 sDebugText_PokemonIV_5[] = _("IV Sp. Defense: \n {STR_VAR_3} \n \n{STR_VAR_2} "); -static const u8 sDebugText_PokemonMove_0[] = _("Move 0: {STR_VAR_3} \n{STR_VAR_1} \n \n{STR_VAR_2}"); -static const u8 sDebugText_PokemonMove_1[] = _("Move 1: {STR_VAR_3} \n{STR_VAR_1} \n \n{STR_VAR_2}"); -static const u8 sDebugText_PokemonMove_2[] = _("Move 2: {STR_VAR_3} \n{STR_VAR_1} \n \n{STR_VAR_2}"); -static const u8 sDebugText_PokemonMove_3[] = _("Move 3: {STR_VAR_3} \n{STR_VAR_1} \n \n{STR_VAR_2}"); -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"); -static const u8 sDebugText_Give_FillPc[] = _("Fill Pc"); -static const u8 sDebugText_Give_GiveCHEAT[] = _("CHEAT Start"); -static const u8 sDebugText_AccessPC[] = _("Access PC"); +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_AllTMs[] = _("Give all TMs"); +static const u8 sDebugText_Give_GivePokemonSimple[] = _("Pkm (lvl)…{CLEAR_TO 110}{RIGHT_ARROW}"); +static const u8 sDebugText_Give_GivePokemonComplex[] = _("Pkm (l,s,n,a,IV,mov)…{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}"); +static const u8 sDebugText_PokemonNature[] = _("NatureId: {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_PokemonAbility[] = _("AbilityNum: {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_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_PokemonIV_0[] = _("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_PokemonIV_1[] = _("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_PokemonIV_2[] = _("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_PokemonIV_3[] = _("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_PokemonIV_4[] = _("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_PokemonIV_5[] = _("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_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"); +// Fill Menu +static const u8 sDebugText_Fill_Pc_Fast[] = _("Fill PCBoxes Fast"); +static const u8 sDebugText_Fill_Pc_Slow[] = _("Fill PCBoxes Slow (LAG!)"); +static const u8 sDebugText_Fill_Pc_Items[] = _("Fill PCItems"); +static const u8 sDebugText_Fill_PocketItems[] = _("Fill Pocket Items"); +static const u8 sDebugText_Fill_PocketPokeBalls[] =_("Fill Pocket PokeBalls"); +static const u8 sDebugText_Fill_PocketTMHM[] = _("Fill Pocket TMHM"); +static const u8 sDebugText_Fill_PocketBerries[] = _("Fill Pocket Berries"); +static const u8 sDebugText_Fill_PocketKeyItems[] = _("Fill Pocket KeyItems"); // Sound Mneu -static const u8 sDebugText_Sound_SE[] = _("Effects"); -static const u8 sDebugText_Sound_SE_ID[] = _("Sound Id: {STR_VAR_3}\n{STR_VAR_1} \n{STR_VAR_2}"); -static const u8 sDebugText_Sound_MUS[] = _("Music"); -static const u8 sDebugText_Sound_MUS_ID[] = _("Music Id: {STR_VAR_3}\n{STR_VAR_1} \n{STR_VAR_2}"); -static const u8 sDebugText_Sound_Empty[] = _(""); +static const u8 sDebugText_Sound_SE[] = _("Effects…{CLEAR_TO 110}{RIGHT_ARROW}"); +static const u8 sDebugText_Sound_SE_ID[] = _("Sound Id: {STR_VAR_3}\n{STR_VAR_1} \n{STR_VAR_2}"); +static const u8 sDebugText_Sound_MUS[] = _("Music…{CLEAR_TO 110}{RIGHT_ARROW}"); +static const u8 sDebugText_Sound_MUS_ID[] = _("Music Id: {STR_VAR_3}\n{STR_VAR_1} \n{STR_VAR_2}"); static const u8 digitInidicator_1[] = _("{LEFT_ARROW}+1{RIGHT_ARROW} "); static const u8 digitInidicator_10[] = _("{LEFT_ARROW}+10{RIGHT_ARROW} "); @@ -432,62 +571,105 @@ 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_SCRIPTS] = {sDebugText_Scripts, DEBUG_MENU_ITEM_SCRIPTS}, - [DEBUG_MENU_ITEM_FLAGS] = {sDebugText_Flags, DEBUG_MENU_ITEM_FLAGS}, - [DEBUG_MENU_ITEM_VARS] = {sDebugText_Vars, DEBUG_MENU_ITEM_VARS}, - [DEBUG_MENU_ITEM_GIVE] = {sDebugText_Give, DEBUG_MENU_ITEM_GIVE}, - [DEBUG_MENU_ITEM_SOUND] = {sDebugText_Sound, DEBUG_MENU_ITEM_SOUND}, - [DEBUG_MENU_ITEM_ACCESS_PC] = {sDebugText_AccessPC, DEBUG_MENU_ITEM_ACCESS_PC}, - [DEBUG_MENU_ITEM_CANCEL] = {sDebugText_Cancel, DEBUG_MENU_ITEM_CANCEL} + [DEBUG_MENU_ITEM_UTILITIES] = {sDebugText_Utilities, DEBUG_MENU_ITEM_UTILITIES}, + [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_GIVE] = {sDebugText_Give, DEBUG_MENU_ITEM_GIVE}, + [DEBUG_MENU_ITEM_FILL] = {sDebugText_Fill, DEBUG_MENU_ITEM_FILL}, + [DEBUG_MENU_ITEM_SOUND] = {sDebugText_Sound, DEBUG_MENU_ITEM_SOUND}, + [DEBUG_MENU_ITEM_ACCESS_PC] = {sDebugText_AccessPC, DEBUG_MENU_ITEM_ACCESS_PC}, + [DEBUG_MENU_ITEM_CANCEL] = {sDebugText_Cancel, DEBUG_MENU_ITEM_CANCEL} }; static const struct ListMenuItem sDebugMenu_Items_Utilities[] = { - [DEBUG_UTIL_MENU_ITEM_HEAL_PARTY] = {sDebugText_Util_HealParty, DEBUG_UTIL_MENU_ITEM_HEAL_PARTY}, - [DEBUG_UTIL_MENU_ITEM_FLY] = {sDebugText_Util_Fly, DEBUG_UTIL_MENU_ITEM_FLY}, - [DEBUG_UTIL_MENU_ITEM_WARP] = {sDebugText_Util_WarpToMap, DEBUG_UTIL_MENU_ITEM_WARP}, - [DEBUG_UTIL_MENU_ITEM_RUNNING_SHOES] = {sDebugText_Util_RunningShoes, DEBUG_UTIL_MENU_ITEM_RUNNING_SHOES}, - [DEBUG_UTIL_MENU_ITEM_POISON_MONS] = {sDebugText_Util_PoisonMons, DEBUG_UTIL_MENU_ITEM_POISON_MONS}, - [DEBUG_UTIL_MENU_ITEM_SAVEBLOCK] = {sDebugText_Util_SaveBlockSpace, DEBUG_UTIL_MENU_ITEM_SAVEBLOCK}, - [DEBUG_UTIL_MENU_ITEM_WEATHER] = {sDebugText_Util_Weather, DEBUG_UTIL_MENU_ITEM_WEATHER}, - [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_TRAINER_NAME] = {sDebugText_Util_Trainer_Name, DEBUG_UTIL_MENU_ITEM_TRAINER_NAME}, - [DEBUG_UTIL_MENU_ITEM_TRAINER_GENDER] = {sDebugText_Util_Trainer_Gender, DEBUG_UTIL_MENU_ITEM_TRAINER_GENDER}, - [DEBUG_UTIL_MENU_ITEM_TRAINER_ID] = {sDebugText_Util_Trainer_Id, DEBUG_UTIL_MENU_ITEM_TRAINER_ID}, - [DEBUG_UTIL_MENU_ITEM_CLEAR_BOXES] = {sDebugText_Util_Clear_Boxes, DEBUG_UTIL_MENU_ITEM_CLEAR_BOXES}, + [DEBUG_UTIL_MENU_ITEM_HEAL_PARTY] = {sDebugText_Util_HealParty, DEBUG_UTIL_MENU_ITEM_HEAL_PARTY}, + [DEBUG_UTIL_MENU_ITEM_FLY] = {sDebugText_Util_Fly, DEBUG_UTIL_MENU_ITEM_FLY}, + [DEBUG_UTIL_MENU_ITEM_WARP] = {sDebugText_Util_WarpToMap, DEBUG_UTIL_MENU_ITEM_WARP}, + [DEBUG_UTIL_MENU_ITEM_POISON_MONS] = {sDebugText_Util_PoisonMons, DEBUG_UTIL_MENU_ITEM_POISON_MONS}, + [DEBUG_UTIL_MENU_ITEM_SAVEBLOCK] = {sDebugText_Util_SaveBlockSpace, DEBUG_UTIL_MENU_ITEM_SAVEBLOCK}, + [DEBUG_UTIL_MENU_ITEM_WEATHER] = {sDebugText_Util_Weather, DEBUG_UTIL_MENU_ITEM_WEATHER}, + [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_TRAINER_NAME] = {sDebugText_Util_Trainer_Name, DEBUG_UTIL_MENU_ITEM_TRAINER_NAME}, + [DEBUG_UTIL_MENU_ITEM_TRAINER_GENDER] = {sDebugText_Util_Trainer_Gender, DEBUG_UTIL_MENU_ITEM_TRAINER_GENDER}, + [DEBUG_UTIL_MENU_ITEM_TRAINER_ID] = {sDebugText_Util_Trainer_Id, DEBUG_UTIL_MENU_ITEM_TRAINER_ID}, + [DEBUG_UTIL_MENU_ITEM_CLEAR_BOXES] = {sDebugText_Util_Clear_Boxes, DEBUG_UTIL_MENU_ITEM_CLEAR_BOXES}, + [DEBUG_UTIL_MENU_ITEM_CHEAT] = {sDebugText_Util_CheatStart, DEBUG_UTIL_MENU_ITEM_CHEAT}, }; 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] = {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}, +}; +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_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_FRONTIER_PASS] = {sDebugText_FlagsVars_ToggleFrontierPass, DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_FRONTIER_PASS}, + [DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_COLISSION] = {sDebugText_FlagsVars_SwitchCollision, DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_COLISSION}, + [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}, +}; +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}, }; -static const struct ListMenuItem sDebugMenu_Items_Flags[] = -{ - [DEBUG_FLAG_MENU_ITEM_FLAGS] = {sDebugText_Flags_Flags, DEBUG_FLAG_MENU_ITEM_FLAGS}, - [DEBUG_FLAG_MENU_ITEM_POKEDEXFLAGS] = {sDebugText_Flags_SetPokedexFlags, DEBUG_FLAG_MENU_ITEM_POKEDEXFLAGS}, - [DEBUG_FLAG_MENU_ITEM_POKEDEXONOFF] = {sDebugText_Flags_SwitchDex, DEBUG_FLAG_MENU_ITEM_POKEDEXONOFF}, - [DEBUG_FLAG_MENU_ITEM_NATDEXONOFF] = {sDebugText_Flags_SwitchNationalDex, DEBUG_FLAG_MENU_ITEM_NATDEXONOFF}, - [DEBUG_FLAG_MENU_ITEM_POKENAVONOFF] = {sDebugText_Flags_SwitchPokeNav, DEBUG_FLAG_MENU_ITEM_POKENAVONOFF}, - [DEBUG_FLAG_MENU_ITEM_FLYANYWHERE] = {sDebugText_Flags_ToggleFlyFlags, DEBUG_FLAG_MENU_ITEM_FLYANYWHERE}, - [DEBUG_FLAG_MENU_ITEM_GETALLBADGES] = {sDebugText_Flags_ToggleAllBadges, DEBUG_FLAG_MENU_ITEM_GETALLBADGES}, - [DEBUG_FLAG_MENU_ITEM_FRONTIER_PASS] = {sDebugText_Flags_ToggleFrontierPass, DEBUG_FLAG_MENU_ITEM_FRONTIER_PASS}, - [DEBUG_FLAG_MENU_ITEM_COLISSION_ONOFF] = {sDebugText_Flags_SwitchCollision, DEBUG_FLAG_MENU_ITEM_COLISSION_ONOFF}, - [DEBUG_FLAG_MENU_ITEM_ENCOUNTER_ONOFF] = {sDebugText_Flags_SwitchEncounter, DEBUG_FLAG_MENU_ITEM_ENCOUNTER_ONOFF}, - [DEBUG_FLAG_MENU_ITEM_TRAINER_SEE_ONOFF] = {sDebugText_Flags_SwitchTrainerSee, DEBUG_FLAG_MENU_ITEM_TRAINER_SEE_ONOFF}, - [DEBUG_FLAG_MENU_ITEM_BAG_USE_ONOFF] = {sDebugText_Flags_SwitchBagUse, DEBUG_FLAG_MENU_ITEM_BAG_USE_ONOFF}, - [DEBUG_FLAG_MENU_ITEM_CATCHING_ONOFF] = {sDebugText_Flags_SwitchCatching, DEBUG_FLAG_MENU_ITEM_CATCHING_ONOFF}, +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}, }; -static const struct ListMenuItem sDebugMenu_Items_Vars[] = +static const struct ListMenuItem sDebugMenu_Items_Battle_2[] = { - [DEBUG_VARS_MENU_ITEM_VARS] = {sDebugText_Vars_Vars, DEBUG_FLAG_MENU_ITEM_FLAGS}, + [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}, }; static const struct ListMenuItem sDebugMenu_Items_Give[] = { @@ -499,44 +681,54 @@ static const struct ListMenuItem sDebugMenu_Items_Give[] = [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_FILL_PC] = {sDebugText_Give_FillPc, DEBUG_GIVE_MENU_ITEM_FILL_PC}, - [DEBUG_GIVE_MENU_ITEM_CHEAT] = {sDebugText_Give_GiveCHEAT, DEBUG_GIVE_MENU_ITEM_CHEAT}, +}; +static const struct ListMenuItem sDebugMenu_Items_Fill[] = +{ + [DEBUG_FILL_MENU_ITEM_PC_BOXES_FAST] = {sDebugText_Fill_Pc_Fast, DEBUG_FILL_MENU_ITEM_PC_BOXES_FAST}, + [DEBUG_FILL_MENU_ITEM_PC_BOXES_SLOW] = {sDebugText_Fill_Pc_Slow, DEBUG_FILL_MENU_ITEM_PC_BOXES_SLOW}, + [DEBUG_FILL_MENU_ITEM_PC_ITEMS] = {sDebugText_Fill_Pc_Items , DEBUG_FILL_MENU_ITEM_PC_ITEMS}, + [DEBUG_FILL_MENU_ITEM_POCKET_ITEMS] = {sDebugText_Fill_PocketItems, DEBUG_FILL_MENU_ITEM_POCKET_ITEMS}, + [DEBUG_FILL_MENU_ITEM_POCKET_BALLS] = {sDebugText_Fill_PocketPokeBalls, DEBUG_FILL_MENU_ITEM_POCKET_BALLS}, + [DEBUG_FILL_MENU_ITEM_POCKET_TMHM] = {sDebugText_Fill_PocketTMHM, DEBUG_FILL_MENU_ITEM_POCKET_TMHM}, + [DEBUG_FILL_MENU_ITEM_POCKET_BERRIES] = {sDebugText_Fill_PocketBerries, DEBUG_FILL_MENU_ITEM_POCKET_BERRIES}, + [DEBUG_FILL_MENU_ITEM_POCKET_KEY_ITEMS] = {sDebugText_Fill_PocketKeyItems, DEBUG_FILL_MENU_ITEM_POCKET_KEY_ITEMS}, }; static const struct ListMenuItem sDebugMenu_Items_Sound[] = { - [DEBUG_SOUND_MENU_ITEM_SE] = {sDebugText_Sound_SE, DEBUG_SOUND_MENU_ITEM_SE}, - [DEBUG_SOUND_MENU_ITEM_MUS] = {sDebugText_Sound_MUS, DEBUG_SOUND_MENU_ITEM_MUS}, + [DEBUG_SOUND_MENU_ITEM_SE] = {sDebugText_Sound_SE, DEBUG_SOUND_MENU_ITEM_SE}, + [DEBUG_SOUND_MENU_ITEM_MUS] = {sDebugText_Sound_MUS, DEBUG_SOUND_MENU_ITEM_MUS}, }; // ******************************* // Menu Actions static void (*const sDebugMenu_Actions_Main[])(u8) = { - [DEBUG_MENU_ITEM_UTILITIES] = DebugAction_OpenUtilitiesMenu, - [DEBUG_MENU_ITEM_SCRIPTS] = DebugAction_OpenScriptsMenu, - [DEBUG_MENU_ITEM_FLAGS] = DebugAction_OpenFlagsMenu, - [DEBUG_MENU_ITEM_VARS] = DebugAction_OpenVariablesMenu, - [DEBUG_MENU_ITEM_GIVE] = DebugAction_OpenGiveMenu, - [DEBUG_MENU_ITEM_SOUND] = DebugAction_OpenSoundMenu, - [DEBUG_MENU_ITEM_ACCESS_PC] = DebugAction_AccessPC, - [DEBUG_MENU_ITEM_CANCEL] = DebugAction_Cancel + [DEBUG_MENU_ITEM_UTILITIES] = DebugAction_OpenUtilitiesMenu, + [DEBUG_MENU_ITEM_SCRIPTS] = DebugAction_OpenScriptsMenu, + [DEBUG_MENU_ITEM_FLAGVAR] = DebugAction_OpenFlagsVarsMenu, + //[DEBUG_MENU_ITEM_BATTLE] = DebugAction_OpenBattleMenu, + [DEBUG_MENU_ITEM_GIVE] = DebugAction_OpenGiveMenu, + [DEBUG_MENU_ITEM_FILL] = DebugAction_OpenFillMenu, + [DEBUG_MENU_ITEM_SOUND] = DebugAction_OpenSoundMenu, + [DEBUG_MENU_ITEM_ACCESS_PC] = DebugAction_AccessPC, + [DEBUG_MENU_ITEM_CANCEL] = DebugAction_Cancel }; static void (*const sDebugMenu_Actions_Utilities[])(u8) = { - [DEBUG_UTIL_MENU_ITEM_HEAL_PARTY] = DebugAction_Util_HealParty, - [DEBUG_UTIL_MENU_ITEM_FLY] = DebugAction_Util_Fly, - [DEBUG_UTIL_MENU_ITEM_WARP] = DebugAction_Util_Warp_Warp, - [DEBUG_UTIL_MENU_ITEM_RUNNING_SHOES] = DebugAction_Util_RunningShoes, - [DEBUG_UTIL_MENU_ITEM_POISON_MONS] = DebugAction_Util_PoisonMons, - [DEBUG_UTIL_MENU_ITEM_SAVEBLOCK] = DebugAction_Util_CheckSaveBlock, - [DEBUG_UTIL_MENU_ITEM_WEATHER] = DebugAction_Util_Weather, - [DEBUG_UTIL_MENU_ITEM_CHECKWALLCLOCK] = DebugAction_Util_CheckWallClock, - [DEBUG_UTIL_MENU_ITEM_SETWALLCLOCK] = DebugAction_Util_SetWallClock, - [DEBUG_UTIL_MENU_ITEM_WATCHCREDITS] = DebugAction_Util_WatchCredits, - [DEBUG_UTIL_MENU_ITEM_TRAINER_NAME] = DebugAction_Util_Trainer_Name, - [DEBUG_UTIL_MENU_ITEM_TRAINER_GENDER] = DebugAction_Util_Trainer_Gender, - [DEBUG_UTIL_MENU_ITEM_TRAINER_ID] = DebugAction_Util_Trainer_Id, - [DEBUG_UTIL_MENU_ITEM_CLEAR_BOXES] = DebugAction_Util_Clear_Boxes, + [DEBUG_UTIL_MENU_ITEM_HEAL_PARTY] = DebugAction_Util_HealParty, + [DEBUG_UTIL_MENU_ITEM_FLY] = DebugAction_Util_Fly, + [DEBUG_UTIL_MENU_ITEM_WARP] = DebugAction_Util_Warp_Warp, + [DEBUG_UTIL_MENU_ITEM_POISON_MONS] = DebugAction_Util_PoisonMons, + [DEBUG_UTIL_MENU_ITEM_SAVEBLOCK] = DebugAction_Util_CheckSaveBlock, + [DEBUG_UTIL_MENU_ITEM_WEATHER] = DebugAction_Util_Weather, + [DEBUG_UTIL_MENU_ITEM_CHECKWALLCLOCK] = DebugAction_Util_CheckWallClock, + [DEBUG_UTIL_MENU_ITEM_SETWALLCLOCK] = DebugAction_Util_SetWallClock, + [DEBUG_UTIL_MENU_ITEM_WATCHCREDITS] = DebugAction_Util_WatchCredits, + [DEBUG_UTIL_MENU_ITEM_TRAINER_NAME] = DebugAction_Util_Trainer_Name, + [DEBUG_UTIL_MENU_ITEM_TRAINER_GENDER] = DebugAction_Util_Trainer_Gender, + [DEBUG_UTIL_MENU_ITEM_TRAINER_ID] = DebugAction_Util_Trainer_Id, + [DEBUG_UTIL_MENU_ITEM_CLEAR_BOXES] = DebugAction_Util_Clear_Boxes, + [DEBUG_UTIL_MENU_ITEM_CHEAT] = DebugAction_Util_CheatStart, }; static void (*const sDebugMenu_Actions_Scripts[])(u8) = { @@ -551,23 +743,22 @@ static void (*const sDebugMenu_Actions_Scripts[])(u8) = }; static void (*const sDebugMenu_Actions_Flags[])(u8) = { - [DEBUG_FLAG_MENU_ITEM_FLAGS] = DebugAction_Flags_Flags, - [DEBUG_FLAG_MENU_ITEM_POKEDEXFLAGS] = DebugAction_Flags_SetPokedexFlags, - [DEBUG_FLAG_MENU_ITEM_POKEDEXONOFF] = DebugAction_Flags_SwitchDex, - [DEBUG_FLAG_MENU_ITEM_NATDEXONOFF] = DebugAction_Flags_SwitchNatDex, - [DEBUG_FLAG_MENU_ITEM_POKENAVONOFF] = DebugAction_Flags_SwitchPokeNav, - [DEBUG_FLAG_MENU_ITEM_FLYANYWHERE] = DebugAction_Flags_ToggleFlyFlags, - [DEBUG_FLAG_MENU_ITEM_GETALLBADGES] = DebugAction_Flags_ToggleBadgeFlags, - [DEBUG_FLAG_MENU_ITEM_FRONTIER_PASS] = DebugAction_Flags_ToggleFrontierPass, - [DEBUG_FLAG_MENU_ITEM_COLISSION_ONOFF] = DebugAction_Flags_CollisionOnOff, - [DEBUG_FLAG_MENU_ITEM_ENCOUNTER_ONOFF] = DebugAction_Flags_EncounterOnOff, - [DEBUG_FLAG_MENU_ITEM_TRAINER_SEE_ONOFF] = DebugAction_Flags_TrainerSeeOnOff, - [DEBUG_FLAG_MENU_ITEM_BAG_USE_ONOFF] = DebugAction_Flags_BagUseOnOff, - [DEBUG_FLAG_MENU_ITEM_CATCHING_ONOFF] = DebugAction_Flags_CatchingOnOff, -}; -static void (*const sDebugMenu_Actions_Vars[])(u8) = -{ - [DEBUG_VARS_MENU_ITEM_VARS] = DebugAction_Vars_Vars, + [DEBUG_FLAGVAR_MENU_ITEM_FLAGS] = DebugAction_FlagsVars_Flags, + [DEBUG_FLAGVAR_MENU_ITEM_VARS] = DebugAction_FlagsVars_Vars, + [DEBUG_FLAGVAR_MENU_ITEM_DEXFLAGS_ALL] = DebugAction_FlagsVars_PokedexFlags_All, + [DEBUG_FLAGVAR_MENU_ITEM_DEXFLAGS_RESET] = DebugAction_FlagsVars_PokedexFlags_Reset, + [DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_POKEDEX] = DebugAction_FlagsVars_SwitchDex, + [DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_NATDEX] = DebugAction_FlagsVars_SwitchNatDex, + [DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_POKENAV] = DebugAction_FlagsVars_SwitchPokeNav, + [DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_RUN_SHOES] = DebugAction_FlagsVars_RunningShoes, + [DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_LOCATIONS] = DebugAction_FlagsVars_ToggleFlyFlags, + [DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_BADGES_ALL] = DebugAction_FlagsVars_ToggleBadgeFlags, + [DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_FRONTIER_PASS] = DebugAction_FlagsVars_ToggleFrontierPass, + [DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_COLISSION] = DebugAction_FlagsVars_CollisionOnOff, + [DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_ENCOUNTER] = DebugAction_FlagsVars_EncounterOnOff, + [DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_TRAINER_SEE] = DebugAction_FlagsVars_TrainerSeeOnOff, + [DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_BAG_USE] = DebugAction_FlagsVars_BagUseOnOff, + [DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_CATCHING] = DebugAction_FlagsVars_CatchingOnOff, }; static void (*const sDebugMenu_Actions_Give[])(u8) = { @@ -579,9 +770,19 @@ static void (*const sDebugMenu_Actions_Give[])(u8) = [DEBUG_GIVE_MENU_ITEM_MAX_COINS] = DebugAction_Give_MaxCoins, [DEBUG_GIVE_MENU_ITEM_MAX_BATTLE_POINTS] = DebugAction_Give_MaxBattlePoints, [DEBUG_GIVE_MENU_ITEM_DAYCARE_EGG] = DebugAction_Give_DayCareEgg, - [DEBUG_GIVE_MENU_ITEM_FILL_PC] = DebugAction_Give_FillPC, - [DEBUG_GIVE_MENU_ITEM_CHEAT] = DebugAction_Give_CHEAT, }; +static void (*const sDebugMenu_Actions_Fill[])(u8) = +{ + [DEBUG_FILL_MENU_ITEM_PC_BOXES_FAST] = DebugAction_Fill_PCBoxes_Fast, + [DEBUG_FILL_MENU_ITEM_PC_BOXES_SLOW] = DebugAction_Fill_PCBoxes_Slow, + [DEBUG_FILL_MENU_ITEM_PC_ITEMS] = DebugAction_Fill_PCItemStorage, + [DEBUG_FILL_MENU_ITEM_POCKET_ITEMS] = DebugAction_Fill_PocketItems, + [DEBUG_FILL_MENU_ITEM_POCKET_BALLS] = DebugAction_Fill_PocketPokeBalls, + [DEBUG_FILL_MENU_ITEM_POCKET_TMHM] = DebugAction_Fill_PocketTMHM, + [DEBUG_FILL_MENU_ITEM_POCKET_BERRIES] = DebugAction_Fill_PocketBerries, + [DEBUG_FILL_MENU_ITEM_POCKET_KEY_ITEMS] = DebugAction_Fill_PocketKeyItems, +}; + static void (*const sDebugMenu_Actions_Sound[])(u8) = { [DEBUG_SOUND_MENU_ITEM_SE] = DebugAction_Sound_SE, @@ -591,46 +792,56 @@ static void (*const sDebugMenu_Actions_Sound[])(u8) = // ******************************* // Windows -static const struct WindowTemplate sDebugMenuWindowTemplate = +static const struct WindowTemplate sDebugMenuWindowTemplateMain = { .bg = 0, .tilemapLeft = 1, .tilemapTop = 1, - .width = DEBUG_MAIN_MENU_WIDTH, - .height = 2 * DEBUG_MAIN_MENU_HEIGHT, + .width = DEBUG_MENU_WIDTH_MAIN, + .height = 2 * DEBUG_MENU_HEIGHT_MAIN, .paletteNum = 15, .baseBlock = 1, }; -static const struct WindowTemplate sDebugNumberDisplayWindowTemplate = +static const struct WindowTemplate sDebugMenuWindowTemplateExtra = { .bg = 0, - .tilemapLeft = 4 + DEBUG_MAIN_MENU_WIDTH, + .tilemapLeft = 30 - DEBUG_MENU_WIDTH_EXTRA - 1, .tilemapTop = 1, - .width = DEBUG_NUMBER_DISPLAY_WIDTH, - .height = 2 * DEBUG_NUMBER_DISPLAY_HEIGHT, + .width = DEBUG_MENU_WIDTH_EXTRA, + .height = 2 * DEBUG_MENU_HEIGHT_EXTRA, .paletteNum = 15, .baseBlock = 1, }; -static const struct WindowTemplate sDebugNumberDisplayMediumWindowTemplate = +static const struct WindowTemplate sDebugMenuWindowTemplateWeather = { .bg = 0, - .tilemapLeft = 30 - DEBUG_NUMBER_DISPLAY_MEDIUM_WIDTH - 1, + .tilemapLeft = 30 - DEBUG_MENU_WIDTH_WEATHER - 1, .tilemapTop = 1, - .width = DEBUG_NUMBER_DISPLAY_MEDIUM_WIDTH, - .height = 2 * DEBUG_NUMBER_DISPLAY_MEDIUM_HEIGHT, + .width = DEBUG_MENU_WIDTH_WEATHER, + .height = 2 * DEBUG_MENU_HEIGHT_WEATHER, .paletteNum = 15, .baseBlock = 1, }; -static const struct WindowTemplate sDebugNumberDisplayLargeWindowTemplate = +static const struct WindowTemplate sDebugMenuWindowTemplateSound = { .bg = 0, - .tilemapLeft = 30 - DEBUG_NUMBER_DISPLAY_SOUND_WIDTH -1, + .tilemapLeft = 30 - DEBUG_MENU_WIDTH_SOUND - 1, .tilemapTop = 1, - .width = DEBUG_NUMBER_DISPLAY_SOUND_WIDTH, - .height = DEBUG_NUMBER_DISPLAY_SOUND_HEIGHT, + .width = DEBUG_MENU_WIDTH_SOUND, + .height = DEBUG_MENU_HEIGHT_SOUND, .paletteNum = 15, .baseBlock = 1, }; +static const struct WindowTemplate sDebugMenuWindowTemplateFlagsVars = +{ + .bg = 0, + .tilemapLeft = 30 - DEBUG_MENU_WIDTH_FLAGVAR - 1, + .tilemapTop = 1, + .width = DEBUG_MENU_WIDTH_FLAGVAR, + .height = DEBUG_MENU_HEIGHT_FLAGVAR, + .paletteNum = 15, + .baseBlock = 1 + DEBUG_MENU_WIDTH_MAIN * DEBUG_MENU_HEIGHT_MAIN * 2, +}; // ******************************* // List Menu Templates @@ -652,17 +863,29 @@ static const struct ListMenuTemplate sDebugMenu_ListTemplate_Scripts = .moveCursorFunc = ListMenuDefaultCursorMoveFunc, .totalItems = ARRAY_COUNT(sDebugMenu_Items_Scripts), }; -static const struct ListMenuTemplate sDebugMenu_ListTemplate_Flags = +static const struct ListMenuTemplate sDebugMenu_ListTemplate_FlagsVars = { - .items = sDebugMenu_Items_Flags, + .items = sDebugMenu_Items_FlagsVars, .moveCursorFunc = ListMenuDefaultCursorMoveFunc, - .totalItems = ARRAY_COUNT(sDebugMenu_Items_Flags), + .totalItems = ARRAY_COUNT(sDebugMenu_Items_FlagsVars), }; -static const struct ListMenuTemplate sDebugMenu_ListTemplate_Vars = +static const struct ListMenuTemplate sDebugMenu_ListTemplate_Battle_0 = { - .items = sDebugMenu_Items_Vars, + .items = sDebugMenu_Items_Battle_0, .moveCursorFunc = ListMenuDefaultCursorMoveFunc, - .totalItems = ARRAY_COUNT(sDebugMenu_Items_Vars), + .totalItems = ARRAY_COUNT(sDebugMenu_Items_Battle_0), +}; +static const struct ListMenuTemplate sDebugMenu_ListTemplate_Battle_1 = +{ + .items = sDebugMenu_Items_Battle_1, + .moveCursorFunc = ListMenuDefaultCursorMoveFunc, + .totalItems = ARRAY_COUNT(sDebugMenu_Items_Battle_1), +}; +static const struct ListMenuTemplate sDebugMenu_ListTemplate_Battle_2 = +{ + .items = sDebugMenu_Items_Battle_2, + .moveCursorFunc = ListMenuDefaultCursorMoveFunc, + .totalItems = ARRAY_COUNT(sDebugMenu_Items_Battle_2), }; static const struct ListMenuTemplate sDebugMenu_ListTemplate_Give = { @@ -670,6 +893,12 @@ static const struct ListMenuTemplate sDebugMenu_ListTemplate_Give = .moveCursorFunc = ListMenuDefaultCursorMoveFunc, .totalItems = ARRAY_COUNT(sDebugMenu_Items_Give), }; +static const struct ListMenuTemplate sDebugMenu_ListTemplate_Fill = +{ + .items = sDebugMenu_Items_Fill, + .moveCursorFunc = ListMenuDefaultCursorMoveFunc, + .totalItems = ARRAY_COUNT(sDebugMenu_Items_Fill), +}; static const struct ListMenuTemplate sDebugMenu_ListTemplate_Sound = { .items = sDebugMenu_Items_Sound, @@ -681,6 +910,14 @@ static const struct ListMenuTemplate sDebugMenu_ListTemplate_Sound = // ******************************* // Functions universal void Debug_ShowMainMenu(void) +{ + sDebugBattleData = AllocZeroed(sizeof(*sDebugBattleData)); + sDebugMenuListData = AllocZeroed(sizeof(*sDebugMenuListData)); + Debug_InitDebugBattleData(); + + Debug_ShowMenu(DebugTask_HandleMenuInput_Main, sDebugMenu_ListTemplate_Main); +} +static void Debug_ReShowMainMenu(void) { Debug_ShowMenu(DebugTask_HandleMenuInput_Main, sDebugMenu_ListTemplate_Main); } @@ -694,12 +931,12 @@ static void Debug_ShowMenu(void (*HandleInput)(u8), struct ListMenuTemplate LMte // create window HideMapNamePopUpWindow(); LoadMessageBoxAndBorderGfx(); - windowId = AddWindow(&sDebugMenuWindowTemplate); + windowId = AddWindow(&sDebugMenuWindowTemplateMain); DrawStdWindowFrame(windowId, FALSE); // create list menu menuTemplate = LMtemplate; - menuTemplate.maxShowed = DEBUG_MAIN_MENU_HEIGHT; + menuTemplate.maxShowed = DEBUG_MENU_HEIGHT_MAIN; menuTemplate.windowId = windowId; menuTemplate.header_X = 0; menuTemplate.item_X = 8; @@ -715,13 +952,17 @@ static void Debug_ShowMenu(void (*HandleInput)(u8), struct ListMenuTemplate LMte menuTemplate.cursorKind = 0; menuTaskId = ListMenuInit(&menuTemplate, 0, 0); - // draw everything - CopyWindowToVram(windowId, 3); - // create input handler task inputTaskId = CreateTask(HandleInput, 3); gTasks[inputTaskId].data[0] = menuTaskId; gTasks[inputTaskId].data[1] = windowId; + gTasks[inputTaskId].data[2] = 0; + + Debug_RefreshListMenu(inputTaskId); + //Debug_ShowMenuDynamic(inputTaskId); + + // draw everything + CopyWindowToVram(windowId, 3); } static void Debug_DestroyMenu(u8 taskId) { @@ -731,11 +972,25 @@ static void Debug_DestroyMenu(u8 taskId) } static void Debug_DestroyMenu_Full(u8 taskId) { + if (gTasks[taskId].data[2] != 0) + { + ClearStdWindowAndFrame(gTasks[taskId].data[2], FALSE); + DebugAction_DestroyExtraWindow(taskId); + } DestroyListMenuTask(gTasks[taskId].data[0], NULL, NULL); ClearStdWindowAndFrame(gTasks[taskId].data[1], TRUE); RemoveWindow(gTasks[taskId].data[1]); DestroyTask(taskId); UnfreezeObjectEvents(); + Free(sDebugMenuListData); + Free(sDebugBattleData); +} +static void Debug_DestroyMenu_Full_Script(u8 taskId, const u8 *script) +{ + Debug_DestroyMenu_Full(taskId); + LockPlayerFieldControls(); + FreezeObjectEvents(); + ScriptContext_SetupScript(script); } static void DebugAction_Cancel(u8 taskId) { @@ -756,6 +1011,216 @@ static void DebugAction_DestroyExtraWindow(u8 taskId) UnfreezeObjectEvents(); } +static u8 Debug_CheckToggleFlags(u8 id) +{ + u8 result = FALSE; + + switch (id) + { + case DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_POKEDEX: + result = FlagGet(FLAG_SYS_POKEDEX_GET); + break; + case DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_NATDEX: + result = IsNationalPokedexEnabled(); + break; + case DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_POKENAV: + result = FlagGet(FLAG_SYS_POKENAV_GET); + break; + case DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_RUN_SHOES: + 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); + 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); + break; + case DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_FRONTIER_PASS: + result = FlagGet(FLAG_SYS_FRONTIER_PASS); + break; + #if OW_FLAG_NO_COLLISION != 0 + case DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_COLISSION: + result = FlagGet(OW_FLAG_NO_COLLISION); + break; + #endif + #if OW_FLAG_NO_ENCOUNTER != 0 + case DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_ENCOUNTER: + result = FlagGet(OW_FLAG_NO_ENCOUNTER); + break; + #endif + #if OW_FLAG_NO_TRAINER_SEE != 0 + case DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_TRAINER_SEE: + result = FlagGet(OW_FLAG_NO_TRAINER_SEE); + break; + #endif + #if B_FLAG_NO_BAG_USE != 0 + case DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_BAG_USE: + result = FlagGet(B_FLAG_NO_BAG_USE); + break; + #endif + #if B_FLAG_NO_CATCHING != 0 + case DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_CATCHING: + result = FlagGet(B_FLAG_NO_CATCHING); + break; + #endif + default: + result = 0xFF; + break; + } + + return result; +} + +static void Debug_InitDebugBattleData(void) +{ + u32 i; + sDebugBattleData->submenu = 0; + sDebugBattleData->battleType = 0xFF; + sDebugBattleData->battleTerrain = 0xFF; + + for (i = 0; i < AI_FLAG_COUNT; i++) + sDebugBattleData->aiFlags[i] = FALSE; +} + +static void Debug_RefreshListMenu(u8 taskId) +{ + u16 i; + const u8 sColor_Red[] = _("{COLOR RED}"); + const u8 sColor_Green[] = _("{COLOR GREEN}"); + u8 listTaskId = gTasks[taskId].data[0]; + struct ListMenu *list = (void*) gTasks[listTaskId].data; + u8 totalItems, flagResult; + u8 const * name; + + if (sDebugMenuListData->listId == 0) + { + gMultiuseListMenuTemplate = sDebugMenu_ListTemplate_FlagsVars; + totalItems = gMultiuseListMenuTemplate.totalItems; + } + else if (sDebugMenuListData->listId == 1 && sDebugBattleData->submenu <= 1) + { + gMultiuseListMenuTemplate = sDebugMenu_ListTemplate_Battle_1; + totalItems = gMultiuseListMenuTemplate.totalItems; + } + else if (sDebugMenuListData->listId == 1 && sDebugBattleData->submenu > 1) + { + gMultiuseListMenuTemplate = sDebugMenu_ListTemplate_Battle_2; + totalItems = 7; + } + + // Copy item names for all entries but the last (which is Cancel) + for(i = 0; i < totalItems; i++) + { + + if (sDebugMenuListData->listId == 1 && sDebugBattleData->submenu > 1) + { + u16 species; + if (i == 6) + { + name = sDebugText_Continue; + StringCopy(&sDebugMenuListData->itemNames[i][0], name); + } + else if (GetMonData(&gEnemyParty[i], MON_DATA_SANITY_HAS_SPECIES)) + { + species = GetMonData(&gEnemyParty[i], MON_DATA_SPECIES); + StringCopy(gStringVar1, GetSpeciesName(species)); + StringCopy(&sDebugMenuListData->itemNames[i][0], gStringVar1); + } + else + { + StringCopy(&sDebugMenuListData->itemNames[i][0], sDebugText_Dashes); + } + } + else + { + if (sDebugMenuListData->listId == 0) + { + flagResult = Debug_CheckToggleFlags(i); + name = sDebugMenu_Items_FlagsVars[i].name; + } + else if (sDebugMenuListData->listId == 1) + { + flagResult = sDebugBattleData->aiFlags[i]; + if (i == totalItems - 1) + flagResult == 0xFF; + name = sDebugMenu_Items_Battle_1[i].name; + } + + if (flagResult == 0xFF) + { + StringCopy(&sDebugMenuListData->itemNames[i][0], name); + } + else if (flagResult) + { + StringCopy(gStringVar1, sColor_Green); + StringExpandPlaceholders(gStringVar4, name); + StringCopy(&sDebugMenuListData->itemNames[i][0], gStringVar4); + } + else + { + StringCopy(gStringVar1, sColor_Red); + StringExpandPlaceholders(gStringVar4, name); + StringCopy(&sDebugMenuListData->itemNames[i][0], gStringVar4); + } + } + + sDebugMenuListData->listItems[i].name = &sDebugMenuListData->itemNames[i][0]; + sDebugMenuListData->listItems[i].id = i; + } + + // Set list menu data + gMultiuseListMenuTemplate.items = sDebugMenuListData->listItems; + gMultiuseListMenuTemplate.totalItems = totalItems; + gMultiuseListMenuTemplate.maxShowed = DEBUG_MENU_HEIGHT_MAIN; + gMultiuseListMenuTemplate.windowId = gTasks[taskId].data[1]; + gMultiuseListMenuTemplate.header_X = 0; + gMultiuseListMenuTemplate.item_X = 8; + gMultiuseListMenuTemplate.cursor_X = 0; + gMultiuseListMenuTemplate.upText_Y = 1; + gMultiuseListMenuTemplate.cursorPal = 2; + gMultiuseListMenuTemplate.fillValue = 1; + gMultiuseListMenuTemplate.cursorShadowPal = 3; + gMultiuseListMenuTemplate.lettersSpacing = 1; + gMultiuseListMenuTemplate.itemVerticalPadding = 0; + gMultiuseListMenuTemplate.scrollMultiple = LIST_NO_MULTIPLE_SCROLL; + gMultiuseListMenuTemplate.fontId = 1; + gMultiuseListMenuTemplate.cursorKind = 0; +} +static void Debug_RedrawListMenu(u8 taskId) +{ + u8 listTaskId = gTasks[taskId].data[0]; + u16 scrollOffset, selectedRow; + ListMenuGetScrollAndRow(listTaskId, &scrollOffset, &selectedRow); + + DestroyListMenuTask(gTasks[taskId].data[0], &scrollOffset, &selectedRow); + Debug_RefreshListMenu(taskId); + gTasks[taskId].data[0] = ListMenuInit(&gMultiuseListMenuTemplate, scrollOffset, selectedRow); +} + // ******************************* // Handle Inputs @@ -792,7 +1257,7 @@ static void DebugTask_HandleMenuInput_Utilities(u8 taskId) { PlaySE(SE_SELECT); Debug_DestroyMenu(taskId); - Debug_ShowMainMenu(); + Debug_ReShowMainMenu(); } } static void DebugTask_HandleMenuInput_Scripts(u8 taskId) @@ -810,10 +1275,10 @@ static void DebugTask_HandleMenuInput_Scripts(u8 taskId) { PlaySE(SE_SELECT); Debug_DestroyMenu(taskId); - Debug_ShowMainMenu(); + Debug_ReShowMainMenu(); } } -static void DebugTask_HandleMenuInput_Flags(u8 taskId) +static void DebugTask_HandleMenuInput_FlagsVars(u8 taskId) { void (*func)(u8); u32 input = ListMenu_ProcessInput(gTasks[taskId].data[0]); @@ -822,16 +1287,186 @@ static void DebugTask_HandleMenuInput_Flags(u8 taskId) { PlaySE(SE_SELECT); if ((func = sDebugMenu_Actions_Flags[input]) != NULL) + { func(taskId); + + // Remove TRUE/FALSE window for functions that haven't been assigned flags + if (gTasks[taskId].data[3] == 0xFF) + { + ClearStdWindowAndFrame(gTasks[taskId].data[2], TRUE); + RemoveWindow(gTasks[taskId].data[2]); + Free(sDebugMenuListData); + } + else + Debug_RedrawListMenu(taskId); + } } else if (JOY_NEW(B_BUTTON)) { PlaySE(SE_SELECT); Debug_DestroyMenu(taskId); - Debug_ShowMainMenu(); + + ClearStdWindowAndFrame(gTasks[taskId].data[2], TRUE); + RemoveWindow(gTasks[taskId].data[2]); + + Debug_ReShowMainMenu(); + } +} + +static void DebugTask_HandleBattleMenuReDraw(u8 taskId) +{ + Debug_RefreshListMenu(taskId); + switch (sDebugBattleData->submenu) + { + case 0: + Debug_DestroyMenu(taskId); + Debug_ShowMenu(DebugTask_HandleMenuInput_Battle, sDebugMenu_ListTemplate_Battle_0); + break; + case 1: + Debug_DestroyMenu(taskId); + Debug_ShowMenu(DebugTask_HandleMenuInput_Battle, gMultiuseListMenuTemplate); + break; + case 2: + Debug_DestroyMenu(taskId); + Debug_ShowMenu(DebugTask_HandleMenuInput_Battle, sDebugMenu_ListTemplate_Battle_2); + break; + case 3: + Debug_DestroyMenu(taskId); + Debug_ShowMenu(DebugTask_HandleMenuInput_Battle, gMultiuseListMenuTemplate); + break; + } +} +static void DebugTask_HandleMenuInput_Battle(u8 taskId) +{ + void (*func)(u8); + u8 listTaskId = gTasks[taskId].data[0]; + u32 input = ListMenu_ProcessInput(listTaskId); + u16 idx; + + ListMenuGetCurrentItemArrayId(listTaskId, &idx); + + if (gMain.newKeys & A_BUTTON) + { + PlaySE(SE_SELECT); + + switch (sDebugBattleData->submenu) + { + case 0: // Battle type + sDebugBattleData->battleType = idx; + sDebugBattleData->submenu++; + Debug_DestroyMenu(taskId); + + if (sDebugBattleData->battleType == DEBUG_BATTLE_0_MENU_ITEM_WILD // Skip AI Flag selection if wild battle + || sDebugBattleData->battleType == DEBUG_BATTLE_0_MENU_ITEM_WILD_DOUBLE) + { + sDebugBattleData->submenu++; + Debug_ShowMenu(DebugTask_HandleMenuInput_Battle, sDebugMenu_ListTemplate_Battle_2); + } + else + { + Debug_ShowMenu(DebugTask_HandleMenuInput_Battle, gMultiuseListMenuTemplate); + } + break; + case 1: // AI Flags + if (idx == sDebugMenu_ListTemplate_Battle_1.totalItems - 1) + { + sDebugBattleData->submenu++; + Debug_DestroyMenu(taskId); + Debug_ShowMenu(DebugTask_HandleMenuInput_Battle, sDebugMenu_ListTemplate_Battle_2); + } + else + { + sDebugBattleData->aiFlags[idx] = !sDebugBattleData->aiFlags[idx]; + Debug_RedrawListMenu(taskId); + } + + break; + case 2: // Terrain + sDebugBattleData->submenu++; + sDebugBattleData->battleTerrain = idx; + Debug_DestroyMenu(taskId); + Debug_ShowMenu(DebugTask_HandleMenuInput_Battle, gMultiuseListMenuTemplate); + break; + case 3: // Enemy pokemon + if (idx == 6) + Debug_InitializeBattle(taskId); + break; + } + } + else if (gMain.newKeys & B_BUTTON) + { + switch (sDebugBattleData->submenu) + { + case 0: // Return to Main menu + PlaySE(SE_SELECT); + Debug_DestroyMenu(taskId); + Debug_ReShowMainMenu(); + break; + case 2: // Skip AI Flag selection if wild battle + if (sDebugBattleData->battleType == DEBUG_BATTLE_0_MENU_ITEM_WILD + || sDebugBattleData->battleType == DEBUG_BATTLE_0_MENU_ITEM_WILD_DOUBLE) + { + sDebugBattleData->submenu = 0; + } + else + sDebugBattleData->submenu--; + DebugTask_HandleBattleMenuReDraw(taskId); + break; + default: + sDebugBattleData->submenu--; + DebugTask_HandleBattleMenuReDraw(taskId); + break; + } + } +} + +static void Debug_InitializeBattle(u8 taskId) +{ + u32 i; + gBattleTypeFlags = 0; + + // Set main battle flags + switch (sDebugBattleData->battleType) + { + case DEBUG_BATTLE_0_MENU_ITEM_WILD: + break; + case DEBUG_BATTLE_0_MENU_ITEM_SINGLE: + gBattleTypeFlags = (BATTLE_TYPE_TRAINER); + break; + case DEBUG_BATTLE_0_MENU_ITEM_DOUBLE: + gBattleTypeFlags = (BATTLE_TYPE_DOUBLE | BATTLE_TYPE_TWO_OPPONENTS | BATTLE_TYPE_TRAINER); + break; + case DEBUG_BATTLE_0_MENU_ITEM_MULTI: + gBattleTypeFlags = (BATTLE_TYPE_DOUBLE | BATTLE_TYPE_TWO_OPPONENTS | BATTLE_TYPE_TRAINER | BATTLE_TYPE_INGAME_PARTNER); + break; + } + + // Set terrain + gBattleTerrain = sDebugBattleData->battleTerrain; + + // Populate enemy party + for (i = 0; i < PARTY_SIZE; i++) + { + ZeroMonData(&gEnemyParty[i]); + if (GetMonData(&gPlayerParty[i], MON_DATA_SANITY_HAS_SPECIES)) + gEnemyParty[i] = gPlayerParty[i]; + } + + // Set AI flags + for (i = 0; i < ARRAY_COUNT(sDebugBattleData->aiFlags); i++) + { + if (sDebugBattleData->aiFlags[i]) + gDebugAIFlags |= (1 << i); } + + gIsDebugBattle = TRUE; + BattleSetup_StartTrainerBattle_Debug(); + + + Debug_DestroyMenu_Full(taskId); } -static void DebugTask_HandleMenuInput_Vars(u8 taskId) + +static void DebugTask_HandleMenuInput_Give(u8 taskId) { void (*func)(u8); u32 input = ListMenu_ProcessInput(gTasks[taskId].data[0]); @@ -839,32 +1474,32 @@ static void DebugTask_HandleMenuInput_Vars(u8 taskId) if (JOY_NEW(A_BUTTON)) { PlaySE(SE_SELECT); - if ((func = sDebugMenu_Actions_Vars[input]) != NULL) + if ((func = sDebugMenu_Actions_Give[input]) != NULL) func(taskId); } else if (JOY_NEW(B_BUTTON)) { PlaySE(SE_SELECT); Debug_DestroyMenu(taskId); - Debug_ShowMainMenu(); + Debug_ReShowMainMenu(); } } -static void DebugTask_HandleMenuInput_Give(u8 taskId) +static void DebugTask_HandleMenuInput_Fill(u8 taskId) { void (*func)(u8); u32 input = ListMenu_ProcessInput(gTasks[taskId].data[0]); - if (JOY_NEW(A_BUTTON)) + if (gMain.newKeys & A_BUTTON) { PlaySE(SE_SELECT); - if ((func = sDebugMenu_Actions_Give[input]) != NULL) + if ((func = sDebugMenu_Actions_Fill[input]) != NULL) func(taskId); } - else if (JOY_NEW(B_BUTTON)) + else if (gMain.newKeys & B_BUTTON) { PlaySE(SE_SELECT); Debug_DestroyMenu(taskId); - Debug_ShowMainMenu(); + Debug_ReShowMainMenu(); } } static void DebugTask_HandleMenuInput_Sound(u8 taskId) @@ -882,7 +1517,7 @@ static void DebugTask_HandleMenuInput_Sound(u8 taskId) { PlaySE(SE_SELECT); Debug_DestroyMenu(taskId); - Debug_ShowMainMenu(); + Debug_ReShowMainMenu(); } } @@ -898,28 +1533,36 @@ static void DebugAction_OpenScriptsMenu(u8 taskId) Debug_DestroyMenu(taskId); Debug_ShowMenu(DebugTask_HandleMenuInput_Scripts, sDebugMenu_ListTemplate_Scripts); } -static void DebugAction_OpenFlagsMenu(u8 taskId) +static void DebugAction_OpenFlagsVarsMenu(u8 taskId) { Debug_DestroyMenu(taskId); - Debug_ShowMenu(DebugTask_HandleMenuInput_Flags, sDebugMenu_ListTemplate_Flags); + sDebugMenuListData->listId = 0; + Debug_ShowMenu(DebugTask_HandleMenuInput_FlagsVars, gMultiuseListMenuTemplate); } -static void DebugAction_OpenVariablesMenu(u8 taskId) + +static void DebugAction_OpenBattleMenu(u8 taskId) { Debug_DestroyMenu(taskId); - Debug_ShowMenu(DebugTask_HandleMenuInput_Vars, sDebugMenu_ListTemplate_Vars); + sDebugMenuListData->listId = 1; + Debug_ShowMenu(DebugTask_HandleMenuInput_Battle, sDebugMenu_ListTemplate_Battle_0); } + static void DebugAction_OpenGiveMenu(u8 taskId) { Debug_DestroyMenu(taskId); Debug_ShowMenu(DebugTask_HandleMenuInput_Give, sDebugMenu_ListTemplate_Give); } +static void DebugAction_OpenFillMenu(u8 taskId) +{ + Debug_DestroyMenu(taskId); + Debug_ShowMenu(DebugTask_HandleMenuInput_Fill, sDebugMenu_ListTemplate_Fill); +} static void DebugAction_OpenSoundMenu(u8 taskId) { Debug_DestroyMenu(taskId); Debug_ShowMenu(DebugTask_HandleMenuInput_Sound, sDebugMenu_ListTemplate_Sound); } - // ******************************* // Actions Utilities static void DebugAction_Util_HealParty(u8 taskId) @@ -962,7 +1605,7 @@ static void DebugAction_Util_Warp_Warp(u8 taskId) HideMapNamePopUpWindow(); LoadMessageBoxAndBorderGfx(); - windowId = AddWindow(&sDebugNumberDisplayWindowTemplate); + windowId = AddWindow(&sDebugMenuWindowTemplateExtra); DrawStdWindowFrame(windowId, FALSE); CopyWindowToVram(windowId, 3); @@ -1138,20 +1781,6 @@ static void DebugAction_Util_Warp_SelectWarp(u8 taskId) } } -static void DebugAction_Util_RunningShoes(u8 taskId) -{ - if (FlagGet(FLAG_SYS_B_DASH)) - { - FlagClear(FLAG_SYS_B_DASH); - PlaySE(SE_PC_OFF); - } - else - { - FlagSet(FLAG_SYS_B_DASH); - PlaySE(SE_PC_LOGIN); - } -} - static void DebugAction_Util_PoisonMons(u8 taskId) { int i; @@ -1229,7 +1858,7 @@ static void DebugAction_Util_Weather(u8 taskId) HideMapNamePopUpWindow(); LoadMessageBoxAndBorderGfx(); - windowId = AddWindow(&sDebugNumberDisplayMediumWindowTemplate); + windowId = AddWindow(&sDebugMenuWindowTemplateWeather); DrawStdWindowFrame(windowId, FALSE); CopyWindowToVram(windowId, 3); @@ -1304,15 +1933,11 @@ static void DebugAction_Util_Weather_SelectId(u8 taskId) static void DebugAction_Util_CheckWallClock(u8 taskId) { - Debug_DestroyMenu_Full(taskId); - LockPlayerFieldControls(); - ScriptContext_SetupScript(PlayersHouse_2F_EventScript_CheckWallClock); + Debug_DestroyMenu_Full_Script(taskId, PlayersHouse_2F_EventScript_CheckWallClock); } static void DebugAction_Util_SetWallClock(u8 taskId) { - Debug_DestroyMenu_Full(taskId); - LockPlayerFieldControls(); - ScriptContext_SetupScript(PlayersHouse_2F_EventScript_SetWallClock); + Debug_DestroyMenu_Full_Script(taskId, PlayersHouse_2F_EventScript_SetWallClock); } static void DebugAction_Util_WatchCredits(u8 taskId) { @@ -1347,61 +1972,49 @@ static void DebugAction_Util_Clear_Boxes(u8 taskId) Debug_DestroyMenu_Full(taskId); ScriptContext_Enable(); } +static void DebugAction_Util_CheatStart(u8 taskId) +{ + Debug_DestroyMenu_Full_Script(taskId, Debug_CheatStart); +} // ******************************* // Actions Scripts static void DebugAction_Util_Script_1(u8 taskId) { - Debug_DestroyMenu_Full(taskId); - LockPlayerFieldControls(); - ScriptContext_SetupScript(Debug_Script_1); + Debug_DestroyMenu_Full_Script(taskId, Debug_Script_1); } static void DebugAction_Util_Script_2(u8 taskId) { - Debug_DestroyMenu_Full(taskId); - LockPlayerFieldControls(); - ScriptContext_SetupScript(Debug_Script_2); + Debug_DestroyMenu_Full_Script(taskId, Debug_Script_2); } static void DebugAction_Util_Script_3(u8 taskId) { - Debug_DestroyMenu_Full(taskId); - LockPlayerFieldControls(); - ScriptContext_SetupScript(Debug_Script_3); + Debug_DestroyMenu_Full_Script(taskId, Debug_Script_3); } static void DebugAction_Util_Script_4(u8 taskId) { - Debug_DestroyMenu_Full(taskId); - LockPlayerFieldControls(); - ScriptContext_SetupScript(Debug_Script_4); + Debug_DestroyMenu_Full_Script(taskId, Debug_Script_4); } static void DebugAction_Util_Script_5(u8 taskId) { - Debug_DestroyMenu_Full(taskId); - LockPlayerFieldControls(); - ScriptContext_SetupScript(Debug_Script_5); + Debug_DestroyMenu_Full_Script(taskId, Debug_Script_5); } static void DebugAction_Util_Script_6(u8 taskId) { - Debug_DestroyMenu_Full(taskId); - LockPlayerFieldControls(); - ScriptContext_SetupScript(Debug_Script_6); + Debug_DestroyMenu_Full_Script(taskId, Debug_Script_6); } static void DebugAction_Util_Script_7(u8 taskId) { - Debug_DestroyMenu_Full(taskId); - LockPlayerFieldControls(); - ScriptContext_SetupScript(Debug_Script_7); + Debug_DestroyMenu_Full_Script(taskId, Debug_Script_7); } static void DebugAction_Util_Script_8(u8 taskId) { - Debug_DestroyMenu_Full(taskId); - LockPlayerFieldControls(); - ScriptContext_SetupScript(Debug_Script_8); + Debug_DestroyMenu_Full_Script(taskId, Debug_Script_8); } // ******************************* -// Actions Flags -static void DebugAction_Flags_Flags(u8 taskId) +// Actions Flags and Vars +static void DebugAction_FlagsVars_Flags(u8 taskId) { u8 windowId; @@ -1410,7 +2023,7 @@ static void DebugAction_Flags_Flags(u8 taskId) HideMapNamePopUpWindow(); LoadMessageBoxAndBorderGfx(); - windowId = AddWindow(&sDebugNumberDisplayWindowTemplate); + windowId = AddWindow(&sDebugMenuWindowTemplateExtra); DrawStdWindowFrame(windowId, FALSE); CopyWindowToVram(windowId, 3); @@ -1418,248 +2031,82 @@ static void DebugAction_Flags_Flags(u8 taskId) //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_Flags_FlagHex); - if (FlagGet(FLAG_TEMP_1) == TRUE) - StringCopyPadded(gStringVar2, sDebugText_Flags_FlagSet, CHAR_SPACE, 15); + StringExpandPlaceholders(gStringVar1, sDebugText_FlagsVars_FlagHex); + if (FlagGet(FLAG_TEMP_1)) + StringCopyPadded(gStringVar2, sDebugText_True, CHAR_SPACE, 15); else - StringCopyPadded(gStringVar2, sDebugText_Flags_FlagUnset, CHAR_SPACE, 15); + StringCopyPadded(gStringVar2, sDebugText_False, CHAR_SPACE, 15); StringCopy(gStringVar3, gText_DigitIndicator[0]); - StringExpandPlaceholders(gStringVar4, sDebugText_Flags_Flag); + StringExpandPlaceholders(gStringVar4, sDebugText_FlagsVars_Flag); AddTextPrinterParameterized(windowId, 1, gStringVar4, 1, 1, 0, NULL); - gTasks[taskId].func = DebugAction_Flags_FlagsSelect; + gTasks[taskId].func = DebugAction_FlagsVars_FlagsSelect; gTasks[taskId].data[2] = windowId; gTasks[taskId].data[3] = FLAG_TEMP_1; //Current Flag - gTasks[taskId].data[4] = 0; //Digit Selected -} -static void DebugAction_Flags_FlagsSelect(u8 taskId) -{ - if (JOY_NEW(A_BUTTON)) - FlagToggle(gTasks[taskId].data[3]); - else if (JOY_NEW(B_BUTTON)) - { - PlaySE(SE_SELECT); - DebugAction_DestroyExtraWindow(taskId); - return; - } - - if (JOY_NEW(DPAD_UP)) - { - PlaySE(SE_SELECT); - gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]]; - if (gTasks[taskId].data[3] >= FLAGS_COUNT){ - gTasks[taskId].data[3] = FLAGS_COUNT - 1; - } - } - if (JOY_NEW(DPAD_DOWN)) - { - PlaySE(SE_SELECT); - gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]]; - if (gTasks[taskId].data[3] < 1){ - gTasks[taskId].data[3] = 1; - } - } - if (JOY_NEW(DPAD_LEFT)) - { - PlaySE(SE_SELECT); - gTasks[taskId].data[4] -= 1; - if (gTasks[taskId].data[4] < 0) - { - gTasks[taskId].data[4] = 0; - } - } - if (JOY_NEW(DPAD_RIGHT)) - { - PlaySE(SE_SELECT); - gTasks[taskId].data[4] += 1; - if (gTasks[taskId].data[4] > DEBUG_NUMBER_DIGITS_FLAGS - 1) - { - gTasks[taskId].data[4] = DEBUG_NUMBER_DIGITS_FLAGS - 1; - } - } - - if (JOY_NEW(DPAD_ANY) || JOY_NEW(A_BUTTON)) - { - ConvertIntToDecimalStringN(gStringVar1, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_FLAGS); - ConvertIntToHexStringN(gStringVar2, gTasks[taskId].data[3], STR_CONV_MODE_LEFT_ALIGN, 3); - StringExpandPlaceholders(gStringVar1, sDebugText_Flags_FlagHex); - if (FlagGet(gTasks[taskId].data[3]) == TRUE) - StringCopyPadded(gStringVar2, sDebugText_Flags_FlagSet, CHAR_SPACE, 15); - else - StringCopyPadded(gStringVar2, sDebugText_Flags_FlagUnset, CHAR_SPACE, 15); - StringCopy(gStringVar3, gText_DigitIndicator[gTasks[taskId].data[4]]); - StringExpandPlaceholders(gStringVar4, sDebugText_Flags_Flag); - AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); - } -} - -static void DebugAction_Flags_SetPokedexFlags(u8 taskId) -{ - u16 i; - for (i = 0; i < NATIONAL_DEX_COUNT; i++) - { - GetSetPokedexFlag(i + 1, FLAG_SET_CAUGHT); - GetSetPokedexFlag(i + 1, FLAG_SET_SEEN); - } - Debug_DestroyMenu_Full(taskId); - ScriptContext_Enable(); -} -static void DebugAction_Flags_SwitchDex(u8 taskId) -{ - if (FlagGet(FLAG_SYS_POKEDEX_GET)) - PlaySE(SE_PC_OFF); - else - PlaySE(SE_PC_LOGIN); - FlagToggle(FLAG_SYS_POKEDEX_GET); -} -static void DebugAction_Flags_SwitchNatDex(u8 taskId) -{ - if (IsNationalPokedexEnabled()) - { - DisableNationalPokedex(); - PlaySE(SE_PC_OFF); - } - else - { - EnableNationalPokedex(); - PlaySE(SE_PC_LOGIN); - } -} -static void DebugAction_Flags_SwitchPokeNav(u8 taskId) -{ - if (FlagGet(FLAG_SYS_POKENAV_GET)) - PlaySE(SE_PC_OFF); - else - PlaySE(SE_PC_LOGIN); - FlagToggle(FLAG_SYS_POKENAV_GET); -} -static void DebugAction_Flags_ToggleFlyFlags(u8 taskId) -{ - // Sound effect - if (FlagGet(FLAG_LANDMARK_BATTLE_FRONTIER)) - PlaySE(SE_PC_OFF); - else - PlaySE(SE_PC_LOGIN); - - FlagToggle(FLAG_VISITED_LITTLEROOT_TOWN); - FlagToggle(FLAG_VISITED_OLDALE_TOWN); - FlagToggle(FLAG_VISITED_DEWFORD_TOWN); - FlagToggle(FLAG_VISITED_LAVARIDGE_TOWN); - FlagToggle(FLAG_VISITED_FALLARBOR_TOWN); - FlagToggle(FLAG_VISITED_VERDANTURF_TOWN); - FlagToggle(FLAG_VISITED_PACIFIDLOG_TOWN); - FlagToggle(FLAG_VISITED_PETALBURG_CITY); - FlagToggle(FLAG_VISITED_SLATEPORT_CITY); - FlagToggle(FLAG_VISITED_MAUVILLE_CITY); - FlagToggle(FLAG_VISITED_RUSTBORO_CITY); - FlagToggle(FLAG_VISITED_FORTREE_CITY); - FlagToggle(FLAG_VISITED_LILYCOVE_CITY); - FlagToggle(FLAG_VISITED_MOSSDEEP_CITY); - FlagToggle(FLAG_VISITED_SOOTOPOLIS_CITY); - FlagToggle(FLAG_VISITED_EVER_GRANDE_CITY); - FlagToggle(FLAG_LANDMARK_POKEMON_LEAGUE); - FlagToggle(FLAG_LANDMARK_BATTLE_FRONTIER); -} -static void DebugAction_Flags_ToggleBadgeFlags(u8 taskId) -{ - // Sound effect - if (FlagGet(FLAG_BADGE08_GET)) - PlaySE(SE_PC_OFF); - else - PlaySE(SE_PC_LOGIN); - - FlagToggle(FLAG_BADGE01_GET); - FlagToggle(FLAG_BADGE02_GET); - FlagToggle(FLAG_BADGE03_GET); - FlagToggle(FLAG_BADGE04_GET); - FlagToggle(FLAG_BADGE05_GET); - FlagToggle(FLAG_BADGE06_GET); - FlagToggle(FLAG_BADGE07_GET); - FlagToggle(FLAG_BADGE08_GET); -} -static void DebugAction_Flags_ToggleFrontierPass(u8 taskId) -{ - // Sound effect - if (FlagGet(FLAG_SYS_FRONTIER_PASS)) - PlaySE(SE_PC_OFF); - else - PlaySE(SE_PC_LOGIN); - FlagToggle(FLAG_SYS_FRONTIER_PASS); -} -static void DebugAction_Flags_CollisionOnOff(u8 taskId) -{ -#if OW_FLAG_NO_COLLISION == 0 - Debug_DestroyMenu_Full(taskId); - LockPlayerFieldControls(); - ScriptContext_SetupScript(Debug_FlagsNotSetOverworldConfigMessage); -#else - if (FlagGet(OW_FLAG_NO_COLLISION)) - PlaySE(SE_PC_OFF); - else - PlaySE(SE_PC_LOGIN); - FlagToggle(OW_FLAG_NO_COLLISION); -#endif -} -static void DebugAction_Flags_EncounterOnOff(u8 taskId) -{ -#if OW_FLAG_NO_ENCOUNTER == 0 - Debug_DestroyMenu_Full(taskId); - LockPlayerFieldControls(); - ScriptContext_SetupScript(Debug_FlagsNotSetOverworldConfigMessage); -#else - if (FlagGet(OW_FLAG_NO_ENCOUNTER)) - PlaySE(SE_PC_OFF); - else - PlaySE(SE_PC_LOGIN); - FlagToggle(OW_FLAG_NO_ENCOUNTER); -#endif -} -static void DebugAction_Flags_TrainerSeeOnOff(u8 taskId) -{ -#if OW_FLAG_NO_TRAINER_SEE == 0 - Debug_DestroyMenu_Full(taskId); - LockPlayerFieldControls(); - ScriptContext_SetupScript(Debug_FlagsNotSetOverworldConfigMessage); -#else - if (FlagGet(OW_FLAG_NO_TRAINER_SEE)) - PlaySE(SE_PC_OFF); - else - PlaySE(SE_PC_LOGIN); - FlagToggle(OW_FLAG_NO_TRAINER_SEE); -#endif -} -static void DebugAction_Flags_BagUseOnOff(u8 taskId) -{ -#if B_FLAG_NO_BAG_USE == 0 - Debug_DestroyMenu_Full(taskId); - LockPlayerFieldControls(); - ScriptContext_SetupScript(Debug_FlagsNotSetBattleConfigMessage); -#else - if (FlagGet(B_FLAG_NO_BAG_USE)) - PlaySE(SE_PC_OFF); - else - PlaySE(SE_PC_LOGIN); - FlagToggle(B_FLAG_NO_BAG_USE); -#endif -} -static void DebugAction_Flags_CatchingOnOff(u8 taskId) -{ -#if B_FLAG_NO_CATCHING == 0 - Debug_DestroyMenu_Full(taskId); - LockPlayerFieldControls(); - ScriptContext_SetupScript(Debug_FlagsNotSetBattleConfigMessage); -#else - if (FlagGet(B_FLAG_NO_CATCHING)) - PlaySE(SE_PC_OFF); - else - PlaySE(SE_PC_LOGIN); - FlagToggle(B_FLAG_NO_CATCHING); -#endif + gTasks[taskId].data[4] = 0; //Digit Selected } +static void DebugAction_FlagsVars_FlagsSelect(u8 taskId) +{ + if (JOY_NEW(A_BUTTON)) + FlagToggle(gTasks[taskId].data[3]); + else if (JOY_NEW(B_BUTTON)) + { + PlaySE(SE_SELECT); + DebugAction_DestroyExtraWindow(taskId); + return; + } -// ******************************* -// Actions Variables -static void DebugAction_Vars_Vars(u8 taskId) + if (JOY_NEW(DPAD_UP)) + { + PlaySE(SE_SELECT); + gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]]; + if (gTasks[taskId].data[3] >= FLAGS_COUNT){ + gTasks[taskId].data[3] = FLAGS_COUNT - 1; + } + } + if (JOY_NEW(DPAD_DOWN)) + { + PlaySE(SE_SELECT); + gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]]; + if (gTasks[taskId].data[3] < 1){ + gTasks[taskId].data[3] = 1; + } + } + if (JOY_NEW(DPAD_LEFT)) + { + PlaySE(SE_SELECT); + gTasks[taskId].data[4] -= 1; + if (gTasks[taskId].data[4] < 0) + { + gTasks[taskId].data[4] = 0; + } + } + if (JOY_NEW(DPAD_RIGHT)) + { + PlaySE(SE_SELECT); + gTasks[taskId].data[4] += 1; + if (gTasks[taskId].data[4] > DEBUG_NUMBER_DIGITS_FLAGS - 1) + { + gTasks[taskId].data[4] = DEBUG_NUMBER_DIGITS_FLAGS - 1; + } + } + + if (JOY_NEW(DPAD_ANY) || JOY_NEW(A_BUTTON)) + { + ConvertIntToDecimalStringN(gStringVar1, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_FLAGS); + ConvertIntToHexStringN(gStringVar2, gTasks[taskId].data[3], STR_CONV_MODE_LEFT_ALIGN, 3); + StringExpandPlaceholders(gStringVar1, sDebugText_FlagsVars_FlagHex); + if (FlagGet(gTasks[taskId].data[3]) == TRUE) + StringCopyPadded(gStringVar2, sDebugText_True, CHAR_SPACE, 15); + else + StringCopyPadded(gStringVar2, sDebugText_False, CHAR_SPACE, 15); + StringCopy(gStringVar3, gText_DigitIndicator[gTasks[taskId].data[4]]); + StringExpandPlaceholders(gStringVar4, sDebugText_FlagsVars_Flag); + AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); + } +} + +static void DebugAction_FlagsVars_Vars(u8 taskId) { u8 windowId; @@ -1668,7 +2115,7 @@ static void DebugAction_Vars_Vars(u8 taskId) HideMapNamePopUpWindow(); LoadMessageBoxAndBorderGfx(); - windowId = AddWindow(&sDebugNumberDisplayWindowTemplate); + windowId = AddWindow(&sDebugMenuWindowTemplateExtra); DrawStdWindowFrame(windowId, FALSE); CopyWindowToVram(windowId, 3); @@ -1676,21 +2123,21 @@ static void DebugAction_Vars_Vars(u8 taskId) //Display initial Variable ConvertIntToDecimalStringN(gStringVar1, VARS_START, STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_VARIABLES); ConvertIntToHexStringN(gStringVar2, VARS_START, STR_CONV_MODE_LEFT_ALIGN, 4); - StringExpandPlaceholders(gStringVar1, sDebugText_Vars_VariableHex); + StringExpandPlaceholders(gStringVar1, sDebugText_FlagsVars_VariableHex); ConvertIntToDecimalStringN(gStringVar3, 0, STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_VARIABLES); StringCopyPadded(gStringVar3, gStringVar3, CHAR_SPACE, 15); StringCopy(gStringVar2, gText_DigitIndicator[0]); - StringExpandPlaceholders(gStringVar4, sDebugText_Vars_Variable); + StringExpandPlaceholders(gStringVar4, sDebugText_FlagsVars_Variable); AddTextPrinterParameterized(windowId, 1, gStringVar4, 1, 1, 0, NULL); - gTasks[taskId].func = DebugAction_Vars_Select; + gTasks[taskId].func = DebugAction_FlagsVars_Select; gTasks[taskId].data[2] = windowId; gTasks[taskId].data[3] = VARS_START; //Current Variable gTasks[taskId].data[4] = 0; //Digit Selected gTasks[taskId].data[5] = 0; //Current Variable VALUE } -static void DebugAction_Vars_Select(u8 taskId) +static void DebugAction_FlagsVars_Select(u8 taskId) { if (JOY_NEW(DPAD_UP)) { @@ -1723,7 +2170,7 @@ static void DebugAction_Vars_Select(u8 taskId) ConvertIntToDecimalStringN(gStringVar1, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_VARIABLES); ConvertIntToHexStringN(gStringVar2, gTasks[taskId].data[3], STR_CONV_MODE_LEFT_ALIGN, 4); - StringExpandPlaceholders(gStringVar1, sDebugText_Vars_VariableHex); + StringExpandPlaceholders(gStringVar1, sDebugText_FlagsVars_VariableHex); if (VarGetIfExist(gTasks[taskId].data[3]) == 65535) //Current value, if 65535 the value hasnt been set gTasks[taskId].data[5] = 0; else @@ -1732,7 +2179,7 @@ static void DebugAction_Vars_Select(u8 taskId) StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].data[4]]); //Current digit //Combine str's to full window string - StringExpandPlaceholders(gStringVar4, sDebugText_Vars_Variable); + StringExpandPlaceholders(gStringVar4, sDebugText_FlagsVars_Variable); AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); } @@ -1744,7 +2191,7 @@ static void DebugAction_Vars_Select(u8 taskId) ConvertIntToDecimalStringN(gStringVar1, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_VARIABLES); ConvertIntToHexStringN(gStringVar2, gTasks[taskId].data[3], STR_CONV_MODE_LEFT_ALIGN, 4); - StringExpandPlaceholders(gStringVar1, sDebugText_Vars_VariableHex); + StringExpandPlaceholders(gStringVar1, sDebugText_FlagsVars_VariableHex); if (VarGetIfExist(gTasks[taskId].data[3]) == 65535) //Current value if 65535 the value hasnt been set gTasks[taskId].data[5] = 0; else @@ -1752,11 +2199,11 @@ static void DebugAction_Vars_Select(u8 taskId) ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[5], STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_VARIABLES); StringCopyPadded(gStringVar3, gStringVar3, CHAR_SPACE, 15); StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].data[4]]); //Current digit - StringExpandPlaceholders(gStringVar4, sDebugText_Vars_VariableValueSet); + StringExpandPlaceholders(gStringVar4, sDebugText_FlagsVars_VariableValueSet); AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); gTasks[taskId].data[6] = gTasks[taskId].data[5]; //New value selector - gTasks[taskId].func = DebugAction_Vars_SetValue; + gTasks[taskId].func = DebugAction_FlagsVars_SetValue; } else if (JOY_NEW(B_BUTTON)) { @@ -1765,7 +2212,7 @@ static void DebugAction_Vars_Select(u8 taskId) return; } } -static void DebugAction_Vars_SetValue(u8 taskId) +static void DebugAction_FlagsVars_SetValue(u8 taskId) { if (JOY_NEW(DPAD_UP)) { @@ -1819,16 +2266,233 @@ static void DebugAction_Vars_SetValue(u8 taskId) ConvertIntToDecimalStringN(gStringVar1, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_VARIABLES); ConvertIntToHexStringN(gStringVar2, gTasks[taskId].data[3], STR_CONV_MODE_LEFT_ALIGN, 4); - StringExpandPlaceholders(gStringVar1, sDebugText_Vars_VariableHex); + StringExpandPlaceholders(gStringVar1, sDebugText_FlagsVars_VariableHex); StringCopyPadded(gStringVar1, gStringVar1, CHAR_SPACE, 15); ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[6], STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_VARIABLES); StringCopyPadded(gStringVar3, gStringVar3, CHAR_SPACE, 15); StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].data[4]]); //Current digit - StringExpandPlaceholders(gStringVar4, sDebugText_Vars_VariableValueSet); + StringExpandPlaceholders(gStringVar4, sDebugText_FlagsVars_VariableValueSet); AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); } } +static void DebugAction_FlagsVars_PokedexFlags_All(u8 taskId) +{ + u16 i; + for (i = 0; i < NATIONAL_DEX_COUNT; i++) + { + GetSetPokedexFlag(i + 1, FLAG_SET_CAUGHT); + GetSetPokedexFlag(i + 1, FLAG_SET_SEEN); + } + Debug_DestroyMenu_Full(taskId); + ScriptContext_Enable(); +} +static void DebugAction_FlagsVars_PokedexFlags_Reset(u8 taskId) +{ + int boxId, boxPosition, partyId; + u16 species; + + // Reset Pokedex to emtpy + memset(&gSaveBlock1Ptr->dexCaught, 0, sizeof(gSaveBlock1Ptr->dexCaught)); + memset(&gSaveBlock1Ptr->dexSeen, 0, sizeof(gSaveBlock1Ptr->dexSeen)); + + // Add party Pokemon to Pokedex + for (partyId = 0; partyId < PARTY_SIZE; partyId++) + { + if (GetMonData(&gPlayerParty[partyId], MON_DATA_SANITY_HAS_SPECIES)) + { + species = GetMonData(&gPlayerParty[partyId], MON_DATA_SPECIES); + GetSetPokedexFlag(SpeciesToNationalPokedexNum(species), FLAG_SET_CAUGHT); + GetSetPokedexFlag(SpeciesToNationalPokedexNum(species), FLAG_SET_SEEN); + } + } + + // Add box Pokemon to Pokedex + for (boxId = 0; boxId < TOTAL_BOXES_COUNT; boxId++) + { + for (boxPosition = 0; boxPosition < IN_BOX_COUNT; boxPosition++) + { + if (GetBoxMonData(&gPokemonStoragePtr->boxes[boxId][boxPosition], MON_DATA_SANITY_HAS_SPECIES)) + { + species = GetBoxMonData(&gPokemonStoragePtr->boxes[boxId][boxPosition], MON_DATA_SPECIES); + GetSetPokedexFlag(SpeciesToNationalPokedexNum(species), FLAG_SET_CAUGHT); + GetSetPokedexFlag(SpeciesToNationalPokedexNum(species), FLAG_SET_SEEN); + } + } + } + Debug_DestroyMenu_Full(taskId); + ScriptContext_Enable(); +} +static void DebugAction_FlagsVars_SwitchDex(u8 taskId) +{ + if (FlagGet(FLAG_SYS_POKEDEX_GET)) + PlaySE(SE_PC_OFF); + else + PlaySE(SE_PC_LOGIN); + FlagToggle(FLAG_SYS_POKEDEX_GET); +} +static void DebugAction_FlagsVars_SwitchNatDex(u8 taskId) +{ + if (IsNationalPokedexEnabled()) + { + DisableNationalPokedex(); + PlaySE(SE_PC_OFF); + }else{ + EnableNationalPokedex(); + PlaySE(SE_PC_LOGIN); + } +} +static void DebugAction_FlagsVars_SwitchPokeNav(u8 taskId) +{ + if (FlagGet(FLAG_SYS_POKENAV_GET)) + PlaySE(SE_PC_OFF); + else + PlaySE(SE_PC_LOGIN); + FlagToggle(FLAG_SYS_POKENAV_GET); +} +static void DebugAction_FlagsVars_RunningShoes(u8 taskId) +{ + if (FlagGet(FLAG_SYS_B_DASH)) + PlaySE(SE_PC_OFF); + else + PlaySE(SE_PC_LOGIN); + FlagToggle(FLAG_SYS_B_DASH); +} +static void DebugAction_FlagsVars_ToggleFlyFlags(u8 taskId) +{ + // Sound effect + if (FlagGet(FLAG_LANDMARK_BATTLE_FRONTIER)) + { + 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); + } + 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); + } +} +static void DebugAction_FlagsVars_ToggleBadgeFlags(u8 taskId) +{ + // Sound effect + if (FlagGet(FLAG_BADGE08_GET)) + PlaySE(SE_PC_OFF); + else + PlaySE(SE_PC_LOGIN); + FlagToggle(FLAG_BADGE01_GET); + FlagToggle(FLAG_BADGE02_GET); + FlagToggle(FLAG_BADGE03_GET); + FlagToggle(FLAG_BADGE04_GET); + FlagToggle(FLAG_BADGE05_GET); + FlagToggle(FLAG_BADGE06_GET); + FlagToggle(FLAG_BADGE07_GET); + FlagToggle(FLAG_BADGE08_GET); +} +static void DebugAction_FlagsVars_ToggleFrontierPass(u8 taskId) +{ + // Sound effect + if (FlagGet(FLAG_SYS_FRONTIER_PASS)) + PlaySE(SE_PC_OFF); + else + PlaySE(SE_PC_LOGIN); + FlagToggle(FLAG_SYS_FRONTIER_PASS); +} +static void DebugAction_FlagsVars_CollisionOnOff(u8 taskId) +{ +#if OW_FLAG_NO_COLLISION == 0 + Debug_DestroyMenu_Full_Script(taskId, Debug_FlagsNotSetOverworldConfigMessage); +#else + if (FlagGet(OW_FLAG_NO_COLLISION)) + PlaySE(SE_PC_OFF); + else + PlaySE(SE_PC_LOGIN); + FlagToggle(OW_FLAG_NO_COLLISION); +#endif +} +static void DebugAction_FlagsVars_EncounterOnOff(u8 taskId) +{ +#if OW_FLAG_NO_ENCOUNTER == 0 + Debug_DestroyMenu_Full_Script(taskId, Debug_FlagsNotSetOverworldConfigMessage); +#else + if (FlagGet(OW_FLAG_NO_ENCOUNTER)) + PlaySE(SE_PC_OFF); + else + PlaySE(SE_PC_LOGIN); + FlagToggle(OW_FLAG_NO_ENCOUNTER); +#endif +} +static void DebugAction_FlagsVars_TrainerSeeOnOff(u8 taskId) +{ +#if OW_FLAG_NO_TRAINER_SEE == 0 + Debug_DestroyMenu_Full_Script(taskId, Debug_FlagsNotSetOverworldConfigMessage); +#else + if (FlagGet(OW_FLAG_NO_TRAINER_SEE)) + PlaySE(SE_PC_OFF); + else + PlaySE(SE_PC_LOGIN); + FlagToggle(OW_FLAG_NO_TRAINER_SEE); +#endif +} +static void DebugAction_FlagsVars_BagUseOnOff(u8 taskId) +{ +#if B_FLAG_NO_BAG_USE == 0 + Debug_DestroyMenu_Full_Script(taskId, Debug_FlagsNotSetBattleConfigMessage); +#else + if (FlagGet(B_FLAG_NO_BAG_USE)) + PlaySE(SE_PC_OFF); + else + PlaySE(SE_PC_LOGIN); + FlagToggle(B_FLAG_NO_BAG_USE); +#endif +} +static void DebugAction_FlagsVars_CatchingOnOff(u8 taskId) +{ +#if B_FLAG_NO_CATCHING == 0 + Debug_DestroyMenu_Full_Script(taskId, Debug_FlagsNotSetBattleConfigMessage); +#else + if (FlagGet(B_FLAG_NO_CATCHING)) + PlaySE(SE_PC_OFF); + else + PlaySE(SE_PC_LOGIN); + FlagToggle(B_FLAG_NO_CATCHING); +#endif +} // ******************************* // Actions Give @@ -1842,7 +2506,7 @@ static void DebugAction_Give_Item(u8 taskId) HideMapNamePopUpWindow(); LoadMessageBoxAndBorderGfx(); - windowId = AddWindow(&sDebugNumberDisplayWindowTemplate); + windowId = AddWindow(&sDebugMenuWindowTemplateExtra); DrawStdWindowFrame(windowId, FALSE); CopyWindowToVram(windowId, 3); @@ -2040,7 +2704,7 @@ static void DebugAction_Give_PokemonSimple(u8 taskId) HideMapNamePopUpWindow(); LoadMessageBoxAndBorderGfx(); - windowId = AddWindow(&sDebugNumberDisplayWindowTemplate); + windowId = AddWindow(&sDebugMenuWindowTemplateExtra); DrawStdWindowFrame(windowId, FALSE); CopyWindowToVram(windowId, 3); @@ -2078,7 +2742,7 @@ static void DebugAction_Give_PokemonComplex(u8 taskId) HideMapNamePopUpWindow(); LoadMessageBoxAndBorderGfx(); - windowId = AddWindow(&sDebugNumberDisplayWindowTemplate); + windowId = AddWindow(&sDebugMenuWindowTemplateExtra); DrawStdWindowFrame(windowId, FALSE); CopyWindowToVram(windowId, 3); @@ -2226,7 +2890,7 @@ static void DebugAction_Give_Pokemon_SelectLevel(u8 taskId) ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 0); StringCopyPadded(gStringVar3, gStringVar3, CHAR_SPACE, 15); - StringCopyPadded(gStringVar2, sDebugText_Flags_FlagUnset, CHAR_SPACE, 15); + StringCopyPadded(gStringVar2, sDebugText_False, CHAR_SPACE, 15); StringExpandPlaceholders(gStringVar4, sDebugText_PokemonShiny); AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); @@ -2263,9 +2927,9 @@ static void DebugAction_Give_Pokemon_SelectShiny(u8 taskId) } if (gTasks[taskId].data[3] == 1) - StringCopyPadded(gStringVar2, sDebugText_Flags_FlagSet, CHAR_SPACE, 15); + StringCopyPadded(gStringVar2, sDebugText_True, CHAR_SPACE, 15); else - StringCopyPadded(gStringVar2, sDebugText_Flags_FlagUnset, CHAR_SPACE, 15); + StringCopyPadded(gStringVar2, sDebugText_False, CHAR_SPACE, 15); ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 0); StringCopyPadded(gStringVar3, gStringVar3, CHAR_SPACE, 15); StringExpandPlaceholders(gStringVar4, sDebugText_PokemonShiny); @@ -2796,23 +3460,47 @@ static void DebugAction_Give_DayCareEgg(u8 taskId) TriggerPendingDaycareEgg(); } -static void DebugAction_Give_FillPC(u8 taskId) //Credit: Sierraffinity +// ******************************* +// Actions Fill +static void DebugAction_Fill_PCBoxes_Fast(u8 taskId) //Credit: Sierraffinity { int boxId, boxPosition; u32 personality; struct BoxPokemon boxMon; u16 species = SPECIES_BULBASAUR; + u8 speciesName[POKEMON_NAME_LENGTH + 1]; personality = Random32(); - CreateBoxMon(&boxMon, - species, - 100, - 32, - personality, - 0, - OT_ID_PLAYER_ID, - 0); + CreateBoxMon(&boxMon, species, 100, USE_RANDOM_IVS, FALSE, personality, OT_ID_PLAYER_ID, 0); + + for (boxId = 0; boxId < TOTAL_BOXES_COUNT; boxId++) + { + for (boxPosition = 0; boxPosition < IN_BOX_COUNT; boxPosition++, species++) + { + if (!GetBoxMonData(&gPokemonStoragePtr->boxes[boxId][boxPosition], MON_DATA_SANITY_HAS_SPECIES)) + { + StringCopy(speciesName, GetSpeciesName(species)); + SetBoxMonData(&boxMon, MON_DATA_NICKNAME, &speciesName); + SetBoxMonData(&boxMon, MON_DATA_SPECIES, &species); + GiveBoxMonInitialMoveset_Fast(&boxMon); + gPokemonStoragePtr->boxes[boxId][boxPosition] = boxMon; + } + } + } + + // Set flag for user convenience + FlagSet(FLAG_SYS_POKEMON_GET); + Debug_DestroyMenu_Full(taskId); + ScriptContext_Enable(); +} +static void DebugAction_Fill_PCBoxes_Slow(u8 taskId) +{ + int boxId, boxPosition; + u32 personality; + struct BoxPokemon boxMon; + u32 species = SPECIES_BULBASAUR; + bool8 spaceAvailable = FALSE; for (boxId = 0; boxId < TOTAL_BOXES_COUNT; boxId++) { @@ -2820,36 +3508,86 @@ static void DebugAction_Give_FillPC(u8 taskId) //Credit: Sierraffinity { if (!GetBoxMonData(&gPokemonStoragePtr->boxes[boxId][boxPosition], MON_DATA_SANITY_HAS_SPECIES)) { + if (!spaceAvailable) + PlayBGM(MUS_RG_MYSTERY_GIFT); + CreateBoxMon(&boxMon, species, 100, USE_RANDOM_IVS, FALSE, 0, OT_ID_PLAYER_ID, 0); gPokemonStoragePtr->boxes[boxId][boxPosition] = boxMon; - SetBoxMonData(&gPokemonStoragePtr->boxes[boxId][boxPosition], MON_DATA_SPECIES, &species); - GetSetPokedexFlag(species, FLAG_SET_SEEN); - GetSetPokedexFlag(species, FLAG_SET_CAUGHT); - species++; + species = (species < NUM_SPECIES - 1) ? species + 1 : 1; + spaceAvailable = TRUE; } } } // Set flag for user convenience FlagSet(FLAG_SYS_POKEMON_GET); + if (spaceAvailable) + PlayBGM(GetCurrentMapMusic()); + + Debug_DestroyMenu_Full_Script(taskId, Debug_BoxFilledMessage); +} +static void DebugAction_Fill_PCItemStorage(u8 taskId) +{ + u16 itemId; + + for (itemId = 1; itemId < ITEMS_COUNT; itemId++) + { + if (!CheckPCHasItem(itemId, MAX_PC_ITEM_CAPACITY)) + AddPCItem(itemId, MAX_PC_ITEM_CAPACITY); + } } +static void DebugAction_Fill_PocketItems(u8 taskId) +{ + u16 itemId; -static void DebugAction_Give_CHEAT(u8 taskId) + for (itemId = 1; itemId < ITEMS_COUNT; itemId++) + { + if (ItemId_GetPocket(itemId) == POCKET_ITEMS && CheckBagHasSpace(itemId, MAX_BAG_ITEM_CAPACITY)) + AddBagItem(itemId, MAX_BAG_ITEM_CAPACITY); + } +} +static void DebugAction_Fill_PocketPokeBalls(u8 taskId) { - Debug_DestroyMenu_Full(taskId); - LockPlayerFieldControls(); - ScriptContext_SetupScript(Debug_CheatStart); + u16 itemId; + + for (itemId = FIRST_BALL; itemId < LAST_BALL; itemId++) + { + if (CheckBagHasSpace(itemId, MAX_BAG_ITEM_CAPACITY)) + AddBagItem(itemId, MAX_BAG_ITEM_CAPACITY); + } } +static void DebugAction_Fill_PocketTMHM(u8 taskId) +{ + u16 itemId; -static void DebugAction_AccessPC(u8 taskId) + for (itemId = ITEM_TM01; itemId <= ITEM_HM08; itemId++) + { + if (CheckBagHasSpace(itemId, 1) && ItemIdToBattleMoveId(itemId) != MOVE_NONE) + AddBagItem(itemId, 1); + } +} +static void DebugAction_Fill_PocketBerries(u8 taskId) { - Debug_DestroyMenu_Full(taskId); - LockPlayerFieldControls(); - ScriptContext_SetupScript(EventScript_PC); + u16 itemId; + + for (itemId = FIRST_BERRY_INDEX; itemId < LAST_BERRY_INDEX; itemId++) + { + if (CheckBagHasSpace(itemId, MAX_BERRY_CAPACITY)) + AddBagItem(itemId, MAX_BERRY_CAPACITY); + } } +static void DebugAction_Fill_PocketKeyItems(u8 taskId) +{ + u16 itemId; + for (itemId = 1; itemId < ITEMS_COUNT; itemId++) + { + if (ItemId_GetPocket(itemId) == POCKET_KEY_ITEMS && CheckBagHasSpace(itemId, 1)) + AddBagItem(itemId, 1); + } +} // ******************************* -// Sound Scripts +// Actions Sound static const u8 *const sBGMNames[]; static const u8 *const sSENames[]; static void DebugAction_Sound_SE(u8 taskId) @@ -2861,7 +3599,7 @@ static void DebugAction_Sound_SE(u8 taskId) HideMapNamePopUpWindow(); LoadMessageBoxAndBorderGfx(); - windowId = AddWindow(&sDebugNumberDisplayLargeWindowTemplate); + windowId = AddWindow(&sDebugMenuWindowTemplateSound); DrawStdWindowFrame(windowId, FALSE); CopyWindowToVram(windowId, 3); @@ -2938,7 +3676,7 @@ static void DebugAction_Sound_MUS(u8 taskId) HideMapNamePopUpWindow(); LoadMessageBoxAndBorderGfx(); - windowId = AddWindow(&sDebugNumberDisplayLargeWindowTemplate); + windowId = AddWindow(&sDebugMenuWindowTemplateSound); DrawStdWindowFrame(windowId, FALSE); CopyWindowToVram(windowId, 3); @@ -3563,4 +4301,12 @@ SOUND_LIST_SE }; #undef X +// ******************************* +// Actions Other + +static void DebugAction_AccessPC(u8 taskId) +{ + Debug_DestroyMenu_Full_Script(taskId, EventScript_PC); +} + #endif //DEBUG_OVERWORLD_MENU == TRUE diff --git a/src/pokemon.c b/src/pokemon.c index cf2c8f5cc86a..881eeab8bc3f 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -4287,6 +4287,40 @@ void GiveBoxMonInitialMoveset(struct BoxPokemon *boxMon) } } +void GiveMonInitialMoveset_Fast(struct Pokemon *mon) +{ + GiveBoxMonInitialMoveset_Fast(&mon->box); +} + +void GiveBoxMonInitialMoveset_Fast(struct BoxPokemon *boxMon) //Credit: AsparagusEduardo +{ + u16 species = GetBoxMonData(boxMon, MON_DATA_SPECIES, NULL); + s32 level = GetLevelFromBoxMonExp(boxMon); + s32 i, j; + u16 levelMoveCount = 0; + u16 moves[MAX_MON_MOVES] = {0}; + u8 addedMoves = 0; + + for (i = 0; gLevelUpLearnsets[species][i].move != LEVEL_UP_END; i++) + levelMoveCount++; + + for (i = levelMoveCount; (i >= 0 && addedMoves < MAX_MON_MOVES); i--) + { + if (gLevelUpLearnsets[species][i].level > level) + continue; + if (gLevelUpLearnsets[species][i].level == 0) + continue; + + if (moves[addedMoves] != gLevelUpLearnsets[species][i].move) + moves[addedMoves++] = gLevelUpLearnsets[species][i].move; + } + for (i = MAX_MON_MOVES - 1; i >= 0; i--) + { + SetBoxMonData(boxMon, MON_DATA_MOVE1 + i, &moves[i]); + SetBoxMonData(boxMon, MON_DATA_PP1 + i, &gBattleMoves[moves[i]].pp); + } +} + u16 MonTryLearningNewMove(struct Pokemon *mon, bool8 firstMove) { u32 retVal = MOVE_NONE; diff --git a/src/wild_encounter.c b/src/wild_encounter.c index b01b5bd5dc38..aa4ffe4ca5fc 100644 --- a/src/wild_encounter.c +++ b/src/wild_encounter.c @@ -1113,3 +1113,13 @@ bool8 TryDoDoubleWildBattle(void) #endif return FALSE; } + +bool8 StandardWildEncounter_Debug(void) +{ + u16 headerId = GetCurrentMapWildMonHeaderId(); + if (TryGenerateWildMon(gWildMonHeaders[headerId].landMonsInfo, WILD_AREA_LAND, 0) != TRUE) + return FALSE; + + DoStandardWildBattle_Debug(); + return TRUE; +}