Added a debug feature to hatch eggs (#3155)

This commit is contained in:
LOuroboros 2023-07-21 07:06:05 -03:00 committed by GitHub
parent 47cea526ec
commit cd5f997ee3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 41 additions and 0 deletions

View File

@ -112,4 +112,35 @@ Debug_SaveBlock2Size::
Debug_PokemonStorageSize:: Debug_PokemonStorageSize::
.string "{PKMN}Storage size: {STR_VAR_1}/{STR_VAR_2}.$" .string "{PKMN}Storage size: {STR_VAR_1}/{STR_VAR_2}.$"
Debug_HatchAnEgg::
lockall
getpartysize
goto_if_eq VAR_RESULT, 0, Debug_HatchAnEgg_NoPokemon
special ChoosePartyMon
waitstate
goto_if_ge VAR_0x8004, PARTY_SIZE, Debug_HatchAnEgg_End
specialvar VAR_RESULT, ScriptGetPartyMonSpecies
goto_if_ne VAR_RESULT, SPECIES_EGG, DebugScript_HatchAnEgg_CantForceHatch
special EggHatch
waitstate
Debug_HatchAnEgg_End::
releaseall
end
Debug_HatchAnEgg_NoPokemon::
msgbox DebugScript_HatchAnEgg_Text_EmptyParty, MSGBOX_DEFAULT
releaseall
end
DebugScript_HatchAnEgg_CantForceHatch::
msgbox DebugScript_HatchAnEgg_Text_NotAnEgg, MSGBOX_DEFAULT
releaseall
end
DebugScript_HatchAnEgg_Text_EmptyParty::
.string "You have no Pokémon nor Eggs.$"
DebugScript_HatchAnEgg_Text_NotAnEgg::
.string "That's not a Pokémon Egg.$"
.endif .endif

View File

@ -91,6 +91,7 @@ enum { // Util
DEBUG_UTIL_MENU_ITEM_TRAINER_ID, DEBUG_UTIL_MENU_ITEM_TRAINER_ID,
DEBUG_UTIL_MENU_ITEM_CLEAR_BOXES, DEBUG_UTIL_MENU_ITEM_CLEAR_BOXES,
DEBUG_UTIL_MENU_ITEM_CHEAT, DEBUG_UTIL_MENU_ITEM_CHEAT,
DEBUG_UTIL_MENU_ITEM_HATCH_AN_EGG,
}; };
enum { // Scripts enum { // Scripts
DEBUG_UTIL_MENU_ITEM_SCRIPT_1, DEBUG_UTIL_MENU_ITEM_SCRIPT_1,
@ -314,6 +315,7 @@ static void DebugAction_Util_Trainer_Gender(u8 taskId);
static void DebugAction_Util_Trainer_Id(u8 taskId); static void DebugAction_Util_Trainer_Id(u8 taskId);
static void DebugAction_Util_Clear_Boxes(u8 taskId); static void DebugAction_Util_Clear_Boxes(u8 taskId);
static void DebugAction_Util_CheatStart(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_Flags(u8 taskId);
static void DebugAction_FlagsVars_FlagsSelect(u8 taskId); static void DebugAction_FlagsVars_FlagsSelect(u8 taskId);
@ -383,6 +385,7 @@ extern u8 Debug_Script_8[];
extern u8 Debug_ShowFieldMessageStringVar4[]; extern u8 Debug_ShowFieldMessageStringVar4[];
extern u8 Debug_CheatStart[]; extern u8 Debug_CheatStart[];
extern u8 Debug_HatchAnEgg[];
extern u8 PlayersHouse_2F_EventScript_SetWallClock[]; extern u8 PlayersHouse_2F_EventScript_SetWallClock[];
extern u8 PlayersHouse_2F_EventScript_CheckWallClock[]; extern u8 PlayersHouse_2F_EventScript_CheckWallClock[];
extern u8 Debug_CheckSaveBlock[]; extern u8 Debug_CheckSaveBlock[];
@ -438,6 +441,7 @@ 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_Trainer_Id[] = _("New Trainer Id");
static const u8 sDebugText_Util_Clear_Boxes[] = _("Clear Storage Boxes"); static const u8 sDebugText_Util_Clear_Boxes[] = _("Clear Storage Boxes");
static const u8 sDebugText_Util_CheatStart[] = _("CHEAT Start"); static const u8 sDebugText_Util_CheatStart[] = _("CHEAT Start");
static const u8 sDebugText_Util_HatchAnEgg[] = _("Hatch an Egg");
// Flags/Vars Menu // Flags/Vars Menu
static const u8 sDebugText_FlagsVars_Flags[] = _("Set Flag XYZ…{CLEAR_TO 110}{RIGHT_ARROW}"); 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_Flag[] = _("Flag: {STR_VAR_1}{CLEAR_TO 90}\n{STR_VAR_2}{CLEAR_TO 90}\n{STR_VAR_3}");
@ -599,6 +603,7 @@ static const struct ListMenuItem sDebugMenu_Items_Utilities[] =
[DEBUG_UTIL_MENU_ITEM_TRAINER_ID] = {sDebugText_Util_Trainer_Id, DEBUG_UTIL_MENU_ITEM_TRAINER_ID}, [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_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_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[] = static const struct ListMenuItem sDebugMenu_Items_Scripts[] =
{ {
@ -731,6 +736,7 @@ static void (*const sDebugMenu_Actions_Utilities[])(u8) =
[DEBUG_UTIL_MENU_ITEM_TRAINER_ID] = DebugAction_Util_Trainer_Id, [DEBUG_UTIL_MENU_ITEM_TRAINER_ID] = DebugAction_Util_Trainer_Id,
[DEBUG_UTIL_MENU_ITEM_CLEAR_BOXES] = DebugAction_Util_Clear_Boxes, [DEBUG_UTIL_MENU_ITEM_CLEAR_BOXES] = DebugAction_Util_Clear_Boxes,
[DEBUG_UTIL_MENU_ITEM_CHEAT] = DebugAction_Util_CheatStart, [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) = static void (*const sDebugMenu_Actions_Scripts[])(u8) =
{ {
@ -1980,6 +1986,10 @@ static void DebugAction_Util_CheatStart(u8 taskId)
{ {
Debug_DestroyMenu_Full_Script(taskId, Debug_CheatStart); Debug_DestroyMenu_Full_Script(taskId, Debug_CheatStart);
} }
static void DebugAction_Util_HatchAnEgg(u8 taskId)
{
Debug_DestroyMenu_Full_Script(taskId, Debug_HatchAnEgg);
}
// ******************************* // *******************************
// Actions Scripts // Actions Scripts