- Added MF6_NOTRIGGER flag that disables all line actions for an actor.

SVN r1907 (trunk)
This commit is contained in:
Christoph Oelckers 2009-10-10 12:42:57 +00:00
parent 4a81f55fb0
commit 4529108b8f
6 changed files with 43 additions and 13 deletions

View file

@ -1,3 +1,6 @@
October 10, 2009 (Changes by Graf Zahl)
- Added MF6_NOTRIGGER flag that disables all line actions for an actor.
October 9, 2009 (Changes by Graf Zahl)
- Added Gez's seeker missile submission.
- Added Gez's thing activation submission.

View file

@ -316,6 +316,7 @@ enum
MF6_ARMED = 0x00002000, // From MBF: Object is armed (for MF6_TOUCHY objects)
MF6_FALLING = 0x00004000, // From MBF: Object is falling (for pseudotorque simulation)
MF6_LINEDONE = 0x00008000, // From MBF: Object has already run a line effect
MF6_NOTRIGGER = 0x00010000, // actor cannot trigger any line actions
// --- mobj.renderflags ---

View file

@ -2428,6 +2428,7 @@ enum
APROP_Species = 20,
APROP_NameTag = 21,
APROP_Score = 22,
APROP_Notrigger = 23,
};
// These are needed for ACS's APROP_RenderStyle
@ -2519,6 +2520,10 @@ void DLevelScript::DoSetActorProperty (AActor *actor, int property, int value)
if (value) actor->flags3 |= MF3_NOTARGET; else actor->flags3 &= ~MF3_NOTARGET;
break;
case APROP_Notrigger:
if (value) actor->flags6 |= MF6_NOTRIGGER; else actor->flags6 &= ~MF6_NOTRIGGER;
break;
case APROP_JumpZ:
if (actor->IsKindOf (RUNTIME_CLASS (APlayerPawn)))
static_cast<APlayerPawn *>(actor)->JumpZ = value;
@ -2638,6 +2643,7 @@ int DLevelScript::GetActorProperty (int tid, int property)
case APROP_Frightened: return !!(actor->flags4 & MF4_FRIGHTENED);
case APROP_Friendly: return !!(actor->flags & MF_FRIENDLY);
case APROP_Notarget: return !!(actor->flags3 & MF3_NOTARGET);
case APROP_Notrigger: return !!(actor->flags6 & MF6_NOTRIGGER);
case APROP_SpawnHealth: if (actor->IsKindOf (RUNTIME_CLASS (APlayerPawn)))
{
return static_cast<APlayerPawn *>(actor)->MaxHealth;
@ -2694,6 +2700,7 @@ int DLevelScript::CheckActorProperty (int tid, int property, int value)
case APROP_Frightened:
case APROP_Friendly:
case APROP_Notarget:
case APROP_Notrigger:
return (GetActorProperty(tid, property) == (!!value));
// Strings are not covered by GetActorProperty, so make the check here

View file

@ -583,15 +583,19 @@ bool P_Move (AActor *actor)
line_t *ld;
int good = 0;
while (spechit.Pop (ld))
if (!(actor->flags6 & MF6_NOTRIGGER))
{
// [RH] let monsters push lines, as well as use them
if (((actor->flags4 & MF4_CANUSEWALLS) && P_ActivateLine (ld, actor, 0, SPAC_Use)) ||
((actor->flags2 & MF2_PUSHWALL) && P_ActivateLine (ld, actor, 0, SPAC_Push)))
while (spechit.Pop (ld))
{
good |= ld == actor->BlockingLine ? 1 : 2;
// [RH] let monsters push lines, as well as use them
if (((actor->flags4 & MF4_CANUSEWALLS) && P_ActivateLine (ld, actor, 0, SPAC_Use)) ||
((actor->flags2 & MF2_PUSHWALL) && P_ActivateLine (ld, actor, 0, SPAC_Push)))
{
good |= ld == actor->BlockingLine ? 1 : 2;
}
}
}
else spechit.Clear();
return good && ((pr_opendoor() >= 203) ^ (good & 1));
}
else

View file

@ -1519,7 +1519,7 @@ void P_FakeZMovement (AActor *mo)
static void CheckForPushSpecial (line_t *line, int side, AActor *mobj)
{
if (line->special)
if (line->special && !(mobj->flags6 & MF6_NOTRIGGER))
{
if (mobj->flags2 & MF2_PUSHWALL)
{
@ -1795,7 +1795,7 @@ bool P_TryMove (AActor *thing, fixed_t x, fixed_t y,
// see if the line was crossed
side = P_PointOnLineSide (thing->x, thing->y, ld);
oldside = P_PointOnLineSide (oldx, oldy, ld);
if (side != oldside && ld->special)
if (side != oldside && ld->special && !(thing->flags6 & MF6_NOTRIGGER))
{
if (thing->player)
{
@ -3231,12 +3231,20 @@ AActor *P_LineAttack (AActor *t1, angle_t angle, fixed_t distance,
t1->player->ReadyWeapon != NULL &&
(t1->player->ReadyWeapon->flags2 & MF2_THRUGHOST));
AActor *puffDefaults = GetDefaultByType (pufftype);
int tflags;
if (puffDefaults != NULL && puffDefaults->flags6 & MF6_NOTRIGGER) tflags = TRACE_NoSky;
else tflags = TRACE_NoSky|TRACE_Impact;
if (!Trace (t1->x, t1->y, shootz, t1->Sector, vx, vy, vz, distance,
MF_SHOOTABLE, ML_BLOCKEVERYTHING, t1, trace,
TRACE_NoSky|TRACE_Impact, hitGhosts ? CheckForGhost : CheckForSpectral))
tflags, hitGhosts ? CheckForGhost : CheckForSpectral))
{ // hit nothing
AActor *puffDefaults = GetDefaultByType (pufftype);
if (puffDefaults->ActiveSound)
if (puffDefaults == NULL)
{
}
else if (puffDefaults->ActiveSound)
{ // Play miss sound
S_Sound (t1, CHAN_WEAPON, puffDefaults->ActiveSound, 1, ATTN_NORM);
}
@ -3629,22 +3637,28 @@ void P_RailAttack (AActor *source, int damage, int offset, int color1, int color
start.Y = FIXED2FLOAT(y1);
start.Z = FIXED2FLOAT(shootz);
int flags;
AActor *puffDefaults = puffclass == NULL? NULL : GetDefaultByType (puffclass);
if (puffDefaults != NULL && puffDefaults->flags6 & MF6_NOTRIGGER) flags = 0;
else flags = TRACE_PCross|TRACE_Impact;
if (pierce)
{
Trace (x1, y1, shootz, source->Sector, vx, vy, vz,
8192*FRACUNIT, MF_SHOOTABLE, ML_BLOCKEVERYTHING, source, trace,
TRACE_PCross|TRACE_Impact, ProcessRailHit);
flags, ProcessRailHit);
}
else
{
Trace (x1, y1, shootz, source->Sector, vx, vy, vz,
8192*FRACUNIT, MF_SHOOTABLE, ML_BLOCKEVERYTHING, source, trace,
TRACE_PCross|TRACE_Impact, ProcessNoPierceRailHit);
flags, ProcessNoPierceRailHit);
}
// Hurt anything the trace hit
unsigned int i;
AActor *puffDefaults = puffclass == NULL? NULL : GetDefaultByType (puffclass);
FName damagetype = (puffDefaults == NULL || puffDefaults->DamageType == NAME_None) ? FName(NAME_Railgun) : puffDefaults->DamageType;
// used as damage inflictor

View file

@ -223,6 +223,7 @@ static FFlagDef ActorFlags[]=
DEFINE_FLAG(MF6, CANJUMP, AActor, flags6),
DEFINE_FLAG(MF6, JUMPDOWN, AActor, flags6),
DEFINE_FLAG(MF6, VULNERABLE, AActor, flags6),
DEFINE_FLAG(MF6, NOTRIGGER, AActor, flags6),
// Effect flags
DEFINE_FLAG(FX, VISIBILITYPULSE, AActor, effects),