mirror of
https://github.com/pret/pmd-sky.git
synced 2026-04-25 15:42:34 -05:00
37 lines
1.1 KiB
C
37 lines
1.1 KiB
C
#include "dungeon_visibility.h"
|
|
#include "dg_object.h"
|
|
#include "dungeon_pokemon_attributes_1.h"
|
|
#include "dungeon_statuses.h"
|
|
#include "dungeon_util_static.h"
|
|
|
|
extern bool8 HasDropeyeStatus(struct entity* entity);
|
|
extern bool8 IsPositionActuallyInSight(struct position *pos1, struct position *pos2, bool8 user_has_dropeye);
|
|
|
|
bool8 CanSeeTarget(struct entity *user, struct entity *target)
|
|
{
|
|
if (!EntityIsValid__022E1A1C(user))
|
|
return FALSE;
|
|
|
|
if (!EntityIsValid__022E1A1C(target))
|
|
return FALSE;
|
|
|
|
if (!target->is_visible)
|
|
return FALSE;
|
|
|
|
if (target->type == ENTITY_MONSTER)
|
|
{
|
|
if (user->type == ENTITY_MONSTER)
|
|
{
|
|
if (!CanSeeInvisibleMonsters(user) && GetEntInfo(target)->invisible_class_status.status == STATUS_INVISIBLE_INVISIBLE)
|
|
return FALSE;
|
|
|
|
if (IsBlinded(user, TRUE))
|
|
return FALSE;
|
|
}
|
|
else if (GetEntInfo(target)->invisible_class_status.status == STATUS_INVISIBLE_INVISIBLE)
|
|
return FALSE;
|
|
}
|
|
|
|
return IsPositionActuallyInSight(&user->pos, &target->pos, HasDropeyeStatus(user));
|
|
}
|