mirror of
https://github.com/pret/pmd-red.git
synced 2026-10-01 07:20:32 -04:00
Decomped HasNegativeStatus()
This commit is contained in:
@@ -9,8 +9,7 @@
|
||||
#include "dungeon_util.h"
|
||||
#include "moves.h"
|
||||
#include "number_util.h"
|
||||
|
||||
extern bool8 HasNegativeStatus(struct DungeonEntity*);
|
||||
#include "status_checks.h"
|
||||
|
||||
u32 EvaluateItem(struct DungeonEntity *targetPokemon, struct ItemSlot *item, u32 itemTargetFlags)
|
||||
{
|
||||
@@ -96,7 +95,7 @@ u32 EvaluateItem(struct DungeonEntity *targetPokemon, struct ItemSlot *item, u32
|
||||
}
|
||||
}
|
||||
}
|
||||
if (itemWeight > 98)
|
||||
if (itemWeight >= 99)
|
||||
{
|
||||
itemWeight = 99;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
#include "global.h"
|
||||
#include "status_checks.h"
|
||||
|
||||
#include "constants/status.h"
|
||||
|
||||
bool8 HasNegativeStatus(struct DungeonEntity *pokemon)
|
||||
{
|
||||
struct DungeonEntityData *pokemonData = pokemon->entityData;
|
||||
s32 i;
|
||||
if (pokemonData->sleepStatus == SLEEP_STATUS_SLEEP ||
|
||||
pokemonData->sleepStatus == SLEEP_STATUS_NIGHTMARE ||
|
||||
pokemonData->sleepStatus == SLEEP_STATUS_YAWNING ||
|
||||
pokemonData->nonVolatileStatus != NON_VOLATILE_STATUS_NONE ||
|
||||
(pokemonData->immobilizeStatus != IMMOBILIZE_STATUS_INGRAIN && pokemonData->immobilizeStatus != IMMOBILIZE_STATUS_NONE) ||
|
||||
pokemonData->volatileStatus != VOLATILE_STATUS_NONE ||
|
||||
pokemonData->waitingStatus == WAITING_STATUS_CURSED ||
|
||||
pokemonData->waitingStatus == WAITING_STATUS_DECOY ||
|
||||
pokemonData->linkedStatus == LINKED_STATUS_LEECH_SEED ||
|
||||
pokemonData->moveStatus == MOVE_STATUS_WHIFFER ||
|
||||
pokemonData->eyesightStatus == EYESIGHT_STATUS_BLINKER ||
|
||||
pokemonData->eyesightStatus == EYESIGHT_STATUS_CROSS_EYED ||
|
||||
pokemonData->muzzledStatus == MUZZLED_STATUS_MUZZLED ||
|
||||
pokemonData->exposedStatus ||
|
||||
pokemonData->perishSongTimer != 0)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
for (i = 0; i < MAX_MON_MOVES; i++)
|
||||
{
|
||||
struct PokemonMove *moves = pokemonData->moves;
|
||||
if (moves[i].moveFlags & MOVE_FLAG_EXISTS && moves[i].sealed & TRUE)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
for (i = 0; i < NUM_SPEED_TURN_COUNTERS; i++)
|
||||
{
|
||||
if (pokemonData->slowTurnsLeft[i] != 0)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
Reference in New Issue
Block a user