Added (XF/RADF)_THRUSTLESS.

This flag allows for explosions that do not thrust any of the actors caught in the blast.
This commit is contained in:
inkoalawetrust 2023-01-05 22:40:59 +02:00 committed by Rachael Alexanderson
parent 357d846b7a
commit 6489b05db9
4 changed files with 16 additions and 7 deletions

View file

@ -406,7 +406,8 @@ enum
RADF_SOURCEISSPOT = 4,
RADF_NODAMAGE = 8,
RADF_THRUSTZ = 16,
RADF_OLDRADIUSDAMAGE = 32
RADF_OLDRADIUSDAMAGE = 32,
RADF_THRUSTLESS = 64
};
int P_GetRadiusDamage(AActor *self, AActor *thing, int damage, int distance, int fulldmgdistance, bool oldradiusdmg);
int P_RadiusAttack (AActor *spot, AActor *source, int damage, int distance,

View file

@ -6101,15 +6101,22 @@ int P_RadiusAttack(AActor *bombspot, AActor *bombsource, int bombdamage, int bom
double thrust;
int damage = abs((int)points);
int newdam = damage;
int dmgmask = 0;
if (!(flags & RADF_NODAMAGE))
{
//[inkoalawetrust] Thrustless explosions don't push anything.
if (!(flags & RADF_THRUSTLESS))
dmgmask = DMG_EXPLOSION;
else
dmgmask = DMG_EXPLOSION | DMG_THRUSTLESS;
//[MC] Don't count actors saved by buddha if already at 1 health.
int prehealth = thing->health;
newdam = P_DamageMobj(thing, bombspot, bombsource, damage, bombmod, DMG_EXPLOSION);
newdam = P_DamageMobj(thing, bombspot, bombsource, damage, bombmod, dmgmask);
if (thing->health < prehealth) count++;
}
else if (thing->player == NULL && (!(flags & RADF_NOIMPACTDAMAGE) && !(thing->flags7 & MF7_DONTTHRUST)))
else if (thing->player == NULL && (!(flags & RADF_NOIMPACTDAMAGE && !(flags & RADF_THRUSTLESS)) && !(thing->flags7 & MF7_DONTTHRUST)))
thing->flags2 |= MF2_BLASTED;
if (!(thing->flags & MF_ICECORPSE))
@ -6117,13 +6124,12 @@ int P_RadiusAttack(AActor *bombspot, AActor *bombsource, int bombdamage, int bom
if (!(flags & RADF_NODAMAGE) && !(bombspot->flags3 & MF3_BLOODLESSIMPACT))
P_TraceBleed(newdam > 0 ? newdam : damage, thing, bombspot);
if ((flags & RADF_NODAMAGE) || !(bombspot->flags2 & MF2_NODMGTHRUST))
if ((flags & RADF_NODAMAGE && !(flags & RADF_THRUSTLESS)) || !(bombspot->flags2 & MF2_NODMGTHRUST) && !(flags & RADF_THRUSTLESS))
{
if (bombsource == NULL || !(bombsource->flags2 & MF2_NODMGTHRUST))
{
if (!(thing->flags7 & MF7_DONTTHRUST))
{
thrust = points * 0.5 / (double)thing->Mass;
if (bombsource == thing)
{

View file

@ -606,6 +606,7 @@ extend class Actor
if (flags & XF_HURTSOURCE) pflags |= RADF_HURTSOURCE;
if (flags & XF_NOTMISSILE) pflags |= RADF_SOURCEISSPOT;
if (flags & XF_THRUSTZ) pflags |= RADF_THRUSTZ;
if (flags & XF_THRUSTLESS) pflags |= RADF_THRUSTLESS;
int count = RadiusAttack (target, damage, distance, damagetype, pflags, fulldamagedistance);
if (!(flags & XF_NOSPLASH)) CheckSplash(distance);

View file

@ -261,7 +261,7 @@ enum EExplodeFlags
XF_EXPLICITDAMAGETYPE = 8,
XF_NOSPLASH = 16,
XF_THRUSTZ = 32,
XF_THRUSTLESS = 64,
};
// Flags for A_RadiusThrust
@ -1227,7 +1227,8 @@ enum RadiusDamageFlags
RADF_SOURCEISSPOT = 4,
RADF_NODAMAGE = 8,
RADF_THRUSTZ = 16,
RADF_OLDRADIUSDAMAGE = 32
RADF_OLDRADIUSDAMAGE = 32,
RADF_THRUSTLESS = 64
};
enum IntermissionSequenceType