- Turned A_Explode's affectsource parameter into a flags parameter and added XF_NOTMISSILE
and RTF_NOTMISSILE so that you can use A_Explode and A_RadiusThrust with non-missiles without them telling P_RadiusAttack() that the target is the source. SVN r3860 (trunk)
This commit is contained in:
parent
7af13c8d52
commit
6a91335841
15 changed files with 60 additions and 36 deletions
|
|
@ -4442,7 +4442,7 @@ CUSTOM_CVAR (Float, splashfactor, 1.f, CVAR_SERVERINFO)
|
|||
//==========================================================================
|
||||
|
||||
void P_RadiusAttack (AActor *bombspot, AActor *bombsource, int bombdamage, int bombdistance, FName bombmod,
|
||||
bool DamageSource, bool bombdodamage, int fulldamagedistance, bool noimpactdamage)
|
||||
int flags, int fulldamagedistance)
|
||||
{
|
||||
if (bombdistance <= 0)
|
||||
return;
|
||||
|
|
@ -4456,6 +4456,11 @@ void P_RadiusAttack (AActor *bombspot, AActor *bombsource, int bombdamage, int b
|
|||
FBlockThingsIterator it(FBoundingBox(bombspot->x, bombspot->y, bombdistance<<FRACBITS));
|
||||
AActor *thing;
|
||||
|
||||
if (flags & RADF_SOURCEISSPOT)
|
||||
{ // The source is actually the same as the spot, even if that wasn't what we receized.
|
||||
bombsource = bombspot;
|
||||
}
|
||||
|
||||
while ((thing = it.Next()))
|
||||
{
|
||||
// Vulnerable actors can be damaged by radius attacks even if not shootable
|
||||
|
|
@ -4468,7 +4473,7 @@ void P_RadiusAttack (AActor *bombspot, AActor *bombsource, int bombdamage, int b
|
|||
if (thing->flags3 & MF3_NORADIUSDMG && !(bombspot->flags4 & MF4_FORCERADIUSDMG))
|
||||
continue;
|
||||
|
||||
if (!DamageSource && (thing == bombsource || thing == bombspot))
|
||||
if (!(flags & RADF_HURTSOURCE) && (thing == bombsource || thing == bombspot))
|
||||
{ // don't damage the source of the explosion
|
||||
continue;
|
||||
}
|
||||
|
|
@ -4488,7 +4493,7 @@ void P_RadiusAttack (AActor *bombspot, AActor *bombsource, int bombdamage, int b
|
|||
// them far too "active." BossBrains also use the old code
|
||||
// because some user levels require they have a height of 16,
|
||||
// which can make them near impossible to hit with the new code.
|
||||
if (!bombdodamage || !((bombspot->flags5 | thing->flags5) & MF5_OLDRADIUSDMG))
|
||||
if ((flags & RADF_NODAMAGE) || !((bombspot->flags5 | thing->flags5) & MF5_OLDRADIUSDMG))
|
||||
{
|
||||
// [RH] New code. The bounding box only covers the
|
||||
// height of the thing and not the height of the map.
|
||||
|
|
@ -4547,14 +4552,17 @@ void P_RadiusAttack (AActor *bombspot, AActor *bombsource, int bombdamage, int b
|
|||
double thrust;
|
||||
int damage = (int)points;
|
||||
|
||||
if (bombdodamage) P_DamageMobj (thing, bombspot, bombsource, damage, bombmod);
|
||||
else if (thing->player == NULL && !noimpactdamage) thing->flags2 |= MF2_BLASTED;
|
||||
if (!(flags & RADF_NODAMAGE))
|
||||
P_DamageMobj (thing, bombspot, bombsource, damage, bombmod);
|
||||
else if (thing->player == NULL && !(flags & RADF_NOIMPACTDAMAGE))
|
||||
thing->flags2 |= MF2_BLASTED;
|
||||
|
||||
if (!(thing->flags & MF_ICECORPSE))
|
||||
{
|
||||
if (bombdodamage && !(bombspot->flags3 & MF3_BLOODLESSIMPACT)) P_TraceBleed (damage, thing, bombspot);
|
||||
if (!(flags & RADF_NODAMAGE) && !(bombspot->flags3 & MF3_BLOODLESSIMPACT))
|
||||
P_TraceBleed (damage, thing, bombspot);
|
||||
|
||||
if (!bombdodamage || !(bombspot->flags2 & MF2_NODMGTHRUST))
|
||||
if (!(flags & RADF_NODAMAGE) || !(bombspot->flags2 & MF2_NODMGTHRUST))
|
||||
{
|
||||
if (bombsource == NULL || !(bombsource->flags2 & MF2_NODMGTHRUST))
|
||||
{
|
||||
|
|
@ -4575,7 +4583,7 @@ void P_RadiusAttack (AActor *bombspot, AActor *bombsource, int bombdamage, int b
|
|||
angle_t ang = R_PointToAngle2 (bombspot->x, bombspot->y, thing->x, thing->y) >> ANGLETOFINESHIFT;
|
||||
thing->velx += fixed_t (finecosine[ang] * thrust);
|
||||
thing->vely += fixed_t (finesine[ang] * thrust);
|
||||
if (bombdodamage)
|
||||
if (!(flags & RADF_NODAMAGE))
|
||||
thing->velz += (fixed_t)velz; // this really doesn't work well
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue