Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Match Call to togglable options in debug menu #3489

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions data/scripts/debug.inc
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,32 @@ Debug_CheatStart::
setvar VAR_BRINEY_HOUSE_STATE, 1
setvar VAR_ROUTE116_STATE, 2
setflag FLAG_HIDE_ROUTE_116_MR_BRINEY
setflag FLAG_BADGE01_GET
setflag FLAG_BADGE02_GET
setflag FLAG_BADGE03_GET
setflag FLAG_BADGE04_GET
setflag FLAG_BADGE05_GET
setflag FLAG_BADGE06_GET
setflag FLAG_BADGE07_GET
setflag FLAG_BADGE08_GET
setflag FLAG_VISITED_LITTLEROOT_TOWN
setflag FLAG_VISITED_OLDALE_TOWN
setflag FLAG_VISITED_DEWFORD_TOWN
setflag FLAG_VISITED_LAVARIDGE_TOWN
setflag FLAG_VISITED_FALLARBOR_TOWN
setflag FLAG_VISITED_VERDANTURF_TOWN
setflag FLAG_VISITED_PACIFIDLOG_TOWN
setflag FLAG_VISITED_PETALBURG_CITY
setflag FLAG_VISITED_SLATEPORT_CITY
setflag FLAG_VISITED_MAUVILLE_CITY
setflag FLAG_VISITED_RUSTBORO_CITY
setflag FLAG_VISITED_FORTREE_CITY
setflag FLAG_VISITED_LILYCOVE_CITY
setflag FLAG_VISITED_MOSSDEEP_CITY
setflag FLAG_VISITED_SOOTOPOLIS_CITY
setflag FLAG_VISITED_EVER_GRANDE_CITY
setflag FLAG_LANDMARK_POKEMON_LEAGUE
setflag FLAG_LANDMARK_BATTLE_FRONTIER
Copy link
Collaborator

@AlexOn1ine AlexOn1ine Oct 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason for the visited flags here? They are set in debug fly as well once you use it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel that setting all Fly flags on when using that feature would get in the way of a user wanting to test stuff in the middle of their game's progression without setting those on.
For example, Record Mixing isn't unlocked until FLAG_VISITED_MAUVILLE_CITY, and some people might use their FLAG_VISITED for stuff other than Fly, like an event happening somewhere else after setting foot on a specific map.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if I understand you completely but it sounds like it would benefit the user so it's good 😅

Will do some tests ingame but it looks like it can be merged

clearflag FLAG_HIDE_BRINEYS_HOUSE_MR_BRINEY
clearflag FLAG_HIDE_BRINEYS_HOUSE_PEEKO
release
Expand Down
129 changes: 84 additions & 45 deletions src/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ enum FlagsVarsMenu
DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_POKEDEX,
DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_NATDEX,
DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_POKENAV,
DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_MATCH_CALL,
DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_RUN_SHOES,
DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_LOCATIONS,
DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_BADGES_ALL,
Expand Down Expand Up @@ -349,6 +350,7 @@ 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_SwitchMatchCall(u8 taskId);
static void DebugAction_FlagsVars_ToggleFlyFlags(u8 taskId);
static void DebugAction_FlagsVars_ToggleBadgeFlags(u8 taskId);
static void DebugAction_FlagsVars_ToggleFrontierPass(u8 taskId);
Expand Down Expand Up @@ -482,6 +484,7 @@ static const u8 sDebugText_FlagsVars_PokedexFlags_Reset[] = _("Pokédex Flag
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_SwitchMatchCall[] = _("Toggle {STR_VAR_1}Match Call");
static const u8 sDebugText_FlagsVars_RunningShoes[] = _("Toggle {STR_VAR_1}Running Shoes");
static const u8 sDebugText_FlagsVars_ToggleFlyFlags[] = _("Toggle {STR_VAR_1}Fly Flags");
static const u8 sDebugText_FlagsVars_ToggleAllBadges[] = _("Toggle {STR_VAR_1}All badges");
Expand Down Expand Up @@ -657,6 +660,7 @@ static const struct ListMenuItem sDebugMenu_Items_FlagsVars[] =
[DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_POKEDEX] = {sDebugText_FlagsVars_SwitchDex, DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_POKEDEX},
[DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_NATDEX] = {sDebugText_FlagsVars_SwitchNationalDex, DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_NATDEX},
[DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_POKENAV] = {sDebugText_FlagsVars_SwitchPokeNav, DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_POKENAV},
[DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_MATCH_CALL] = {sDebugText_FlagsVars_SwitchMatchCall, DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_MATCH_CALL},
[DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_RUN_SHOES] = {sDebugText_FlagsVars_RunningShoes, DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_RUN_SHOES},
[DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_LOCATIONS] = {sDebugText_FlagsVars_ToggleFlyFlags, DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_LOCATIONS},
[DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_BADGES_ALL] = {sDebugText_FlagsVars_ToggleAllBadges, DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_BADGES_ALL},
Expand Down Expand Up @@ -799,6 +803,7 @@ static void (*const sDebugMenu_Actions_Flags[])(u8) =
[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_MATCH_CALL] = DebugAction_FlagsVars_SwitchMatchCall,
[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,
Expand Down Expand Up @@ -1100,6 +1105,9 @@ static u8 Debug_CheckToggleFlags(u8 id)
case DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_POKENAV:
result = FlagGet(FLAG_SYS_POKENAV_GET);
break;
case DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_MATCH_CALL:
result = FlagGet(FLAG_ADDED_MATCH_CALL_TO_POKENAV) && FlagGet(FLAG_HAS_MATCH_CALL);
break;
case DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_RUN_SHOES:
result = FlagGet(FLAG_SYS_B_DASH);
break;
Expand Down Expand Up @@ -1649,24 +1657,6 @@ static void DebugAction_Util_HealParty(u8 taskId)

static void DebugAction_Util_Fly(u8 taskId)
{
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);
}
Expand Down Expand Up @@ -2516,6 +2506,22 @@ static void DebugAction_FlagsVars_SwitchPokeNav(u8 taskId)
FlagToggle(FLAG_SYS_POKENAV_GET);
}

static void DebugAction_FlagsVars_SwitchMatchCall(u8 taskId)
{
if (FlagGet(FLAG_ADDED_MATCH_CALL_TO_POKENAV))
{
PlaySE(SE_PC_OFF);
FlagClear(FLAG_ADDED_MATCH_CALL_TO_POKENAV);
FlagClear(FLAG_HAS_MATCH_CALL);
}
else
{
PlaySE(SE_PC_LOGIN);
FlagSet(FLAG_ADDED_MATCH_CALL_TO_POKENAV);
FlagSet(FLAG_HAS_MATCH_CALL);
}
}

static void DebugAction_FlagsVars_RunningShoes(u8 taskId)
{
if (FlagGet(FLAG_SYS_B_DASH))
Expand All @@ -2528,44 +2534,77 @@ static void DebugAction_FlagsVars_RunningShoes(u8 taskId)
static void DebugAction_FlagsVars_ToggleFlyFlags(u8 taskId)
{
if (FlagGet(FLAG_LANDMARK_BATTLE_FRONTIER))
{
PlaySE(SE_PC_OFF);
FlagClear(FLAG_VISITED_LITTLEROOT_TOWN);
FlagClear(FLAG_VISITED_OLDALE_TOWN);
FlagClear(FLAG_VISITED_DEWFORD_TOWN);
FlagClear(FLAG_VISITED_LAVARIDGE_TOWN);
FlagClear(FLAG_VISITED_FALLARBOR_TOWN);
FlagClear(FLAG_VISITED_VERDANTURF_TOWN);
FlagClear(FLAG_VISITED_PACIFIDLOG_TOWN);
FlagClear(FLAG_VISITED_PETALBURG_CITY);
FlagClear(FLAG_VISITED_SLATEPORT_CITY);
FlagClear(FLAG_VISITED_MAUVILLE_CITY);
FlagClear(FLAG_VISITED_RUSTBORO_CITY);
FlagClear(FLAG_VISITED_FORTREE_CITY);
FlagClear(FLAG_VISITED_LILYCOVE_CITY);
FlagClear(FLAG_VISITED_MOSSDEEP_CITY);
FlagClear(FLAG_VISITED_SOOTOPOLIS_CITY);
FlagClear(FLAG_VISITED_EVER_GRANDE_CITY);
FlagClear(FLAG_LANDMARK_POKEMON_LEAGUE);
FlagClear(FLAG_LANDMARK_BATTLE_FRONTIER);
}
else
{
PlaySE(SE_PC_LOGIN);

FlagToggle(FLAG_VISITED_LITTLEROOT_TOWN);
FlagToggle(FLAG_VISITED_OLDALE_TOWN);
FlagToggle(FLAG_VISITED_DEWFORD_TOWN);
FlagToggle(FLAG_VISITED_LAVARIDGE_TOWN);
FlagToggle(FLAG_VISITED_FALLARBOR_TOWN);
FlagToggle(FLAG_VISITED_VERDANTURF_TOWN);
FlagToggle(FLAG_VISITED_PACIFIDLOG_TOWN);
FlagToggle(FLAG_VISITED_PETALBURG_CITY);
FlagToggle(FLAG_VISITED_SLATEPORT_CITY);
FlagToggle(FLAG_VISITED_MAUVILLE_CITY);
FlagToggle(FLAG_VISITED_RUSTBORO_CITY);
FlagToggle(FLAG_VISITED_FORTREE_CITY);
FlagToggle(FLAG_VISITED_LILYCOVE_CITY);
FlagToggle(FLAG_VISITED_MOSSDEEP_CITY);
FlagToggle(FLAG_VISITED_SOOTOPOLIS_CITY);
FlagToggle(FLAG_VISITED_EVER_GRANDE_CITY);
FlagToggle(FLAG_LANDMARK_POKEMON_LEAGUE);
FlagToggle(FLAG_LANDMARK_BATTLE_FRONTIER);
FlagSet(FLAG_VISITED_LITTLEROOT_TOWN);
FlagSet(FLAG_VISITED_OLDALE_TOWN);
FlagSet(FLAG_VISITED_DEWFORD_TOWN);
FlagSet(FLAG_VISITED_LAVARIDGE_TOWN);
FlagSet(FLAG_VISITED_FALLARBOR_TOWN);
FlagSet(FLAG_VISITED_VERDANTURF_TOWN);
FlagSet(FLAG_VISITED_PACIFIDLOG_TOWN);
FlagSet(FLAG_VISITED_PETALBURG_CITY);
FlagSet(FLAG_VISITED_SLATEPORT_CITY);
FlagSet(FLAG_VISITED_MAUVILLE_CITY);
FlagSet(FLAG_VISITED_RUSTBORO_CITY);
FlagSet(FLAG_VISITED_FORTREE_CITY);
FlagSet(FLAG_VISITED_LILYCOVE_CITY);
FlagSet(FLAG_VISITED_MOSSDEEP_CITY);
FlagSet(FLAG_VISITED_SOOTOPOLIS_CITY);
FlagSet(FLAG_VISITED_EVER_GRANDE_CITY);
FlagSet(FLAG_LANDMARK_POKEMON_LEAGUE);
FlagSet(FLAG_LANDMARK_BATTLE_FRONTIER);
}
}

static void DebugAction_FlagsVars_ToggleBadgeFlags(u8 taskId)
{
if (FlagGet(FLAG_BADGE08_GET))
{
PlaySE(SE_PC_OFF);
FlagClear(FLAG_BADGE01_GET);
FlagClear(FLAG_BADGE02_GET);
FlagClear(FLAG_BADGE03_GET);
FlagClear(FLAG_BADGE04_GET);
FlagClear(FLAG_BADGE05_GET);
FlagClear(FLAG_BADGE06_GET);
FlagClear(FLAG_BADGE07_GET);
FlagClear(FLAG_BADGE08_GET);
}
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);
FlagSet(FLAG_BADGE01_GET);
FlagSet(FLAG_BADGE02_GET);
FlagSet(FLAG_BADGE03_GET);
FlagSet(FLAG_BADGE04_GET);
FlagSet(FLAG_BADGE05_GET);
FlagSet(FLAG_BADGE06_GET);
FlagSet(FLAG_BADGE07_GET);
FlagSet(FLAG_BADGE08_GET);
}
}

static void DebugAction_FlagsVars_ToggleFrontierPass(u8 taskId)
Expand Down
Loading