Added (XF/RADF)_NOALLIES.

This flag allows explosions to not harm any actors that are friendly to its' source.
This commit is contained in:
inkoalawetrust 2023-01-06 05:19:44 +02:00 committed by Rachael Alexanderson
parent 6489b05db9
commit ca1f3ac580
4 changed files with 11 additions and 5 deletions

View file

@ -407,7 +407,8 @@ enum
RADF_NODAMAGE = 8,
RADF_THRUSTZ = 16,
RADF_OLDRADIUSDAMAGE = 32,
RADF_THRUSTLESS = 64
RADF_THRUSTLESS = 64,
RADF_NOALLIES = 128
};
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

@ -6072,10 +6072,12 @@ int P_RadiusAttack(AActor *bombspot, AActor *bombsource, int bombdamage, int bom
)
) continue;
if((species != NAME_None) && (thing->Species != species))
{
if ((species != NAME_None) && (thing->Species != species))
continue;
//[inkoalawetrust] Don't harm actors friendly to the explosions' source.
if ((flags & RADF_NOALLIES) && bombsource->IsFriend(thing))
continue;
}
if (bombsource && thing != bombsource && bombsource->player && P_ShouldPassThroughPlayer(bombsource, thing))
continue;

View file

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

View file

@ -262,6 +262,7 @@ enum EExplodeFlags
XF_NOSPLASH = 16,
XF_THRUSTZ = 32,
XF_THRUSTLESS = 64,
XF_NOALLIES = 128,
};
// Flags for A_RadiusThrust
@ -1228,7 +1229,8 @@ enum RadiusDamageFlags
RADF_NODAMAGE = 8,
RADF_THRUSTZ = 16,
RADF_OLDRADIUSDAMAGE = 32,
RADF_THRUSTLESS = 64
RADF_THRUSTLESS = 64,
RADF_NOALLIES = 128
};
enum IntermissionSequenceType