blob: d258c999a47d852a3b5b4c3005d275a84841180e (
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
35
|
#include "global.h"
#include "dungeon_visibility.h"
#include "constants/status.h"
#include "dungeon_pokemon_attributes_1.h"
#include "dungeon_util.h"
extern bool8 InSameRoom_2(struct Position*, struct Position*);
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);
}
|