mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-01-13 07:03:40 +01:00
4340 lines
162 KiB
C
4340 lines
162 KiB
C
//CREDITS
|
|
//TheXaman: https://github.com/TheXaman/pokeemerald/tree/tx_debug_system
|
|
//CODE USED FROM:
|
|
//ketsuban: https://github.com/pret/pokeemerald/wiki/Add-a-debug-menu
|
|
//Pyredrid: https://github.com/Pyredrid/pokeemerald/tree/debugmenu
|
|
//AsparagusEduardo: https://github.com/AsparagusEduardo/pokeemerald/tree/InfusedEmerald_v2
|
|
//Ghoulslash: https://github.com/ghoulslash/pokeemerald
|
|
//Jaizu: https://jaizu.moe/
|
|
#include "global.h"
|
|
#include "battle.h"
|
|
#include "battle_setup.h"
|
|
#include "clock.h"
|
|
#include "coins.h"
|
|
#include "credits.h"
|
|
#include "data.h"
|
|
#include "daycare.h"
|
|
#include "debug.h"
|
|
#include "event_data.h"
|
|
#include "event_object_movement.h"
|
|
#include "event_scripts.h"
|
|
#include "field_message_box.h"
|
|
#include "field_screen_effect.h"
|
|
#include "field_weather.h"
|
|
#include "international_string_util.h"
|
|
#include "item.h"
|
|
#include "item_icon.h"
|
|
#include "list_menu.h"
|
|
#include "m4a.h"
|
|
#include "main.h"
|
|
#include "main_menu.h"
|
|
#include "malloc.h"
|
|
#include "map_name_popup.h"
|
|
#include "menu.h"
|
|
#include "money.h"
|
|
#include "naming_screen.h"
|
|
#include "new_game.h"
|
|
#include "overworld.h"
|
|
#include "palette.h"
|
|
#include "party_menu.h"
|
|
#include "pokedex.h"
|
|
#include "pokemon.h"
|
|
#include "pokemon_icon.h"
|
|
#include "pokemon_storage_system.h"
|
|
#include "random.h"
|
|
#include "region_map.h"
|
|
#include "script.h"
|
|
#include "script_pokemon_util.h"
|
|
#include "sound.h"
|
|
#include "strings.h"
|
|
#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"
|
|
#include "constants/map_groups.h"
|
|
#include "constants/rgb.h"
|
|
#include "constants/songs.h"
|
|
#include "constants/species.h"
|
|
#include "constants/weather.h"
|
|
#include "save.h"
|
|
|
|
#if DEBUG_OVERWORLD_MENU == TRUE
|
|
// *******************************
|
|
// Enums
|
|
enum { // Main
|
|
DEBUG_MENU_ITEM_UTILITIES,
|
|
DEBUG_MENU_ITEM_SCRIPTS,
|
|
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
|
|
};
|
|
enum { // Util
|
|
DEBUG_UTIL_MENU_ITEM_HEAL_PARTY,
|
|
DEBUG_UTIL_MENU_ITEM_FLY,
|
|
DEBUG_UTIL_MENU_ITEM_WARP,
|
|
DEBUG_UTIL_MENU_ITEM_POISON_MONS,
|
|
DEBUG_UTIL_MENU_ITEM_SAVEBLOCK,
|
|
DEBUG_UTIL_MENU_ITEM_WEATHER,
|
|
DEBUG_UTIL_MENU_ITEM_CHECKWALLCLOCK,
|
|
DEBUG_UTIL_MENU_ITEM_SETWALLCLOCK,
|
|
DEBUG_UTIL_MENU_ITEM_WATCHCREDITS,
|
|
DEBUG_UTIL_MENU_ITEM_TRAINER_NAME,
|
|
DEBUG_UTIL_MENU_ITEM_TRAINER_GENDER,
|
|
DEBUG_UTIL_MENU_ITEM_TRAINER_ID,
|
|
DEBUG_UTIL_MENU_ITEM_CLEAR_BOXES,
|
|
DEBUG_UTIL_MENU_ITEM_CHEAT,
|
|
DEBUG_UTIL_MENU_ITEM_HATCH_AN_EGG,
|
|
};
|
|
enum { // Scripts
|
|
DEBUG_UTIL_MENU_ITEM_SCRIPT_1,
|
|
DEBUG_UTIL_MENU_ITEM_SCRIPT_2,
|
|
DEBUG_UTIL_MENU_ITEM_SCRIPT_3,
|
|
DEBUG_UTIL_MENU_ITEM_SCRIPT_4,
|
|
DEBUG_UTIL_MENU_ITEM_SCRIPT_5,
|
|
DEBUG_UTIL_MENU_ITEM_SCRIPT_6,
|
|
DEBUG_UTIL_MENU_ITEM_SCRIPT_7,
|
|
DEBUG_UTIL_MENU_ITEM_SCRIPT_8,
|
|
};
|
|
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 { // 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,
|
|
DEBUG_GIVE_MENU_ITEM_POKEMON_SIMPLE,
|
|
DEBUG_GIVE_MENU_ITEM_POKEMON_COMPLEX,
|
|
DEBUG_GIVE_MENU_ITEM_MAX_MONEY,
|
|
DEBUG_GIVE_MENU_ITEM_MAX_COINS,
|
|
DEBUG_GIVE_MENU_ITEM_MAX_BATTLE_POINTS,
|
|
DEBUG_GIVE_MENU_ITEM_DAYCARE_EGG,
|
|
};
|
|
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,
|
|
DEBUG_SOUND_MENU_ITEM_MUS,
|
|
};
|
|
|
|
// *******************************
|
|
// Constants
|
|
#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_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
|
|
#define DEBUG_NUMBER_DIGITS_VARIABLE_VALUE 5
|
|
#define DEBUG_NUMBER_DIGITS_ITEMS 4
|
|
#define DEBUG_NUMBER_DIGITS_ITEM_QUANTITY 3
|
|
|
|
#define DEBUG_NUMBER_ICON_X 210
|
|
#define DEBUG_NUMBER_ICON_Y 50
|
|
|
|
#define DEBUG_MAX_MENU_ITEMS 50
|
|
|
|
// *******************************
|
|
struct DebugMonData
|
|
{
|
|
u16 mon_speciesId;
|
|
u8 mon_level;
|
|
u8 isShiny;
|
|
u16 mon_natureId;
|
|
u16 mon_abilityNum;
|
|
u8 mon_iv_hp;
|
|
u8 mon_iv_atk;
|
|
u8 mon_iv_def;
|
|
u8 mon_iv_speed;
|
|
u8 mon_iv_satk;
|
|
u8 mon_iv_sdef;
|
|
u16 mon_move_0;
|
|
u16 mon_move_1;
|
|
u16 mon_move_2;
|
|
u16 mon_move_3;
|
|
};
|
|
|
|
struct DebugMenuListData
|
|
{
|
|
struct ListMenuItem listItems[20 + 1];
|
|
u8 itemNames[DEBUG_MAX_MENU_ITEMS + 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);
|
|
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);
|
|
static void DebugAction_Util_Script_3(u8 taskId);
|
|
static void DebugAction_Util_Script_4(u8 taskId);
|
|
static void DebugAction_Util_Script_5(u8 taskId);
|
|
static void DebugAction_Util_Script_6(u8 taskId);
|
|
static void DebugAction_Util_Script_7(u8 taskId);
|
|
static void DebugAction_Util_Script_8(u8 taskId);
|
|
|
|
static void DebugAction_OpenUtilitiesMenu(u8 taskId);
|
|
static void DebugAction_OpenScriptsMenu(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_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);
|
|
static void DebugAction_Util_Fly(u8 taskId);
|
|
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_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);
|
|
static void DebugAction_Util_Weather_SelectId(u8 taskId);
|
|
static void DebugAction_Util_CheckWallClock(u8 taskId);
|
|
static void DebugAction_Util_SetWallClock(u8 taskId);
|
|
static void DebugAction_Util_WatchCredits(u8 taskId);
|
|
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_Util_CheatStart(u8 taskId);
|
|
static void DebugAction_Util_HatchAnEgg(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);
|
|
static void DebugAction_Give_Item_SelectQuantity(u8 taskId);
|
|
static void DebugAction_Give_AllTMs(u8 taskId);
|
|
static void DebugAction_Give_PokemonSimple(u8 taskId);
|
|
static void DebugAction_Give_PokemonComplex(u8 taskId);
|
|
static void DebugAction_Give_Pokemon_SelectId(u8 taskId);
|
|
static void DebugAction_Give_Pokemon_SelectLevel(u8 taskId);
|
|
static void DebugAction_Give_Pokemon_SelectShiny(u8 taskId);
|
|
static void DebugAction_Give_Pokemon_SelectNature(u8 taskId);
|
|
static void DebugAction_Give_Pokemon_SelectAbility(u8 taskId);
|
|
static void DebugAction_Give_Pokemon_SelectIVs(u8 taskId);
|
|
static void DebugAction_Give_Pokemon_ComplexCreateMon(u8 taskId);
|
|
static void DebugAction_Give_Pokemon_Move(u8 taskId);
|
|
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_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);
|
|
|
|
|
|
extern const u8 Debug_FlagsNotSetOverworldConfigMessage[];
|
|
extern const u8 Debug_FlagsNotSetBattleConfigMessage[];
|
|
extern const u8 Debug_Script_1[];
|
|
extern const u8 Debug_Script_2[];
|
|
extern const u8 Debug_Script_3[];
|
|
extern const u8 Debug_Script_4[];
|
|
extern const u8 Debug_Script_5[];
|
|
extern const u8 Debug_Script_6[];
|
|
extern const u8 Debug_Script_7[];
|
|
extern const u8 Debug_Script_8[];
|
|
extern const u8 DebugScript_DaycareMonsNotCompatible[];
|
|
extern const u8 DebugScript_OneDaycareMons[];
|
|
extern const u8 DebugScript_ZeroDaycareMons[];
|
|
|
|
extern const u8 Debug_ShowFieldMessageStringVar4[];
|
|
extern const u8 Debug_CheatStart[];
|
|
extern const u8 Debug_HatchAnEgg[];
|
|
extern const u8 PlayersHouse_2F_EventScript_SetWallClock[];
|
|
extern const u8 PlayersHouse_2F_EventScript_CheckWallClock[];
|
|
extern const u8 Debug_CheckSaveBlock[];
|
|
extern const 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…{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");
|
|
// Util Menu
|
|
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");
|
|
static const u8 sDebugText_Util_HatchAnEgg[] = _("Hatch an Egg");
|
|
// 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 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…{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} ");
|
|
static const u8 digitInidicator_100[] = _("{LEFT_ARROW}+100{RIGHT_ARROW} ");
|
|
static const u8 digitInidicator_1000[] = _("{LEFT_ARROW}+1000{RIGHT_ARROW} ");
|
|
static const u8 digitInidicator_10000[] = _("{LEFT_ARROW}+10000{RIGHT_ARROW} ");
|
|
static const u8 digitInidicator_100000[] = _("{LEFT_ARROW}+100000{RIGHT_ARROW} ");
|
|
static const u8 digitInidicator_1000000[] = _("{LEFT_ARROW}+1000000{RIGHT_ARROW} ");
|
|
static const u8 digitInidicator_10000000[] = _("{LEFT_ARROW}+10000000{RIGHT_ARROW} ");
|
|
const u8 * const gText_DigitIndicator[] =
|
|
{
|
|
digitInidicator_1,
|
|
digitInidicator_10,
|
|
digitInidicator_100,
|
|
digitInidicator_1000,
|
|
digitInidicator_10000,
|
|
digitInidicator_100000,
|
|
digitInidicator_1000000,
|
|
digitInidicator_10000000
|
|
};
|
|
static const s32 sPowersOfTen[] =
|
|
{
|
|
1,
|
|
10,
|
|
100,
|
|
1000,
|
|
10000,
|
|
100000,
|
|
1000000,
|
|
10000000,
|
|
100000000,
|
|
1000000000,
|
|
};
|
|
|
|
// *******************************
|
|
// 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_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_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},
|
|
[DEBUG_UTIL_MENU_ITEM_HATCH_AN_EGG] = {sDebugText_Util_HatchAnEgg, DEBUG_UTIL_MENU_ITEM_HATCH_AN_EGG},
|
|
};
|
|
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},
|
|
};
|
|
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_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_Battle_2[] =
|
|
{
|
|
[DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_0] = {sDebugText_Battle_2_Terrain_0, DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_0},
|
|
[DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_1] = {sDebugText_Battle_2_Terrain_1, DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_1},
|
|
[DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_2] = {sDebugText_Battle_2_Terrain_2, DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_2},
|
|
[DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_3] = {sDebugText_Battle_2_Terrain_3, DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_3},
|
|
[DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_4] = {sDebugText_Battle_2_Terrain_4, DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_4},
|
|
[DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_5] = {sDebugText_Battle_2_Terrain_5, DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_5},
|
|
[DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_6] = {sDebugText_Battle_2_Terrain_6, DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_6},
|
|
[DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_7] = {sDebugText_Battle_2_Terrain_7, DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_7},
|
|
[DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_8] = {sDebugText_Battle_2_Terrain_8, DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_8},
|
|
[DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_9] = {sDebugText_Battle_2_Terrain_9, DEBUG_BATTLE_2_MENU_ITEM_TERRAIN_9},
|
|
};
|
|
static const struct ListMenuItem sDebugMenu_Items_Give[] =
|
|
{
|
|
[DEBUG_GIVE_MENU_ITEM_ITEM_X] = {sDebugText_Give_GiveItem, DEBUG_GIVE_MENU_ITEM_ITEM_X},
|
|
[DEBUG_GIVE_MENU_ITEM_ALLTMS] = {sDebugText_Give_AllTMs, DEBUG_GIVE_MENU_ITEM_ALLTMS},
|
|
[DEBUG_GIVE_MENU_ITEM_POKEMON_SIMPLE] = {sDebugText_Give_GivePokemonSimple, DEBUG_GIVE_MENU_ITEM_POKEMON_SIMPLE},
|
|
[DEBUG_GIVE_MENU_ITEM_POKEMON_COMPLEX] = {sDebugText_Give_GivePokemonComplex, DEBUG_GIVE_MENU_ITEM_POKEMON_COMPLEX},
|
|
[DEBUG_GIVE_MENU_ITEM_MAX_MONEY] = {sDebugText_Give_MaxMoney, DEBUG_GIVE_MENU_ITEM_MAX_MONEY},
|
|
[DEBUG_GIVE_MENU_ITEM_MAX_COINS] = {sDebugText_Give_MaxCoins, DEBUG_GIVE_MENU_ITEM_MAX_COINS},
|
|
[DEBUG_GIVE_MENU_ITEM_MAX_BATTLE_POINTS] = {sDebugText_Give_BattlePoints, DEBUG_GIVE_MENU_ITEM_MAX_BATTLE_POINTS},
|
|
[DEBUG_GIVE_MENU_ITEM_DAYCARE_EGG] = {sDebugText_Give_DaycareEgg, DEBUG_GIVE_MENU_ITEM_DAYCARE_EGG},
|
|
};
|
|
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},
|
|
};
|
|
|
|
// *******************************
|
|
// Menu Actions
|
|
static void (*const sDebugMenu_Actions_Main[])(u8) =
|
|
{
|
|
[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_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,
|
|
[DEBUG_UTIL_MENU_ITEM_HATCH_AN_EGG] = DebugAction_Util_HatchAnEgg,
|
|
};
|
|
static void (*const sDebugMenu_Actions_Scripts[])(u8) =
|
|
{
|
|
[DEBUG_UTIL_MENU_ITEM_SCRIPT_1] = DebugAction_Util_Script_1,
|
|
[DEBUG_UTIL_MENU_ITEM_SCRIPT_2] = DebugAction_Util_Script_2,
|
|
[DEBUG_UTIL_MENU_ITEM_SCRIPT_3] = DebugAction_Util_Script_3,
|
|
[DEBUG_UTIL_MENU_ITEM_SCRIPT_4] = DebugAction_Util_Script_4,
|
|
[DEBUG_UTIL_MENU_ITEM_SCRIPT_5] = DebugAction_Util_Script_5,
|
|
[DEBUG_UTIL_MENU_ITEM_SCRIPT_6] = DebugAction_Util_Script_6,
|
|
[DEBUG_UTIL_MENU_ITEM_SCRIPT_7] = DebugAction_Util_Script_7,
|
|
[DEBUG_UTIL_MENU_ITEM_SCRIPT_8] = DebugAction_Util_Script_8,
|
|
};
|
|
static void (*const sDebugMenu_Actions_Flags[])(u8) =
|
|
{
|
|
[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) =
|
|
{
|
|
[DEBUG_GIVE_MENU_ITEM_ITEM_X] = DebugAction_Give_Item,
|
|
[DEBUG_GIVE_MENU_ITEM_ALLTMS] = DebugAction_Give_AllTMs,
|
|
[DEBUG_GIVE_MENU_ITEM_POKEMON_SIMPLE] = DebugAction_Give_PokemonSimple,
|
|
[DEBUG_GIVE_MENU_ITEM_POKEMON_COMPLEX] = DebugAction_Give_PokemonComplex,
|
|
[DEBUG_GIVE_MENU_ITEM_MAX_MONEY] = DebugAction_Give_MaxMoney,
|
|
[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,
|
|
};
|
|
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,
|
|
[DEBUG_SOUND_MENU_ITEM_MUS] = DebugAction_Sound_MUS,
|
|
};
|
|
|
|
|
|
// *******************************
|
|
// Windows
|
|
static const struct WindowTemplate sDebugMenuWindowTemplateMain =
|
|
{
|
|
.bg = 0,
|
|
.tilemapLeft = 1,
|
|
.tilemapTop = 1,
|
|
.width = DEBUG_MENU_WIDTH_MAIN,
|
|
.height = 2 * DEBUG_MENU_HEIGHT_MAIN,
|
|
.paletteNum = 15,
|
|
.baseBlock = 1,
|
|
};
|
|
static const struct WindowTemplate sDebugMenuWindowTemplateExtra =
|
|
{
|
|
.bg = 0,
|
|
.tilemapLeft = 30 - DEBUG_MENU_WIDTH_EXTRA - 1,
|
|
.tilemapTop = 1,
|
|
.width = DEBUG_MENU_WIDTH_EXTRA,
|
|
.height = 2 * DEBUG_MENU_HEIGHT_EXTRA,
|
|
.paletteNum = 15,
|
|
.baseBlock = 1,
|
|
};
|
|
static const struct WindowTemplate sDebugMenuWindowTemplateWeather =
|
|
{
|
|
.bg = 0,
|
|
.tilemapLeft = 30 - DEBUG_MENU_WIDTH_WEATHER - 1,
|
|
.tilemapTop = 1,
|
|
.width = DEBUG_MENU_WIDTH_WEATHER,
|
|
.height = 2 * DEBUG_MENU_HEIGHT_WEATHER,
|
|
.paletteNum = 15,
|
|
.baseBlock = 1,
|
|
};
|
|
static const struct WindowTemplate sDebugMenuWindowTemplateSound =
|
|
{
|
|
.bg = 0,
|
|
.tilemapLeft = 30 - DEBUG_MENU_WIDTH_SOUND - 1,
|
|
.tilemapTop = 1,
|
|
.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
|
|
static const struct ListMenuTemplate sDebugMenu_ListTemplate_Main =
|
|
{
|
|
.items = sDebugMenu_Items_Main,
|
|
.moveCursorFunc = ListMenuDefaultCursorMoveFunc,
|
|
.totalItems = ARRAY_COUNT(sDebugMenu_Items_Main),
|
|
};
|
|
static const struct ListMenuTemplate sDebugMenu_ListTemplate_Utilities =
|
|
{
|
|
.items = sDebugMenu_Items_Utilities,
|
|
.moveCursorFunc = ListMenuDefaultCursorMoveFunc,
|
|
.totalItems = ARRAY_COUNT(sDebugMenu_Items_Utilities),
|
|
};
|
|
static const struct ListMenuTemplate sDebugMenu_ListTemplate_Scripts =
|
|
{
|
|
.items = sDebugMenu_Items_Scripts,
|
|
.moveCursorFunc = ListMenuDefaultCursorMoveFunc,
|
|
.totalItems = ARRAY_COUNT(sDebugMenu_Items_Scripts),
|
|
};
|
|
static const struct ListMenuTemplate sDebugMenu_ListTemplate_FlagsVars =
|
|
{
|
|
.items = sDebugMenu_Items_FlagsVars,
|
|
.moveCursorFunc = ListMenuDefaultCursorMoveFunc,
|
|
.totalItems = ARRAY_COUNT(sDebugMenu_Items_FlagsVars),
|
|
};
|
|
static const struct ListMenuTemplate sDebugMenu_ListTemplate_Battle_0 =
|
|
{
|
|
.items = sDebugMenu_Items_Battle_0,
|
|
.moveCursorFunc = ListMenuDefaultCursorMoveFunc,
|
|
.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 =
|
|
{
|
|
.items = sDebugMenu_Items_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,
|
|
.moveCursorFunc = ListMenuDefaultCursorMoveFunc,
|
|
.totalItems = ARRAY_COUNT(sDebugMenu_Items_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);
|
|
}
|
|
static void Debug_ShowMenu(void (*HandleInput)(u8), struct ListMenuTemplate LMtemplate)
|
|
{
|
|
struct ListMenuTemplate menuTemplate;
|
|
u8 windowId;
|
|
u8 menuTaskId;
|
|
u8 inputTaskId;
|
|
|
|
// create window
|
|
HideMapNamePopUpWindow();
|
|
LoadMessageBoxAndBorderGfx();
|
|
windowId = AddWindow(&sDebugMenuWindowTemplateMain);
|
|
DrawStdWindowFrame(windowId, FALSE);
|
|
|
|
// create list menu
|
|
menuTemplate = LMtemplate;
|
|
menuTemplate.maxShowed = DEBUG_MENU_HEIGHT_MAIN;
|
|
menuTemplate.windowId = windowId;
|
|
menuTemplate.header_X = 0;
|
|
menuTemplate.item_X = 8;
|
|
menuTemplate.cursor_X = 0;
|
|
menuTemplate.upText_Y = 1;
|
|
menuTemplate.cursorPal = 2;
|
|
menuTemplate.fillValue = 1;
|
|
menuTemplate.cursorShadowPal = 3;
|
|
menuTemplate.lettersSpacing = 1;
|
|
menuTemplate.itemVerticalPadding = 0;
|
|
menuTemplate.scrollMultiple = LIST_NO_MULTIPLE_SCROLL;
|
|
menuTemplate.fontId = 1;
|
|
menuTemplate.cursorKind = 0;
|
|
menuTaskId = ListMenuInit(&menuTemplate, 0, 0);
|
|
|
|
// 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)
|
|
{
|
|
DestroyListMenuTask(gTasks[taskId].data[0], NULL, NULL);
|
|
RemoveWindow(gTasks[taskId].data[1]);
|
|
DestroyTask(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)
|
|
{
|
|
Debug_DestroyMenu_Full(taskId);
|
|
ScriptContext_Enable();
|
|
}
|
|
static void DebugAction_DestroyExtraWindow(u8 taskId)
|
|
{
|
|
ClearStdWindowAndFrame(gTasks[taskId].data[1], TRUE);
|
|
RemoveWindow(gTasks[taskId].data[1]);
|
|
|
|
ClearStdWindowAndFrame(gTasks[taskId].data[2], TRUE);
|
|
RemoveWindow(gTasks[taskId].data[2]);
|
|
|
|
DestroyListMenuTask(gTasks[taskId].data[0], NULL, NULL);
|
|
DestroyTask(taskId);
|
|
ScriptContext_Enable();
|
|
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_BUDPORT_CITY) &&
|
|
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;
|
|
}
|
|
|
|
// Failsafe to prevent memory corruption
|
|
totalItems = min(totalItems, DEBUG_MAX_MENU_ITEMS);
|
|
// 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
|
|
static void DebugTask_HandleMenuInput_Main(u8 taskId)
|
|
{
|
|
void (*func)(u8);
|
|
u32 input = ListMenu_ProcessInput(gTasks[taskId].data[0]);
|
|
|
|
if (JOY_NEW(A_BUTTON))
|
|
{
|
|
PlaySE(SE_SELECT);
|
|
if ((func = sDebugMenu_Actions_Main[input]) != NULL)
|
|
func(taskId);
|
|
}
|
|
else if (JOY_NEW(B_BUTTON))
|
|
{
|
|
PlaySE(SE_SELECT);
|
|
Debug_DestroyMenu_Full(taskId);
|
|
ScriptContext_Enable();
|
|
}
|
|
}
|
|
static void DebugTask_HandleMenuInput_Utilities(u8 taskId)
|
|
{
|
|
void (*func)(u8);
|
|
u32 input = ListMenu_ProcessInput(gTasks[taskId].data[0]);
|
|
|
|
if (JOY_NEW(A_BUTTON))
|
|
{
|
|
PlaySE(SE_SELECT);
|
|
if ((func = sDebugMenu_Actions_Utilities[input]) != NULL)
|
|
func(taskId);
|
|
}
|
|
else if (JOY_NEW(B_BUTTON))
|
|
{
|
|
PlaySE(SE_SELECT);
|
|
Debug_DestroyMenu(taskId);
|
|
Debug_ReShowMainMenu();
|
|
}
|
|
}
|
|
static void DebugTask_HandleMenuInput_Scripts(u8 taskId)
|
|
{
|
|
void (*func)(u8);
|
|
u32 input = ListMenu_ProcessInput(gTasks[taskId].data[0]);
|
|
|
|
if (JOY_NEW(A_BUTTON))
|
|
{
|
|
PlaySE(SE_SELECT);
|
|
if ((func = sDebugMenu_Actions_Scripts[input]) != NULL)
|
|
func(taskId);
|
|
}
|
|
else if (JOY_NEW(B_BUTTON))
|
|
{
|
|
PlaySE(SE_SELECT);
|
|
Debug_DestroyMenu(taskId);
|
|
Debug_ReShowMainMenu();
|
|
}
|
|
}
|
|
static void DebugTask_HandleMenuInput_FlagsVars(u8 taskId)
|
|
{
|
|
void (*func)(u8);
|
|
u32 input = ListMenu_ProcessInput(gTasks[taskId].data[0]);
|
|
|
|
if (JOY_NEW(A_BUTTON))
|
|
{
|
|
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_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_Give(u8 taskId)
|
|
{
|
|
void (*func)(u8);
|
|
u32 input = ListMenu_ProcessInput(gTasks[taskId].data[0]);
|
|
|
|
if (JOY_NEW(A_BUTTON))
|
|
{
|
|
PlaySE(SE_SELECT);
|
|
if ((func = sDebugMenu_Actions_Give[input]) != NULL)
|
|
func(taskId);
|
|
}
|
|
else if (JOY_NEW(B_BUTTON))
|
|
{
|
|
PlaySE(SE_SELECT);
|
|
Debug_DestroyMenu(taskId);
|
|
Debug_ReShowMainMenu();
|
|
}
|
|
}
|
|
static void DebugTask_HandleMenuInput_Fill(u8 taskId)
|
|
{
|
|
void (*func)(u8);
|
|
u32 input = ListMenu_ProcessInput(gTasks[taskId].data[0]);
|
|
|
|
if (gMain.newKeys & A_BUTTON)
|
|
{
|
|
PlaySE(SE_SELECT);
|
|
if ((func = sDebugMenu_Actions_Fill[input]) != NULL)
|
|
func(taskId);
|
|
}
|
|
else if (gMain.newKeys & B_BUTTON)
|
|
{
|
|
PlaySE(SE_SELECT);
|
|
Debug_DestroyMenu(taskId);
|
|
Debug_ReShowMainMenu();
|
|
}
|
|
}
|
|
static void DebugTask_HandleMenuInput_Sound(u8 taskId)
|
|
{
|
|
void (*func)(u8);
|
|
u32 input = ListMenu_ProcessInput(gTasks[taskId].data[0]);
|
|
|
|
if (JOY_NEW(A_BUTTON))
|
|
{
|
|
PlaySE(SE_SELECT);
|
|
if ((func = sDebugMenu_Actions_Sound[input]) != NULL)
|
|
func(taskId);
|
|
}
|
|
else if (JOY_NEW(B_BUTTON))
|
|
{
|
|
PlaySE(SE_SELECT);
|
|
Debug_DestroyMenu(taskId);
|
|
Debug_ReShowMainMenu();
|
|
}
|
|
}
|
|
|
|
// *******************************
|
|
// Open sub-menus
|
|
static void DebugAction_OpenUtilitiesMenu(u8 taskId)
|
|
{
|
|
Debug_DestroyMenu(taskId);
|
|
Debug_ShowMenu(DebugTask_HandleMenuInput_Utilities, sDebugMenu_ListTemplate_Utilities);
|
|
}
|
|
static void DebugAction_OpenScriptsMenu(u8 taskId)
|
|
{
|
|
Debug_DestroyMenu(taskId);
|
|
Debug_ShowMenu(DebugTask_HandleMenuInput_Scripts, sDebugMenu_ListTemplate_Scripts);
|
|
}
|
|
static void DebugAction_OpenFlagsVarsMenu(u8 taskId)
|
|
{
|
|
Debug_DestroyMenu(taskId);
|
|
sDebugMenuListData->listId = 0;
|
|
Debug_ShowMenu(DebugTask_HandleMenuInput_FlagsVars, gMultiuseListMenuTemplate);
|
|
}
|
|
|
|
static void DebugAction_OpenBattleMenu(u8 taskId)
|
|
{
|
|
Debug_DestroyMenu(taskId);
|
|
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)
|
|
{
|
|
PlaySE(SE_USE_ITEM);
|
|
HealPlayerParty();
|
|
ScriptContext_Enable();
|
|
Debug_DestroyMenu_Full(taskId);
|
|
}
|
|
static void DebugAction_Util_Fly(u8 taskId)
|
|
{
|
|
FlagSet(FLAG_VISITED_BUDPORT_CITY);
|
|
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);
|
|
Debug_DestroyMenu_Full(taskId);
|
|
SetMainCallback2(CB2_OpenFlyMap);
|
|
}
|
|
|
|
static void DebugAction_Util_Warp_Warp(u8 taskId)
|
|
{
|
|
u8 windowId;
|
|
|
|
ClearStdWindowAndFrame(gTasks[taskId].data[1], TRUE);
|
|
RemoveWindow(gTasks[taskId].data[1]);
|
|
|
|
HideMapNamePopUpWindow();
|
|
LoadMessageBoxAndBorderGfx();
|
|
windowId = AddWindow(&sDebugMenuWindowTemplateExtra);
|
|
DrawStdWindowFrame(windowId, FALSE);
|
|
|
|
CopyWindowToVram(windowId, 3);
|
|
|
|
ConvertIntToDecimalStringN(gStringVar1, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 2);
|
|
ConvertIntToDecimalStringN(gStringVar2, MAP_GROUPS_COUNT-1, STR_CONV_MODE_LEADING_ZEROS, 2);
|
|
StringExpandPlaceholders(gStringVar1, sDebugText_Util_WarpToMap_SelMax);
|
|
StringCopy(gStringVar3, gText_DigitIndicator[0]);
|
|
StringExpandPlaceholders(gStringVar4, sDebugText_Util_WarpToMap_SelectMapGroup);
|
|
AddTextPrinterParameterized(windowId, 1, gStringVar4, 1, 1, 0, NULL);
|
|
|
|
gTasks[taskId].func = DebugAction_Util_Warp_SelectMapGroup;
|
|
gTasks[taskId].data[2] = windowId;
|
|
gTasks[taskId].data[3] = 0; //Current Flag
|
|
gTasks[taskId].data[4] = 0; //Digit Selected
|
|
gTasks[taskId].data[5] = 0; //Map Group
|
|
gTasks[taskId].data[6] = 0; //Map
|
|
gTasks[taskId].data[7] = 0; //warp
|
|
}
|
|
static void DebugAction_Util_Warp_SelectMapGroup(u8 taskId)
|
|
{
|
|
if (JOY_NEW(DPAD_ANY))
|
|
{
|
|
PlaySE(SE_SELECT);
|
|
if (JOY_NEW(DPAD_UP))
|
|
{
|
|
gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]];
|
|
if (gTasks[taskId].data[3] > MAP_GROUPS_COUNT - 1)
|
|
gTasks[taskId].data[3] = MAP_GROUPS_COUNT - 1;
|
|
}
|
|
if (JOY_NEW(DPAD_DOWN))
|
|
{
|
|
gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]];
|
|
if (gTasks[taskId].data[3] < 0)
|
|
gTasks[taskId].data[3] = 0;
|
|
}
|
|
if (JOY_NEW(DPAD_LEFT))
|
|
{
|
|
if (gTasks[taskId].data[4] > 0)
|
|
gTasks[taskId].data[4] -= 1;
|
|
}
|
|
if (JOY_NEW(DPAD_RIGHT))
|
|
{
|
|
if (gTasks[taskId].data[4] < 2)
|
|
gTasks[taskId].data[4] += 1;
|
|
}
|
|
|
|
ConvertIntToDecimalStringN(gStringVar1, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 2);
|
|
ConvertIntToDecimalStringN(gStringVar2, MAP_GROUPS_COUNT - 1, STR_CONV_MODE_LEADING_ZEROS, 2);
|
|
StringExpandPlaceholders(gStringVar1, sDebugText_Util_WarpToMap_SelMax);
|
|
StringCopy(gStringVar3, gText_DigitIndicator[gTasks[taskId].data[4]]);
|
|
StringExpandPlaceholders(gStringVar4, sDebugText_Util_WarpToMap_SelectMapGroup);
|
|
AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL);
|
|
}
|
|
|
|
if (JOY_NEW(A_BUTTON))
|
|
{
|
|
gTasks[taskId].data[5] = gTasks[taskId].data[3];
|
|
gTasks[taskId].data[3] = 0;
|
|
gTasks[taskId].data[4] = 0;
|
|
|
|
ConvertIntToDecimalStringN(gStringVar1, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, (MAP_GROUP_COUNT[gTasks[taskId].data[5]] - 1 >= 100) ? 3 : 2);
|
|
ConvertIntToDecimalStringN(gStringVar2, MAP_GROUP_COUNT[gTasks[taskId].data[5]] - 1, STR_CONV_MODE_LEADING_ZEROS, (MAP_GROUP_COUNT[gTasks[taskId].data[5]] - 1 >= 100) ? 3 : 2);
|
|
StringExpandPlaceholders(gStringVar1, sDebugText_Util_WarpToMap_SelMax);
|
|
GetMapName(gStringVar2, Overworld_GetMapHeaderByGroupAndId(gTasks[taskId].data[5], gTasks[taskId].data[3])->regionMapSectionId, 0);
|
|
StringCopy(gStringVar3, gText_DigitIndicator[gTasks[taskId].data[4]]);
|
|
StringExpandPlaceholders(gStringVar4, sDebugText_Util_WarpToMap_SelectMap);
|
|
AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL);
|
|
|
|
gTasks[taskId].func = DebugAction_Util_Warp_SelectMap;
|
|
}
|
|
else if (JOY_NEW(B_BUTTON))
|
|
{
|
|
PlaySE(SE_SELECT);
|
|
DebugAction_DestroyExtraWindow(taskId);
|
|
}
|
|
}
|
|
static void DebugAction_Util_Warp_SelectMap(u8 taskId)
|
|
{
|
|
u8 max_value = MAP_GROUP_COUNT[gTasks[taskId].data[5]]; //maps in the selected map group
|
|
|
|
if (JOY_NEW(DPAD_ANY))
|
|
{
|
|
PlaySE(SE_SELECT);
|
|
if (JOY_NEW(DPAD_UP))
|
|
{
|
|
gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]];
|
|
if (gTasks[taskId].data[3] > max_value - 1)
|
|
gTasks[taskId].data[3] = max_value - 1;
|
|
}
|
|
if (JOY_NEW(DPAD_DOWN))
|
|
{
|
|
gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]];
|
|
if (gTasks[taskId].data[3] < 0)
|
|
gTasks[taskId].data[3] = 0;
|
|
}
|
|
if (JOY_NEW(DPAD_LEFT))
|
|
{
|
|
if (gTasks[taskId].data[4] > 0)
|
|
gTasks[taskId].data[4] -= 1;
|
|
}
|
|
if (JOY_NEW(DPAD_RIGHT))
|
|
{
|
|
if (gTasks[taskId].data[4] < 2)
|
|
gTasks[taskId].data[4] += 1;
|
|
}
|
|
|
|
ConvertIntToDecimalStringN(gStringVar1, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, (max_value >= 100) ? 3 : 2);
|
|
ConvertIntToDecimalStringN(gStringVar2, MAP_GROUP_COUNT[gTasks[taskId].data[5]] - 1, STR_CONV_MODE_LEADING_ZEROS, (max_value >= 100) ? 3 : 2);
|
|
StringExpandPlaceholders(gStringVar1, sDebugText_Util_WarpToMap_SelMax);
|
|
GetMapName(gStringVar2, Overworld_GetMapHeaderByGroupAndId(gTasks[taskId].data[5], gTasks[taskId].data[3])->regionMapSectionId, 0);
|
|
StringCopy(gStringVar3, gText_DigitIndicator[gTasks[taskId].data[4]]);
|
|
StringExpandPlaceholders(gStringVar4, sDebugText_Util_WarpToMap_SelectMap);
|
|
AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL);
|
|
}
|
|
|
|
if (JOY_NEW(A_BUTTON))
|
|
{
|
|
gTasks[taskId].data[6] = gTasks[taskId].data[3];
|
|
gTasks[taskId].data[3] = 0;
|
|
gTasks[taskId].data[4] = 0;
|
|
|
|
StringCopy(gStringVar3, gText_DigitIndicator[gTasks[taskId].data[4]]);
|
|
ConvertIntToDecimalStringN(gStringVar1, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 2);
|
|
StringExpandPlaceholders(gStringVar4, sDebugText_Util_WarpToMap_SelectWarp);
|
|
AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL);
|
|
gTasks[taskId].func = DebugAction_Util_Warp_SelectWarp;
|
|
}
|
|
else if (JOY_NEW(B_BUTTON))
|
|
{
|
|
PlaySE(SE_SELECT);
|
|
DebugAction_DestroyExtraWindow(taskId);
|
|
}
|
|
}
|
|
static void DebugAction_Util_Warp_SelectWarp(u8 taskId)
|
|
{
|
|
if (JOY_NEW(DPAD_ANY))
|
|
{
|
|
PlaySE(SE_SELECT);
|
|
if (JOY_NEW(DPAD_UP))
|
|
{
|
|
gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]];
|
|
if (gTasks[taskId].data[3] > 10)
|
|
gTasks[taskId].data[3] = 10;
|
|
}
|
|
if (JOY_NEW(DPAD_DOWN))
|
|
{
|
|
gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]];
|
|
if (gTasks[taskId].data[3] < 0)
|
|
gTasks[taskId].data[3] = 0;
|
|
}
|
|
|
|
StringCopy(gStringVar3, gText_DigitIndicator[gTasks[taskId].data[4]]);
|
|
ConvertIntToDecimalStringN(gStringVar1, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 2);
|
|
StringExpandPlaceholders(gStringVar4, sDebugText_Util_WarpToMap_SelectWarp);
|
|
AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL);
|
|
}
|
|
|
|
if (JOY_NEW(A_BUTTON))
|
|
{
|
|
gTasks[taskId].data[7] = gTasks[taskId].data[3];
|
|
//WARP
|
|
//If there's no warp with the number available, warp to the center of the map.
|
|
SetWarpDestinationToMapWarp(gTasks[taskId].data[5], gTasks[taskId].data[6], gTasks[taskId].data[7]);
|
|
DoWarp();
|
|
ResetInitialPlayerAvatarState();
|
|
DebugAction_DestroyExtraWindow(taskId);
|
|
}
|
|
else if (JOY_NEW(B_BUTTON))
|
|
{
|
|
PlaySE(SE_SELECT);
|
|
DebugAction_DestroyExtraWindow(taskId);
|
|
}
|
|
}
|
|
|
|
static void DebugAction_Util_PoisonMons(u8 taskId)
|
|
{
|
|
int i;
|
|
for (i = 0; i < PARTY_SIZE; i++)
|
|
{
|
|
if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES, 0)
|
|
&& GetMonData(&gPlayerParty[i], MON_DATA_SPECIES_OR_EGG) != SPECIES_NONE
|
|
&& GetMonData(&gPlayerParty[i], MON_DATA_SPECIES_OR_EGG) != SPECIES_EGG)
|
|
{
|
|
u32 curStatus = STATUS1_POISON;
|
|
SetMonData(&gPlayerParty[i], MON_DATA_STATUS, &curStatus);
|
|
}
|
|
}
|
|
PlaySE(SE_FIELD_POISON);
|
|
}
|
|
|
|
void CheckSaveBlock1Size(struct ScriptContext *ctx)
|
|
{
|
|
u32 currSb1Size = sizeof(struct SaveBlock1);
|
|
u32 maxSb1Size = SECTOR_DATA_SIZE * (SECTOR_ID_SAVEBLOCK1_END - SECTOR_ID_SAVEBLOCK1_START + 1);
|
|
ConvertIntToDecimalStringN(gStringVar1, currSb1Size, STR_CONV_MODE_LEFT_ALIGN, 6);
|
|
ConvertIntToDecimalStringN(gStringVar2, maxSb1Size, STR_CONV_MODE_LEFT_ALIGN, 6);
|
|
}
|
|
|
|
void CheckSaveBlock2Size(struct ScriptContext *ctx)
|
|
{
|
|
u32 currSb2Size = (sizeof(struct SaveBlock2));
|
|
u32 maxSb2Size = SECTOR_DATA_SIZE;
|
|
ConvertIntToDecimalStringN(gStringVar1, currSb2Size, STR_CONV_MODE_LEFT_ALIGN, 6);
|
|
ConvertIntToDecimalStringN(gStringVar2, maxSb2Size, STR_CONV_MODE_LEFT_ALIGN, 6);
|
|
}
|
|
|
|
void CheckPokemonStorageSize(struct ScriptContext *ctx)
|
|
{
|
|
u32 currPkmnStorageSize = sizeof(struct PokemonStorage);
|
|
u32 maxPkmnStorageSize = SECTOR_DATA_SIZE * (SECTOR_ID_PKMN_STORAGE_END - SECTOR_ID_PKMN_STORAGE_START + 1);
|
|
ConvertIntToDecimalStringN(gStringVar1, currPkmnStorageSize, STR_CONV_MODE_LEFT_ALIGN, 6);
|
|
ConvertIntToDecimalStringN(gStringVar2, maxPkmnStorageSize, STR_CONV_MODE_LEFT_ALIGN, 6);
|
|
}
|
|
|
|
static void DebugAction_Util_CheckSaveBlock(u8 taskId)
|
|
{
|
|
Debug_DestroyMenu_Full(taskId);
|
|
LockPlayerFieldControls();
|
|
ScriptContext_SetupScript(Debug_CheckSaveBlock);
|
|
}
|
|
|
|
static const u8 sWeatherNames[22][24] = {
|
|
[WEATHER_NONE] = _("NONE"),
|
|
[WEATHER_SUNNY_CLOUDS] = _("SUNNY CLOUDS"),
|
|
[WEATHER_SUNNY] = _("SUNNY"),
|
|
[WEATHER_RAIN] = _("RAIN"),
|
|
[WEATHER_SNOW] = _("SNOW"),
|
|
[WEATHER_RAIN_THUNDERSTORM] = _("RAIN THUNDERSTORM"),
|
|
[WEATHER_FOG_HORIZONTAL] = _("FOG HORIZONTAL"),
|
|
[WEATHER_VOLCANIC_ASH] = _("VOLCANIC ASH"),
|
|
[WEATHER_SANDSTORM] = _("SANDSTORM"),
|
|
[WEATHER_FOG_DIAGONAL] = _("FOG DIAGONAL"),
|
|
[WEATHER_UNDERWATER] = _("UNDERWATER"),
|
|
[WEATHER_SHADE] = _("SHADE"),
|
|
[WEATHER_DROUGHT] = _("DROUGHT"),
|
|
[WEATHER_DOWNPOUR] = _("DOWNPOUR"),
|
|
[WEATHER_UNDERWATER_BUBBLES] = _("UNDERWATER BUBBLES"),
|
|
[WEATHER_ABNORMAL] = _("ABNORMAL(NOT WORKING)"),
|
|
[WEATHER_ROUTE119_CYCLE] = _("ROUTE119 CYCLE"),
|
|
[WEATHER_ROUTE123_CYCLE] = _("ROUTE123 CYCLE"),
|
|
};
|
|
static const u8 sText_WeatherNotDefined[] = _("NOT DEFINED!!!");
|
|
static void DebugAction_Util_Weather(u8 taskId)
|
|
{
|
|
u8 windowId;
|
|
|
|
ClearStdWindowAndFrame(gTasks[taskId].data[1], TRUE);
|
|
RemoveWindow(gTasks[taskId].data[1]);
|
|
|
|
HideMapNamePopUpWindow();
|
|
LoadMessageBoxAndBorderGfx();
|
|
windowId = AddWindow(&sDebugMenuWindowTemplateWeather);
|
|
DrawStdWindowFrame(windowId, FALSE);
|
|
|
|
CopyWindowToVram(windowId, 3);
|
|
|
|
//Display initial ID
|
|
StringCopy(gStringVar2, gText_DigitIndicator[0]);
|
|
ConvertIntToDecimalStringN(gStringVar3, 1, STR_CONV_MODE_LEADING_ZEROS, 2);
|
|
StringCopyPadded(gStringVar1, sWeatherNames[0], CHAR_SPACE, 30);
|
|
StringExpandPlaceholders(gStringVar4, sDebugText_Util_Weather_ID);
|
|
AddTextPrinterParameterized(windowId, 1, gStringVar4, 1, 1, 0, NULL);
|
|
|
|
gTasks[taskId].func = DebugAction_Util_Weather_SelectId;
|
|
gTasks[taskId].data[2] = windowId;
|
|
gTasks[taskId].data[3] = 0; //Current ID
|
|
gTasks[taskId].data[4] = 0; //Digit Selected
|
|
}
|
|
static void DebugAction_Util_Weather_SelectId(u8 taskId)
|
|
{
|
|
if (JOY_NEW(DPAD_ANY))
|
|
{
|
|
PlaySE(SE_SELECT);
|
|
|
|
if (JOY_NEW(DPAD_UP))
|
|
{
|
|
gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]];
|
|
if (gTasks[taskId].data[3] > WEATHER_ROUTE123_CYCLE)
|
|
gTasks[taskId].data[3] = WEATHER_ROUTE123_CYCLE;
|
|
}
|
|
if (JOY_NEW(DPAD_DOWN))
|
|
{
|
|
gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]];
|
|
if (gTasks[taskId].data[3] < WEATHER_NONE)
|
|
gTasks[taskId].data[3] = WEATHER_NONE;
|
|
}
|
|
if (JOY_NEW(DPAD_LEFT))
|
|
{
|
|
if (gTasks[taskId].data[4] > 0)
|
|
gTasks[taskId].data[4] -= 1;
|
|
}
|
|
if (JOY_NEW(DPAD_RIGHT))
|
|
{
|
|
if (gTasks[taskId].data[4] < 2)
|
|
gTasks[taskId].data[4] += 1;
|
|
}
|
|
|
|
StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].data[4]]);
|
|
ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 2);
|
|
|
|
if (gTasks[taskId].data[3] <= 15 || gTasks[taskId].data[3] >= 20)
|
|
StringCopyPadded(gStringVar1, sWeatherNames[gTasks[taskId].data[3]], CHAR_SPACE, 30);
|
|
else
|
|
StringCopyPadded(gStringVar1, sText_WeatherNotDefined, CHAR_SPACE, 30);
|
|
|
|
StringExpandPlaceholders(gStringVar4, sDebugText_Util_Weather_ID);
|
|
AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL);
|
|
}
|
|
|
|
if (JOY_NEW(A_BUTTON))
|
|
{
|
|
if (gTasks[taskId].data[3] <= 14 || gTasks[taskId].data[3] >= 20)
|
|
{
|
|
gTasks[taskId].data[5] = gTasks[taskId].data[3];
|
|
SetWeather(gTasks[taskId].data[5]);
|
|
}
|
|
}
|
|
else if (JOY_NEW(B_BUTTON))
|
|
{
|
|
PlaySE(SE_SELECT);
|
|
DebugAction_DestroyExtraWindow(taskId);
|
|
}
|
|
}
|
|
|
|
static void DebugAction_Util_CheckWallClock(u8 taskId)
|
|
{
|
|
Debug_DestroyMenu_Full_Script(taskId, PlayersHouse_2F_EventScript_CheckWallClock);
|
|
}
|
|
static void DebugAction_Util_SetWallClock(u8 taskId)
|
|
{
|
|
Debug_DestroyMenu_Full_Script(taskId, PlayersHouse_2F_EventScript_SetWallClock);
|
|
}
|
|
static void DebugAction_Util_WatchCredits(u8 taskId)
|
|
{
|
|
struct Task* task = &gTasks[taskId];
|
|
Debug_DestroyMenu_Full(taskId);
|
|
SetMainCallback2(CB2_StartCreditsSequence);
|
|
}
|
|
static void DebugAction_Util_Trainer_Name(u8 taskId)
|
|
{
|
|
NewGameBirchSpeech_SetDefaultPlayerName(Random() % 20);
|
|
DoNamingScreen(0, gSaveBlock2Ptr->playerName, gSaveBlock2Ptr->playerGender, 0, 0, CB2_ReturnToFieldContinueScript);
|
|
}
|
|
static void DebugAction_Util_Trainer_Gender(u8 taskId)
|
|
{
|
|
if (gSaveBlock2Ptr->playerGender == 0) // 0 Male, 1 Female
|
|
gSaveBlock2Ptr->playerGender = 1;
|
|
else
|
|
gSaveBlock2Ptr->playerGender = 0;
|
|
Debug_DestroyMenu_Full(taskId);
|
|
ScriptContext_Enable();
|
|
}
|
|
static void DebugAction_Util_Trainer_Id(u8 taskId)
|
|
{
|
|
u32 trainerId = ((Random() << 16) | Random());
|
|
SetTrainerId(trainerId, gSaveBlock2Ptr->playerTrainerId);
|
|
Debug_DestroyMenu_Full(taskId);
|
|
ScriptContext_Enable();
|
|
}
|
|
static void DebugAction_Util_Clear_Boxes(u8 taskId)
|
|
{
|
|
ResetPokemonStorageSystem();
|
|
Debug_DestroyMenu_Full(taskId);
|
|
ScriptContext_Enable();
|
|
}
|
|
static void DebugAction_Util_CheatStart(u8 taskId)
|
|
{
|
|
InitTimeBasedEvents();
|
|
Debug_DestroyMenu_Full_Script(taskId, Debug_CheatStart);
|
|
}
|
|
static void DebugAction_Util_HatchAnEgg(u8 taskId)
|
|
{
|
|
Debug_DestroyMenu_Full_Script(taskId, Debug_HatchAnEgg);
|
|
}
|
|
|
|
// *******************************
|
|
// Actions Scripts
|
|
static void DebugAction_Util_Script_1(u8 taskId)
|
|
{
|
|
Debug_DestroyMenu_Full_Script(taskId, Debug_Script_1);
|
|
}
|
|
static void DebugAction_Util_Script_2(u8 taskId)
|
|
{
|
|
Debug_DestroyMenu_Full_Script(taskId, Debug_Script_2);
|
|
}
|
|
static void DebugAction_Util_Script_3(u8 taskId)
|
|
{
|
|
Debug_DestroyMenu_Full_Script(taskId, Debug_Script_3);
|
|
}
|
|
static void DebugAction_Util_Script_4(u8 taskId)
|
|
{
|
|
Debug_DestroyMenu_Full_Script(taskId, Debug_Script_4);
|
|
}
|
|
static void DebugAction_Util_Script_5(u8 taskId)
|
|
{
|
|
Debug_DestroyMenu_Full_Script(taskId, Debug_Script_5);
|
|
}
|
|
static void DebugAction_Util_Script_6(u8 taskId)
|
|
{
|
|
Debug_DestroyMenu_Full_Script(taskId, Debug_Script_6);
|
|
}
|
|
static void DebugAction_Util_Script_7(u8 taskId)
|
|
{
|
|
Debug_DestroyMenu_Full_Script(taskId, Debug_Script_7);
|
|
}
|
|
static void DebugAction_Util_Script_8(u8 taskId)
|
|
{
|
|
Debug_DestroyMenu_Full_Script(taskId, Debug_Script_8);
|
|
}
|
|
|
|
// *******************************
|
|
// Actions Flags and Vars
|
|
static void DebugAction_FlagsVars_Flags(u8 taskId)
|
|
{
|
|
u8 windowId;
|
|
|
|
ClearStdWindowAndFrame(gTasks[taskId].data[1], TRUE);
|
|
RemoveWindow(gTasks[taskId].data[1]);
|
|
|
|
HideMapNamePopUpWindow();
|
|
LoadMessageBoxAndBorderGfx();
|
|
windowId = AddWindow(&sDebugMenuWindowTemplateExtra);
|
|
DrawStdWindowFrame(windowId, FALSE);
|
|
|
|
CopyWindowToVram(windowId, 3);
|
|
|
|
//Display initial Flag
|
|
ConvertIntToDecimalStringN(gStringVar1, 1, STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_FLAGS);
|
|
ConvertIntToHexStringN(gStringVar2, 1, STR_CONV_MODE_LEFT_ALIGN, 3);
|
|
StringExpandPlaceholders(gStringVar1, sDebugText_FlagsVars_FlagHex);
|
|
if (FlagGet(FLAG_TEMP_1))
|
|
StringCopyPadded(gStringVar2, sDebugText_True, CHAR_SPACE, 15);
|
|
else
|
|
StringCopyPadded(gStringVar2, sDebugText_False, CHAR_SPACE, 15);
|
|
StringCopy(gStringVar3, gText_DigitIndicator[0]);
|
|
StringExpandPlaceholders(gStringVar4, sDebugText_FlagsVars_Flag);
|
|
AddTextPrinterParameterized(windowId, 1, gStringVar4, 1, 1, 0, NULL);
|
|
|
|
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_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;
|
|
}
|
|
|
|
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;
|
|
|
|
ClearStdWindowAndFrame(gTasks[taskId].data[1], TRUE);
|
|
RemoveWindow(gTasks[taskId].data[1]);
|
|
|
|
HideMapNamePopUpWindow();
|
|
LoadMessageBoxAndBorderGfx();
|
|
windowId = AddWindow(&sDebugMenuWindowTemplateExtra);
|
|
DrawStdWindowFrame(windowId, FALSE);
|
|
|
|
CopyWindowToVram(windowId, 3);
|
|
|
|
//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_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_FlagsVars_Variable);
|
|
AddTextPrinterParameterized(windowId, 1, gStringVar4, 1, 1, 0, NULL);
|
|
|
|
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_FlagsVars_Select(u8 taskId)
|
|
{
|
|
if (JOY_NEW(DPAD_UP))
|
|
{
|
|
gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]];
|
|
if (gTasks[taskId].data[3] > VARS_END)
|
|
gTasks[taskId].data[3] = VARS_END;
|
|
}
|
|
if (JOY_NEW(DPAD_DOWN))
|
|
{
|
|
gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]];
|
|
if (gTasks[taskId].data[3] < VARS_START)
|
|
gTasks[taskId].data[3] = VARS_START;
|
|
}
|
|
if (JOY_NEW(DPAD_LEFT))
|
|
{
|
|
gTasks[taskId].data[4] -= 1;
|
|
if (gTasks[taskId].data[4] < 0)
|
|
gTasks[taskId].data[4] = 0;
|
|
}
|
|
if (JOY_NEW(DPAD_RIGHT))
|
|
{
|
|
gTasks[taskId].data[4] += 1;
|
|
if (gTasks[taskId].data[4] > DEBUG_NUMBER_DIGITS_VARIABLES - 1)
|
|
gTasks[taskId].data[4] = DEBUG_NUMBER_DIGITS_VARIABLES - 1;
|
|
}
|
|
|
|
if (JOY_NEW(DPAD_ANY))
|
|
{
|
|
PlaySE(SE_SELECT);
|
|
|
|
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_FlagsVars_VariableHex);
|
|
if (VarGetIfExist(gTasks[taskId].data[3]) == 65535) //Current value, if 65535 the value hasnt been set
|
|
gTasks[taskId].data[5] = 0;
|
|
else
|
|
gTasks[taskId].data[5] = VarGet(gTasks[taskId].data[3]);
|
|
ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[5], STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_VARIABLES);
|
|
StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].data[4]]); //Current digit
|
|
|
|
//Combine str's to full window string
|
|
StringExpandPlaceholders(gStringVar4, sDebugText_FlagsVars_Variable);
|
|
AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL);
|
|
}
|
|
|
|
if (JOY_NEW(A_BUTTON))
|
|
{
|
|
gTasks[taskId].data[4] = 0;
|
|
|
|
PlaySE(SE_SELECT);
|
|
|
|
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_FlagsVars_VariableHex);
|
|
if (VarGetIfExist(gTasks[taskId].data[3]) == 65535) //Current value if 65535 the value hasnt been set
|
|
gTasks[taskId].data[5] = 0;
|
|
else
|
|
gTasks[taskId].data[5] = VarGet(gTasks[taskId].data[3]);
|
|
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_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_FlagsVars_SetValue;
|
|
}
|
|
else if (JOY_NEW(B_BUTTON))
|
|
{
|
|
PlaySE(SE_SELECT);
|
|
DebugAction_DestroyExtraWindow(taskId);
|
|
return;
|
|
}
|
|
}
|
|
static void DebugAction_FlagsVars_SetValue(u8 taskId)
|
|
{
|
|
if (JOY_NEW(DPAD_UP))
|
|
{
|
|
if (gTasks[taskId].data[6] + sPowersOfTen[gTasks[taskId].data[4]] <= 32000)
|
|
gTasks[taskId].data[6] += sPowersOfTen[gTasks[taskId].data[4]];
|
|
else
|
|
gTasks[taskId].data[6] = 32000 - 1;
|
|
|
|
if (gTasks[taskId].data[6] >= 32000)
|
|
gTasks[taskId].data[6] = 32000 - 1;
|
|
}
|
|
if (JOY_NEW(DPAD_DOWN))
|
|
{
|
|
gTasks[taskId].data[6] -= sPowersOfTen[gTasks[taskId].data[4]];
|
|
if (gTasks[taskId].data[6] < 0){
|
|
gTasks[taskId].data[6] = 0;
|
|
}
|
|
}
|
|
if (JOY_NEW(DPAD_LEFT))
|
|
{
|
|
gTasks[taskId].data[4] -= 1;
|
|
if (gTasks[taskId].data[4] < 0)
|
|
{
|
|
gTasks[taskId].data[4] = 0;
|
|
}
|
|
}
|
|
if (JOY_NEW(DPAD_RIGHT))
|
|
{
|
|
gTasks[taskId].data[4] += 1;
|
|
if (gTasks[taskId].data[4] > 4)
|
|
{
|
|
gTasks[taskId].data[4] = 4;
|
|
}
|
|
}
|
|
|
|
if (JOY_NEW(A_BUTTON))
|
|
{
|
|
PlaySE(SE_SELECT);
|
|
VarSet(gTasks[taskId].data[3], gTasks[taskId].data[6]);
|
|
}
|
|
else if (JOY_NEW(B_BUTTON))
|
|
{
|
|
PlaySE(SE_SELECT);
|
|
DebugAction_DestroyExtraWindow(taskId);
|
|
return;
|
|
}
|
|
|
|
if (JOY_NEW(DPAD_ANY) || JOY_NEW(A_BUTTON))
|
|
{
|
|
PlaySE(SE_SELECT);
|
|
|
|
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_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_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_BUDPORT_CITY);
|
|
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_BUDPORT_CITY);
|
|
FlagClear(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
|
|
#define ITEM_TAG 0xFDF3
|
|
static void DebugAction_Give_Item(u8 taskId)
|
|
{
|
|
u8 windowId;
|
|
|
|
ClearStdWindowAndFrame(gTasks[taskId].data[1], TRUE);
|
|
RemoveWindow(gTasks[taskId].data[1]);
|
|
|
|
HideMapNamePopUpWindow();
|
|
LoadMessageBoxAndBorderGfx();
|
|
windowId = AddWindow(&sDebugMenuWindowTemplateExtra);
|
|
DrawStdWindowFrame(windowId, FALSE);
|
|
|
|
CopyWindowToVram(windowId, 3);
|
|
|
|
//Display initial ID
|
|
StringCopy(gStringVar2, gText_DigitIndicator[0]);
|
|
ConvertIntToDecimalStringN(gStringVar3, 1, STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_ITEMS);
|
|
CopyItemName(1, gStringVar1);
|
|
StringCopyPadded(gStringVar1, gStringVar1, CHAR_SPACE, 15);
|
|
StringExpandPlaceholders(gStringVar4, sDebugText_ItemID);
|
|
AddTextPrinterParameterized(windowId, 1, gStringVar4, 1, 1, 0, NULL);
|
|
|
|
gTasks[taskId].func = DebugAction_Give_Item_SelectId;
|
|
gTasks[taskId].data[2] = windowId;
|
|
gTasks[taskId].data[3] = 1; //Current ID
|
|
gTasks[taskId].data[4] = 0; //Digit Selected
|
|
gTasks[taskId].data[6] = AddItemIconSprite(ITEM_TAG, ITEM_TAG, gTasks[taskId].data[3]);
|
|
gSprites[gTasks[taskId].data[6]].x2 = DEBUG_NUMBER_ICON_X+10;
|
|
gSprites[gTasks[taskId].data[6]].y2 = DEBUG_NUMBER_ICON_Y+10;
|
|
gSprites[gTasks[taskId].data[6]].oam.priority = 0;
|
|
}
|
|
static void DebugAction_Give_Item_SelectId(u8 taskId)
|
|
{
|
|
if (JOY_NEW(DPAD_ANY))
|
|
{
|
|
PlaySE(SE_SELECT);
|
|
|
|
if (JOY_NEW(DPAD_UP))
|
|
{
|
|
gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]];
|
|
if (gTasks[taskId].data[3] >= ITEMS_COUNT)
|
|
gTasks[taskId].data[3] = ITEMS_COUNT - 1;
|
|
}
|
|
if (JOY_NEW(DPAD_DOWN))
|
|
{
|
|
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))
|
|
{
|
|
if (gTasks[taskId].data[4] > 0)
|
|
gTasks[taskId].data[4] -= 1;
|
|
}
|
|
if (JOY_NEW(DPAD_RIGHT))
|
|
{
|
|
if (gTasks[taskId].data[4] < DEBUG_NUMBER_DIGITS_ITEMS - 1)
|
|
gTasks[taskId].data[4] += 1;
|
|
}
|
|
|
|
StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].data[4]]);
|
|
CopyItemName(gTasks[taskId].data[3], gStringVar1);
|
|
StringCopyPadded(gStringVar1, gStringVar1, CHAR_SPACE, 15);
|
|
ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_ITEMS);
|
|
StringExpandPlaceholders(gStringVar4, sDebugText_ItemID);
|
|
AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL);
|
|
|
|
FreeSpriteTilesByTag(ITEM_TAG); //Destroy item icon
|
|
FreeSpritePaletteByTag(ITEM_TAG); //Destroy item icon
|
|
FreeSpriteOamMatrix(&gSprites[gTasks[taskId].data[6]]); //Destroy item icon
|
|
DestroySprite(&gSprites[gTasks[taskId].data[6]]); //Destroy item icon
|
|
gTasks[taskId].data[6] = AddItemIconSprite(ITEM_TAG, ITEM_TAG, gTasks[taskId].data[3]);
|
|
gSprites[gTasks[taskId].data[6]].x2 = DEBUG_NUMBER_ICON_X+10;
|
|
gSprites[gTasks[taskId].data[6]].y2 = DEBUG_NUMBER_ICON_Y+10;
|
|
gSprites[gTasks[taskId].data[6]].oam.priority = 0;
|
|
}
|
|
|
|
if (JOY_NEW(A_BUTTON))
|
|
{
|
|
gTasks[taskId].data[5] = gTasks[taskId].data[3];
|
|
gTasks[taskId].data[3] = 1;
|
|
gTasks[taskId].data[4] = 0;
|
|
|
|
StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].data[4]]);
|
|
ConvertIntToDecimalStringN(gStringVar1, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_ITEM_QUANTITY);
|
|
StringCopyPadded(gStringVar1, gStringVar1, CHAR_SPACE, 15);
|
|
StringExpandPlaceholders(gStringVar4, sDebugText_ItemQuantity);
|
|
AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL);
|
|
|
|
gTasks[taskId].func = DebugAction_Give_Item_SelectQuantity;
|
|
}
|
|
else if (JOY_NEW(B_BUTTON))
|
|
{
|
|
FreeSpriteTilesByTag(ITEM_TAG); //Destroy item icon
|
|
FreeSpritePaletteByTag(ITEM_TAG); //Destroy item icon
|
|
FreeSpriteOamMatrix(&gSprites[gTasks[taskId].data[6]]); //Destroy item icon
|
|
DestroySprite(&gSprites[gTasks[taskId].data[6]]); //Destroy item icon
|
|
|
|
PlaySE(SE_SELECT);
|
|
DebugAction_DestroyExtraWindow(taskId);
|
|
}
|
|
}
|
|
static void DebugAction_Give_Item_SelectQuantity(u8 taskId)
|
|
{
|
|
u32 itemId = gTasks[taskId].data[5];
|
|
|
|
if (JOY_NEW(DPAD_ANY))
|
|
{
|
|
PlaySE(SE_SELECT);
|
|
|
|
if (JOY_NEW(DPAD_UP))
|
|
{
|
|
u32 maxCapacity = (ItemId_GetPocket(itemId) - 1 == BERRIES_POCKET) ? MAX_BERRY_CAPACITY : MAX_BAG_ITEM_CAPACITY;
|
|
gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]];
|
|
if (gTasks[taskId].data[3] > maxCapacity)
|
|
gTasks[taskId].data[3] = maxCapacity;
|
|
}
|
|
if (JOY_NEW(DPAD_DOWN))
|
|
{
|
|
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))
|
|
{
|
|
if (gTasks[taskId].data[4] > 0)
|
|
gTasks[taskId].data[4] -= 1;
|
|
}
|
|
if (JOY_NEW(DPAD_RIGHT))
|
|
{
|
|
if (gTasks[taskId].data[4] < 2)
|
|
gTasks[taskId].data[4] += 1;
|
|
}
|
|
|
|
StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].data[4]]);
|
|
ConvertIntToDecimalStringN(gStringVar1, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_ITEM_QUANTITY);
|
|
StringCopyPadded(gStringVar1, gStringVar1, CHAR_SPACE, 15);
|
|
StringExpandPlaceholders(gStringVar4, sDebugText_ItemQuantity);
|
|
AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL);
|
|
}
|
|
|
|
if (JOY_NEW(A_BUTTON))
|
|
{
|
|
FreeSpriteTilesByTag(ITEM_TAG); //Destroy item icon
|
|
FreeSpritePaletteByTag(ITEM_TAG); //Destroy item icon
|
|
FreeSpriteOamMatrix(&gSprites[gTasks[taskId].data[6]]); //Destroy item icon
|
|
DestroySprite(&gSprites[gTasks[taskId].data[6]]); //Destroy item icon
|
|
|
|
PlaySE(MUS_OBTAIN_ITEM);
|
|
AddBagItem(itemId, gTasks[taskId].data[3]);
|
|
DebugAction_DestroyExtraWindow(taskId);
|
|
}
|
|
else if (JOY_NEW(B_BUTTON))
|
|
{
|
|
FreeSpriteTilesByTag(ITEM_TAG); //Destroy item icon
|
|
FreeSpritePaletteByTag(ITEM_TAG); //Destroy item icon
|
|
FreeSpriteOamMatrix(&gSprites[gTasks[taskId].data[6]]); //Destroy item icon
|
|
DestroySprite(&gSprites[gTasks[taskId].data[6]]); //Destroy item icon
|
|
|
|
PlaySE(SE_SELECT);
|
|
DebugAction_DestroyExtraWindow(taskId);
|
|
}
|
|
}
|
|
|
|
//TMs
|
|
static void DebugAction_Give_AllTMs(u8 taskId)
|
|
{
|
|
u16 i;
|
|
PlayFanfare(MUS_OBTAIN_TMHM);
|
|
for (i = ITEM_TM01; i <= ITEM_HM08; i++)
|
|
{
|
|
if (ItemIdToBattleMoveId(i) != MOVE_NONE && !CheckBagHasItem(i, 1))
|
|
AddBagItem(i, 1);
|
|
}
|
|
Debug_DestroyMenu_Full(taskId);
|
|
ScriptContext_Enable();
|
|
}
|
|
|
|
//Pokemon
|
|
static void ResetMonDataStruct(struct DebugMonData *sDebugMonData)
|
|
{
|
|
sDebugMonData->mon_speciesId = 1;
|
|
sDebugMonData->mon_level = 1;
|
|
sDebugMonData->isShiny = 0;
|
|
sDebugMonData->mon_natureId = 0;
|
|
sDebugMonData->mon_abilityNum = 0;
|
|
sDebugMonData->mon_iv_hp = 0;
|
|
sDebugMonData->mon_iv_atk = 0;
|
|
sDebugMonData->mon_iv_def = 0;
|
|
sDebugMonData->mon_iv_speed = 0;
|
|
sDebugMonData->mon_iv_satk = 0;
|
|
sDebugMonData->mon_iv_sdef = 0;
|
|
}
|
|
static void DebugAction_Give_PokemonSimple(u8 taskId)
|
|
{
|
|
u8 windowId;
|
|
|
|
//Mon data struct
|
|
sDebugMonData = AllocZeroed(sizeof(struct DebugMonData));
|
|
ResetMonDataStruct(sDebugMonData);
|
|
|
|
//Window initialization
|
|
ClearStdWindowAndFrame(gTasks[taskId].data[1], TRUE);
|
|
RemoveWindow(gTasks[taskId].data[1]);
|
|
|
|
HideMapNamePopUpWindow();
|
|
LoadMessageBoxAndBorderGfx();
|
|
windowId = AddWindow(&sDebugMenuWindowTemplateExtra);
|
|
DrawStdWindowFrame(windowId, FALSE);
|
|
|
|
CopyWindowToVram(windowId, 3);
|
|
|
|
//Display initial ID
|
|
StringCopy(gStringVar2, gText_DigitIndicator[0]);
|
|
ConvertIntToDecimalStringN(gStringVar3, 1, STR_CONV_MODE_LEADING_ZEROS, 3);
|
|
StringCopy(gStringVar1, GetSpeciesName(1));
|
|
StringCopyPadded(gStringVar1, gStringVar1, CHAR_SPACE, 15);
|
|
StringExpandPlaceholders(gStringVar4, sDebugText_PokemonID);
|
|
AddTextPrinterParameterized(windowId, 1, gStringVar4, 1, 1, 0, NULL);
|
|
|
|
//Set task data
|
|
gTasks[taskId].func = DebugAction_Give_Pokemon_SelectId;
|
|
gTasks[taskId].data[2] = windowId;
|
|
gTasks[taskId].data[3] = 1; //Current ID
|
|
gTasks[taskId].data[4] = 0; //Digit Selected
|
|
gTasks[taskId].data[5] = 0; //Complex?
|
|
FreeMonIconPalettes(); //Free space for new pallete
|
|
LoadMonIconPalette(gTasks[taskId].data[3]); //Loads pallete for current mon
|
|
gTasks[taskId].data[6] = CreateMonIcon(gTasks[taskId].data[3], SpriteCB_MonIcon, DEBUG_NUMBER_ICON_X, DEBUG_NUMBER_ICON_Y, 4, 0); //Create pokemon sprite
|
|
gSprites[gTasks[taskId].data[6]].oam.priority = 0; //Mon Icon ID
|
|
}
|
|
static void DebugAction_Give_PokemonComplex(u8 taskId)
|
|
{
|
|
u8 windowId;
|
|
|
|
//Mon data struct
|
|
sDebugMonData = AllocZeroed(sizeof(struct DebugMonData));
|
|
ResetMonDataStruct(sDebugMonData);
|
|
|
|
//Window initialization
|
|
ClearStdWindowAndFrame(gTasks[taskId].data[1], TRUE);
|
|
RemoveWindow(gTasks[taskId].data[1]);
|
|
|
|
HideMapNamePopUpWindow();
|
|
LoadMessageBoxAndBorderGfx();
|
|
windowId = AddWindow(&sDebugMenuWindowTemplateExtra);
|
|
DrawStdWindowFrame(windowId, FALSE);
|
|
|
|
CopyWindowToVram(windowId, 3);
|
|
|
|
//Display initial ID
|
|
StringCopy(gStringVar2, gText_DigitIndicator[0]);
|
|
ConvertIntToDecimalStringN(gStringVar3, 1, STR_CONV_MODE_LEADING_ZEROS, 4);
|
|
StringCopy(gStringVar1, GetSpeciesName(1));
|
|
StringCopyPadded(gStringVar1, gStringVar1, CHAR_SPACE, 15);
|
|
StringExpandPlaceholders(gStringVar4, sDebugText_PokemonID);
|
|
AddTextPrinterParameterized(windowId, 1, gStringVar4, 1, 1, 0, NULL);
|
|
|
|
gTasks[taskId].func = DebugAction_Give_Pokemon_SelectId;
|
|
gTasks[taskId].data[2] = windowId;
|
|
gTasks[taskId].data[3] = 1; //Current ID
|
|
gTasks[taskId].data[4] = 0; //Digit Selected
|
|
gTasks[taskId].data[5] = 1; //Complex?
|
|
FreeMonIconPalettes(); //Free space for new palletes
|
|
LoadMonIconPalette(gTasks[taskId].data[3]); //Loads pallete for current mon
|
|
gTasks[taskId].data[6] = CreateMonIcon(gTasks[taskId].data[3], SpriteCB_MonIcon, DEBUG_NUMBER_ICON_X, DEBUG_NUMBER_ICON_Y, 4, 0); //Create pokemon sprite
|
|
gSprites[gTasks[taskId].data[6]].oam.priority = 0; //Mon Icon ID
|
|
gTasks[taskId].data[7] = 0; //iterator
|
|
}
|
|
|
|
static void DebugAction_Give_Pokemon_SelectId(u8 taskId)
|
|
{
|
|
if (JOY_NEW(DPAD_ANY))
|
|
{
|
|
PlaySE(SE_SELECT);
|
|
|
|
if (JOY_NEW(DPAD_UP))
|
|
{
|
|
gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]];
|
|
if (gTasks[taskId].data[3] >= NUM_SPECIES)
|
|
gTasks[taskId].data[3] = NUM_SPECIES - 1;
|
|
}
|
|
if (JOY_NEW(DPAD_DOWN))
|
|
{
|
|
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))
|
|
{
|
|
if (gTasks[taskId].data[4] > 0)
|
|
gTasks[taskId].data[4] -= 1;
|
|
}
|
|
if (JOY_NEW(DPAD_RIGHT))
|
|
{
|
|
if (gTasks[taskId].data[4] < DEBUG_NUMBER_DIGITS_ITEMS - 1)
|
|
gTasks[taskId].data[4] += 1;
|
|
}
|
|
|
|
StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].data[4]]);
|
|
StringCopy(gStringVar1, GetSpeciesName(gTasks[taskId].data[3])); //CopyItemName(gTasks[taskId].data[3], gStringVar1);
|
|
StringCopyPadded(gStringVar1, gStringVar1, CHAR_SPACE, 15);
|
|
ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 4);
|
|
StringExpandPlaceholders(gStringVar4, sDebugText_PokemonID);
|
|
AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL);
|
|
|
|
FreeAndDestroyMonIconSprite(&gSprites[gTasks[taskId].data[6]]);
|
|
FreeMonIconPalettes(); //Free space for new pallete
|
|
LoadMonIconPalette(gTasks[taskId].data[3]); //Loads pallete for current mon
|
|
gTasks[taskId].data[6] = CreateMonIcon(gTasks[taskId].data[3], SpriteCB_MonIcon, DEBUG_NUMBER_ICON_X, DEBUG_NUMBER_ICON_Y, 4, 0); //Create pokemon sprite
|
|
gSprites[gTasks[taskId].data[6]].oam.priority = 0;
|
|
}
|
|
|
|
if (JOY_NEW(A_BUTTON))
|
|
{
|
|
sDebugMonData->mon_speciesId = gTasks[taskId].data[3]; //Species ID
|
|
gTasks[taskId].data[3] = 1;
|
|
gTasks[taskId].data[4] = 0;
|
|
|
|
StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].data[4]]);
|
|
ConvertIntToDecimalStringN(gStringVar1, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 3);
|
|
StringCopyPadded(gStringVar1, gStringVar1, CHAR_SPACE, 15);
|
|
StringExpandPlaceholders(gStringVar4, sDebugText_PokemonLevel);
|
|
AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL);
|
|
|
|
gTasks[taskId].func = DebugAction_Give_Pokemon_SelectLevel;
|
|
}
|
|
else if (JOY_NEW(B_BUTTON))
|
|
{
|
|
PlaySE(SE_SELECT);
|
|
Free(sDebugMonData); //Frees EWRAM of MonData Struct
|
|
FreeMonIconPalettes();
|
|
FreeAndDestroyMonIconSprite(&gSprites[gTasks[taskId].data[6]]); //Destroy pokemon sprite
|
|
DebugAction_DestroyExtraWindow(taskId);
|
|
}
|
|
}
|
|
static void DebugAction_Give_Pokemon_SelectLevel(u8 taskId)
|
|
{
|
|
if (JOY_NEW(DPAD_ANY))
|
|
{
|
|
PlaySE(SE_SELECT);
|
|
|
|
if (JOY_NEW(DPAD_UP))
|
|
{
|
|
gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]];
|
|
if (gTasks[taskId].data[3] > 100)
|
|
gTasks[taskId].data[3] = 100;
|
|
}
|
|
if (JOY_NEW(DPAD_DOWN))
|
|
{
|
|
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))
|
|
{
|
|
if (gTasks[taskId].data[4] > 0)
|
|
gTasks[taskId].data[4] -= 1;
|
|
}
|
|
if (JOY_NEW(DPAD_RIGHT))
|
|
{
|
|
if (gTasks[taskId].data[4] < 2)
|
|
gTasks[taskId].data[4] += 1;
|
|
}
|
|
|
|
StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].data[4]]);
|
|
ConvertIntToDecimalStringN(gStringVar1, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 3);
|
|
StringCopyPadded(gStringVar1, gStringVar1, CHAR_SPACE, 15);
|
|
StringExpandPlaceholders(gStringVar4, sDebugText_PokemonLevel);
|
|
AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL);
|
|
}
|
|
|
|
if (JOY_NEW(A_BUTTON))
|
|
{
|
|
FreeMonIconPalettes();
|
|
FreeAndDestroyMonIconSprite(&gSprites[gTasks[taskId].data[6]]); //Destroy pokemon sprite
|
|
if (gTasks[taskId].data[5] == 0)
|
|
{
|
|
PlaySE(MUS_LEVEL_UP);
|
|
ScriptGiveMon(sDebugMonData->mon_speciesId, gTasks[taskId].data[3], ITEM_NONE, 0,0,0);
|
|
// Set flag for user convenience
|
|
FlagSet(FLAG_SYS_POKEMON_GET);
|
|
Free(sDebugMonData); //Frees EWRAM of MonData Struct
|
|
DebugAction_DestroyExtraWindow(taskId);
|
|
}
|
|
else
|
|
{
|
|
sDebugMonData->mon_level = gTasks[taskId].data[3]; //Level
|
|
gTasks[taskId].data[3] = 0;
|
|
gTasks[taskId].data[4] = 0;
|
|
|
|
ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 0);
|
|
StringCopyPadded(gStringVar3, gStringVar3, 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);
|
|
|
|
gTasks[taskId].func = DebugAction_Give_Pokemon_SelectShiny;
|
|
}
|
|
}
|
|
else if (JOY_NEW(B_BUTTON))
|
|
{
|
|
PlaySE(SE_SELECT);
|
|
Free(sDebugMonData); //Frees EWRAM of MonData Struct
|
|
FreeMonIconPalettes();
|
|
FreeAndDestroyMonIconSprite(&gSprites[gTasks[taskId].data[6]]); //Destroy pokemon sprite
|
|
DebugAction_DestroyExtraWindow(taskId);
|
|
}
|
|
}
|
|
//If complex
|
|
static void DebugAction_Give_Pokemon_SelectShiny(u8 taskId)
|
|
{
|
|
if (JOY_NEW(DPAD_ANY))
|
|
{
|
|
PlaySE(SE_SELECT);
|
|
|
|
if (JOY_NEW(DPAD_UP))
|
|
{
|
|
gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]];
|
|
if (gTasks[taskId].data[3] > 1)
|
|
gTasks[taskId].data[3] = 1;
|
|
}
|
|
if (JOY_NEW(DPAD_DOWN))
|
|
{
|
|
gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]];
|
|
if (gTasks[taskId].data[3] < 0)
|
|
gTasks[taskId].data[3] = 0;
|
|
}
|
|
|
|
if (gTasks[taskId].data[3] == 1)
|
|
StringCopyPadded(gStringVar2, sDebugText_True, CHAR_SPACE, 15);
|
|
else
|
|
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);
|
|
AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL);
|
|
}
|
|
|
|
if (JOY_NEW(A_BUTTON))
|
|
{
|
|
sDebugMonData->isShiny = gTasks[taskId].data[3]; //isShiny
|
|
gTasks[taskId].data[3] = 0;
|
|
gTasks[taskId].data[4] = 0;
|
|
|
|
StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].data[4]]);
|
|
ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 2);
|
|
StringCopyPadded(gStringVar3, gStringVar3, CHAR_SPACE, 15);
|
|
StringCopy(gStringVar1, gNatureNamePointers[0]);
|
|
StringExpandPlaceholders(gStringVar4, sDebugText_PokemonNature);
|
|
AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL);
|
|
|
|
gTasks[taskId].func = DebugAction_Give_Pokemon_SelectNature;
|
|
}
|
|
else if (JOY_NEW(B_BUTTON))
|
|
{
|
|
PlaySE(SE_SELECT);
|
|
Free(sDebugMonData); //Frees EWRAM of MonData Struct
|
|
DebugAction_DestroyExtraWindow(taskId);
|
|
}
|
|
}
|
|
static void DebugAction_Give_Pokemon_SelectNature(u8 taskId)
|
|
{
|
|
if (JOY_NEW(DPAD_ANY))
|
|
{
|
|
PlaySE(SE_SELECT);
|
|
|
|
if (JOY_NEW(DPAD_UP))
|
|
{
|
|
gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]];
|
|
if (gTasks[taskId].data[3] > NUM_NATURES-1)
|
|
gTasks[taskId].data[3] = NUM_NATURES-1;
|
|
}
|
|
if (JOY_NEW(DPAD_DOWN))
|
|
{
|
|
gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]];
|
|
if (gTasks[taskId].data[3] < 0)
|
|
gTasks[taskId].data[3] = 0;
|
|
}
|
|
|
|
StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].data[4]]);
|
|
ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 2);
|
|
StringCopyPadded(gStringVar3, gStringVar3, CHAR_SPACE, 15);
|
|
StringCopy(gStringVar1, gNatureNamePointers[gTasks[taskId].data[3]]);
|
|
StringExpandPlaceholders(gStringVar4, sDebugText_PokemonNature);
|
|
AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL);
|
|
}
|
|
|
|
if (JOY_NEW(A_BUTTON))
|
|
{
|
|
u8 abilityId;
|
|
sDebugMonData->mon_natureId = gTasks[taskId].data[3]; //NatureId
|
|
gTasks[taskId].data[3] = 0;
|
|
gTasks[taskId].data[4] = 0;
|
|
|
|
StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].data[4]]);
|
|
ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 2);
|
|
StringCopyPadded(gStringVar3, gStringVar3, CHAR_SPACE, 15);
|
|
abilityId = GetAbilityBySpecies(sDebugMonData->mon_speciesId, 0);
|
|
StringCopy(gStringVar1, gAbilityNames[abilityId]);
|
|
StringExpandPlaceholders(gStringVar4, sDebugText_PokemonAbility);
|
|
AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL);
|
|
|
|
gTasks[taskId].func = DebugAction_Give_Pokemon_SelectAbility;
|
|
}
|
|
else if (JOY_NEW(B_BUTTON))
|
|
{
|
|
PlaySE(SE_SELECT);
|
|
Free(sDebugMonData); //Frees EWRAM of MonData Struct
|
|
DebugAction_DestroyExtraWindow(taskId);
|
|
}
|
|
}
|
|
static void DebugAction_Give_Pokemon_SelectAbility(u8 taskId)
|
|
{
|
|
u16 abilityId;
|
|
u8 abilityCount = NUM_ABILITY_SLOTS - 1; //-1 for proper iteration
|
|
u8 i = 0;
|
|
|
|
if (JOY_NEW(DPAD_ANY))
|
|
{
|
|
PlaySE(SE_SELECT);
|
|
|
|
if (JOY_NEW(DPAD_UP))
|
|
{
|
|
gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]];
|
|
if (gTasks[taskId].data[3] > abilityCount)
|
|
gTasks[taskId].data[3] = abilityCount;
|
|
}
|
|
if (JOY_NEW(DPAD_DOWN))
|
|
{
|
|
gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]];
|
|
if (gTasks[taskId].data[3] < 0)
|
|
gTasks[taskId].data[3] = 0;
|
|
}
|
|
|
|
while (GetAbilityBySpecies(sDebugMonData->mon_speciesId, gTasks[taskId].data[3] - i) == ABILITY_NONE && gTasks[taskId].data[3] - i < NUM_ABILITY_SLOTS)
|
|
{
|
|
i++;
|
|
}
|
|
abilityId = GetAbilityBySpecies(sDebugMonData->mon_speciesId, gTasks[taskId].data[3] - i);
|
|
StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].data[4]]);
|
|
ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 2);
|
|
StringCopyPadded(gStringVar3, gStringVar3, CHAR_SPACE, 15);
|
|
StringCopy(gStringVar1, gAbilityNames[abilityId]);
|
|
StringExpandPlaceholders(gStringVar4, sDebugText_PokemonAbility);
|
|
AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL);
|
|
}
|
|
|
|
if (JOY_NEW(A_BUTTON))
|
|
{
|
|
sDebugMonData->mon_abilityNum = gTasks[taskId].data[3] - i; //AbilityNum
|
|
gTasks[taskId].data[3] = 0;
|
|
gTasks[taskId].data[4] = 0;
|
|
|
|
StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].data[4]]);
|
|
ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 2);
|
|
StringCopyPadded(gStringVar3, gStringVar3, CHAR_SPACE, 15);
|
|
StringExpandPlaceholders(gStringVar4, sDebugText_PokemonIV_0);
|
|
AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL);
|
|
|
|
gTasks[taskId].func = DebugAction_Give_Pokemon_SelectIVs;
|
|
}
|
|
else if (JOY_NEW(B_BUTTON))
|
|
{
|
|
PlaySE(SE_SELECT);
|
|
Free(sDebugMonData); //Frees EWRAM of MonData Struct
|
|
DebugAction_DestroyExtraWindow(taskId);
|
|
}
|
|
}
|
|
static void DebugAction_Give_Pokemon_SelectIVs(u8 taskId)
|
|
{
|
|
if (JOY_NEW(DPAD_ANY))
|
|
{
|
|
PlaySE(SE_SELECT);
|
|
|
|
if (JOY_NEW(DPAD_UP))
|
|
{
|
|
gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]];
|
|
if (gTasks[taskId].data[3] > 31)
|
|
gTasks[taskId].data[3] = 31;
|
|
}
|
|
if (JOY_NEW(DPAD_DOWN))
|
|
{
|
|
gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]];
|
|
if (gTasks[taskId].data[3] < 0)
|
|
gTasks[taskId].data[3] = 0;
|
|
}
|
|
if (JOY_NEW(DPAD_LEFT))
|
|
{
|
|
if (gTasks[taskId].data[4] > 0)
|
|
gTasks[taskId].data[4] -= 1;
|
|
}
|
|
if (JOY_NEW(DPAD_RIGHT))
|
|
{
|
|
if (gTasks[taskId].data[4] < 2)
|
|
gTasks[taskId].data[4] += 1;
|
|
}
|
|
|
|
StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].data[4]]);
|
|
ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 2);
|
|
StringCopyPadded(gStringVar3, gStringVar3, CHAR_SPACE, 15);
|
|
switch (gTasks[taskId].data[7])
|
|
{
|
|
case 0:
|
|
StringExpandPlaceholders(gStringVar4, sDebugText_PokemonIV_0);
|
|
break;
|
|
case 1:
|
|
StringExpandPlaceholders(gStringVar4, sDebugText_PokemonIV_1);
|
|
break;
|
|
case 2:
|
|
StringExpandPlaceholders(gStringVar4, sDebugText_PokemonIV_2);
|
|
break;
|
|
case 3:
|
|
StringExpandPlaceholders(gStringVar4, sDebugText_PokemonIV_3);
|
|
break;
|
|
case 4:
|
|
StringExpandPlaceholders(gStringVar4, sDebugText_PokemonIV_4);
|
|
break;
|
|
case 5:
|
|
StringExpandPlaceholders(gStringVar4, sDebugText_PokemonIV_5);
|
|
break;
|
|
}
|
|
AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL);
|
|
}
|
|
|
|
//If A or B button
|
|
if (JOY_NEW(A_BUTTON))
|
|
{
|
|
switch (gTasks[taskId].data[7])
|
|
{
|
|
case 0:
|
|
sDebugMonData->mon_iv_hp = gTasks[taskId].data[3];
|
|
break;
|
|
case 1:
|
|
sDebugMonData->mon_iv_atk = gTasks[taskId].data[3];
|
|
break;
|
|
case 2:
|
|
sDebugMonData->mon_iv_def = gTasks[taskId].data[3];
|
|
break;
|
|
case 3:
|
|
sDebugMonData->mon_iv_speed = gTasks[taskId].data[3];
|
|
break;
|
|
case 4:
|
|
sDebugMonData->mon_iv_satk = gTasks[taskId].data[3];
|
|
break;
|
|
case 5:
|
|
sDebugMonData->mon_iv_sdef = gTasks[taskId].data[3];
|
|
break;
|
|
}
|
|
|
|
//Check if all IVs set
|
|
if (gTasks[taskId].data[7] != 5)
|
|
{
|
|
gTasks[taskId].data[7] += 1;
|
|
gTasks[taskId].data[3] = 0;
|
|
gTasks[taskId].data[4] = 0;
|
|
|
|
StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].data[4]]);
|
|
ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 2);
|
|
StringCopyPadded(gStringVar3, gStringVar3, CHAR_SPACE, 15);
|
|
switch (gTasks[taskId].data[7])
|
|
{
|
|
case 0:
|
|
StringExpandPlaceholders(gStringVar4, sDebugText_PokemonIV_0);
|
|
break;
|
|
case 1:
|
|
StringExpandPlaceholders(gStringVar4, sDebugText_PokemonIV_1);
|
|
break;
|
|
case 2:
|
|
StringExpandPlaceholders(gStringVar4, sDebugText_PokemonIV_2);
|
|
break;
|
|
case 3:
|
|
StringExpandPlaceholders(gStringVar4, sDebugText_PokemonIV_3);
|
|
break;
|
|
case 4:
|
|
StringExpandPlaceholders(gStringVar4, sDebugText_PokemonIV_4);
|
|
break;
|
|
case 5:
|
|
StringExpandPlaceholders(gStringVar4, sDebugText_PokemonIV_5);
|
|
break;
|
|
}
|
|
AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL);
|
|
|
|
gTasks[taskId].func = DebugAction_Give_Pokemon_SelectIVs;
|
|
}
|
|
else
|
|
{
|
|
gTasks[taskId].data[3] = 0;
|
|
gTasks[taskId].data[4] = 0;
|
|
gTasks[taskId].data[7] = 0; //Reset iterator
|
|
|
|
StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].data[4]]);
|
|
StringCopy(gStringVar1, gMoveNames[gTasks[taskId].data[3]]);
|
|
StringCopyPadded(gStringVar1, gStringVar1, CHAR_SPACE, 15);
|
|
ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 3);
|
|
StringExpandPlaceholders(gStringVar4, sDebugText_PokemonMove_0);
|
|
AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL);
|
|
|
|
gTasks[taskId].func = DebugAction_Give_Pokemon_Move;
|
|
}
|
|
}
|
|
else if (JOY_NEW(B_BUTTON))
|
|
{
|
|
PlaySE(SE_SELECT);
|
|
Free(sDebugMonData); //Frees EWRAM of MonData Struct
|
|
DebugAction_DestroyExtraWindow(taskId);
|
|
}
|
|
}
|
|
static void DebugAction_Give_Pokemon_Move(u8 taskId)
|
|
{
|
|
if (JOY_NEW(DPAD_ANY))
|
|
{
|
|
PlaySE(SE_SELECT);
|
|
|
|
if (JOY_NEW(DPAD_UP))
|
|
{
|
|
gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]];
|
|
if (gTasks[taskId].data[3] >= MOVES_COUNT)
|
|
gTasks[taskId].data[3] = MOVES_COUNT - 1;
|
|
}
|
|
if (JOY_NEW(DPAD_DOWN))
|
|
{
|
|
gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]];
|
|
if (gTasks[taskId].data[3] < 0)
|
|
gTasks[taskId].data[3] = 0;
|
|
}
|
|
if (JOY_NEW(DPAD_LEFT))
|
|
{
|
|
if (gTasks[taskId].data[4] > 0)
|
|
gTasks[taskId].data[4] -= 1;
|
|
}
|
|
if (JOY_NEW(DPAD_RIGHT))
|
|
{
|
|
if (gTasks[taskId].data[4] < 3)
|
|
gTasks[taskId].data[4] += 1;
|
|
}
|
|
|
|
StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].data[4]]);
|
|
StringCopy(gStringVar1, gMoveNames[gTasks[taskId].data[3]]);
|
|
StringCopyPadded(gStringVar1, gStringVar1, CHAR_SPACE, 15);
|
|
ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 3);
|
|
switch (gTasks[taskId].data[7])
|
|
{
|
|
case 0:
|
|
StringExpandPlaceholders(gStringVar4, sDebugText_PokemonMove_0);
|
|
break;
|
|
case 1:
|
|
StringExpandPlaceholders(gStringVar4, sDebugText_PokemonMove_1);
|
|
break;
|
|
case 2:
|
|
StringExpandPlaceholders(gStringVar4, sDebugText_PokemonMove_2);
|
|
break;
|
|
case 3:
|
|
StringExpandPlaceholders(gStringVar4, sDebugText_PokemonMove_3);
|
|
break;
|
|
}
|
|
AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL);
|
|
}
|
|
|
|
if (JOY_NEW(A_BUTTON))
|
|
{
|
|
//If MOVE_NONE selected, stop asking for additional moves
|
|
if (gTasks[taskId].data[3] == 0)
|
|
gTasks[taskId].data[7] = 4;
|
|
|
|
//Set current value
|
|
switch (gTasks[taskId].data[7])
|
|
{
|
|
case 0:
|
|
sDebugMonData->mon_move_0 = gTasks[taskId].data[3];
|
|
break;
|
|
case 1:
|
|
sDebugMonData->mon_move_1 = gTasks[taskId].data[3];
|
|
break;
|
|
case 2:
|
|
sDebugMonData->mon_move_2 = gTasks[taskId].data[3];
|
|
break;
|
|
case 3:
|
|
sDebugMonData->mon_move_3 = gTasks[taskId].data[3];
|
|
break;
|
|
}
|
|
|
|
//If NOT last move or selected MOVE_NONE ask for next move, else make mon
|
|
if (gTasks[taskId].data[7] < 3)
|
|
{
|
|
gTasks[taskId].data[7] += 1;
|
|
gTasks[taskId].data[3] = 0;
|
|
gTasks[taskId].data[4] = 0;
|
|
|
|
StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].data[4]]);
|
|
StringCopy(gStringVar1, gMoveNames[gTasks[taskId].data[3]]);
|
|
StringCopyPadded(gStringVar1, gStringVar1, CHAR_SPACE, 15);
|
|
ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 3);
|
|
switch (gTasks[taskId].data[7])
|
|
{
|
|
case 0:
|
|
StringExpandPlaceholders(gStringVar4, sDebugText_PokemonMove_0);
|
|
break;
|
|
case 1:
|
|
StringExpandPlaceholders(gStringVar4, sDebugText_PokemonMove_1);
|
|
break;
|
|
case 2:
|
|
StringExpandPlaceholders(gStringVar4, sDebugText_PokemonMove_2);
|
|
break;
|
|
case 3:
|
|
StringExpandPlaceholders(gStringVar4, sDebugText_PokemonMove_3);
|
|
break;
|
|
}
|
|
AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL);
|
|
|
|
gTasks[taskId].func = DebugAction_Give_Pokemon_Move;
|
|
}
|
|
else
|
|
{
|
|
gTasks[taskId].data[3] = 0;
|
|
gTasks[taskId].data[4] = 0;
|
|
|
|
PlaySE(MUS_LEVEL_UP);
|
|
gTasks[taskId].func = DebugAction_Give_Pokemon_ComplexCreateMon;
|
|
}
|
|
}
|
|
else if (JOY_NEW(B_BUTTON))
|
|
{
|
|
PlaySE(SE_SELECT);
|
|
Free(sDebugMonData); //Frees EWRAM of MonData Struct
|
|
DebugAction_DestroyExtraWindow(taskId);
|
|
}
|
|
}
|
|
static void DebugAction_Give_Pokemon_ComplexCreateMon(u8 taskId) //https://github.com/ghoulslash/pokeemerald/tree/custom-givemon
|
|
{
|
|
u16 nationalDexNum;
|
|
int sentToPc;
|
|
struct Pokemon mon;
|
|
u8 i;
|
|
u16 moves[4];
|
|
u8 IVs[6];
|
|
u8 iv_val;
|
|
u16 species = sDebugMonData->mon_speciesId;
|
|
u8 level = sDebugMonData->mon_level;
|
|
u8 isShiny = sDebugMonData->isShiny; //Shiny: no 0, yes 1
|
|
u8 nature = sDebugMonData->mon_natureId;
|
|
u8 abilityNum = sDebugMonData->mon_abilityNum;
|
|
moves[0] = sDebugMonData->mon_move_0;
|
|
moves[1] = sDebugMonData->mon_move_1;
|
|
moves[2] = sDebugMonData->mon_move_2;
|
|
moves[3] = sDebugMonData->mon_move_3;
|
|
IVs[0] = sDebugMonData->mon_iv_hp;
|
|
IVs[1] = sDebugMonData->mon_iv_atk;
|
|
IVs[2] = sDebugMonData->mon_iv_def;
|
|
IVs[3] = sDebugMonData->mon_iv_speed;
|
|
IVs[4] = sDebugMonData->mon_iv_satk;
|
|
IVs[5] = sDebugMonData->mon_iv_sdef;
|
|
|
|
//Nature
|
|
if (nature == NUM_NATURES || nature == 0xFF)
|
|
nature = Random() % NUM_NATURES;
|
|
|
|
//Shininess
|
|
if (isShiny == 1)
|
|
{
|
|
u32 personality;
|
|
u32 otid = gSaveBlock2Ptr->playerTrainerId[0]
|
|
| (gSaveBlock2Ptr->playerTrainerId[1] << 8)
|
|
| (gSaveBlock2Ptr->playerTrainerId[2] << 16)
|
|
| (gSaveBlock2Ptr->playerTrainerId[3] << 24);
|
|
|
|
do
|
|
{
|
|
personality = Random32();
|
|
personality = ((((Random() % 8) ^ (HIHALF(otid) ^ LOHALF(otid))) ^ LOHALF(personality)) << 16) | LOHALF(personality);
|
|
} while (nature != GetNatureFromPersonality(personality));
|
|
|
|
CreateMon(&mon, species, level, 32, 1, personality, OT_ID_PRESET, otid);
|
|
}
|
|
else
|
|
CreateMonWithNature(&mon, species, level, 32, nature);
|
|
|
|
//IVs
|
|
for (i = 0; i < NUM_STATS; i++)
|
|
{
|
|
iv_val = IVs[i];
|
|
if (iv_val != 32 && iv_val != 0xFF)
|
|
SetMonData(&mon, MON_DATA_HP_IV + i, &iv_val);
|
|
}
|
|
CalculateMonStats(&mon);
|
|
|
|
//Moves
|
|
for (i = 0; i < MAX_MON_MOVES; i++)
|
|
{
|
|
if (moves[i] == 0 || moves[i] == 0xFF || moves[i] >= MOVES_COUNT)
|
|
continue;
|
|
|
|
SetMonMoveSlot(&mon, moves[i], i);
|
|
}
|
|
|
|
//Ability
|
|
if (abilityNum == 0xFF || GetAbilityBySpecies(species, abilityNum) == 0)
|
|
{
|
|
do {
|
|
abilityNum = Random() % 3; // includes hidden abilities
|
|
} while (GetAbilityBySpecies(species, abilityNum) == 0);
|
|
}
|
|
|
|
SetMonData(&mon, MON_DATA_ABILITY_NUM, &abilityNum);
|
|
|
|
// give player the mon
|
|
SetMonData(&mon, MON_DATA_OT_NAME, gSaveBlock2Ptr->playerName);
|
|
SetMonData(&mon, MON_DATA_OT_GENDER, &gSaveBlock2Ptr->playerGender);
|
|
for (i = 0; i < PARTY_SIZE; i++)
|
|
{
|
|
if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES, NULL) == SPECIES_NONE)
|
|
break;
|
|
}
|
|
|
|
if (i >= PARTY_SIZE)
|
|
sentToPc = SendMonToPC(&mon);
|
|
else
|
|
{
|
|
sentToPc = MON_GIVEN_TO_PARTY;
|
|
CopyMon(&gPlayerParty[i], &mon, sizeof(mon));
|
|
gPlayerPartyCount = i + 1;
|
|
}
|
|
|
|
//Pokedex entry
|
|
nationalDexNum = SpeciesToNationalPokedexNum(species);
|
|
switch(sentToPc)
|
|
{
|
|
case MON_GIVEN_TO_PARTY:
|
|
case MON_GIVEN_TO_PC:
|
|
GetSetPokedexFlag(nationalDexNum, FLAG_SET_SEEN);
|
|
GetSetPokedexFlag(nationalDexNum, FLAG_SET_CAUGHT);
|
|
break;
|
|
case MON_CANT_GIVE:
|
|
break;
|
|
}
|
|
|
|
// Set flag for user convenience
|
|
FlagSet(FLAG_SYS_POKEMON_GET);
|
|
|
|
Free(sDebugMonData); //Frees EWRAM of MonData Struct
|
|
DebugAction_DestroyExtraWindow(taskId); //return sentToPc;
|
|
}
|
|
|
|
static void DebugAction_Give_MaxMoney(u8 taskId)
|
|
{
|
|
SetMoney(&gSaveBlock1Ptr->money, MAX_MONEY);
|
|
}
|
|
|
|
static void DebugAction_Give_MaxCoins(u8 taskId)
|
|
{
|
|
SetCoins(9999);
|
|
}
|
|
|
|
static void DebugAction_Give_MaxBattlePoints(u8 taskId)
|
|
{
|
|
gSaveBlock2Ptr->frontier.battlePoints = MAX_BATTLE_FRONTIER_POINTS;
|
|
}
|
|
|
|
static void DebugAction_Give_DayCareEgg(u8 taskId)
|
|
{
|
|
s32 emptySlot = Daycare_FindEmptySpot(&gSaveBlock1Ptr->daycare);
|
|
if (emptySlot == 0) // no daycare mons
|
|
Debug_DestroyMenu_Full_Script(taskId, DebugScript_ZeroDaycareMons);
|
|
else if (emptySlot == 1) // 1 daycare mon
|
|
Debug_DestroyMenu_Full_Script(taskId, DebugScript_OneDaycareMons);
|
|
else if (GetDaycareCompatibilityScore(&gSaveBlock1Ptr->daycare) == PARENTS_INCOMPATIBLE) // not compatible parents
|
|
Debug_DestroyMenu_Full_Script(taskId, DebugScript_DaycareMonsNotCompatible);
|
|
else // 2 pokemon which can have a pokemon baby together
|
|
TriggerPendingDaycareEgg();
|
|
}
|
|
|
|
// *******************************
|
|
// 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, 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++)
|
|
{
|
|
for (boxPosition = 0; boxPosition < IN_BOX_COUNT; boxPosition++)
|
|
{
|
|
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;
|
|
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;
|
|
|
|
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)
|
|
{
|
|
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;
|
|
|
|
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)
|
|
{
|
|
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);
|
|
}
|
|
}
|
|
|
|
// *******************************
|
|
// Actions Sound
|
|
static const u8 *const sBGMNames[];
|
|
static const u8 *const sSENames[];
|
|
static void DebugAction_Sound_SE(u8 taskId)
|
|
{
|
|
u8 windowId;
|
|
|
|
ClearStdWindowAndFrame(gTasks[taskId].data[1], TRUE);
|
|
RemoveWindow(gTasks[taskId].data[1]);
|
|
|
|
HideMapNamePopUpWindow();
|
|
LoadMessageBoxAndBorderGfx();
|
|
windowId = AddWindow(&sDebugMenuWindowTemplateSound);
|
|
DrawStdWindowFrame(windowId, FALSE);
|
|
|
|
CopyWindowToVram(windowId, 3);
|
|
|
|
//Display initial ID
|
|
StringCopy(gStringVar2, gText_DigitIndicator[0]);
|
|
ConvertIntToDecimalStringN(gStringVar3, 1, STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_ITEMS);
|
|
StringCopyPadded(gStringVar1, sSENames[0], CHAR_SPACE, 35);
|
|
StringExpandPlaceholders(gStringVar4, sDebugText_Sound_SE_ID);
|
|
AddTextPrinterParameterized(windowId, 1, gStringVar4, 1, 1, 0, NULL);
|
|
|
|
StopMapMusic(); //Stop map music to better hear sounds
|
|
|
|
gTasks[taskId].func = DebugAction_Sound_SE_SelectId;
|
|
gTasks[taskId].data[2] = windowId;
|
|
gTasks[taskId].data[3] = 1; //Current ID
|
|
gTasks[taskId].data[4] = 0; //Digit Selected
|
|
gTasks[taskId].data[5] = gTasks[taskId].data[3]; //Last song played (for stopping)
|
|
}
|
|
static void DebugAction_Sound_SE_SelectId(u8 taskId)
|
|
{
|
|
if (JOY_NEW(DPAD_ANY))
|
|
{
|
|
if (JOY_NEW(DPAD_UP))
|
|
{
|
|
gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]];
|
|
if (gTasks[taskId].data[3] > END_SE)
|
|
gTasks[taskId].data[3] = END_SE;
|
|
}
|
|
if (JOY_NEW(DPAD_DOWN))
|
|
{
|
|
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))
|
|
{
|
|
if (gTasks[taskId].data[4] > 0)
|
|
gTasks[taskId].data[4] -= 1;
|
|
}
|
|
if (JOY_NEW(DPAD_RIGHT))
|
|
{
|
|
if (gTasks[taskId].data[4] < DEBUG_NUMBER_DIGITS_ITEMS - 1)
|
|
gTasks[taskId].data[4] += 1;
|
|
}
|
|
|
|
StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].data[4]]);
|
|
StringCopyPadded(gStringVar1, sSENames[gTasks[taskId].data[3]-1], CHAR_SPACE, 35);
|
|
ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_ITEMS);
|
|
StringExpandPlaceholders(gStringVar4, sDebugText_Sound_SE_ID);
|
|
AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL);
|
|
}
|
|
|
|
if (JOY_NEW(A_BUTTON))
|
|
{
|
|
m4aSongNumStop(gTasks[taskId].data[5]);
|
|
gTasks[taskId].data[5] = gTasks[taskId].data[3];
|
|
m4aSongNumStart(gTasks[taskId].data[3]);
|
|
}
|
|
else if (JOY_NEW(B_BUTTON))
|
|
{
|
|
PlaySE(SE_SELECT);
|
|
m4aSongNumStop(gTasks[taskId].data[5]);
|
|
DebugAction_DestroyExtraWindow(taskId);
|
|
}
|
|
}
|
|
|
|
static void DebugAction_Sound_MUS(u8 taskId)
|
|
{
|
|
u8 windowId;
|
|
|
|
ClearStdWindowAndFrame(gTasks[taskId].data[1], TRUE);
|
|
RemoveWindow(gTasks[taskId].data[1]);
|
|
|
|
HideMapNamePopUpWindow();
|
|
LoadMessageBoxAndBorderGfx();
|
|
windowId = AddWindow(&sDebugMenuWindowTemplateSound);
|
|
DrawStdWindowFrame(windowId, FALSE);
|
|
|
|
CopyWindowToVram(windowId, 3);
|
|
|
|
//Display initial ID
|
|
StringCopy(gStringVar2, gText_DigitIndicator[0]);
|
|
ConvertIntToDecimalStringN(gStringVar3, START_MUS, STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_ITEMS);
|
|
StringCopyPadded(gStringVar1, sBGMNames[0], CHAR_SPACE, 35);
|
|
StringExpandPlaceholders(gStringVar4, sDebugText_Sound_MUS_ID);
|
|
AddTextPrinterParameterized(windowId, 1, gStringVar4, 1, 1, 0, NULL);
|
|
|
|
StopMapMusic(); //Stop map music to better hear new music
|
|
|
|
gTasks[taskId].func = DebugAction_Sound_MUS_SelectId;
|
|
gTasks[taskId].data[2] = windowId;
|
|
gTasks[taskId].data[3] = START_MUS; //Current ID
|
|
gTasks[taskId].data[4] = 0; //Digit Selected
|
|
gTasks[taskId].data[5] = gTasks[taskId].data[3]; //Last song played (for stopping)
|
|
}
|
|
static void DebugAction_Sound_MUS_SelectId(u8 taskId)
|
|
{
|
|
if (JOY_NEW(DPAD_ANY))
|
|
{
|
|
if (JOY_NEW(DPAD_UP))
|
|
{
|
|
gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]];
|
|
if (gTasks[taskId].data[3] > END_MUS)
|
|
gTasks[taskId].data[3] = END_MUS;
|
|
}
|
|
if (JOY_NEW(DPAD_DOWN))
|
|
{
|
|
gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]];
|
|
if (gTasks[taskId].data[3] < START_MUS)
|
|
gTasks[taskId].data[3] = START_MUS;
|
|
}
|
|
if (JOY_NEW(DPAD_LEFT))
|
|
{
|
|
if (gTasks[taskId].data[4] > 0)
|
|
gTasks[taskId].data[4] -= 1;
|
|
}
|
|
if (JOY_NEW(DPAD_RIGHT))
|
|
{
|
|
if (gTasks[taskId].data[4] < DEBUG_NUMBER_DIGITS_ITEMS - 1)
|
|
gTasks[taskId].data[4] += 1;
|
|
}
|
|
|
|
StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].data[4]]);
|
|
StringCopyPadded(gStringVar1, sBGMNames[gTasks[taskId].data[3]-START_MUS], CHAR_SPACE, 35);
|
|
ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_ITEMS);
|
|
StringExpandPlaceholders(gStringVar4, sDebugText_Sound_MUS_ID);
|
|
AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL);
|
|
}
|
|
|
|
if (JOY_NEW(A_BUTTON))
|
|
{
|
|
m4aSongNumStop(gTasks[taskId].data[5]);
|
|
gTasks[taskId].data[5] = gTasks[taskId].data[3];
|
|
m4aSongNumStart(gTasks[taskId].data[3]);
|
|
}
|
|
else if (JOY_NEW(B_BUTTON))
|
|
{
|
|
PlaySE(SE_SELECT);
|
|
// m4aSongNumStop(gTasks[taskId].data[5]); //Uncomment if music should stop after leaving menu
|
|
DebugAction_DestroyExtraWindow(taskId);
|
|
}
|
|
}
|
|
|
|
#define SOUND_LIST_BGM \
|
|
X(MUS_LITTLEROOT_TEST) \
|
|
X(MUS_GSC_ROUTE38) \
|
|
X(MUS_CAUGHT) \
|
|
X(MUS_VICTORY_WILD) \
|
|
X(MUS_VICTORY_GYM_LEADER) \
|
|
X(MUS_VICTORY_LEAGUE) \
|
|
X(MUS_C_COMM_CENTER) \
|
|
X(MUS_GSC_PEWTER) \
|
|
X(MUS_C_VS_LEGEND_BEAST) \
|
|
X(MUS_ROUTE101) \
|
|
X(MUS_ROUTE110) \
|
|
X(MUS_ROUTE120) \
|
|
X(MUS_PETALBURG) \
|
|
X(MUS_OLDALE) \
|
|
X(MUS_GYM) \
|
|
X(MUS_SURF) \
|
|
X(MUS_PETALBURG_WOODS) \
|
|
X(MUS_LEVEL_UP) \
|
|
X(MUS_HEAL) \
|
|
X(MUS_OBTAIN_BADGE) \
|
|
X(MUS_OBTAIN_ITEM) \
|
|
X(MUS_EVOLVED) \
|
|
X(MUS_OBTAIN_TMHM) \
|
|
X(MUS_LILYCOVE_MUSEUM) \
|
|
X(MUS_ROUTE122) \
|
|
X(MUS_OCEANIC_MUSEUM) \
|
|
X(MUS_EVOLUTION_INTRO) \
|
|
X(MUS_EVOLUTION) \
|
|
X(MUS_MOVE_DELETED) \
|
|
X(MUS_ENCOUNTER_GIRL) \
|
|
X(MUS_ENCOUNTER_MALE) \
|
|
X(MUS_ABANDONED_SHIP) \
|
|
X(MUS_FORTREE) \
|
|
X(MUS_BIRCH_LAB) \
|
|
X(MUS_B_TOWER_RS) \
|
|
X(MUS_ENCOUNTER_SWIMMER) \
|
|
X(MUS_CAVE_OF_ORIGIN) \
|
|
X(MUS_OBTAIN_BERRY) \
|
|
X(MUS_AWAKEN_LEGEND) \
|
|
X(MUS_SLOTS_JACKPOT) \
|
|
X(MUS_SLOTS_WIN) \
|
|
X(MUS_TOO_BAD) \
|
|
X(MUS_ROULETTE) \
|
|
X(MUS_LINK_CONTEST_P1) \
|
|
X(MUS_LINK_CONTEST_P2) \
|
|
X(MUS_LINK_CONTEST_P3) \
|
|
X(MUS_LINK_CONTEST_P4) \
|
|
X(MUS_ENCOUNTER_RICH) \
|
|
X(MUS_VERDANTURF) \
|
|
X(MUS_RUSTBORO) \
|
|
X(MUS_POKE_CENTER) \
|
|
X(MUS_ROUTE104) \
|
|
X(MUS_ROUTE119) \
|
|
X(MUS_CYCLING) \
|
|
X(MUS_POKE_MART) \
|
|
X(MUS_LITTLEROOT) \
|
|
X(MUS_MT_CHIMNEY) \
|
|
X(MUS_ENCOUNTER_FEMALE) \
|
|
X(MUS_LILYCOVE) \
|
|
X(MUS_ROUTE111) \
|
|
X(MUS_HELP) \
|
|
X(MUS_UNDERWATER) \
|
|
X(MUS_VICTORY_TRAINER) \
|
|
X(MUS_TITLE) \
|
|
X(MUS_INTRO) \
|
|
X(MUS_ENCOUNTER_MAY) \
|
|
X(MUS_ENCOUNTER_INTENSE) \
|
|
X(MUS_ENCOUNTER_COOL) \
|
|
X(MUS_ROUTE113) \
|
|
X(MUS_ENCOUNTER_AQUA) \
|
|
X(MUS_FOLLOW_ME) \
|
|
X(MUS_ENCOUNTER_BRENDAN) \
|
|
X(MUS_EVER_GRANDE) \
|
|
X(MUS_ENCOUNTER_SUSPICIOUS) \
|
|
X(MUS_VICTORY_AQUA_MAGMA) \
|
|
X(MUS_CABLE_CAR) \
|
|
X(MUS_GAME_CORNER) \
|
|
X(MUS_DEWFORD) \
|
|
X(MUS_SAFARI_ZONE) \
|
|
X(MUS_VICTORY_ROAD) \
|
|
X(MUS_AQUA_MAGMA_HIDEOUT) \
|
|
X(MUS_SAILING) \
|
|
X(MUS_MT_PYRE) \
|
|
X(MUS_SLATEPORT) \
|
|
X(MUS_MT_PYRE_EXTERIOR) \
|
|
X(MUS_SCHOOL) \
|
|
X(MUS_HALL_OF_FAME) \
|
|
X(MUS_FALLARBOR) \
|
|
X(MUS_SEALED_CHAMBER) \
|
|
X(MUS_CONTEST_WINNER) \
|
|
X(MUS_CONTEST) \
|
|
X(MUS_ENCOUNTER_MAGMA) \
|
|
X(MUS_INTRO_BATTLE) \
|
|
X(MUS_WEATHER_KYOGRE) \
|
|
X(MUS_WEATHER_GROUDON) \
|
|
X(MUS_SOOTOPOLIS) \
|
|
X(MUS_CONTEST_RESULTS) \
|
|
X(MUS_HALL_OF_FAME_ROOM) \
|
|
X(MUS_TRICK_HOUSE) \
|
|
X(MUS_ENCOUNTER_TWINS) \
|
|
X(MUS_ENCOUNTER_ELITE_FOUR) \
|
|
X(MUS_ENCOUNTER_HIKER) \
|
|
X(MUS_CONTEST_LOBBY) \
|
|
X(MUS_ENCOUNTER_INTERVIEWER) \
|
|
X(MUS_ENCOUNTER_CHAMPION) \
|
|
X(MUS_CREDITS) \
|
|
X(MUS_END) \
|
|
X(MUS_B_FRONTIER) \
|
|
X(MUS_B_ARENA) \
|
|
X(MUS_OBTAIN_B_POINTS) \
|
|
X(MUS_REGISTER_MATCH_CALL) \
|
|
X(MUS_B_PYRAMID) \
|
|
X(MUS_B_PYRAMID_TOP) \
|
|
X(MUS_B_PALACE) \
|
|
X(MUS_RAYQUAZA_APPEARS) \
|
|
X(MUS_B_TOWER) \
|
|
X(MUS_OBTAIN_SYMBOL) \
|
|
X(MUS_B_DOME) \
|
|
X(MUS_B_PIKE) \
|
|
X(MUS_B_FACTORY) \
|
|
X(MUS_VS_RAYQUAZA) \
|
|
X(MUS_VS_FRONTIER_BRAIN) \
|
|
X(MUS_VS_MEW) \
|
|
X(MUS_B_DOME_LOBBY) \
|
|
X(MUS_VS_WILD) \
|
|
X(MUS_VS_AQUA_MAGMA) \
|
|
X(MUS_VS_TRAINER) \
|
|
X(MUS_VS_GYM_LEADER) \
|
|
X(MUS_VS_CHAMPION) \
|
|
X(MUS_VS_REGI) \
|
|
X(MUS_VS_KYOGRE_GROUDON) \
|
|
X(MUS_VS_RIVAL) \
|
|
X(MUS_VS_ELITE_FOUR) \
|
|
X(MUS_VS_AQUA_MAGMA_LEADER) \
|
|
X(MUS_RG_FOLLOW_ME) \
|
|
X(MUS_RG_GAME_CORNER) \
|
|
X(MUS_RG_ROCKET_HIDEOUT) \
|
|
X(MUS_RG_GYM) \
|
|
X(MUS_RG_JIGGLYPUFF) \
|
|
X(MUS_RG_INTRO_FIGHT) \
|
|
X(MUS_RG_TITLE) \
|
|
X(MUS_RG_CINNABAR) \
|
|
X(MUS_RG_LAVENDER) \
|
|
X(MUS_RG_HEAL) \
|
|
X(MUS_RG_CYCLING) \
|
|
X(MUS_RG_ENCOUNTER_ROCKET) \
|
|
X(MUS_RG_ENCOUNTER_GIRL) \
|
|
X(MUS_RG_ENCOUNTER_BOY) \
|
|
X(MUS_RG_HALL_OF_FAME) \
|
|
X(MUS_RG_VIRIDIAN_FOREST) \
|
|
X(MUS_RG_MT_MOON) \
|
|
X(MUS_RG_POKE_MANSION) \
|
|
X(MUS_RG_CREDITS) \
|
|
X(MUS_RG_ROUTE1) \
|
|
X(MUS_RG_ROUTE24) \
|
|
X(MUS_RG_ROUTE3) \
|
|
X(MUS_RG_ROUTE11) \
|
|
X(MUS_RG_VICTORY_ROAD) \
|
|
X(MUS_RG_VS_GYM_LEADER) \
|
|
X(MUS_RG_VS_TRAINER) \
|
|
X(MUS_RG_VS_WILD) \
|
|
X(MUS_RG_VS_CHAMPION) \
|
|
X(MUS_RG_PALLET) \
|
|
X(MUS_RG_OAK_LAB) \
|
|
X(MUS_RG_OAK) \
|
|
X(MUS_RG_POKE_CENTER) \
|
|
X(MUS_RG_SS_ANNE) \
|
|
X(MUS_RG_SURF) \
|
|
X(MUS_RG_POKE_TOWER) \
|
|
X(MUS_RG_SILPH) \
|
|
X(MUS_RG_FUCHSIA) \
|
|
X(MUS_RG_CELADON) \
|
|
X(MUS_RG_VICTORY_TRAINER) \
|
|
X(MUS_RG_VICTORY_WILD) \
|
|
X(MUS_RG_VICTORY_GYM_LEADER) \
|
|
X(MUS_RG_VERMILLION) \
|
|
X(MUS_RG_PEWTER) \
|
|
X(MUS_RG_ENCOUNTER_RIVAL) \
|
|
X(MUS_RG_RIVAL_EXIT) \
|
|
X(MUS_RG_DEX_RATING) \
|
|
X(MUS_RG_OBTAIN_KEY_ITEM) \
|
|
X(MUS_RG_CAUGHT_INTRO) \
|
|
X(MUS_RG_PHOTO) \
|
|
X(MUS_RG_GAME_FREAK) \
|
|
X(MUS_RG_CAUGHT) \
|
|
X(MUS_RG_NEW_GAME_INSTRUCT) \
|
|
X(MUS_RG_NEW_GAME_INTRO) \
|
|
X(MUS_RG_NEW_GAME_EXIT) \
|
|
X(MUS_RG_POKE_JUMP) \
|
|
X(MUS_RG_UNION_ROOM) \
|
|
X(MUS_RG_NET_CENTER) \
|
|
X(MUS_RG_MYSTERY_GIFT) \
|
|
X(MUS_RG_BERRY_PICK) \
|
|
X(MUS_RG_SEVII_CAVE) \
|
|
X(MUS_RG_TEACHY_TV_SHOW) \
|
|
X(MUS_RG_SEVII_ROUTE) \
|
|
X(MUS_RG_SEVII_DUNGEON) \
|
|
X(MUS_RG_SEVII_123) \
|
|
X(MUS_RG_SEVII_45) \
|
|
X(MUS_RG_SEVII_67) \
|
|
X(MUS_RG_POKE_FLUTE) \
|
|
X(MUS_RG_VS_DEOXYS) \
|
|
X(MUS_RG_VS_MEWTWO) \
|
|
X(MUS_RG_VS_LEGEND) \
|
|
X(MUS_RG_ENCOUNTER_GYM_LEADER) \
|
|
X(MUS_RG_ENCOUNTER_DEOXYS) \
|
|
X(MUS_RG_TRAINER_TOWER) \
|
|
X(MUS_RG_SLOW_PALLET) \
|
|
X(MUS_RG_TEACHY_TV_MENU) \
|
|
X(PH_TRAP_BLEND) \
|
|
X(PH_TRAP_HELD) \
|
|
X(PH_TRAP_SOLO) \
|
|
X(PH_FACE_BLEND) \
|
|
X(PH_FACE_HELD) \
|
|
X(PH_FACE_SOLO) \
|
|
X(PH_CLOTH_BLEND) \
|
|
X(PH_CLOTH_HELD) \
|
|
X(PH_CLOTH_SOLO) \
|
|
X(PH_DRESS_BLEND) \
|
|
X(PH_DRESS_HELD) \
|
|
X(PH_DRESS_SOLO) \
|
|
X(PH_FLEECE_BLEND) \
|
|
X(PH_FLEECE_HELD) \
|
|
X(PH_FLEECE_SOLO) \
|
|
X(PH_KIT_BLEND) \
|
|
X(PH_KIT_HELD) \
|
|
X(PH_KIT_SOLO) \
|
|
X(PH_PRICE_BLEND) \
|
|
X(PH_PRICE_HELD) \
|
|
X(PH_PRICE_SOLO) \
|
|
X(PH_LOT_BLEND) \
|
|
X(PH_LOT_HELD) \
|
|
X(PH_LOT_SOLO) \
|
|
X(PH_GOAT_BLEND) \
|
|
X(PH_GOAT_HELD) \
|
|
X(PH_GOAT_SOLO) \
|
|
X(PH_THOUGHT_BLEND) \
|
|
X(PH_THOUGHT_HELD) \
|
|
X(PH_THOUGHT_SOLO) \
|
|
X(PH_CHOICE_BLEND) \
|
|
X(PH_CHOICE_HELD) \
|
|
X(PH_CHOICE_SOLO) \
|
|
X(PH_MOUTH_BLEND) \
|
|
X(PH_MOUTH_HELD) \
|
|
X(PH_MOUTH_SOLO) \
|
|
X(PH_FOOT_BLEND) \
|
|
X(PH_FOOT_HELD) \
|
|
X(PH_FOOT_SOLO) \
|
|
X(PH_GOOSE_BLEND) \
|
|
X(PH_GOOSE_HELD) \
|
|
X(PH_GOOSE_SOLO) \
|
|
X(PH_STRUT_BLEND) \
|
|
X(PH_STRUT_HELD) \
|
|
X(PH_STRUT_SOLO) \
|
|
X(PH_CURE_BLEND) \
|
|
X(PH_CURE_HELD) \
|
|
X(PH_CURE_SOLO) \
|
|
X(PH_NURSE_BLEND) \
|
|
X(PH_NURSE_HELD) \
|
|
X(PH_NURSE_SOLO) \
|
|
|
|
#define SOUND_LIST_SE \
|
|
X(SE_USE_ITEM) \
|
|
X(SE_PC_LOGIN) \
|
|
X(SE_PC_OFF) \
|
|
X(SE_PC_ON) \
|
|
X(SE_SELECT) \
|
|
X(SE_WIN_OPEN) \
|
|
X(SE_WALL_HIT) \
|
|
X(SE_DOOR) \
|
|
X(SE_EXIT) \
|
|
X(SE_LEDGE) \
|
|
X(SE_BIKE_BELL) \
|
|
X(SE_NOT_EFFECTIVE) \
|
|
X(SE_EFFECTIVE) \
|
|
X(SE_SUPER_EFFECTIVE) \
|
|
X(SE_BALL_OPEN) \
|
|
X(SE_FAINT) \
|
|
X(SE_FLEE) \
|
|
X(SE_SLIDING_DOOR) \
|
|
X(SE_SHIP) \
|
|
X(SE_BANG) \
|
|
X(SE_PIN) \
|
|
X(SE_BOO) \
|
|
X(SE_BALL) \
|
|
X(SE_CONTEST_PLACE) \
|
|
X(SE_A) \
|
|
X(SE_I) \
|
|
X(SE_U) \
|
|
X(SE_E) \
|
|
X(SE_O) \
|
|
X(SE_N) \
|
|
X(SE_SUCCESS) \
|
|
X(SE_FAILURE) \
|
|
X(SE_EXP) \
|
|
X(SE_BIKE_HOP) \
|
|
X(SE_SWITCH) \
|
|
X(SE_CLICK) \
|
|
X(SE_FU_ZAKU) \
|
|
X(SE_CONTEST_CONDITION_LOSE) \
|
|
X(SE_LAVARIDGE_FALL_WARP) \
|
|
X(SE_ICE_STAIRS) \
|
|
X(SE_ICE_BREAK) \
|
|
X(SE_ICE_CRACK) \
|
|
X(SE_FALL) \
|
|
X(SE_UNLOCK) \
|
|
X(SE_WARP_IN) \
|
|
X(SE_WARP_OUT) \
|
|
X(SE_REPEL) \
|
|
X(SE_ROTATING_GATE) \
|
|
X(SE_TRUCK_MOVE) \
|
|
X(SE_TRUCK_STOP) \
|
|
X(SE_TRUCK_UNLOAD) \
|
|
X(SE_TRUCK_DOOR) \
|
|
X(SE_BERRY_BLENDER) \
|
|
X(SE_CARD) \
|
|
X(SE_SAVE) \
|
|
X(SE_BALL_BOUNCE_1) \
|
|
X(SE_BALL_BOUNCE_2) \
|
|
X(SE_BALL_BOUNCE_3) \
|
|
X(SE_BALL_BOUNCE_4) \
|
|
X(SE_BALL_TRADE) \
|
|
X(SE_BALL_THROW) \
|
|
X(SE_NOTE_C) \
|
|
X(SE_NOTE_D) \
|
|
X(SE_NOTE_E) \
|
|
X(SE_NOTE_F) \
|
|
X(SE_NOTE_G) \
|
|
X(SE_NOTE_A) \
|
|
X(SE_NOTE_B) \
|
|
X(SE_NOTE_C_HIGH) \
|
|
X(SE_PUDDLE) \
|
|
X(SE_BRIDGE_WALK) \
|
|
X(SE_ITEMFINDER) \
|
|
X(SE_DING_DONG) \
|
|
X(SE_BALLOON_RED) \
|
|
X(SE_BALLOON_BLUE) \
|
|
X(SE_BALLOON_YELLOW) \
|
|
X(SE_BREAKABLE_DOOR) \
|
|
X(SE_MUD_BALL) \
|
|
X(SE_FIELD_POISON) \
|
|
X(SE_ESCALATOR) \
|
|
X(SE_THUNDERSTORM) \
|
|
X(SE_THUNDERSTORM_STOP) \
|
|
X(SE_DOWNPOUR) \
|
|
X(SE_DOWNPOUR_STOP) \
|
|
X(SE_RAIN) \
|
|
X(SE_RAIN_STOP) \
|
|
X(SE_THUNDER) \
|
|
X(SE_THUNDER2) \
|
|
X(SE_ELEVATOR) \
|
|
X(SE_LOW_HEALTH) \
|
|
X(SE_EXP_MAX) \
|
|
X(SE_ROULETTE_BALL) \
|
|
X(SE_ROULETTE_BALL2) \
|
|
X(SE_TAILLOW_WING_FLAP) \
|
|
X(SE_SHOP) \
|
|
X(SE_CONTEST_HEART) \
|
|
X(SE_CONTEST_CURTAIN_RISE) \
|
|
X(SE_CONTEST_CURTAIN_FALL) \
|
|
X(SE_CONTEST_ICON_CHANGE) \
|
|
X(SE_CONTEST_ICON_CLEAR) \
|
|
X(SE_CONTEST_MONS_TURN) \
|
|
X(SE_SHINY) \
|
|
X(SE_INTRO_BLAST) \
|
|
X(SE_MUGSHOT) \
|
|
X(SE_APPLAUSE) \
|
|
X(SE_VEND) \
|
|
X(SE_ORB) \
|
|
X(SE_DEX_SCROLL) \
|
|
X(SE_DEX_PAGE) \
|
|
X(SE_POKENAV_ON) \
|
|
X(SE_POKENAV_OFF) \
|
|
X(SE_DEX_SEARCH) \
|
|
X(SE_EGG_HATCH) \
|
|
X(SE_BALL_TRAY_ENTER) \
|
|
X(SE_BALL_TRAY_BALL) \
|
|
X(SE_BALL_TRAY_EXIT) \
|
|
X(SE_GLASS_FLUTE) \
|
|
X(SE_M_THUNDERBOLT) \
|
|
X(SE_M_THUNDERBOLT2) \
|
|
X(SE_M_HARDEN) \
|
|
X(SE_M_NIGHTMARE) \
|
|
X(SE_M_VITAL_THROW) \
|
|
X(SE_M_VITAL_THROW2) \
|
|
X(SE_M_BUBBLE) \
|
|
X(SE_M_BUBBLE2) \
|
|
X(SE_M_BUBBLE3) \
|
|
X(SE_M_RAIN_DANCE) \
|
|
X(SE_M_CUT) \
|
|
X(SE_M_STRING_SHOT) \
|
|
X(SE_M_STRING_SHOT2) \
|
|
X(SE_M_ROCK_THROW) \
|
|
X(SE_M_GUST) \
|
|
X(SE_M_GUST2) \
|
|
X(SE_M_DOUBLE_SLAP) \
|
|
X(SE_M_DOUBLE_TEAM) \
|
|
X(SE_M_RAZOR_WIND) \
|
|
X(SE_M_ICY_WIND) \
|
|
X(SE_M_THUNDER_WAVE) \
|
|
X(SE_M_COMET_PUNCH) \
|
|
X(SE_M_MEGA_KICK) \
|
|
X(SE_M_MEGA_KICK2) \
|
|
X(SE_M_CRABHAMMER) \
|
|
X(SE_M_JUMP_KICK) \
|
|
X(SE_M_FLAME_WHEEL) \
|
|
X(SE_M_FLAME_WHEEL2) \
|
|
X(SE_M_FLAMETHROWER) \
|
|
X(SE_M_FIRE_PUNCH) \
|
|
X(SE_M_TOXIC) \
|
|
X(SE_M_SACRED_FIRE) \
|
|
X(SE_M_SACRED_FIRE2) \
|
|
X(SE_M_EMBER) \
|
|
X(SE_M_TAKE_DOWN) \
|
|
X(SE_M_BLIZZARD) \
|
|
X(SE_M_BLIZZARD2) \
|
|
X(SE_M_SCRATCH) \
|
|
X(SE_M_VICEGRIP) \
|
|
X(SE_M_WING_ATTACK) \
|
|
X(SE_M_FLY) \
|
|
X(SE_M_SAND_ATTACK) \
|
|
X(SE_M_RAZOR_WIND2) \
|
|
X(SE_M_BITE) \
|
|
X(SE_M_HEADBUTT) \
|
|
X(SE_M_SURF) \
|
|
X(SE_M_HYDRO_PUMP) \
|
|
X(SE_M_WHIRLPOOL) \
|
|
X(SE_M_HORN_ATTACK) \
|
|
X(SE_M_TAIL_WHIP) \
|
|
X(SE_M_MIST) \
|
|
X(SE_M_POISON_POWDER) \
|
|
X(SE_M_BIND) \
|
|
X(SE_M_DRAGON_RAGE) \
|
|
X(SE_M_SING) \
|
|
X(SE_M_PERISH_SONG) \
|
|
X(SE_M_PAY_DAY) \
|
|
X(SE_M_DIG) \
|
|
X(SE_M_DIZZY_PUNCH) \
|
|
X(SE_M_SELF_DESTRUCT) \
|
|
X(SE_M_EXPLOSION) \
|
|
X(SE_M_ABSORB_2) \
|
|
X(SE_M_ABSORB) \
|
|
X(SE_M_SCREECH) \
|
|
X(SE_M_BUBBLE_BEAM) \
|
|
X(SE_M_BUBBLE_BEAM2) \
|
|
X(SE_M_SUPERSONIC) \
|
|
X(SE_M_BELLY_DRUM) \
|
|
X(SE_M_METRONOME) \
|
|
X(SE_M_BONEMERANG) \
|
|
X(SE_M_LICK) \
|
|
X(SE_M_PSYBEAM) \
|
|
X(SE_M_FAINT_ATTACK) \
|
|
X(SE_M_SWORDS_DANCE) \
|
|
X(SE_M_LEER) \
|
|
X(SE_M_SWAGGER) \
|
|
X(SE_M_SWAGGER2) \
|
|
X(SE_M_HEAL_BELL) \
|
|
X(SE_M_CONFUSE_RAY) \
|
|
X(SE_M_SNORE) \
|
|
X(SE_M_BRICK_BREAK) \
|
|
X(SE_M_GIGA_DRAIN) \
|
|
X(SE_M_PSYBEAM2) \
|
|
X(SE_M_SOLAR_BEAM) \
|
|
X(SE_M_PETAL_DANCE) \
|
|
X(SE_M_TELEPORT) \
|
|
X(SE_M_MINIMIZE) \
|
|
X(SE_M_SKETCH) \
|
|
X(SE_M_SWIFT) \
|
|
X(SE_M_REFLECT) \
|
|
X(SE_M_BARRIER) \
|
|
X(SE_M_DETECT) \
|
|
X(SE_M_LOCK_ON) \
|
|
X(SE_M_MOONLIGHT) \
|
|
X(SE_M_CHARM) \
|
|
X(SE_M_CHARGE) \
|
|
X(SE_M_STRENGTH) \
|
|
X(SE_M_HYPER_BEAM) \
|
|
X(SE_M_WATERFALL) \
|
|
X(SE_M_REVERSAL) \
|
|
X(SE_M_ACID_ARMOR) \
|
|
X(SE_M_SANDSTORM) \
|
|
X(SE_M_TRI_ATTACK) \
|
|
X(SE_M_TRI_ATTACK2) \
|
|
X(SE_M_ENCORE) \
|
|
X(SE_M_ENCORE2) \
|
|
X(SE_M_BATON_PASS) \
|
|
X(SE_M_MILK_DRINK) \
|
|
X(SE_M_ATTRACT) \
|
|
X(SE_M_ATTRACT2) \
|
|
X(SE_M_MORNING_SUN) \
|
|
X(SE_M_FLATTER) \
|
|
X(SE_M_SAND_TOMB) \
|
|
X(SE_M_GRASSWHISTLE) \
|
|
X(SE_M_SPIT_UP) \
|
|
X(SE_M_DIVE) \
|
|
X(SE_M_EARTHQUAKE) \
|
|
X(SE_M_TWISTER) \
|
|
X(SE_M_SWEET_SCENT) \
|
|
X(SE_M_YAWN) \
|
|
X(SE_M_SKY_UPPERCUT) \
|
|
X(SE_M_STAT_INCREASE) \
|
|
X(SE_M_HEAT_WAVE) \
|
|
X(SE_M_UPROAR) \
|
|
X(SE_M_HAIL) \
|
|
X(SE_M_COSMIC_POWER) \
|
|
X(SE_M_TEETER_DANCE) \
|
|
X(SE_M_STAT_DECREASE) \
|
|
X(SE_M_HAZE) \
|
|
X(SE_M_HYPER_BEAM2) \
|
|
X(SE_RG_DOOR) \
|
|
X(SE_RG_CARD_FLIP) \
|
|
X(SE_RG_CARD_FLIPPING) \
|
|
X(SE_RG_CARD_OPEN) \
|
|
X(SE_RG_BAG_CURSOR) \
|
|
X(SE_RG_BAG_POCKET) \
|
|
X(SE_RG_BALL_CLICK) \
|
|
X(SE_RG_SHOP) \
|
|
X(SE_RG_SS_ANNE_HORN) \
|
|
X(SE_RG_HELP_OPEN) \
|
|
X(SE_RG_HELP_CLOSE) \
|
|
X(SE_RG_HELP_ERROR) \
|
|
X(SE_RG_DEOXYS_MOVE) \
|
|
X(SE_RG_POKE_JUMP_SUCCESS) \
|
|
X(SE_RG_POKE_JUMP_FAILURE) \
|
|
X(SE_PHONE_CALL) \
|
|
X(SE_PHONE_CLICK) \
|
|
X(SE_ARENA_TIMEUP1) \
|
|
X(SE_ARENA_TIMEUP2) \
|
|
X(SE_PIKE_CURTAIN_CLOSE) \
|
|
X(SE_PIKE_CURTAIN_OPEN) \
|
|
X(SE_SUDOWOODO_SHAKE) \
|
|
|
|
// Create BGM list
|
|
#define X(songId) static const u8 sBGMName_##songId[] = _(#songId);
|
|
SOUND_LIST_BGM
|
|
#undef X
|
|
|
|
#define X(songId) sBGMName_##songId,
|
|
static const u8 *const sBGMNames[] =
|
|
{
|
|
SOUND_LIST_BGM
|
|
};
|
|
#undef X
|
|
|
|
// Create SE list
|
|
#define X(songId) static const u8 sSEName_##songId[] = _(#songId);
|
|
SOUND_LIST_SE
|
|
#undef X
|
|
|
|
#define X(songId) sSEName_##songId,
|
|
static const u8 *const sSENames[] =
|
|
{
|
|
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
|