blob: 4a76b69f1dd42cf74278e26c2ec9873adb55a707 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
#include "global.h"
#include "dungeon_visibility.h"
#include "constants/status.h"
#include "dungeon_pokemon_attributes.h"
#include "dungeon_range.h"
#include "dungeon_util.h"
bool8 CanSee(struct DungeonEntity *entity, struct DungeonEntity *targetEntity)
{
if (!EntityExists(entity) || !EntityExists(targetEntity) || !targetEntity->visible)
{
return FALSE;
}
if (targetEntity->entityType == ENTITY_POKEMON)
{
if (entity->entityType == ENTITY_POKEMON)
{
if (!CanSeeInvisible(entity) && targetEntity->entityData->transformStatus == TRANSFORM_STATUS_INVISIBLE)
{
return FALSE;
}
if (entity->entityData->eyesightStatus == EYESIGHT_STATUS_BLINKER)
{
return FALSE;
}
}
else if (targetEntity->entityData->transformStatus == TRANSFORM_STATUS_INVISIBLE)
{
return FALSE;
}
}
return InSameRoom_2(&entity->posWorld, &targetEntity->posWorld);
}
|