Changed Script_GetSetPokedexFlag to callnative

This commit is contained in:
pkmnsnfrn 2024-09-12 20:15:55 -07:00
parent be7938f322
commit c2db77c4f6
4 changed files with 24 additions and 24 deletions

View file

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

View file

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

View file

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

View file

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