diff --git a/asm/macros/event.inc b/asm/macros/event.inc index 0fb6414f61..e3c47c04ea 100644 --- a/asm/macros/event.inc +++ b/asm/macros/event.inc @@ -2341,3 +2341,29 @@ setorcopyvar VAR_0x8006, \y specialvar VAR_RESULT, CheckObjectAtXY .endm + + @ 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 + .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 + .endm + + @ Sets the Pokédex Seen flag of the specified Pokemon + .macro setseenmon species:req + setvar VAR_TEMP_1, \species + special SetSeenMon + .endm + + @ Sets the Pokédex Caught flag of the specified Pokemon + .macro setcaughtmon species:req + setvar VAR_TEMP_1, \species + special SetCaughtMon + .endm diff --git a/data/specials.inc b/data/specials.inc index aa994a31f6..8f17fd8e55 100644 --- a/data/specials.inc +++ b/data/specials.inc @@ -556,3 +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 diff --git a/src/field_specials.c b/src/field_specials.c index 3014d48407..64330d2e6d 100644 --- a/src/field_specials.c +++ b/src/field_specials.c @@ -68,6 +68,7 @@ #include "constants/metatile_labels.h" #include "palette.h" #include "battle_util.h" +#include "pokedex.h" #define TAG_ITEM_ICON 5500 @@ -4310,3 +4311,24 @@ u16 CheckObjectAtXY(void) return FALSE; } +bool8 GetSeenMon(void) +{ + return GetSetPokedexFlag(SpeciesToNationalPokedexNum(VarGet(VAR_TEMP_1)), FLAG_GET_SEEN); +} + +bool8 GetCaughtMon(void) +{ + return GetSetPokedexFlag(SpeciesToNationalPokedexNum(VarGet(VAR_TEMP_1)), FLAG_GET_CAUGHT); +} + +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); +} +