Skip to content

Commit

Permalink
some clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
ghoulslash committed Jan 2, 2025
1 parent 85787aa commit 7a9e847
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 15 deletions.
6 changes: 3 additions & 3 deletions include/config/dexnav.h
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#ifndef GUARD_CONFIG_DEXNAV_H
#define GUARD_CONFIG_DEXNAV_H

#define DEXNAV_ENABLED FALSE // Whether or not dexnav is enabled. If TRUE, flags/vars below must all be non-zero
#define DEXNAV_ENABLED FALSE // Whether or not DexNav is enabled. If TRUE, flags/vars below must all be non-zero
#define USE_DEXNAV_SEARCH_LEVELS FALSE /* WARNING: POSSIBLY EXCEEDS SAVEBLOCK SPACE! REQUIRES 1 BYTE PER SPECIES */

// Flag/var defines
#define FLAG_SYS_DEXNAV_SEARCH 0 // Searching for mon
#define FLAG_SYS_DEXNAV_GET 0 // Dexnav shows in start menu
#define FLAG_SYS_DEXNAV_GET 0 // DexNav shows in start menu
#define FLAG_SYS_DETECTOR_MODE 0 // Allow player to find hidden mons
#define VAR_DEXNAV_SPECIES 0 // Registered dexnav species
#define VAR_DEXNAV_SPECIES 0 // Registered DexNav species
#define VAR_DEXNAV_STEP_COUNTER 0 // Steps for finding hidden pokemon

// Search parameters
Expand Down
4 changes: 2 additions & 2 deletions include/dexnav.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
#define LIT_STAR_TILE_TAG 0x4010
#define HELD_ITEM_TAG 0xd750

// Dexnav search variable
// DexNav search variable
#define DEXNAV_MASK_SPECIES 0x3FFF // First 14 bits
#define DEXNAV_MASK_ENVIRONMENT 0xC000 // Last two bit

Expand All @@ -72,6 +72,6 @@ bool8 TryFindHiddenPokemon(void);
u32 CalculateDexnavShinyRolls(void);
void IncrementDexNavChain(void);

extern bool8 gDexnavBattle;
extern bool8 gDexNavBattle;

#endif // GUARD_DEXNAV_H
2 changes: 1 addition & 1 deletion include/event_scripts.h
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,7 @@ extern const u8 Common_Movement_FollowerSafeEnd[];
extern const u8 EventScript_CancelMessageBox[];
extern const u8 Common_EventScript_ShowPokemonCenterSign[];
extern const u8 Common_EventScript_ShowPokemartSign[];
// Dexnav
// DexNav
extern const u8 EventScript_StartDexNavBattle[];
extern const u8 EventScript_NotFoundNearby[];
extern const u8 EventScript_PokemonGotAway[];
Expand Down
4 changes: 2 additions & 2 deletions src/battle_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -5690,12 +5690,12 @@ static void FreeResetData_ReturnToOvOrDoEvolutions(void)
{
gIsFishingEncounter = FALSE;
gIsSurfingEncounter = FALSE;
if (gDexnavBattle && (gBattleOutcome == B_OUTCOME_WON || gBattleOutcome == B_OUTCOME_CAUGHT))
if (gDexNavBattle && (gBattleOutcome == B_OUTCOME_WON || gBattleOutcome == B_OUTCOME_CAUGHT))
IncrementDexNavChain();
else
gSaveBlock3Ptr->dexNavChain = 0;

gDexnavBattle = FALSE;
gDexNavBattle = FALSE;
ResetSpriteData();
if (!(gBattleTypeFlags & (BATTLE_TYPE_LINK
| BATTLE_TYPE_RECORDED_LINK
Expand Down
10 changes: 5 additions & 5 deletions src/dexnav.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ struct DexNavGUI
EWRAM_DATA static struct DexNavSearch *sDexNavSearchDataPtr = NULL;
EWRAM_DATA static struct DexNavGUI *sDexNavUiDataPtr = NULL;
EWRAM_DATA static u8 *sBg1TilemapBuffer = NULL;
EWRAM_DATA bool8 gDexnavBattle = FALSE;
EWRAM_DATA bool8 gDexNavBattle = FALSE;

//// Function Declarations
//GUI
Expand Down Expand Up @@ -977,7 +977,7 @@ static void DexNavDrawIcons(void)
/////////////////////
//// SEARCH TASK ////
/////////////////////
bool8 TryStartDexnavSearch(void)
bool8 TryStartDexNavSearch(void)
{
u8 taskId;
u16 val = VarGet(VAR_DEXNAV_SPECIES);
Expand Down Expand Up @@ -1110,7 +1110,7 @@ static void Task_DexNavSearch(u8 taskId)

if (sDexNavSearchDataPtr->proximity < 1)
{
gDexnavBattle = TRUE;
gDexNavBattle = TRUE;
CreateDexNavWildMon(sDexNavSearchDataPtr->species, sDexNavSearchDataPtr->potential, sDexNavSearchDataPtr->monLevel,
sDexNavSearchDataPtr->abilityNum, sDexNavSearchDataPtr->heldItem, sDexNavSearchDataPtr->moves);

Expand Down Expand Up @@ -2326,7 +2326,7 @@ void Task_OpenDexNavFromStartMenu(u8 taskId)
{
if (DEXNAV_ENABLED == FALSE)
{ // must have it enabled to enter
DebugPrintfLevel(MGBA_LOG_ERROR, "Dexnav was opened when DEXNAV_ENABLED config was disabled! Check include/config/dexnav.h");
DebugPrintfLevel(MGBA_LOG_ERROR, "DexNav was opened when DEXNAV_ENABLED config was disabled! Check include/config/dexnav.h");
DestroyTask(taskId);
}
else if (!gPaletteFade.active)
Expand Down Expand Up @@ -2655,7 +2655,7 @@ static void DexNavDrawHiddenIcons(void)
/////////////////////////
//// GENERAL UTILITY ////
/////////////////////////
u32 CalculateDexnavShinyRolls(void)
u32 CalculateDexNavShinyRolls(void)
{
u32 chainBonus, rndBonus;
u8 chain = gSaveBlock3Ptr->dexNavChain;
Expand Down
2 changes: 1 addition & 1 deletion src/pokemon.c
Original file line number Diff line number Diff line change
Expand Up @@ -1163,7 +1163,7 @@ void CreateBoxMon(struct BoxPokemon *boxMon, u16 species, u8 level, u8 fixedIV,
totalRerolls += 1;
if (I_FISHING_CHAIN && gIsFishingEncounter)
totalRerolls += CalculateChainFishingShinyRolls();
if (gDexnavBattle)
if (gDexNavBattle)
totalRerolls += CalculateDexnavShinyRolls();

while (GET_SHINY_VALUE(value, personality) >= SHINY_ODDS && totalRerolls > 0)
Expand Down
2 changes: 1 addition & 1 deletion src/start_menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ static void AddStartMenuAction(u8 action)
}

static void BuildNormalStartMenu(void)
{
{
if (FlagGet(FLAG_SYS_POKEDEX_GET) == TRUE)
AddStartMenuAction(MENU_ACTION_POKEDEX);

Expand Down

0 comments on commit 7a9e847

Please sign in to comment.