mirror of
https://github.com/pret/pmd-red.git
synced 2026-08-27 03:07:22 -05:00
merge dungeon capabilities with dungeon ai targeting
This commit is contained in:
@@ -3,6 +3,12 @@
|
||||
|
||||
#include "structs/dungeon_entity.h"
|
||||
|
||||
bool8 CheckVariousStatuses2(Entity *pokemon, bool8 checkBlinker);
|
||||
bool8 sub_8070BC0(Entity* entity);
|
||||
bool8 CheckVariousConditions(Entity *pokemon);
|
||||
bool8 CheckVariousStatuses(Entity *pokemon);
|
||||
bool8 CannotAttack(Entity *pokemon, bool8 skipSleep);
|
||||
bool8 CanMoveInDirection(Entity *pokemon, u32 direction);
|
||||
bool8 CanAttackInDirection(Entity *pokemon, s32 direction);
|
||||
bool8 CanAIMonsterMoveInDirection(Entity *pokemon, s32 direction, bool8 *pokemonInFront);
|
||||
bool8 IsAtJunction(Entity *pokemon);
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
#ifndef GUARD_DUNGEON_CAPABILITIES_H
|
||||
#define GUARD_DUNGEON_CAPABILITIES_H
|
||||
|
||||
#include "structs/dungeon_entity.h"
|
||||
|
||||
bool8 CheckVariousStatuses2(Entity *pokemon, bool8 checkBlinker);
|
||||
bool8 sub_8070BC0(Entity* entity);
|
||||
bool8 CheckVariousConditions(Entity *pokemon);
|
||||
bool8 CheckVariousStatuses(Entity *pokemon);
|
||||
bool8 CannotAttack(Entity *pokemon, bool8 skipSleep);
|
||||
bool8 CanMoveInDirection(Entity *pokemon, u32 direction);
|
||||
|
||||
#endif
|
||||
@@ -245,7 +245,6 @@ SECTIONS {
|
||||
src/status_checks.o(.text);
|
||||
src/dungeon_movement.o(.text);
|
||||
src/status_checks_1.o(.text);
|
||||
src/dungeon_capabilities.o(.text);
|
||||
src/dungeon_ai_targeting.o(.text);
|
||||
src/dungeon_pokemon_attributes.o(.text);
|
||||
src/code_80718D8.o(.text);
|
||||
@@ -582,7 +581,6 @@ SECTIONS {
|
||||
src/code_806CD90.o(.rodata);
|
||||
src/type_effectiveness.o(.data);
|
||||
data/data_8106F7C.o(.rodata);
|
||||
src/dungeon_capabilities.o(.rodata);
|
||||
src/dungeon_ai_targeting.o(.rodata);
|
||||
data/data_8107010.o(.rodata);
|
||||
src/dungeon_serializer.o(.rodata);
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
#include "code_807CD9C.h"
|
||||
#include "code_8084778.h"
|
||||
#include "dungeon_ai_targeting.h"
|
||||
#include "dungeon_capabilities.h"
|
||||
#include "run_dungeon.h"
|
||||
#include "dungeon_items.h"
|
||||
#include "dungeon_leader.h"
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#include "code_805D8C8.h"
|
||||
#include "code_806CD90.h"
|
||||
#include "code_8077274_1.h"
|
||||
#include "dungeon_capabilities.h"
|
||||
#include "dungeon_ai_targeting.h"
|
||||
#include "dungeon_config.h"
|
||||
#include "dungeon_items.h"
|
||||
#include "dungeon_map_access.h"
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include "global.h"
|
||||
#include "constants/tactic.h"
|
||||
#include "dungeon_capabilities.h"
|
||||
#include "dungeon_config.h"
|
||||
#include "dungeon_pokemon_attributes.h"
|
||||
#include "dungeon_leader.h"
|
||||
@@ -16,6 +15,7 @@
|
||||
#include "status_checks_1.h"
|
||||
#include "code_805D8C8.h"
|
||||
#include "structs/str_806B7F8.h"
|
||||
#include "dungeon_ai_targeting.h"
|
||||
|
||||
EWRAM_DATA s32 gUnknown_202F31C[2] = {0, 0};
|
||||
EWRAM_DATA s32 gUnknown_202F324[2] = {0, 0};
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
#include "status.h"
|
||||
#include "weather.h"
|
||||
#include "dungeon_ai_targeting.h"
|
||||
#include "dungeon_capabilities.h"
|
||||
#include "structs/dungeon_entity.h"
|
||||
#include "structs/map.h"
|
||||
#include "structs/str_moves.h"
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
#include "constants/status.h"
|
||||
#include "constants/type.h"
|
||||
#include "code_806CD90.h"
|
||||
#include "dungeon_capabilities.h"
|
||||
#include "dungeon_items.h"
|
||||
#include "dungeon_map_access.h"
|
||||
#include "dungeon_pokemon_attributes.h"
|
||||
@@ -13,6 +12,7 @@
|
||||
#include "structs/str_dungeon.h"
|
||||
#include "position_util.h"
|
||||
#include "trap.h"
|
||||
#include "dungeon_ai_targeting.h"
|
||||
|
||||
extern void sub_8073D14(Entity *);
|
||||
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
#include "dungeon_pokemon_attributes.h"
|
||||
#include "string_format.h"
|
||||
#include "dungeon_movement.h"
|
||||
#include "dungeon_capabilities.h"
|
||||
#include "dungeon_map_access.h"
|
||||
#include "dungeon_movement.h"
|
||||
#include "dungeon_ai_targeting.h"
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
#include "code_807CD9C.h"
|
||||
#include "code_8084778.h"
|
||||
#include "dungeon_ai_targeting.h"
|
||||
#include "dungeon_capabilities.h"
|
||||
#include "run_dungeon.h"
|
||||
#include "dungeon_items.h"
|
||||
#include "dungeon_leader.h"
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
#include "dungeon_ai_items.h"
|
||||
#include "dungeon_ai_movement.h"
|
||||
#include "dungeon_ai_targeting.h"
|
||||
#include "dungeon_capabilities.h"
|
||||
#include "dungeon_items.h"
|
||||
#include "dungeon_leader.h"
|
||||
#include "dungeon_map_access.h"
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
#include "dungeon_action.h"
|
||||
#include "dungeon_ai_targeting.h"
|
||||
#include "dungeon_ai.h"
|
||||
#include "dungeon_capabilities.h"
|
||||
#include "dungeon_config.h"
|
||||
#include "run_dungeon.h"
|
||||
#include "dungeon_map_access.h"
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
#include "dungeon_ai_item_weight.h"
|
||||
#include "dungeon_ai_items.h"
|
||||
#include "dungeon_ai_targeting.h"
|
||||
#include "dungeon_capabilities.h"
|
||||
#include "structs/dungeon_entity.h"
|
||||
#include "structs/str_dungeon.h"
|
||||
#include "dungeon_map_access.h"
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
#include "constants/status.h"
|
||||
#include "constants/targeting.h"
|
||||
#include "dungeon_ai_targeting.h"
|
||||
#include "dungeon_capabilities.h"
|
||||
#include "dungeon_items.h"
|
||||
#include "dungeon_leader.h"
|
||||
#include "dungeon_movement.h"
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
#include "dungeon_action.h"
|
||||
#include "dungeon_ai_leader.h"
|
||||
#include "dungeon_ai_targeting.h"
|
||||
#include "dungeon_capabilities.h"
|
||||
#include "structs/str_dungeon.h"
|
||||
#include "dungeon_map_access.h"
|
||||
#include "dungeon_movement.h"
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include "global.h"
|
||||
#include "dungeon_ai_targeting.h"
|
||||
|
||||
#include "constants/ability.h"
|
||||
#include "constants/dungeon.h"
|
||||
#include "constants/iq_skill.h"
|
||||
@@ -8,7 +7,6 @@
|
||||
#include "constants/status.h"
|
||||
#include "constants/tactic.h"
|
||||
#include "constants/targeting.h"
|
||||
|
||||
#include "run_dungeon.h"
|
||||
#include "structs/str_dungeon.h"
|
||||
#include "dungeon_items.h"
|
||||
@@ -18,9 +16,11 @@
|
||||
#include "dungeon_random.h"
|
||||
#include "dungeon_util.h"
|
||||
#include "structs/map.h"
|
||||
#include "dungeon_move_util.h"
|
||||
|
||||
extern void ShowVisualFlags(Entity *r0);
|
||||
|
||||
const u8 gDirectionBitMasks_1[] = {0x1, 0x2, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80};
|
||||
const u8 gDirectionBitMasks_2[] = {0x1, 0x2, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80};
|
||||
const u8 gDirectionBitMasks_3[] = {0x1, 0x2, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80};
|
||||
const u8 gDirectionBitMasks_4[] = {0x1, 0x2, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80};
|
||||
@@ -61,6 +61,149 @@ const u8 gTreatmentData[3][2][2][2] = {
|
||||
}
|
||||
};
|
||||
|
||||
// TODO CheckVariousStatuses, CheckVariousStatuses2, CheckVariousConditions all check for different conditions that interfere with a Pokémon's ability to act,
|
||||
// but I'm not sure what the reason is for each function checking the conditions that they do.
|
||||
// These functions could use better names if someone figures out a clear pattern/reasoning.
|
||||
bool8 CheckVariousStatuses2(Entity *pokemon, bool8 checkBlinker)
|
||||
{
|
||||
EntityInfo *pokemonInfo = GetEntInfo(pokemon);
|
||||
|
||||
if ((checkBlinker && pokemonInfo->blinkerClassStatus.status == STATUS_BLINKER))
|
||||
return TRUE;
|
||||
if (pokemonInfo->sleepClassStatus.status == STATUS_SLEEP || pokemonInfo->sleepClassStatus.status == STATUS_NAPPING || pokemonInfo->sleepClassStatus.status == STATUS_NIGHTMARE)
|
||||
return TRUE;
|
||||
if (pokemonInfo->cringeClassStatus.status == STATUS_PAUSED || pokemonInfo->cringeClassStatus.status == STATUS_INFATUATED)
|
||||
return TRUE;
|
||||
if (pokemonInfo->frozenClassStatus.status == STATUS_PETRIFIED)
|
||||
return TRUE;
|
||||
if (pokemonInfo->terrifiedTurns != 0)
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 sub_8070BC0(Entity* entity)
|
||||
{
|
||||
EntityInfo *entityInfo = GetEntInfo(entity);
|
||||
|
||||
if (IsChargingAnyTwoTurnMove(entity, FALSE)
|
||||
|| entityInfo->sleepClassStatus.status == STATUS_YAWNING
|
||||
|| entityInfo->sleepClassStatus.status == STATUS_NIGHTMARE
|
||||
|| ShouldMonsterRunAway(entity)
|
||||
|| entityInfo->muzzled.muzzled == TRUE
|
||||
|| entityInfo->frozenClassStatus.status == STATUS_PETRIFIED
|
||||
|| entityInfo->frozenClassStatus.status == STATUS_FROZEN)
|
||||
return FALSE;
|
||||
|
||||
if (entityInfo->cringeClassStatus.status == STATUS_CONFUSED)
|
||||
return FALSE;
|
||||
if (entityInfo->sleepClassStatus.status == STATUS_SLEEP)
|
||||
return FALSE;
|
||||
if (entityInfo->invisibleClassStatus.status == STATUS_INVISIBLE
|
||||
|| entityInfo->sleepClassStatus.status == STATUS_NAPPING)
|
||||
return FALSE;
|
||||
if (entityInfo->cringeClassStatus.status == STATUS_CRINGE)
|
||||
return FALSE;
|
||||
if (entityInfo->frozenClassStatus.status == STATUS_WRAP)
|
||||
return FALSE;
|
||||
if (entityInfo->frozenClassStatus.status == STATUS_WRAPPED
|
||||
|| entityInfo->blinkerClassStatus.status == STATUS_CROSS_EYED)
|
||||
return FALSE;
|
||||
if (entityInfo->curseClassStatus.status == STATUS_DECOY)
|
||||
return FALSE;
|
||||
if (entityInfo->blinkerClassStatus.status == STATUS_BLINKER)
|
||||
return FALSE;
|
||||
if (entityInfo->cringeClassStatus.status != STATUS_INFATUATED
|
||||
&& entityInfo->cringeClassStatus.status != STATUS_PAUSED)
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 CheckVariousConditions(Entity *pokemon)
|
||||
{
|
||||
EntityInfo *pokemonInfo = GetEntInfo(pokemon);
|
||||
|
||||
if (pokemonInfo->monsterBehavior == BEHAVIOR_RESCUE_TARGET
|
||||
|| IsExperienceLocked(pokemonInfo->joinedAt.id)
|
||||
|| (!pokemonInfo->isTeamLeader && ShouldMonsterRunAway(pokemon))
|
||||
|| CheckVariousStatuses2(pokemon, FALSE)
|
||||
|| CheckVariousStatuses(pokemon))
|
||||
return TRUE;
|
||||
|
||||
if (IsChargingAnyTwoTurnMove(pokemon, FALSE))
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 CheckVariousStatuses(Entity *pokemon)
|
||||
{
|
||||
EntityInfo *pokemonInfo = GetEntInfo(pokemon);
|
||||
|
||||
if ((pokemonInfo->sleepClassStatus.status != STATUS_SLEEPLESS && pokemonInfo->sleepClassStatus.status != STATUS_NONE))
|
||||
return TRUE;
|
||||
if (pokemonInfo->frozenClassStatus.status == STATUS_FROZEN || pokemonInfo->frozenClassStatus.status == STATUS_PETRIFIED)
|
||||
return TRUE;
|
||||
if (pokemonInfo->bideClassStatus.status == STATUS_BIDE)
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 CannotAttack(Entity *pokemon, bool8 skipSleep)
|
||||
{
|
||||
EntityInfo *pokemonInfo = GetEntInfo(pokemon);
|
||||
|
||||
if ((skipSleep ||
|
||||
pokemonInfo->sleepClassStatus.status == STATUS_SLEEPLESS ||
|
||||
pokemonInfo->sleepClassStatus.status == STATUS_YAWNING ||
|
||||
pokemonInfo->sleepClassStatus.status == STATUS_NONE) &&
|
||||
pokemonInfo->frozenClassStatus.status != STATUS_FROZEN &&
|
||||
pokemonInfo->frozenClassStatus.status != STATUS_WRAP &&
|
||||
pokemonInfo->frozenClassStatus.status != STATUS_WRAPPED &&
|
||||
pokemonInfo->frozenClassStatus.status != STATUS_PETRIFIED &&
|
||||
pokemonInfo->cringeClassStatus.status != STATUS_CRINGE &&
|
||||
pokemonInfo->cringeClassStatus.status != STATUS_PAUSED &&
|
||||
pokemonInfo->cringeClassStatus.status != STATUS_INFATUATED &&
|
||||
pokemonInfo->burnClassStatus.status != STATUS_PARALYSIS &&
|
||||
!ShouldMonsterRunAway(pokemon))
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool8 CanMoveInDirection(Entity *pokemon, u32 direction)
|
||||
{
|
||||
u8 crossableTerrain = GetCrossableTerrain(GetEntInfo(pokemon)->id);
|
||||
const Tile *currentMapTile = GetTile(pokemon->pos.x + gAdjacentTileOffsets[direction].x,
|
||||
pokemon->pos.y + gAdjacentTileOffsets[direction].y);
|
||||
|
||||
if (currentMapTile->terrainType & TERRAIN_TYPE_IMPASSABLE_WALL || currentMapTile->monster != NULL)
|
||||
return FALSE;
|
||||
|
||||
if (!IsCurrentFixedRoomBossFight())
|
||||
{
|
||||
if (GetEntInfo(pokemon)->invisibleClassStatus.status == STATUS_MOBILE || HasHeldItem(pokemon, ITEM_MOBILE_SCARF))
|
||||
crossableTerrain = CROSSABLE_TERRAIN_WALL;
|
||||
else if (IQSkillIsEnabled(pokemon, IQ_ALL_TERRAIN_HIKER))
|
||||
crossableTerrain = CROSSABLE_TERRAIN_CREVICE;
|
||||
else if (IQSkillIsEnabled(pokemon, IQ_SUPER_MOBILE)) {
|
||||
if (direction & 1)
|
||||
// Super Mobile can't break walls diagonally.
|
||||
crossableTerrain = CROSSABLE_TERRAIN_CREVICE;
|
||||
else
|
||||
crossableTerrain = CROSSABLE_TERRAIN_WALL;
|
||||
}
|
||||
}
|
||||
|
||||
currentMapTile = GetTile(pokemon->pos.x, pokemon->pos.y);
|
||||
if (!(currentMapTile->walkableNeighborFlags[crossableTerrain] & gDirectionBitMasks_1[direction & DIRECTION_MASK]))
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool8 sub_8070F3C(Entity * pokemon, DungeonPos *pos, s32 direction)
|
||||
{
|
||||
u8 terrain;
|
||||
@@ -169,7 +312,7 @@ bool8 sub_8070F80(Entity * pokemon, s32 direction)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 sub_8071058(Entity * pokemon, s32 direction)
|
||||
UNUSED static bool8 sub_8071058(Entity * pokemon, s32 direction)
|
||||
{
|
||||
u8 terrain;
|
||||
const Tile *tile;
|
||||
|
||||
@@ -1,161 +0,0 @@
|
||||
#include "global.h"
|
||||
#include "dungeon_capabilities.h"
|
||||
#include "dungeon_move_util.h"
|
||||
#include "constants/dungeon.h"
|
||||
#include "constants/iq_skill.h"
|
||||
#include "constants/status.h"
|
||||
#include "dungeon_move_util.h"
|
||||
#include "dungeon_ai_targeting.h"
|
||||
#include "dungeon_capabilities.h"
|
||||
#include "run_dungeon.h"
|
||||
#include "dungeon_items.h"
|
||||
#include "dungeon_map_access.h"
|
||||
#include "dungeon_movement.h"
|
||||
#include "dungeon_pokemon_attributes.h"
|
||||
#include "dungeon_util.h"
|
||||
#include "structs/map.h"
|
||||
|
||||
const u8 gDirectionBitMasks_1[] = {0x1, 0x2, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80};
|
||||
|
||||
// TODO CheckVariousStatuses, CheckVariousStatuses2, CheckVariousConditions all check for different conditions that interfere with a Pokémon's ability to act,
|
||||
// but I'm not sure what the reason is for each function checking the conditions that they do.
|
||||
// These functions could use better names if someone figures out a clear pattern/reasoning.
|
||||
bool8 CheckVariousStatuses2(Entity *pokemon, bool8 checkBlinker)
|
||||
{
|
||||
EntityInfo *pokemonInfo = GetEntInfo(pokemon);
|
||||
|
||||
if ((checkBlinker && pokemonInfo->blinkerClassStatus.status == STATUS_BLINKER))
|
||||
return TRUE;
|
||||
if (pokemonInfo->sleepClassStatus.status == STATUS_SLEEP || pokemonInfo->sleepClassStatus.status == STATUS_NAPPING || pokemonInfo->sleepClassStatus.status == STATUS_NIGHTMARE)
|
||||
return TRUE;
|
||||
if (pokemonInfo->cringeClassStatus.status == STATUS_PAUSED || pokemonInfo->cringeClassStatus.status == STATUS_INFATUATED)
|
||||
return TRUE;
|
||||
if (pokemonInfo->frozenClassStatus.status == STATUS_PETRIFIED)
|
||||
return TRUE;
|
||||
if (pokemonInfo->terrifiedTurns != 0)
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 sub_8070BC0(Entity* entity)
|
||||
{
|
||||
EntityInfo *entityInfo = GetEntInfo(entity);
|
||||
|
||||
if (IsChargingAnyTwoTurnMove(entity, FALSE)
|
||||
|| entityInfo->sleepClassStatus.status == STATUS_YAWNING
|
||||
|| entityInfo->sleepClassStatus.status == STATUS_NIGHTMARE
|
||||
|| ShouldMonsterRunAway(entity)
|
||||
|| entityInfo->muzzled.muzzled == TRUE
|
||||
|| entityInfo->frozenClassStatus.status == STATUS_PETRIFIED
|
||||
|| entityInfo->frozenClassStatus.status == STATUS_FROZEN)
|
||||
return FALSE;
|
||||
|
||||
if (entityInfo->cringeClassStatus.status == STATUS_CONFUSED)
|
||||
return FALSE;
|
||||
if (entityInfo->sleepClassStatus.status == STATUS_SLEEP)
|
||||
return FALSE;
|
||||
if (entityInfo->invisibleClassStatus.status == STATUS_INVISIBLE
|
||||
|| entityInfo->sleepClassStatus.status == STATUS_NAPPING)
|
||||
return FALSE;
|
||||
if (entityInfo->cringeClassStatus.status == STATUS_CRINGE)
|
||||
return FALSE;
|
||||
if (entityInfo->frozenClassStatus.status == STATUS_WRAP)
|
||||
return FALSE;
|
||||
if (entityInfo->frozenClassStatus.status == STATUS_WRAPPED
|
||||
|| entityInfo->blinkerClassStatus.status == STATUS_CROSS_EYED)
|
||||
return FALSE;
|
||||
if (entityInfo->curseClassStatus.status == STATUS_DECOY)
|
||||
return FALSE;
|
||||
if (entityInfo->blinkerClassStatus.status == STATUS_BLINKER)
|
||||
return FALSE;
|
||||
if (entityInfo->cringeClassStatus.status != STATUS_INFATUATED
|
||||
&& entityInfo->cringeClassStatus.status != STATUS_PAUSED)
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 CheckVariousConditions(Entity *pokemon)
|
||||
{
|
||||
EntityInfo *pokemonInfo = GetEntInfo(pokemon);
|
||||
|
||||
if (pokemonInfo->monsterBehavior == BEHAVIOR_RESCUE_TARGET
|
||||
|| IsExperienceLocked(pokemonInfo->joinedAt.id)
|
||||
|| (!pokemonInfo->isTeamLeader && ShouldMonsterRunAway(pokemon))
|
||||
|| CheckVariousStatuses2(pokemon, FALSE)
|
||||
|| CheckVariousStatuses(pokemon))
|
||||
return TRUE;
|
||||
|
||||
if (IsChargingAnyTwoTurnMove(pokemon, FALSE))
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 CheckVariousStatuses(Entity *pokemon)
|
||||
{
|
||||
EntityInfo *pokemonInfo = GetEntInfo(pokemon);
|
||||
|
||||
if ((pokemonInfo->sleepClassStatus.status != STATUS_SLEEPLESS && pokemonInfo->sleepClassStatus.status != STATUS_NONE))
|
||||
return TRUE;
|
||||
if (pokemonInfo->frozenClassStatus.status == STATUS_FROZEN || pokemonInfo->frozenClassStatus.status == STATUS_PETRIFIED)
|
||||
return TRUE;
|
||||
if (pokemonInfo->bideClassStatus.status == STATUS_BIDE)
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 CannotAttack(Entity *pokemon, bool8 skipSleep)
|
||||
{
|
||||
EntityInfo *pokemonInfo = GetEntInfo(pokemon);
|
||||
|
||||
if ((skipSleep ||
|
||||
pokemonInfo->sleepClassStatus.status == STATUS_SLEEPLESS ||
|
||||
pokemonInfo->sleepClassStatus.status == STATUS_YAWNING ||
|
||||
pokemonInfo->sleepClassStatus.status == STATUS_NONE) &&
|
||||
pokemonInfo->frozenClassStatus.status != STATUS_FROZEN &&
|
||||
pokemonInfo->frozenClassStatus.status != STATUS_WRAP &&
|
||||
pokemonInfo->frozenClassStatus.status != STATUS_WRAPPED &&
|
||||
pokemonInfo->frozenClassStatus.status != STATUS_PETRIFIED &&
|
||||
pokemonInfo->cringeClassStatus.status != STATUS_CRINGE &&
|
||||
pokemonInfo->cringeClassStatus.status != STATUS_PAUSED &&
|
||||
pokemonInfo->cringeClassStatus.status != STATUS_INFATUATED &&
|
||||
pokemonInfo->burnClassStatus.status != STATUS_PARALYSIS &&
|
||||
!ShouldMonsterRunAway(pokemon))
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool8 CanMoveInDirection(Entity *pokemon, u32 direction)
|
||||
{
|
||||
u8 crossableTerrain = GetCrossableTerrain(GetEntInfo(pokemon)->id);
|
||||
const Tile *currentMapTile = GetTile(pokemon->pos.x + gAdjacentTileOffsets[direction].x,
|
||||
pokemon->pos.y + gAdjacentTileOffsets[direction].y);
|
||||
|
||||
if (currentMapTile->terrainType & TERRAIN_TYPE_IMPASSABLE_WALL || currentMapTile->monster != NULL)
|
||||
return FALSE;
|
||||
|
||||
if (!IsCurrentFixedRoomBossFight())
|
||||
{
|
||||
if (GetEntInfo(pokemon)->invisibleClassStatus.status == STATUS_MOBILE || HasHeldItem(pokemon, ITEM_MOBILE_SCARF))
|
||||
crossableTerrain = CROSSABLE_TERRAIN_WALL;
|
||||
else if (IQSkillIsEnabled(pokemon, IQ_ALL_TERRAIN_HIKER))
|
||||
crossableTerrain = CROSSABLE_TERRAIN_CREVICE;
|
||||
else if (IQSkillIsEnabled(pokemon, IQ_SUPER_MOBILE)) {
|
||||
if (direction & 1)
|
||||
// Super Mobile can't break walls diagonally.
|
||||
crossableTerrain = CROSSABLE_TERRAIN_CREVICE;
|
||||
else
|
||||
crossableTerrain = CROSSABLE_TERRAIN_WALL;
|
||||
}
|
||||
}
|
||||
|
||||
currentMapTile = GetTile(pokemon->pos.x, pokemon->pos.y);
|
||||
if (!(currentMapTile->walkableNeighborFlags[crossableTerrain] & gDirectionBitMasks_1[direction & DIRECTION_MASK]))
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@@ -12,7 +12,6 @@
|
||||
#include "constants/status.h"
|
||||
#include "constants/type.h"
|
||||
#include "dungeon_action.h"
|
||||
#include "dungeon_capabilities.h"
|
||||
#include "dungeon_items.h"
|
||||
#include "dungeon_music.h"
|
||||
#include "dungeon_pokemon_attributes.h"
|
||||
@@ -32,6 +31,7 @@
|
||||
#include "dungeon_misc.h"
|
||||
#include "code_803E724.h"
|
||||
#include "dungeon_data.h"
|
||||
#include "dungeon_ai_targeting.h"
|
||||
|
||||
extern u8 *gUnknown_80F89F4[];
|
||||
extern u8 *gUnknown_80FB580[];
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
#include "code_8041AD0.h"
|
||||
#include "code_80861A8.h"
|
||||
#include "code_80869E4.h"
|
||||
#include "dungeon_capabilities.h"
|
||||
#include "dungeon_leader.h"
|
||||
#include "dungeon_random.h"
|
||||
#include "dungeon_util.h"
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
#include "dungeon_action.h"
|
||||
#include "dungeon_ai_movement.h"
|
||||
#include "dungeon_ai_targeting.h"
|
||||
#include "dungeon_capabilities.h"
|
||||
#include "dungeon_items.h"
|
||||
#include "dungeon_leader.h"
|
||||
#include "dungeon_main.h"
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
#include "text_1.h"
|
||||
#include "code_8044CC8.h"
|
||||
#include "code_801B3C0.h"
|
||||
#include "dungeon_capabilities.h"
|
||||
#include "dungeon_ai_targeting.h"
|
||||
|
||||
extern void PlayDungeonCancelSE(void);
|
||||
extern void PlayDungeonConfirmationSE(void);
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
#include "code_8097DD0.h"
|
||||
#include "dungeon_action.h"
|
||||
#include "dungeon_ai_movement.h"
|
||||
#include "dungeon_capabilities.h"
|
||||
#include "dungeon_items.h"
|
||||
#include "dungeon_leader.h"
|
||||
#include "dungeon_main.h"
|
||||
@@ -44,6 +43,7 @@
|
||||
#include "string_format.h"
|
||||
#include "text_2.h"
|
||||
#include "weather.h"
|
||||
#include "dungeon_ai_targeting.h"
|
||||
|
||||
extern bool8 sub_8048A68(Entity *param_1,Item *item);
|
||||
extern bool8 sub_8048950(Entity *param_1,Item *item);
|
||||
|
||||
@@ -37,7 +37,6 @@
|
||||
#include "dungeon_config.h"
|
||||
#include "game_options.h"
|
||||
#include "weather.h"
|
||||
#include "dungeon_capabilities.h"
|
||||
#include "text_util.h"
|
||||
#include "dungeon_random.h"
|
||||
#include "position_util.h"
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
#include "code_807CD9C.h"
|
||||
#include "code_808417C.h"
|
||||
#include "dungeon_ai_targeting.h"
|
||||
#include "dungeon_capabilities.h"
|
||||
#include "dungeon_config.h"
|
||||
#include "run_dungeon.h"
|
||||
#include "dungeon_items.h"
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
#include "code_807CD9C.h"
|
||||
#include "code_808417C.h"
|
||||
#include "dungeon_ai_targeting.h"
|
||||
#include "dungeon_capabilities.h"
|
||||
#include "dungeon_config.h"
|
||||
#include "run_dungeon.h"
|
||||
#include "dungeon_items.h"
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
#include "dungeon_ai_items.h"
|
||||
#include "dungeon_ai_movement.h"
|
||||
#include "dungeon_ai_targeting.h"
|
||||
#include "dungeon_capabilities.h"
|
||||
#include "dungeon_items.h"
|
||||
#include "dungeon_leader.h"
|
||||
#include "dungeon_map_access.h"
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
#include "constants/status.h"
|
||||
#include "dungeon_action.h"
|
||||
#include "dungeon_ai_attack.h"
|
||||
#include "dungeon_capabilities.h"
|
||||
#include "dungeon_random.h"
|
||||
#include "dungeon_ai_targeting.h"
|
||||
|
||||
extern const char *gPtrFrozenMessage[];
|
||||
extern const char *gPtrWrappedAroundMessage[];
|
||||
|
||||
Reference in New Issue
Block a user