diff --git a/asm/macros/event.inc b/asm/macros/event.inc index 9375b7be9a..c4bbda645f 100644 --- a/asm/macros/event.inc +++ b/asm/macros/event.inc @@ -2348,27 +2348,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_TEMP_1, \species - specialvar VAR_RESULT, GetSeenMon + setvar VAR_0x8005, \species + setvar VAR_0x8006, 0 + specialvar VAR_RESULT, Script_GetSetPokedexFlag .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_TEMP_1, \species - specialvar VAR_RESULT, GetCaughtMon + setvar VAR_0x8005, \species + setvar VAR_0x8006, 1 + specialvar VAR_RESULT, Script_GetSetPokedexFlag .endm @ Sets the Pokédex Seen flag of the specified Pokemon .macro setseenmon species:req - setvar VAR_TEMP_1, \species - special SetSeenMon + setvar VAR_0x8005, \species + setvar VAR_0x8006, 2 + specialvar VAR_RESULT, Script_GetSetPokedexFlag .endm @ Sets the Pokédex Caught flag of the specified Pokemon .macro setcaughtmon species:req - setvar VAR_TEMP_1, \species - special SetCaughtMon + setvar VAR_0x8005, \species + setvar VAR_0x8006, 3 + specialvar VAR_RESULT, Script_GetSetPokedexFlag .endm @ Changes the caught ball of a selected Pokémon diff --git a/data/specials.inc b/data/specials.inc index 5b0aa23ddd..7b391cc968 100644 --- a/data/specials.inc +++ b/data/specials.inc @@ -556,10 +556,7 @@ gSpecials:: def_special Script_GetChosenMonDefensiveIVs def_special GetObjectPosition def_special CheckObjectAtXY - def_special GetSeenMon - def_special GetCaughtMon - def_special SetSeenMon - def_special SetCaughtMon + def_special Script_GetSetPokedexFlag def_special SetMonBall def_special CheckPartyForMon def_special Script_GetObjectFacingDirection diff --git a/src/field_specials.c b/src/field_specials.c index 98a909d725..a161ba3c44 100644 --- a/src/field_specials.c +++ b/src/field_specials.c @@ -4312,25 +4312,15 @@ bool32 CheckObjectAtXY(void) return TRUE; } -bool8 GetSeenMon(void) +bool32 Script_GetSetPokedexFlag(void) { - return GetSetPokedexFlag(SpeciesToNationalPokedexNum(VarGet(VAR_TEMP_1)), FLAG_GET_SEEN); -} + u32 speciesId = SpeciesToNationalPokedexNum(gSpecialVar_0x8005); + bool32 desiredFlag = gSpecialVar_0x8006; -bool8 GetCaughtMon(void) -{ - return GetSetPokedexFlag(SpeciesToNationalPokedexNum(VarGet(VAR_TEMP_1)), FLAG_GET_CAUGHT); -} + if (desiredFlag == FLAG_SET_CAUGHT) + GetSetPokedexFlag(speciesId,FLAG_SET_SEEN); -void SetSeenMon(void) -{ - GetSetPokedexFlag(SpeciesToNationalPokedexNum(VarGet(VAR_TEMP_1)), FLAG_SET_SEEN); -} - -void SetCaughtMon(void) -{ - GetSetPokedexFlag(SpeciesToNationalPokedexNum(VarGet(VAR_TEMP_1)), FLAG_SET_SEEN); - GetSetPokedexFlag(SpeciesToNationalPokedexNum(VarGet(VAR_TEMP_1)), FLAG_SET_CAUGHT); + return GetSetPokedexFlag(speciesId,desiredFlag); } void SetMonBall(void)