remove checkpartymove

This commit is contained in:
cawtds
2024-11-12 18:31:15 +01:00
parent c6bdd950e0
commit 66f18290b3
3 changed files with 8 additions and 36 deletions

View File

@@ -1127,12 +1127,12 @@
.2byte \move
.endm
@ Checks if at least one Pokemon in the player's party knows the specified move. If so, VAR_RESULT is set to the
@ (zero-indexed) slot number of the first Pokemon that knows the move. If not, VAR_RESULT is set to PARTY_SIZE.
@ VAR_0x8004 is also set to this Pokemon's species.
.macro checkpartymove move:req
@ Checks if field move can be used. If so, VAR_RESULT is set to TRUE, gFieldEffectArguments[0] to masked
@ species or party index of the Pokemon, VAR_0x8004 to species, STR_VAR_1 to the Pokemon's name,
@ and STR_VAR_2 to the move's name.
.macro checkfieldmoveusable fieldMove:req
.byte 0x7c
.2byte \move
.2byte \fieldMove
.endm
@ Converts STR_VAR_1, STR_VAR_2, or STR_VAR_3 to its corresponding index into sScriptStringVars (0, 1, or 2).
@@ -1764,12 +1764,6 @@
.byte 0xd6
.endm
@ Checks if effect can be used
.macro checkfieldmoveusable effect:req
.byte 0xd7
.2byte \effect
.endm
@ Equivalent to fadescreen but copies gPlttBufferUnfaded to gDecompressionBuffer on the fade out
@ and the reverse on the fade in, in effect saving gPlttBufferUnfaded to restore it.
@ If nowait set, does not wait for the fade to complete

View File

@@ -125,7 +125,7 @@ gScriptCmdTable::
.4byte ScrCmd_nop1 @ 0x79
.4byte ScrCmd_giveegg @ 0x7a
.4byte ScrCmd_setmonmove @ 0x7b
.4byte ScrCmd_checkpartymove @ 0x7c
.4byte ScrCmd_checkfieldmoveusable @ 0x7c
.4byte ScrCmd_bufferspeciesname @ 0x7d
.4byte ScrCmd_bufferleadmonspeciesname @ 0x7e
.4byte ScrCmd_bufferpartymonnick @ 0x7f
@@ -216,7 +216,7 @@ gScriptCmdTable::
.4byte ScrCmd_bufferitemnameplural @ 0xd4
.4byte ScrCmd_selectapproachingtrainer @ 0xd5
.4byte ScrCmd_lockfortrainer @ 0xd6
.4byte ScrCmd_checkfieldmoveusable @ 0xd7
.4byte ScrCmd_nop1 @ 0xd7
.4byte ScrCmd_nop1 @ 0xd8
.4byte ScrCmd_nop1 @ 0xd9
.4byte ScrCmd_nop1 @ 0xda

View File

@@ -1805,33 +1805,11 @@ bool8 ScrCmd_setmonmove(struct ScriptContext * ctx)
return FALSE;
}
bool8 ScrCmd_checkpartymove(struct ScriptContext * ctx)
{
u8 i;
u16 moveId = ScriptReadHalfword(ctx);
gSpecialVar_Result = PARTY_SIZE;
for (i = 0; i < PARTY_SIZE; i++)
{
u16 species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES, NULL);
if (!species)
break;
if (!GetMonData(&gPlayerParty[i], MON_DATA_IS_EGG) && MonKnowsMove(&gPlayerParty[i], moveId) == TRUE)
{
gSpecialVar_Result = i;
gSpecialVar_0x8004 = species;
break;
}
}
return FALSE;
}
bool8 ScrCmd_checkfieldmoveusable(struct ScriptContext* ctx)
{
u32 partyIndex;
enum FieldMove fieldMove = ScriptReadHalfword(ctx);
u16 moveId = gFieldMovesInfo[fieldMove].moveId;
u16 species = SPECIES_NONE;
gSpecialVar_Result = FALSE;
if (!FieldMove_IsUnlocked(fieldMove))
@@ -1849,7 +1827,7 @@ bool8 ScrCmd_checkfieldmoveusable(struct ScriptContext* ctx)
}
else if (OW_FIELD_MOVES_WITHOUT_HMS)
{
species = FieldMove_GetDefaultSpecies(fieldMove);
u16 species = FieldMove_GetDefaultSpecies(fieldMove);
gFieldEffectArguments[0] = species | NOT_IN_PARTY_MASK;
gSpecialVar_0x8004 = species;
gSpecialVar_Result = TRUE;