Quadravol charge level 5 point blank fix.

Add DE_NONEXPLOSIVE flag to DoExplosion. Treats damage as "not explosive" (This makes detecting what is or isn't an explosive damage source easier).
This commit is contained in:
Mari the Deer 2022-08-25 20:03:54 +02:00
commit c77504b9a2
12 changed files with 27 additions and 47 deletions

View file

@ -14,7 +14,8 @@ enum EDoExplosionFlags
DE_COUNTFHKILLS = 512, // only count kills for enemies that were at full health
DE_NOHURTFRIEND = 1024, // splash damage will not affect allies
DE_CENTERHEIGHT = 2048, // origin of explosion is at the center height of the source actor, rather than its base
DE_QUADRAVOL = 4096 // splash burn from a Quadravol projectile, so it'll ignite enemies instead of dealing damage
DE_NONEXPLOSIVE = 4096, // does not count as explosive damage (DMG_EXPLOSION is not passed, and no blast taunts are used)
DE_QUADRAVOL = 8192 // splash burn from a Quadravol projectile, so it'll ignite enemies instead of dealing damage
};
enum EExitType
@ -1167,23 +1168,6 @@ Class SWWMUtility
Victim.vel += Momentum;
}
// fixes some false positives for explosion taunts
static bool IsExplosiveSource( Actor s )
{
if ( s is 'DemolitionistShockwave' ) return false;
if ( s is 'HammerShockwave' ) return false;
if ( s is 'BigPunchSplash' ) return false;
if ( s is 'AirBullet' ) return false;
if ( s is 'SaltBeam' ) return false;
if ( s is 'CorrodeDebuff' ) return false;
if ( s is 'CorrosiveSplash' ) return false;
if ( s is 'TheBall' ) return false;
if ( s is 'SilverAirRip' ) return false;
if ( s is 'SilverImpact' ) return false;
if ( s is 'SheenTrail' ) return false;
return true;
}
// complete spherical and more accurate replacement of A_Explode
// 100% free of the buggery GZDoom's own splash damage has
// returns the number of shootables hit/killed
@ -1205,6 +1189,7 @@ Class SWWMUtility
if ( !(flags&DE_NOSPLASH) ) Source.CheckSplash(ExplosionRadius);
double brange = 1./(ExplosionRadius-FullDamageRadius);
Actor Instigator = realsource?realsource:(flags&DE_NOTMISSILE)?Source:Source.target;
int dflg = ((flags&DE_NONEXPLOSIVE)?0:DMG_EXPLOSION)|dmgflags;
BlockThingsIterator bi = BlockThingsIterator.Create(Source,ExplosionRadius);
int nhit = 0, nkill = 0;
bool haskilled = false;
@ -1274,7 +1259,7 @@ Class SWWMUtility
if ( dmg <= 0 ) continue; // no harm
int oldhp = a.Health;
int basehp = a.GetSpawnHealth();
int ndmg = a.DamageMobj(realinflictor?realinflictor:Source,Instigator,dmg,(DamageType=='')?Source.DamageType:DamageType,DMG_EXPLOSION|dmgflags,atan2(-dir.y,-dir.x));
int ndmg = a.DamageMobj(realinflictor?realinflictor:Source,Instigator,dmg,(DamageType=='')?Source.DamageType:DamageType,dflg,atan2(-dir.y,-dir.x));
if ( a && !(flags&DE_NOBLEED) ) a.TraceBleed((ndmg>0)?ndmg:dmg,Source);
if ( (flags&DE_HOWL) && a && (a.Health > 0) && a.bISMONSTER && !Random[DoBlast](0,3) ) a.Howl();
if ( hostile && (!a || (a.Health <= 0)) ) haskilled = true;
@ -1285,7 +1270,7 @@ Class SWWMUtility
let hnd = SWWMHandler(EventHandler.Find("SWWMHandler"));
if ( !hnd || (hnd.psectors.Size() <= 1) )
{
if ( (Instigator is 'Demolitionist') && haskilled && IsExplosiveSource(Source) )
if ( (Instigator is 'Demolitionist') && haskilled && !(flags&DE_NONEXPLOSIVE) )
{
let demo = Demolitionist(Instigator);
if ( (gametic > demo.lastbang+30) && (!hnd || (gametic > hnd.lastcombat+10)) && !Random[DemoLines](0,1) )
@ -1366,7 +1351,7 @@ Class SWWMUtility
if ( dmg <= 0 ) continue; // no harm
int oldhp = a.Health;
int basehp = a.GetSpawnHealth();
int ndmg = a.DamageMobj(realinflictor?realinflictor:Source,Instigator,dmg,(DamageType=='')?Source.DamageType:DamageType,DMG_EXPLOSION|dmgflags,atan2(-dir.y,-dir.x));
int ndmg = a.DamageMobj(realinflictor?realinflictor:Source,Instigator,dmg,(DamageType=='')?Source.DamageType:DamageType,dflg,atan2(-dir.y,-dir.x));
if ( a && !(flags&DE_NOBLEED) ) a.TraceBleed((ndmg>0)?ndmg:dmg,Source);
if ( (flags&DE_HOWL) && a && (a.Health > 0) && a.bISMONSTER && !Random[DoBlast](0,3) ) a.Howl();
if ( hostile && (!a || (a.Health <= 0)) ) haskilled = true;
@ -1374,7 +1359,7 @@ Class SWWMUtility
if ( (!a || (a.Health <= 0)) && (!(flags&DE_COUNTENEMIES) || hostile) && (!(flags&DE_COUNTSTEALTH) || inactive) ) nkill++;
}
}
if ( (Instigator is 'Demolitionist') && haskilled && IsExplosiveSource(Source) )
if ( (Instigator is 'Demolitionist') && haskilled && !(flags&DE_NONEXPLOSIVE) )
{
let demo = Demolitionist(Instigator);
if ( (gametic > demo.lastbang+30) && (gametic > hnd.lastcombat+10) && !Random[DemoLines](0,1) )