From 1c7d69530a81de719e0cba72608124e57902a584 Mon Sep 17 00:00:00 2001 From: voloved <36523934+voloved@users.noreply.github.com> Date: Mon, 28 Aug 2023 18:53:08 -0400 Subject: [PATCH] Added flag --- Add-Nuzlocke-Challenge.md | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/Add-Nuzlocke-Challenge.md b/Add-Nuzlocke-Challenge.md index 51baccd..be6bdca 100644 --- a/Add-Nuzlocke-Challenge.md +++ b/Add-Nuzlocke-Challenge.md @@ -36,6 +36,16 @@ There are about 100 locations where Pokemon can reasonably be caught in the game ```diff +-------------------------- include/constants/flags.h -------------------------- +#define FLAG_ITEM_MAGMA_HIDEOUT_4F_MAX_REVIVE 0x490 +#define FLAG_ITEM_SAFARI_ZONE_NORTH_EAST_NUGGET 0x491 +#define FLAG_ITEM_SAFARI_ZONE_SOUTH_EAST_BIG_PEARL 0x492 + +-#define FLAG_UNUSED_0x493 0x493 // Unused Flag ++#define FLAG_NUZLOCKE 0x493 +#define FLAG_UNUSED_0x494 0x494 // Unused Flag +#define FLAG_UNUSED_0x495 0x495 // Unused Flag + ------------------------------- src/main_menu.c ------------------------------- index f99703622..75520e337 100644 @@ -36,8 +36,9 @@ @@ -628,7 +638,6 @@ index 5a1d5bab3..9126aeeb4 100644 u16 CountBattledRematchTeams(u16 trainerId); +u8 HasWildPokmnOnThisRouteBeenSeen(u8 currLocation, bool8 setVarForThisEnc); +u8 currLocConvertForNuzlocke(u8 currLocation); -+ void DoStandardWildBattle_Debug(void); void BattleSetup_StartTrainerBattle_Debug(void); @@ -1285,7 +1294,7 @@ index 6e6f5886e..c5f9baa57 100644 + u8 levelCap = 0; + u16 nextLeader, i; + const struct TrainerMonItemCustomMoves *partyData; -+ if (!FlagGet(FLAG_NUZLOCKE) || !FlagGet(FLAG_NUZLOCKE_LEVEL_CAP) || FlagGet(FLAG_IS_CHAMPION)) ++ if (!FlagGet(FLAG_NUZLOCKE) || FlagGet(FLAG_IS_CHAMPION)) + return 100; + if (!FlagGet(FLAG_BADGE01_GET)) + nextLeader = TRAINER_ROXANNE_1; @@ -1316,7 +1325,7 @@ index 6e6f5886e..c5f9baa57 100644 + +bool8 levelCappedNuzlocke(u8 level){ + u8 levelCap = getLevelCap(); -+ if (!FlagGet(FLAG_NUZLOCKE) || !FlagGet(FLAG_NUZLOCKE_LEVEL_CAP) || FlagGet(FLAG_IS_CHAMPION)) ++ if (!FlagGet(FLAG_NUZLOCKE) || FlagGet(FLAG_IS_CHAMPION)) + return FALSE; //Redundant since getLevelCap would already return 100 for these, but better to be explicit + if (level >= levelCap) + return TRUE; @@ -1532,7 +1541,6 @@ index 546385218..978b9eeec 100644 EventScript_PkmnCenterNurse_ReturnPkmn:: goto_if_eq VAR_0x8004, 1, EventScript_PkmnCenterNurse_ReturnPkmn2 + goto_if_unset FLAG_NUZLOCKE, EventScript_PkmnCenterNurse_ReturnPkmnDefault -+ goto_if_unset FLAG_NUZLOCKE_LEVEL_CAP, EventScript_PkmnCenterNurse_ReturnPkmnDefault + special LevelCapToString + message gText_WeHopeToSeeYouAgain4 + return