- 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_ADDITIVEPOISONDURATION = 0x00200000,
MF6_NOMENU = 0x00400000, // Player class should not appear in the class selection menu. 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_BOSSCUBE = 0x00800000, // Actor spawned by A_BrainSpit, flagged for timefreeze reasons.
MF6_SEEINVISIBLE = 0x01000000, // Monsters can see invisible player.
// --- mobj.renderflags --- // --- mobj.renderflags ---

View file

@ -1667,19 +1667,24 @@ bool P_LookForPlayers (AActor *actor, INTBOOL allaround, FLookExParams *params)
continue; continue;
} }
if ((player->mo->flags & MF_SHADOW && !(i_compatflags & COMPATF_INVISIBILITY)) || // [RC] Well, let's let special monsters with this flag active be able to see
player->mo->flags3 & MF3_GHOST) // the player then, eh?
if(!(actor->flags & MF6_SEEINVISIBLE))
{ {
if ((P_AproxDistance (player->mo->x - actor->x, if ((player->mo->flags & MF_SHADOW && !(i_compatflags & COMPATF_INVISIBILITY)) ||
player->mo->y - actor->y) > 2*MELEERANGE) player->mo->flags3 & MF3_GHOST)
&& P_AproxDistance (player->mo->velx, player->mo->vely) {
< 5*FRACUNIT) if ((P_AproxDistance (player->mo->x - actor->x,
{ // Player is sneaking - can't detect player->mo->y - actor->y) > 2*MELEERANGE)
return false; && P_AproxDistance (player->mo->velx, player->mo->vely)
} < 5*FRACUNIT)
if (pr_lookforplayers() < 225) { // Player is sneaking - can't detect
{ // Player isn't sneaking, but still didn't detect return false;
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. // 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; 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->x - self->target->velx * 3,
self->target->y - self->target->vely * 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; self->angle += pr_railface.Random2() << 21;
} }
P_RailAttack (self, self->GetMissileDamage (0, 1), 0); P_RailAttack (self, self->GetMissileDamage (0, 1), 0);
self->pitch = saved_pitch; 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); th->velz = (fixed_t)(velocity.Z);
// invisible target: rotate velocity vector in 2D // 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; angle_t an = pr_spawnmissile.Random2 () << 20;
an >>= ANGLETOFINESHIFT; an >>= ANGLETOFINESHIFT;

View file

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