mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-11 07:12:02 +00:00
- Added +FULLMASS.
Actors will be excluded from damage/radius thrusting of all sorts by explosions or damage of any kind. They will also never deal impact damage to other enemies, nor will they damage themselves from being too close to a wall.
This commit is contained in:
parent
be4b253215
commit
f802d7a44c
4 changed files with 26 additions and 19 deletions
|
@ -344,6 +344,7 @@ enum
|
|||
MF7_HARMFRIENDS = 0x00000020, // is allowed to harm friendly monsters.
|
||||
MF7_BUDDHA = 0x00000040, // Behaves just like the buddha cheat.
|
||||
MF7_FOILBUDDHA = 0x00000080, // Similar to FOILINVUL, foils buddha mode.
|
||||
MF7_FULLMASS = 0x00000100, // Thrusting functions do not take, and do not give thrust (damage) to actors with this flag.
|
||||
|
||||
// --- mobj.renderflags ---
|
||||
|
||||
|
|
|
@ -1097,6 +1097,7 @@ int P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage,
|
|||
&& !(target->flags & MF_NOCLIP)
|
||||
&& !(inflictor->flags2 & MF2_NODMGTHRUST)
|
||||
&& !(flags & DMG_THRUSTLESS)
|
||||
&& !(target->flags7 & MF7_FULLMASS)
|
||||
&& (source == NULL || source->player == NULL || !(source->flags2 & MF2_NODMGTHRUST)))
|
||||
{
|
||||
int kickback;
|
||||
|
@ -1324,7 +1325,7 @@ int P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage,
|
|||
if (target->health <= 0)
|
||||
{
|
||||
if ((target->flags7 & MF7_BUDDHA) && (damage < TELEFRAG_DAMAGE) && (!(inflictor->flags3 & MF7_FOILBUDDHA) && !(flags & DMG_FOILBUDDHA)))
|
||||
{ //Make sure FOILINVUL flags work here too for monsters. Or perhaps consider a FOILBUDDHA flag...
|
||||
{ //FOILBUDDHA or Telefrag damage must kill it.
|
||||
target->health = 1;
|
||||
}
|
||||
else
|
||||
|
|
|
@ -4679,7 +4679,7 @@ void P_RadiusAttack(AActor *bombspot, AActor *bombsource, int bombdamage, int bo
|
|||
|
||||
if (!(flags & RADF_NODAMAGE))
|
||||
newdam = P_DamageMobj(thing, bombspot, bombsource, damage, bombmod);
|
||||
else if (thing->player == NULL && !(flags & RADF_NOIMPACTDAMAGE))
|
||||
else if (thing->player == NULL && (!(flags & RADF_NOIMPACTDAMAGE) && !(thing->flags7 & MF7_FULLMASS)))
|
||||
thing->flags2 |= MF2_BLASTED;
|
||||
|
||||
if (!(thing->flags & MF_ICECORPSE))
|
||||
|
@ -4691,6 +4691,9 @@ void P_RadiusAttack(AActor *bombspot, AActor *bombsource, int bombdamage, int bo
|
|||
{
|
||||
if (bombsource == NULL || !(bombsource->flags2 & MF2_NODMGTHRUST))
|
||||
{
|
||||
if (!(thing->flags7 & MF7_FULLMASS))
|
||||
{
|
||||
|
||||
thrust = points * 0.5f / (double)thing->Mass;
|
||||
if (bombsource == thing)
|
||||
{
|
||||
|
@ -4715,6 +4718,7 @@ void P_RadiusAttack(AActor *bombspot, AActor *bombsource, int bombdamage, int bo
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// [RH] Old code just for barrels
|
||||
|
|
|
@ -244,6 +244,7 @@ static FFlagDef ActorFlags[]=
|
|||
DEFINE_FLAG(MF7, HARMFRIENDS, AActor, flags7),
|
||||
DEFINE_FLAG(MF7, BUDDHA, AActor, flags7),
|
||||
DEFINE_FLAG(MF7, FOILBUDDHA, AActor, flags7),
|
||||
DEFINE_FLAG(MF7, FULLMASS, AActor, flags7),
|
||||
|
||||
// Effect flags
|
||||
DEFINE_FLAG(FX, VISIBILITYPULSE, AActor, effects),
|
||||
|
|
Loading…
Reference in a new issue