mirror of
https://github.com/pret/pmd-red.git
synced 2026-10-02 23:45:08 -04:00
Decomped HasLastUsedMove()
This commit is contained in:
+3
-3
@@ -51,7 +51,7 @@ u8 sub_809287C(struct PokemonMove *move)
|
||||
{
|
||||
if((move->moveFlags & MOVE_FLAG_DISABLED) != 0)
|
||||
return 0x32;
|
||||
else if((move->sealed & 1) == 0)
|
||||
else if((move->moveFlags2 & MOVE_FLAG_SEALED) == 0)
|
||||
return 0x34;
|
||||
else
|
||||
return 0x32;
|
||||
@@ -130,7 +130,7 @@ void sub_80928C0(u8 *buffer, struct PokemonMove *move, struct unkStruct_80928C0
|
||||
void InitPokemonMove(struct PokemonMove *move, u16 moveID)
|
||||
{
|
||||
move->moveFlags = MOVE_FLAG_ENABLED | MOVE_FLAG_EXISTS;
|
||||
move->sealed = FALSE;
|
||||
move->moveFlags2 = 0;
|
||||
move->moveID = moveID;
|
||||
move->PP = GetMoveMaxPP(move);
|
||||
move->powerBoost = 0;
|
||||
@@ -143,7 +143,7 @@ void sub_8092AA8(struct PokemonMove *move, u16 moveID)
|
||||
else
|
||||
{
|
||||
move->moveFlags = MOVE_FLAG_ENABLED | MOVE_FLAG_EXISTS;
|
||||
move->sealed = FALSE;
|
||||
move->moveFlags2 = 0;
|
||||
move->moveID = moveID;
|
||||
move->PP = GetMoveMaxPP(move);
|
||||
move->powerBoost = 0;
|
||||
|
||||
+2
-2
@@ -38,7 +38,7 @@ void RestorePokemonMoves(struct unkStruct_8094924 *r0, struct PokemonMove *moveS
|
||||
void sub_8094148(struct unkStruct_8094924 *r0, struct PokemonMove *move)
|
||||
{
|
||||
SaveIntegerBits(r0, &move->moveFlags, 4);
|
||||
SaveIntegerBits(r0, &move->sealed, 1);
|
||||
SaveIntegerBits(r0, &move->moveFlags2, 1);
|
||||
SaveIntegerBits(r0, &move->moveID, 9);
|
||||
SaveIntegerBits(r0, &move->PP, 7);
|
||||
SaveIntegerBits(r0, &move->powerBoost, 7);
|
||||
@@ -59,7 +59,7 @@ void sub_80941B0(struct unkStruct_8094924 *r0, struct PokemonMove *move)
|
||||
{
|
||||
memset(move, 0, sizeof(struct PokemonMove));
|
||||
RestoreIntegerBits(r0, &move->moveFlags, 4);
|
||||
RestoreIntegerBits(r0, &move->sealed, 1);
|
||||
RestoreIntegerBits(r0, &move->moveFlags2, 1);
|
||||
RestoreIntegerBits(r0, &move->moveID, 9);
|
||||
RestoreIntegerBits(r0, &move->PP, 7);
|
||||
RestoreIntegerBits(r0, &move->powerBoost, 7);
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include "map.h"
|
||||
#include "moves.h"
|
||||
#include "number_util.h"
|
||||
#include "status_checker_1.h"
|
||||
#include "status_checks_1.h"
|
||||
#include "tile_types.h"
|
||||
#include "trap.h"
|
||||
@@ -98,7 +99,6 @@ const u8 gDungeonCamouflageTypes[76] = {
|
||||
TYPE_ROCK
|
||||
};
|
||||
|
||||
extern bool8 HasLastUsedMove(struct PokemonMove *moves);
|
||||
extern bool8 HasDisabledMove(struct PokemonMove *moves);
|
||||
extern bool8 LastMoveOutOfPP(struct PokemonMove *moves);
|
||||
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
#include "global.h"
|
||||
#include "status_checker_1.h"
|
||||
|
||||
#include "dungeon_entity.h"
|
||||
|
||||
bool8 HasLastUsedMove(struct PokemonMove *moves)
|
||||
{
|
||||
s32 i;
|
||||
for (i = 0; i < MAX_MON_MOVES; i++)
|
||||
{
|
||||
if (moves[i].moveFlags & MOVE_FLAG_EXISTS && moves[i].moveFlags & MOVE_FLAG_LAST_USED)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
if (moves[STRUGGLE_MOVE_INDEX].moveFlags & MOVE_FLAG_LAST_USED)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
@@ -28,7 +28,7 @@ bool8 HasNegativeStatus(struct DungeonEntity *pokemon)
|
||||
for (i = 0; i < MAX_MON_MOVES; i++)
|
||||
{
|
||||
struct PokemonMove *moves = pokemonData->moves;
|
||||
if (moves[i].moveFlags & MOVE_FLAG_EXISTS && moves[i].sealed & TRUE)
|
||||
if (moves[i].moveFlags & MOVE_FLAG_EXISTS && moves[i].moveFlags2 & MOVE_FLAG_SEALED)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user