Added Seen/CaughtMon macros

This commit is contained in:
pkmnsnfrn 2024-08-11 18:49:42 -07:00
parent 0784f9fa74
commit fba1452c3b
3 changed files with 52 additions and 0 deletions

View file

@ -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

View file

@ -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

View file

@ -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);
}