Added RGF_NORANDOMPUFFZ flag for A_CustomRailgun and A_RailAttack

This commit is contained in:
yqco 2016-07-22 02:35:44 -06:00
parent fa22acca5d
commit 4d6532d303
3 changed files with 13 additions and 5 deletions

View file

@ -372,6 +372,7 @@ enum // P_RailAttack / A_RailAttack / A_CustomRailgun / P_DrawRailTrail flags
RAF_EXPLICITANGLE = 4, RAF_EXPLICITANGLE = 4,
RAF_FULLBRIGHT = 8, RAF_FULLBRIGHT = 8,
RAF_CENTERZ = 16, RAF_CENTERZ = 16,
RAF_NORANDOMPUFFZ = 32,
}; };

View file

@ -4725,6 +4725,12 @@ void P_RailAttack(FRailParams *p)
} }
} }
int puffflags = 0;
if (p->flags & RAF_NORANDOMPUFFZ)
{
puffflags |= PF_NORANDOMZ;
}
DVector2 xy = source->Vec2Angle(p->offset_xy, angle - 90.); DVector2 xy = source->Vec2Angle(p->offset_xy, angle - 90.);
RailData rail_data; RailData rail_data;
@ -4777,7 +4783,7 @@ void P_RailAttack(FRailParams *p)
bool spawnpuff; bool spawnpuff;
bool bleed = false; bool bleed = false;
int puffflags = PF_HITTHING; int actorpuffflags = puffflags | PF_HITTHING;
AActor *hitactor = rail_data.RailHits[i].HitActor; AActor *hitactor = rail_data.RailHits[i].HitActor;
DVector3 &hitpos = rail_data.RailHits[i].HitPos; DVector3 &hitpos = rail_data.RailHits[i].HitPos;
DAngle hitangle = rail_data.RailHits[i].HitAngle; DAngle hitangle = rail_data.RailHits[i].HitAngle;
@ -4790,7 +4796,7 @@ void P_RailAttack(FRailParams *p)
else else
{ {
spawnpuff = (puffclass != NULL && puffDefaults->flags3 & MF3_ALWAYSPUFF); spawnpuff = (puffclass != NULL && puffDefaults->flags3 & MF3_ALWAYSPUFF);
puffflags |= PF_HITTHINGBLEED; // [XA] Allow for puffs to jump to XDeath state. actorpuffflags |= PF_HITTHINGBLEED; // [XA] Allow for puffs to jump to XDeath state.
if (!(puffDefaults->flags3 & MF3_BLOODLESSIMPACT)) if (!(puffDefaults->flags3 & MF3_BLOODLESSIMPACT))
{ {
bleed = true; bleed = true;
@ -4798,7 +4804,7 @@ void P_RailAttack(FRailParams *p)
} }
if (spawnpuff) if (spawnpuff)
{ {
P_SpawnPuff(source, puffclass, hitpos, hitangle, hitangle - 90, 1, puffflags, hitactor); P_SpawnPuff(source, puffclass, hitpos, hitangle, hitangle - 90, 1, actorpuffflags, hitactor);
} }
int dmgFlagPass = DMG_INFLICTOR_IS_PUFF; int dmgFlagPass = DMG_INFLICTOR_IS_PUFF;
@ -4827,7 +4833,7 @@ void P_RailAttack(FRailParams *p)
if (puffclass != NULL && puffDefaults->flags3 & MF3_ALWAYSPUFF) if (puffclass != NULL && puffDefaults->flags3 & MF3_ALWAYSPUFF)
{ {
puff = P_SpawnPuff(source, puffclass, trace.HitPos, trace.SrcAngleFromTarget, trace.SrcAngleFromTarget - 90, 1, 0); puff = P_SpawnPuff(source, puffclass, trace.HitPos, trace.SrcAngleFromTarget, trace.SrcAngleFromTarget - 90, 1, puffflags);
if (puff && (trace.Line != NULL) && (trace.Line->special == Line_Horizon) && !(puff->flags3 & MF3_SKYEXPLODE)) if (puff && (trace.Line != NULL) && (trace.Line->special == Line_Horizon) && !(puff->flags3 & MF3_SKYEXPLODE))
puff->Destroy(); puff->Destroy();
} }
@ -4842,7 +4848,7 @@ void P_RailAttack(FRailParams *p)
AActor* puff = NULL; AActor* puff = NULL;
if (puffclass != NULL && puffDefaults->flags3 & MF3_ALWAYSPUFF) if (puffclass != NULL && puffDefaults->flags3 & MF3_ALWAYSPUFF)
{ {
puff = P_SpawnPuff(source, puffclass, trace.HitPos, trace.SrcAngleFromTarget, trace.SrcAngleFromTarget - 90, 1, 0); puff = P_SpawnPuff(source, puffclass, trace.HitPos, trace.SrcAngleFromTarget, trace.SrcAngleFromTarget - 90, 1, puffflags);
if (puff && !(puff->flags3 & MF3_SKYEXPLODE) && if (puff && !(puff->flags3 & MF3_SKYEXPLODE) &&
(((trace.HitType == TRACE_HitFloor) && (puff->floorpic == skyflatnum)) || (((trace.HitType == TRACE_HitFloor) && (puff->floorpic == skyflatnum)) ||
((trace.HitType == TRACE_HitCeiling) && (puff->ceilingpic == skyflatnum)))) ((trace.HitType == TRACE_HitCeiling) && (puff->ceilingpic == skyflatnum))))

View file

@ -171,6 +171,7 @@ const int RGF_NOPIERCING = 2;
const int RGF_EXPLICITANGLE = 4; const int RGF_EXPLICITANGLE = 4;
const int RGF_FULLBRIGHT = 8; const int RGF_FULLBRIGHT = 8;
const int RGF_CENTERZ = 16; const int RGF_CENTERZ = 16;
const int RGF_NORANDOMPUFFZ = 32;
// Flags for A_Mushroom // Flags for A_Mushroom
const int MSF_Standard = 0; const int MSF_Standard = 0;