mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-11-16 11:37:40 +01:00
Merge pull request #2277 from TheXaman/tx_debug_system_rhh
Inclusion of the tx_debug_system
This commit is contained in:
commit
066a5bee85
@ -577,6 +577,8 @@ gStdScripts_End::
|
||||
.include "data/scripts/new_game.inc"
|
||||
.include "data/scripts/hall_of_fame.inc"
|
||||
|
||||
.include "data/scripts/debug.inc"
|
||||
|
||||
EventScript_WhiteOut::
|
||||
call EverGrandeCity_HallOfFame_EventScript_ResetEliteFour
|
||||
goto EventScript_ResetMrBriney
|
||||
|
79
data/scripts/debug.inc
Normal file
79
data/scripts/debug.inc
Normal file
@ -0,0 +1,79 @@
|
||||
Debug_ShowFieldMessageStringVar4::
|
||||
special ShowFieldMessageStringVar4
|
||||
waitmessage
|
||||
waitbuttonpress
|
||||
releaseall
|
||||
end
|
||||
|
||||
Debug_CheatStart::
|
||||
lockall
|
||||
setflag FLAG_SYS_POKEMON_GET
|
||||
setflag FLAG_RESCUED_BIRCH
|
||||
setflag FLAG_HIDE_ROUTE_101_BIRCH_ZIGZAGOON_BATTLE
|
||||
setflag FLAG_ADVENTURE_STARTED
|
||||
clearflag FLAG_HIDE_LITTLEROOT_TOWN_BIRCHS_LAB_BIRCH
|
||||
setflag FLAG_HIDE_ROUTE_101_BIRCH_STARTERS_BAG
|
||||
setvar VAR_BIRCH_LAB_STATE, 2
|
||||
setvar VAR_ROUTE101_STATE, 3
|
||||
givemon SPECIES_TREECKO, 20, ITEM_NONE
|
||||
givemon SPECIES_TORCHIC, 20, ITEM_NONE
|
||||
givemon SPECIES_MUDKIP, 20, ITEM_NONE
|
||||
setflag FLAG_SYS_POKEDEX_GET
|
||||
special SetUnlockedPokedexFlags
|
||||
setflag FLAG_RECEIVED_POKEDEX_FROM_BIRCH
|
||||
setvar VAR_CABLE_CLUB_TUTORIAL_STATE, 1
|
||||
setflag FLAG_SYS_NATIONAL_DEX
|
||||
special EnableNationalPokedex
|
||||
setflag FLAG_RECEIVED_RUNNING_SHOES
|
||||
setflag FLAG_SYS_B_DASH
|
||||
setvar VAR_LITTLEROOT_TOWN_STATE, 4 @ 4: Received Running Shoes
|
||||
setvar VAR_LITTLEROOT_INTRO_STATE, 7 @ 7: Told to go meet rival
|
||||
setvar VAR_LITTLEROOT_HOUSES_STATE_BRENDAN, 2 @ 2: Met Rival's Mom (and is corresponding gender)
|
||||
setvar VAR_LITTLEROOT_HOUSES_STATE_MAY, 2 @ 2: Met Rival's Mom (and is corresponding gender)
|
||||
setvar VAR_LITTLEROOT_RIVAL_STATE, 4 @ 4: Received Pokedex
|
||||
setflag FLAG_RECEIVED_BIKE
|
||||
additem ITEM_ACRO_BIKE
|
||||
setvar VAR_BRINEY_HOUSE_STATE, 1
|
||||
setvar VAR_ROUTE116_STATE, 2
|
||||
setflag FLAG_HIDE_ROUTE_116_MR_BRINEY
|
||||
clearflag FLAG_HIDE_BRINEYS_HOUSE_MR_BRINEY
|
||||
clearflag FLAG_HIDE_BRINEYS_HOUSE_PEEKO
|
||||
release
|
||||
end
|
||||
|
||||
Debug_FlagsNotSetMessage::
|
||||
lockall
|
||||
message Debug_FlagsNotSetMessage_Text
|
||||
waitmessage
|
||||
waitbuttonpress
|
||||
releaseall
|
||||
end
|
||||
|
||||
Debug_FlagsNotSetMessage_Text:
|
||||
.string "Feature unavailable!\n"
|
||||
.string "Please define a usable flag in:\l"
|
||||
.string "'include/constants/overworld{UNDERSCORE}config.h'!$"
|
||||
|
||||
Debug_Script_1::
|
||||
end
|
||||
|
||||
Debug_Script_2::
|
||||
end
|
||||
|
||||
Debug_Script_3::
|
||||
end
|
||||
|
||||
Debug_Script_4::
|
||||
end
|
||||
|
||||
Debug_Script_5::
|
||||
end
|
||||
|
||||
Debug_Script_6::
|
||||
end
|
||||
|
||||
Debug_Script_7::
|
||||
end
|
||||
|
||||
Debug_Script_8::
|
||||
end
|
@ -130,6 +130,8 @@
|
||||
#define B_FLAG_INVERSE_BATTLE 0 // If this flag is set, the battle's type effectiveness are inversed. For example, fire is super effective against water.
|
||||
#define B_FLAG_FORCE_DOUBLE_WILD 0 // If this flag is set, all land and surfing wild battles will be double battles.
|
||||
#define B_SMART_WILD_AI_FLAG 0 // If not 0, you can set this flag in a script to enable smart wild pokemon
|
||||
#define B_FLAG_NO_BAG_USE 0 // If this flag is set, the ability to use the bag in battle is disabled.
|
||||
#define B_FLAG_NO_CATCHING 0 // If this flag is set, the ability to catch wild Pokémon is disabled.
|
||||
|
||||
// Var Settings
|
||||
// To use the following features in scripting, replace the 0s with the var ID you're assigning it to.
|
||||
|
@ -2,6 +2,7 @@
|
||||
#define GUARD_CONSTANTS_GLOBAL_H
|
||||
|
||||
#include "constants/battle_config.h"
|
||||
#include "constants/overworld_config.h"
|
||||
|
||||
// Invalid Versions show as "----------" in Gen 4 and Gen 5's summary screen.
|
||||
// In Gens 6 and 7, invalid versions instead show "a distant land" in the summary screen.
|
||||
|
18
include/constants/overworld_config.h
Normal file
18
include/constants/overworld_config.h
Normal file
@ -0,0 +1,18 @@
|
||||
#ifndef GUARD_CONSTANTS_OVERWORLD_CONFIG_H
|
||||
#define GUARD_CONSTANTS_OVERWORLD_CONFIG_H
|
||||
|
||||
// Overworld flags
|
||||
#define OW_FLAG_NO_ENCOUNTER 0 // If this flag is set, wild encounters will be disabled.
|
||||
#define OW_FLAG_NO_TRAINER_SEE 0 // If this flag is set, trainers will not battle the player unless they're talked to.
|
||||
|
||||
// Debug options
|
||||
#define DEBUG_SYSTEM_ENABLE TRUE // Enables a overworld debug menu for changing flags, variables, giving pokemon and more, accessed by holding R and pressing START while in the overworld by default.
|
||||
#define DEBUG_SYSTEM_HELD_KEYS (R_BUTTON) // The keys required to be held to open the debug menu.
|
||||
#define DEBUG_SYSTEM_TRIGGER_EVENT pressedStartButton // The event that opens the menu when holding the key(s) defined in DEBUG_SYSTEM_HELD_KEYS.
|
||||
#define DEBUG_SYSTEM_IN_MENU FALSE // Replaces the overworld debug menu button combination with a start menu entry (above Pokédex).
|
||||
|
||||
// Replace the used flags with others or disable with a 0
|
||||
#define DEBUG_FLAG_NO_COLLISION 0 // If this flag is set, the debug function in the Utility submenu to disable player collision can be used.
|
||||
#define DEBUG_FLAG_PC_FROM_DEBUG_MENU 0 // If this flag is set, the debug function in debug menu to access the player PC works.
|
||||
|
||||
#endif // GUARD_CONSTANTS_OVERWORLD_CONFIG_H
|
@ -276,8 +276,10 @@
|
||||
#define SE_PIKE_CURTAIN_CLOSE 267 // SE_CURTAIN
|
||||
#define SE_PIKE_CURTAIN_OPEN 268 // SE_CURTAIN1
|
||||
#define SE_SUDOWOODO_SHAKE 269 // SE_USSOKI
|
||||
#define END_SE SE_SUDOWOODO_SHAKE
|
||||
|
||||
// Music
|
||||
#define START_MUS 350
|
||||
#define MUS_LITTLEROOT_TEST 350 // MUS_TETSUJI
|
||||
#define MUS_GSC_ROUTE38 351 // MUS_FIELD13
|
||||
#define MUS_CAUGHT 352 // MUS_KACHI22
|
||||
@ -488,6 +490,7 @@
|
||||
#define MUS_RG_TRAINER_TOWER 556 // MUS_RG_T_TOWER
|
||||
#define MUS_RG_SLOW_PALLET 557 // MUS_RG_SLOWMASARA
|
||||
#define MUS_RG_TEACHY_TV_MENU 558 // MUS_RG_TVNOIZE
|
||||
#define END_MUS MUS_RG_TEACHY_TV_MENU
|
||||
|
||||
#define PH_TRAP_BLEND 559
|
||||
#define PH_TRAP_HELD 560
|
||||
|
8
include/debug.h
Normal file
8
include/debug.h
Normal file
@ -0,0 +1,8 @@
|
||||
#ifndef GUARD_DEBUG_H
|
||||
#define GUARD_DEBUG_H
|
||||
|
||||
#include "constants/overworld_config.h"
|
||||
|
||||
void Debug_ShowMainMenu(void);
|
||||
|
||||
#endif // GUARD_DEBUG_H
|
@ -20,10 +20,12 @@ void EnableResetRTC(void);
|
||||
bool32 CanResetRTC(void);
|
||||
u16 *GetVarPointer(u16 id);
|
||||
u16 VarGet(u16 id);
|
||||
u16 VarGetIfExist(u16 id);
|
||||
bool8 VarSet(u16 id, u16 value);
|
||||
u8 VarGetObjectEventGraphicsId(u8 id);
|
||||
u8 *GetFlagPointer(u16 id);
|
||||
u8 FlagSet(u16 id);
|
||||
u8 FlagToggle(u16 id);
|
||||
u8 FlagClear(u16 id);
|
||||
bool8 FlagGet(u16 id);
|
||||
|
||||
|
@ -43,6 +43,7 @@ enum {
|
||||
BALL_THROW_UNABLE_NO_ROOM,
|
||||
BALL_THROW_UNABLE_SEMI_INVULNERABLE,
|
||||
BALL_THROW_ABLE,
|
||||
BALL_THROW_UNABLE_DISABLED_FLAG,
|
||||
};
|
||||
|
||||
bool32 CanThrowBall(void);
|
||||
|
@ -3,5 +3,6 @@
|
||||
|
||||
void CB2_InitMainMenu(void);
|
||||
void CreateYesNoMenuParameterized(u8 x, u8 y, u16 baseTileNum, u16 baseBlock, u8 yesNoPalNum, u8 winPalNum);
|
||||
void NewGameBirchSpeech_SetDefaultPlayerName(u8);
|
||||
|
||||
#endif // GUARD_MAIN_MENU_H
|
||||
|
@ -464,6 +464,7 @@ void SetMonData(struct Pokemon *mon, s32 field, const void *dataArg);
|
||||
void SetBoxMonData(struct BoxPokemon *boxMon, s32 field, const void *dataArg);
|
||||
void CopyMon(void *dest, void *src, size_t size);
|
||||
u8 GiveMonToPlayer(struct Pokemon *mon);
|
||||
u8 SendMonToPC(struct Pokemon* mon);
|
||||
u8 CalculatePlayerPartyCount(void);
|
||||
u8 CalculateEnemyPartyCount(void);
|
||||
u8 GetMonsStateToDoubles(void);
|
||||
|
@ -72,4 +72,6 @@ u8 *GetWaldaPhrasePtr(void);
|
||||
void SetWaldaPhrase(const u8 *src);
|
||||
bool32 IsWaldaPhraseEmpty(void);
|
||||
|
||||
void EnterPokeStorage(u8 boxOption);
|
||||
|
||||
#endif // GUARD_POKEMON_STORAGE_SYSTEM_H
|
||||
|
@ -4006,6 +4006,16 @@ static void HandleTurnActionSelectionState(void)
|
||||
}
|
||||
break;
|
||||
case B_ACTION_USE_ITEM:
|
||||
if (FlagGet(B_FLAG_NO_BAG_USE))
|
||||
{
|
||||
RecordedBattle_ClearBattlerAction(gActiveBattler, 1);
|
||||
gSelectionBattleScripts[gActiveBattler] = BattleScript_ActionSelectionItemsCantBeUsed;
|
||||
gBattleCommunication[gActiveBattler] = STATE_SELECTION_SCRIPT;
|
||||
*(gBattleStruct->selectionScriptFinished + gActiveBattler) = FALSE;
|
||||
*(gBattleStruct->stateIdAfterSelScript + gActiveBattler) = STATE_BEFORE_ACTION_CHOSEN;
|
||||
return;
|
||||
}
|
||||
|
||||
if ((gBattleTypeFlags & (BATTLE_TYPE_LINK
|
||||
| BATTLE_TYPE_FRONTIER_NO_PYRAMID
|
||||
| BATTLE_TYPE_EREADER_TRAINER
|
||||
|
3398
src/debug.c
Normal file
3398
src/debug.c
Normal file
File diff suppressed because it is too large
Load Diff
@ -184,6 +184,14 @@ u16 VarGet(u16 id)
|
||||
return *ptr;
|
||||
}
|
||||
|
||||
u16 VarGetIfExist(u16 id)
|
||||
{
|
||||
u16 *ptr = GetVarPointer(id);
|
||||
if (!ptr)
|
||||
return 65535;
|
||||
return *ptr;
|
||||
}
|
||||
|
||||
bool8 VarSet(u16 id, u16 value)
|
||||
{
|
||||
u16 *ptr = GetVarPointer(id);
|
||||
@ -216,6 +224,14 @@ u8 FlagSet(u16 id)
|
||||
return 0;
|
||||
}
|
||||
|
||||
u8 FlagToggle(u16 id)
|
||||
{
|
||||
u8 *ptr = GetFlagPointer(id);
|
||||
if (ptr)
|
||||
*ptr ^= 1 << (id & 7);
|
||||
return 0;
|
||||
}
|
||||
|
||||
u8 FlagClear(u16 id)
|
||||
{
|
||||
u8 *ptr = GetFlagPointer(id);
|
||||
|
@ -2,6 +2,7 @@
|
||||
#include "malloc.h"
|
||||
#include "battle_pyramid.h"
|
||||
#include "berry.h"
|
||||
#include "debug.h"
|
||||
#include "decoration.h"
|
||||
#include "event_data.h"
|
||||
#include "event_object_movement.h"
|
||||
@ -4628,6 +4629,12 @@ static u8 GetCollisionInDirection(struct ObjectEvent *objectEvent, u8 direction)
|
||||
u8 GetCollisionAtCoords(struct ObjectEvent *objectEvent, s16 x, s16 y, u32 dir)
|
||||
{
|
||||
u8 direction = dir;
|
||||
|
||||
#if DEBUG_SYSTEM_ENABLE == TRUE
|
||||
if (FlagGet(DEBUG_FLAG_NO_COLLISION))
|
||||
return COLLISION_NONE;
|
||||
#endif
|
||||
|
||||
if (IsCoordOutsideObjectEventMovementRange(objectEvent, x, y))
|
||||
return COLLISION_OUTSIDE_RANGE;
|
||||
else if (MapGridGetCollisionAt(x, y) || GetMapBorderIdAt(x, y) == CONNECTION_INVALID || IsMetatileDirectionallyImpassable(objectEvent, x, y, direction))
|
||||
|
@ -3,6 +3,7 @@
|
||||
#include "bike.h"
|
||||
#include "coord_event_weather.h"
|
||||
#include "daycare.h"
|
||||
#include "debug.h"
|
||||
#include "faraway_island.h"
|
||||
#include "event_data.h"
|
||||
#include "event_object_movement.h"
|
||||
@ -129,6 +130,14 @@ void FieldGetPlayerInput(struct FieldInput *input, u16 newKeys, u16 heldKeys)
|
||||
input->dpadDirection = DIR_WEST;
|
||||
else if (heldKeys & DPAD_RIGHT)
|
||||
input->dpadDirection = DIR_EAST;
|
||||
|
||||
#if DEBUG_SYSTEM_ENABLE == TRUE && DEBUG_SYSTEM_IN_MENU == FALSE
|
||||
if ((heldKeys & DEBUG_SYSTEM_HELD_KEYS) && input->DEBUG_SYSTEM_TRIGGER_EVENT)
|
||||
{
|
||||
input->input_field_1_2 = TRUE;
|
||||
input->DEBUG_SYSTEM_TRIGGER_EVENT = FALSE;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
int ProcessPlayerFieldInput(struct FieldInput *input)
|
||||
@ -188,6 +197,15 @@ int ProcessPlayerFieldInput(struct FieldInput *input)
|
||||
if (input->pressedSelectButton && UseRegisteredKeyItemOnField() == TRUE)
|
||||
return TRUE;
|
||||
|
||||
#if DEBUG_SYSTEM_ENABLE == TRUE && DEBUG_SYSTEM_IN_MENU == FALSE
|
||||
if (input->input_field_1_2)
|
||||
{
|
||||
PlaySE(SE_WIN_OPEN);
|
||||
Debug_ShowMainMenu();
|
||||
return TRUE;
|
||||
}
|
||||
#endif
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -668,6 +686,9 @@ void RestartWildEncounterImmunitySteps(void)
|
||||
|
||||
static bool8 CheckStandardWildEncounter(u16 metatileBehavior)
|
||||
{
|
||||
if (FlagGet(OW_FLAG_NO_ENCOUNTER))
|
||||
return FALSE;
|
||||
|
||||
if (sWildEncounterImmunitySteps < 4)
|
||||
{
|
||||
sWildEncounterImmunitySteps++;
|
||||
|
9
src/item_use.c
Executable file → Normal file
9
src/item_use.c
Executable file → Normal file
@ -968,6 +968,8 @@ static u32 GetBallThrowableState(void)
|
||||
else if (gStatuses3[GetCatchingBattler()] & STATUS3_SEMI_INVULNERABLE)
|
||||
return BALL_THROW_UNABLE_SEMI_INVULNERABLE;
|
||||
#endif
|
||||
else if (FlagGet(B_FLAG_NO_CATCHING))
|
||||
return BALL_THROW_UNABLE_DISABLED_FLAG;
|
||||
|
||||
return BALL_THROW_ABLE;
|
||||
}
|
||||
@ -979,6 +981,7 @@ bool32 CanThrowBall(void)
|
||||
|
||||
static const u8 sText_CantThrowPokeBall_TwoMons[] = _("Cannot throw a ball!\nThere are two Pokémon out there!\p");
|
||||
static const u8 sText_CantThrowPokeBall_SemiInvulnerable[] = _("Cannot throw a ball!\nThere's no Pokémon in sight!\p");
|
||||
static const u8 sText_CantThrowPokeBall_Disabled[] = _("POKé BALLS cannot be used\nright now!\p");
|
||||
void ItemUseInBattle_PokeBall(u8 taskId)
|
||||
{
|
||||
switch (GetBallThrowableState())
|
||||
@ -1011,6 +1014,12 @@ void ItemUseInBattle_PokeBall(u8 taskId)
|
||||
DisplayItemMessageInBattlePyramid(taskId, sText_CantThrowPokeBall_SemiInvulnerable, Task_CloseBattlePyramidBagMessage);
|
||||
break;
|
||||
#endif
|
||||
case BALL_THROW_UNABLE_DISABLED_FLAG:
|
||||
if (!InBattlePyramid())
|
||||
DisplayItemMessage(taskId, FONT_NORMAL, sText_CantThrowPokeBall_Disabled, CloseItemMessage);
|
||||
else
|
||||
DisplayItemMessageInBattlePyramid(taskId, sText_CantThrowPokeBall_Disabled, Task_CloseBattlePyramidBagMessage);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -12,6 +12,7 @@
|
||||
#include "international_string_util.h"
|
||||
#include "link.h"
|
||||
#include "main.h"
|
||||
#include "main_menu.h"
|
||||
#include "menu.h"
|
||||
#include "list_menu.h"
|
||||
#include "mystery_event_menu.h"
|
||||
@ -223,7 +224,6 @@ static void Task_NewGameBirchSpeech_WaitForWhatsYourNameToPrint(u8);
|
||||
static void Task_NewGameBirchSpeech_WaitPressBeforeNameChoice(u8);
|
||||
static void Task_NewGameBirchSpeech_StartNamingScreen(u8);
|
||||
static void CB2_NewGameBirchSpeech_ReturnFromNamingScreen(void);
|
||||
static void NewGameBirchSpeech_SetDefaultPlayerName(u8);
|
||||
static void Task_NewGameBirchSpeech_CreateNameYesNo(u8);
|
||||
static void Task_NewGameBirchSpeech_ProcessNameYesNoMenu(u8);
|
||||
void CreateYesNoMenuParameterized(u8, u8, u16, u16, u8, u8);
|
||||
@ -2100,7 +2100,7 @@ static s8 NewGameBirchSpeech_ProcessGenderMenuInput(void)
|
||||
return Menu_ProcessInputNoWrap();
|
||||
}
|
||||
|
||||
static void NewGameBirchSpeech_SetDefaultPlayerName(u8 nameId)
|
||||
void NewGameBirchSpeech_SetDefaultPlayerName(u8 nameId)
|
||||
{
|
||||
const u8 *name;
|
||||
u8 i;
|
||||
|
@ -65,7 +65,6 @@ static void DecryptBoxMon(struct BoxPokemon *boxMon);
|
||||
static void Task_PlayMapChosenOrBattleBGM(u8 taskId);
|
||||
static u16 GiveMoveToBoxMon(struct BoxPokemon *boxMon, u16 move);
|
||||
static bool8 ShouldSkipFriendshipChange(void);
|
||||
static u8 SendMonToPC(struct Pokemon *mon);
|
||||
static void RemoveIVIndexFromList(u8 *ivs, u8 selectedIv);
|
||||
void TrySpecialOverworldEvo();
|
||||
|
||||
@ -5183,7 +5182,7 @@ u8 GiveMonToPlayer(struct Pokemon *mon)
|
||||
return MON_GIVEN_TO_PARTY;
|
||||
}
|
||||
|
||||
static u8 SendMonToPC(struct Pokemon *mon)
|
||||
u8 SendMonToPC(struct Pokemon* mon)
|
||||
{
|
||||
s32 boxNo, boxPos;
|
||||
|
||||
|
@ -579,7 +579,6 @@ EWRAM_DATA static bool8 sAutoActionOn = 0;
|
||||
EWRAM_DATA static bool8 sJustOpenedBag = 0;
|
||||
|
||||
// Main tasks
|
||||
static void EnterPokeStorage(u8);
|
||||
static void Task_InitPokeStorage(u8);
|
||||
static void Task_PlaceMon(u8);
|
||||
static void Task_ChangeScreen(u8);
|
||||
@ -1670,10 +1669,18 @@ static void FieldTask_ReturnToPcMenu(void)
|
||||
MainCallback vblankCb = gMain.vblankCallback;
|
||||
|
||||
SetVBlankCallback(NULL);
|
||||
taskId = CreateTask(Task_PCMainMenu, 80);
|
||||
gTasks[taskId].tState = 0;
|
||||
gTasks[taskId].tSelectedOption = sPreviousBoxOption;
|
||||
Task_PCMainMenu(taskId);
|
||||
if (!FlagGet(DEBUG_FLAG_PC_FROM_DEBUG_MENU))
|
||||
{
|
||||
taskId = CreateTask(Task_PCMainMenu, 80);
|
||||
gTasks[taskId].tState = 0;
|
||||
gTasks[taskId].tSelectedOption = sPreviousBoxOption;
|
||||
Task_PCMainMenu(taskId);
|
||||
}
|
||||
else
|
||||
{
|
||||
FlagClear(DEBUG_FLAG_PC_FROM_DEBUG_MENU);
|
||||
ScriptContext_Enable();
|
||||
}
|
||||
SetVBlankCallback(vblankCb);
|
||||
FadeInFromBlack();
|
||||
}
|
||||
@ -2003,7 +2010,7 @@ static void CB2_PokeStorage(void)
|
||||
BuildOamBuffer();
|
||||
}
|
||||
|
||||
static void EnterPokeStorage(u8 boxOption)
|
||||
void EnterPokeStorage(u8 boxOption)
|
||||
{
|
||||
ResetTasks();
|
||||
sCurrentBoxOption = boxOption;
|
||||
|
@ -3,6 +3,7 @@
|
||||
#include "battle_pyramid.h"
|
||||
#include "battle_pyramid_bag.h"
|
||||
#include "bg.h"
|
||||
#include "debug.h"
|
||||
#include "event_data.h"
|
||||
#include "event_object_movement.h"
|
||||
#include "event_object_lock.h"
|
||||
@ -62,7 +63,8 @@ enum
|
||||
MENU_ACTION_PLAYER_LINK,
|
||||
MENU_ACTION_REST_FRONTIER,
|
||||
MENU_ACTION_RETIRE_FRONTIER,
|
||||
MENU_ACTION_PYRAMID_BAG
|
||||
MENU_ACTION_PYRAMID_BAG,
|
||||
MENU_ACTION_DEBUG,
|
||||
};
|
||||
|
||||
// Save status
|
||||
@ -103,6 +105,7 @@ static bool8 StartMenuSafariZoneRetireCallback(void);
|
||||
static bool8 StartMenuLinkModePlayerNameCallback(void);
|
||||
static bool8 StartMenuBattlePyramidRetireCallback(void);
|
||||
static bool8 StartMenuBattlePyramidBagCallback(void);
|
||||
static bool8 StartMenuDebugCallback(void);
|
||||
|
||||
// Menu callbacks
|
||||
static bool8 SaveStartCallback(void);
|
||||
@ -154,6 +157,8 @@ static const u8 *const sPyramidFloorNames[FRONTIER_STAGES_PER_CHALLENGE + 1] =
|
||||
static const struct WindowTemplate sPyramidFloorWindowTemplate_2 = {0, 1, 1, 0xA, 4, 0xF, 8};
|
||||
static const struct WindowTemplate sPyramidFloorWindowTemplate_1 = {0, 1, 1, 0xC, 4, 0xF, 8};
|
||||
|
||||
static const u8 gText_MenuDebug[] = _("DEBUG");
|
||||
|
||||
static const struct MenuAction sStartMenuItems[] =
|
||||
{
|
||||
[MENU_ACTION_POKEDEX] = {gText_MenuPokedex, {.u8_void = StartMenuPokedexCallback}},
|
||||
@ -168,7 +173,8 @@ static const struct MenuAction sStartMenuItems[] =
|
||||
[MENU_ACTION_PLAYER_LINK] = {gText_MenuPlayer, {.u8_void = StartMenuLinkModePlayerNameCallback}},
|
||||
[MENU_ACTION_REST_FRONTIER] = {gText_MenuRest, {.u8_void = StartMenuSaveCallback}},
|
||||
[MENU_ACTION_RETIRE_FRONTIER] = {gText_MenuRetire, {.u8_void = StartMenuBattlePyramidRetireCallback}},
|
||||
[MENU_ACTION_PYRAMID_BAG] = {gText_MenuBag, {.u8_void = StartMenuBattlePyramidBagCallback}}
|
||||
[MENU_ACTION_PYRAMID_BAG] = {gText_MenuBag, {.u8_void = StartMenuBattlePyramidBagCallback}},
|
||||
[MENU_ACTION_DEBUG] = {gText_MenuDebug, {.u8_void = StartMenuDebugCallback}},
|
||||
};
|
||||
|
||||
static const struct BgTemplate sBgTemplates_LinkBattleSave[] =
|
||||
@ -212,6 +218,7 @@ static const struct WindowTemplate sSaveInfoWindowTemplate = {
|
||||
static void BuildStartMenuActions(void);
|
||||
static void AddStartMenuAction(u8 action);
|
||||
static void BuildNormalStartMenu(void);
|
||||
static void BuildDebugStartMenu(void);
|
||||
static void BuildSafariZoneStartMenu(void);
|
||||
static void BuildLinkModeStartMenu(void);
|
||||
static void BuildUnionRoomStartMenu(void);
|
||||
@ -240,6 +247,7 @@ static void CB2_SaveAfterLinkBattle(void);
|
||||
static void ShowSaveInfoWindow(void);
|
||||
static void RemoveSaveInfoWindow(void);
|
||||
static void HideStartMenuWindow(void);
|
||||
static void HideStartMenuDebug(void);
|
||||
|
||||
void SetDexPokemonPokenavFlags(void) // unused
|
||||
{
|
||||
@ -278,7 +286,11 @@ static void BuildStartMenuActions(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
#if DEBUG_SYSTEM_ENABLE == TRUE && DEBUG_SYSTEM_IN_MENU == TRUE
|
||||
BuildDebugStartMenu();
|
||||
#else
|
||||
BuildNormalStartMenu();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@ -311,6 +323,21 @@ static void BuildNormalStartMenu(void)
|
||||
AddStartMenuAction(MENU_ACTION_EXIT);
|
||||
}
|
||||
|
||||
static void BuildDebugStartMenu(void)
|
||||
{
|
||||
AddStartMenuAction(MENU_ACTION_DEBUG);
|
||||
if (FlagGet(FLAG_SYS_POKEDEX_GET) == TRUE)
|
||||
AddStartMenuAction(MENU_ACTION_POKEDEX);
|
||||
if (FlagGet(FLAG_SYS_POKEMON_GET) == TRUE)
|
||||
AddStartMenuAction(MENU_ACTION_POKEMON);
|
||||
AddStartMenuAction(MENU_ACTION_BAG);
|
||||
if (FlagGet(FLAG_SYS_POKENAV_GET) == TRUE)
|
||||
AddStartMenuAction(MENU_ACTION_POKENAV);
|
||||
AddStartMenuAction(MENU_ACTION_PLAYER);
|
||||
AddStartMenuAction(MENU_ACTION_SAVE);
|
||||
AddStartMenuAction(MENU_ACTION_OPTION);
|
||||
}
|
||||
|
||||
static void BuildSafariZoneStartMenu(void)
|
||||
{
|
||||
AddStartMenuAction(MENU_ACTION_RETIRE_SAFARI);
|
||||
@ -592,6 +619,7 @@ static bool8 HandleStartMenuInput(void)
|
||||
|
||||
if (gMenuCallback != StartMenuSaveCallback
|
||||
&& gMenuCallback != StartMenuExitCallback
|
||||
&& gMenuCallback != StartMenuDebugCallback
|
||||
&& gMenuCallback != StartMenuSafariZoneRetireCallback
|
||||
&& gMenuCallback != StartMenuBattlePyramidRetireCallback)
|
||||
{
|
||||
@ -727,6 +755,18 @@ static bool8 StartMenuExitCallback(void)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static bool8 StartMenuDebugCallback(void)
|
||||
{
|
||||
RemoveExtraStartMenuWindows();
|
||||
HideStartMenuDebug(); // Hide start menu without enabling movement
|
||||
|
||||
#if DEBUG_SYSTEM_ENABLE == TRUE
|
||||
Debug_ShowMainMenu();
|
||||
#endif
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static bool8 StartMenuSafariZoneRetireCallback(void)
|
||||
{
|
||||
RemoveExtraStartMenuWindows();
|
||||
@ -736,6 +776,13 @@ static bool8 StartMenuSafariZoneRetireCallback(void)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void HideStartMenuDebug(void)
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
ClearStdWindowAndFrame(GetStartMenuWindowId(), TRUE);
|
||||
RemoveStartMenuWindow();
|
||||
}
|
||||
|
||||
static bool8 StartMenuLinkModePlayerNameCallback(void)
|
||||
{
|
||||
if (!gPaletteFade.active)
|
||||
|
@ -192,6 +192,9 @@ bool8 CheckForTrainersWantingBattle(void)
|
||||
{
|
||||
u8 i;
|
||||
|
||||
if (FlagGet(OW_FLAG_NO_TRAINER_SEE))
|
||||
return FALSE;
|
||||
|
||||
gNoOfApproachingTrainers = 0;
|
||||
gApproachingTrainerId = 0;
|
||||
|
||||
|
@ -148,3 +148,4 @@
|
||||
.include "src/faraway_island.o"
|
||||
.include "src/trainer_hill.o"
|
||||
.include "src/rayquaza_scene.o"
|
||||
.include "src/debug.o"
|
||||
|
@ -393,11 +393,14 @@ string generate_map_constants_text(string groups_filepath, Json groups_data) {
|
||||
text << "//\n// DO NOT MODIFY THIS FILE! It is auto-generated from data/maps/map_groups.json\n//\n\n";
|
||||
|
||||
int group_num = 0;
|
||||
vector<int> map_count_vec; //DEBUG
|
||||
|
||||
for (auto &group : groups_data["group_order"].array_items()) {
|
||||
text << "// " << group.string_value() << "\n";
|
||||
vector<Json> map_ids;
|
||||
size_t max_length = 0;
|
||||
|
||||
int map_count = 0; //DEBUG
|
||||
|
||||
for (auto &map_name : groups_data[group.string_value()].array_items()) {
|
||||
string header_filepath = file_dir + map_name.string_value() + dir_separator + "map.json";
|
||||
@ -406,6 +409,7 @@ string generate_map_constants_text(string groups_filepath, Json groups_data) {
|
||||
map_ids.push_back(map_data["id"]);
|
||||
if (map_data["id"].string_value().length() > max_length)
|
||||
max_length = map_data["id"].string_value().length();
|
||||
map_count++; //DEBUG
|
||||
}
|
||||
|
||||
int map_id_num = 0;
|
||||
@ -416,9 +420,17 @@ string generate_map_constants_text(string groups_filepath, Json groups_data) {
|
||||
text << "\n";
|
||||
|
||||
group_num++;
|
||||
map_count_vec.push_back(map_count); //DEBUG
|
||||
}
|
||||
|
||||
text << "#define MAP_GROUPS_COUNT " << group_num << "\n\n";
|
||||
|
||||
text << "// static const u8 MAP_GROUP_COUNT[] = {"; //DEBUG
|
||||
for(int i=0; i<group_num; i++){ //DEBUG
|
||||
text << map_count_vec[i] << ", "; //DEBUG
|
||||
} //DEBUG
|
||||
text << "0};\n\n"; //DEBUG
|
||||
|
||||
text << "#endif // GUARD_CONSTANTS_MAP_GROUPS_H\n";
|
||||
|
||||
return text.str();
|
||||
|
Loading…
Reference in New Issue
Block a user