diff --git a/asm/macros/event.inc b/asm/macros/event.inc index a4f22f817a..b826b4c556 100644 --- a/asm/macros/event.inc +++ b/asm/macros/event.inc @@ -2375,31 +2375,31 @@ @ Checks the state of the Pokédex Seen flag of the specified Pokemon @ The result is stored in VAR_RESULT .macro getseenmon species:req - setvar VAR_0x8005, \species - setvar VAR_0x8006, FLAG_GET_SEEN - specialvar VAR_RESULT, Script_GetSetPokedexFlag + callnative Script_GetSetPokedexFlag + .2byte \species + .2byte FLAG_GET_SEEN .endm @ Checks the state of the Pokédex Caught flag of the specified Pokemon @ The result is stored in VAR_RESULT .macro getcaughtmon species:req - setvar VAR_0x8005, \species - setvar VAR_0x8006, FLAG_GET_CAUGHT - specialvar VAR_RESULT, Script_GetSetPokedexFlag + callnative Script_GetSetPokedexFlag + .2byte \species + .2byte FLAG_GET_CAUGHT .endm @ Sets the Pokédex Seen flag of the specified Pokemon .macro setseenmon species:req - setvar VAR_0x8005, \species - setvar VAR_0x8006, FLAG_SET_SEEN - specialvar VAR_RESULT, Script_GetSetPokedexFlag + callnative Script_GetSetPokedexFlag + .2byte \species + .2byte FLAG_SET_SEEN .endm @ Sets the Pokédex Caught flag of the specified Pokemon .macro setcaughtmon species:req - setvar VAR_0x8005, \species - setvar VAR_0x8006, FLAG_SET_CAUGHT - specialvar VAR_RESULT, Script_GetSetPokedexFlag + callnative Script_GetSetPokedexFlag + .2byte \species + .2byte FLAG_SET_CAUGHT .endm @ Check if the Player has \speciesId in their party. OPEN_PARTY_SCREEN will have the player select a mon from their party. NO_PARTY_SCREEN will automatically check every mon in the player's party. diff --git a/data/specials.inc b/data/specials.inc index 91fed72d78..e6a8860096 100644 --- a/data/specials.inc +++ b/data/specials.inc @@ -554,7 +554,6 @@ gSpecials:: def_special Script_GetChosenMonDefensiveEVs def_special Script_GetChosenMonOffensiveIVs def_special Script_GetChosenMonDefensiveIVs - def_special Script_GetSetPokedexFlag def_special CheckPartyHasSpecie def_special CheckChosenMonMatchDesiredSpecie def_special Script_GetObjectFacingDirection diff --git a/src/field_specials.c b/src/field_specials.c index 0f1854b3b5..57bd0158a6 100644 --- a/src/field_specials.c +++ b/src/field_specials.c @@ -4278,17 +4278,6 @@ void PreparePartyForSkyBattle(void) CompactPartySlots(); } -bool32 Script_GetSetPokedexFlag(void) -{ - u32 speciesId = SpeciesToNationalPokedexNum(gSpecialVar_0x8005); - bool32 desiredFlag = gSpecialVar_0x8006; - - if (desiredFlag == FLAG_SET_CAUGHT) - GetSetPokedexFlag(speciesId,FLAG_SET_SEEN); - - return GetSetPokedexFlag(speciesId,desiredFlag); -} - bool32 CheckPartyHasSpecie(void) { u32 partyIndex; diff --git a/src/scrcmd.c b/src/scrcmd.c index d68e2dbd86..f087d2d290 100644 --- a/src/scrcmd.c +++ b/src/scrcmd.c @@ -53,6 +53,7 @@ #include "list_menu.h" #include "malloc.h" #include "constants/event_objects.h" +#include "pokedex.h" typedef u16 (*SpecialFunc)(void); typedef void (*NativeFunc)(struct ScriptContext *ctx); @@ -2527,3 +2528,14 @@ bool32 CheckObjectAtXY(struct ScriptContext *ctx) return FALSE; } +void Script_GetSetPokedexFlag(struct ScriptContext *ctx) +{ + u32 speciesId = SpeciesToNationalPokedexNum(VarGet(ScriptReadHalfword(ctx))); + bool32 desiredFlag = VarGet(ScriptReadHalfword(ctx)); + + if (desiredFlag == FLAG_SET_CAUGHT) + GetSetPokedexFlag(speciesId,FLAG_SET_SEEN); + + gSpecialVar_Result = GetSetPokedexFlag(speciesId,desiredFlag); +} +