- added SEEINVISIBLE submission.

SVN r3215 (trunk)
This commit is contained in:
Christoph Oelckers 2011-05-26 23:25:02 +00:00
parent 81ae38c072
commit 3277b508cd
4 changed files with 25 additions and 17 deletions

View File

@ -326,6 +326,7 @@ enum
MF6_ADDITIVEPOISONDURATION = 0x00200000,
MF6_NOMENU = 0x00400000, // Player class should not appear in the class selection menu.
MF6_BOSSCUBE = 0x00800000, // Actor spawned by A_BrainSpit, flagged for timefreeze reasons.
MF6_SEEINVISIBLE = 0x01000000, // Monsters can see invisible player.
// --- mobj.renderflags ---

View File

@ -1667,19 +1667,24 @@ bool P_LookForPlayers (AActor *actor, INTBOOL allaround, FLookExParams *params)
continue;
}
if ((player->mo->flags & MF_SHADOW && !(i_compatflags & COMPATF_INVISIBILITY)) ||
player->mo->flags3 & MF3_GHOST)
// [RC] Well, let's let special monsters with this flag active be able to see
// the player then, eh?
if(!(actor->flags & MF6_SEEINVISIBLE))
{
if ((P_AproxDistance (player->mo->x - actor->x,
player->mo->y - actor->y) > 2*MELEERANGE)
&& P_AproxDistance (player->mo->velx, player->mo->vely)
< 5*FRACUNIT)
{ // Player is sneaking - can't detect
return false;
}
if (pr_lookforplayers() < 225)
{ // Player isn't sneaking, but still didn't detect
return false;
if ((player->mo->flags & MF_SHADOW && !(i_compatflags & COMPATF_INVISIBILITY)) ||
player->mo->flags3 & MF3_GHOST)
{
if ((P_AproxDistance (player->mo->x - actor->x,
player->mo->y - actor->y) > 2*MELEERANGE)
&& P_AproxDistance (player->mo->velx, player->mo->vely)
< 5*FRACUNIT)
{ // Player is sneaking - can't detect
return false;
}
if (pr_lookforplayers() < 225)
{ // Player isn't sneaking, but still didn't detect
return false;
}
}
}
@ -2757,7 +2762,7 @@ void A_Face (AActor *self, AActor *other, angle_t max_turn)
}
// This will never work well if the turn angle is limited.
if (max_turn == 0 && (self->angle == other_angle) && other->flags & MF_SHADOW)
if (max_turn == 0 && (self->angle == other_angle) && other->flags & MF_SHADOW && !(self->flags6 & MF6_SEEINVISIBLE) )
{
self->angle += pr_facetarget.Random2() << 21;
}
@ -2846,10 +2851,10 @@ DEFINE_ACTION_FUNCTION(AActor, A_MonsterRail)
self->target->x - self->target->velx * 3,
self->target->y - self->target->vely * 3);
if (self->target->flags & MF_SHADOW)
{
if (self->target->flags & MF_SHADOW && !(self->flags6 & MF6_SEEINVISIBLE))
{
self->angle += pr_railface.Random2() << 21;
}
}
P_RailAttack (self, self->GetMissileDamage (0, 1), 0);
self->pitch = saved_pitch;

View File

@ -5071,7 +5071,8 @@ AActor *P_SpawnMissileXYZ (fixed_t x, fixed_t y, fixed_t z,
th->velz = (fixed_t)(velocity.Z);
// invisible target: rotate velocity vector in 2D
if (dest->flags & MF_SHADOW)
// [RC] Now monsters can aim at invisible player as if they were fully visible.
if (dest->flags & MF_SHADOW && !(source->flags6 & MF6_SEEINVISIBLE))
{
angle_t an = pr_spawnmissile.Random2 () << 20;
an >>= ANGLETOFINESHIFT;

View File

@ -229,6 +229,7 @@ static FFlagDef ActorFlags[]=
DEFINE_FLAG(MF6, ADDITIVEPOISONDURATION, AActor, flags6),
DEFINE_FLAG(MF6, BLOCKEDBYSOLIDACTORS, AActor, flags6),
DEFINE_FLAG(MF6, NOMENU, AActor, flags6),
DEFINE_FLAG(MF6, SEEINVISIBLE, AActor, flags6),
// Effect flags
DEFINE_FLAG(FX, VISIBILITYPULSE, AActor, effects),