mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-10 23:02:08 +00:00
Added DMG_EXPLOSION flag.
- This allows modders to determine if damage is caused by an actual explosion, assigned by P_RadiusAttack and BlastActor for +TOUCHY actors.
This commit is contained in:
parent
c988a0b3a4
commit
1210e1a951
4 changed files with 5 additions and 3 deletions
|
@ -453,6 +453,7 @@ enum EDmgFlags
|
||||||
DMG_NO_PROTECT = 256,
|
DMG_NO_PROTECT = 256,
|
||||||
DMG_USEANGLE = 512,
|
DMG_USEANGLE = 512,
|
||||||
DMG_NO_PAIN = 1024,
|
DMG_NO_PAIN = 1024,
|
||||||
|
DMG_EXPLOSION = 2048,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -6177,7 +6177,7 @@ int P_RadiusAttack(AActor *bombspot, AActor *bombsource, int bombdamage, int bom
|
||||||
{
|
{
|
||||||
//[MC] Don't count actors saved by buddha if already at 1 health.
|
//[MC] Don't count actors saved by buddha if already at 1 health.
|
||||||
int prehealth = thing->health;
|
int prehealth = thing->health;
|
||||||
newdam = P_DamageMobj(thing, bombspot, bombsource, damage, bombmod);
|
newdam = P_DamageMobj(thing, bombspot, bombsource, damage, bombmod, DMG_EXPLOSION);
|
||||||
if (thing->health < prehealth) count++;
|
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) && !(thing->flags7 & MF7_DONTTHRUST)))
|
||||||
|
@ -6229,7 +6229,7 @@ int P_RadiusAttack(AActor *bombspot, AActor *bombsource, int bombdamage, int bom
|
||||||
{ // OK to damage; target is in direct path
|
{ // OK to damage; target is in direct path
|
||||||
//[MC] Don't count actors saved by buddha if already at 1 health.
|
//[MC] Don't count actors saved by buddha if already at 1 health.
|
||||||
int prehealth = thing->health;
|
int prehealth = thing->health;
|
||||||
int newdam = P_DamageMobj(thing, bombspot, bombsource, damage, bombmod);
|
int newdam = P_DamageMobj(thing, bombspot, bombsource, damage, bombmod, DMG_EXPLOSION);
|
||||||
P_TraceBleed(newdam > 0 ? newdam : damage, thing, bombspot);
|
P_TraceBleed(newdam > 0 ? newdam : damage, thing, bombspot);
|
||||||
if (thing->health < prehealth) count++;
|
if (thing->health < prehealth) count++;
|
||||||
}
|
}
|
||||||
|
|
|
@ -939,6 +939,7 @@ enum EDmgFlags
|
||||||
DMG_NO_PROTECT = 256,
|
DMG_NO_PROTECT = 256,
|
||||||
DMG_USEANGLE = 512,
|
DMG_USEANGLE = 512,
|
||||||
DMG_NO_PAIN = 1024,
|
DMG_NO_PAIN = 1024,
|
||||||
|
DMG_EXPLOSION = 2048,
|
||||||
}
|
}
|
||||||
|
|
||||||
enum EReplace
|
enum EReplace
|
||||||
|
|
|
@ -89,7 +89,7 @@ extend class Actor
|
||||||
if (victim.bTouchy)
|
if (victim.bTouchy)
|
||||||
{ // Touchy objects die when blasted
|
{ // Touchy objects die when blasted
|
||||||
victim.bArmed = false; // Disarm
|
victim.bArmed = false; // Disarm
|
||||||
victim.DamageMobj(self, self, victim.health, 'Melee', DMG_FORCED);
|
victim.DamageMobj(self, self, victim.health, 'Melee', DMG_FORCED|DMG_EXPLOSION);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue