mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-14 16:40:56 +00:00
Add FALLDAMAGE flag and add property to properly apply falling damage… (#1153)
* Add FALLDAMAGE flag and add property to properly apply falling damage to the monsters * Change name of propermonsterdamage property to propermonsterfallingdamage
This commit is contained in:
parent
776e3b10da
commit
e74b9f1955
5 changed files with 7 additions and 2 deletions
|
@ -1644,6 +1644,7 @@ MapFlagHandlers[] =
|
|||
{ "nolightfade", MITYPE_SETFLAG3, LEVEL3_NOLIGHTFADE, 0 },
|
||||
{ "nocoloredspritelighting", MITYPE_SETFLAG3, LEVEL3_NOCOLOREDSPRITELIGHTING, 0 },
|
||||
{ "forceworldpanning", MITYPE_SETFLAG3, LEVEL3_FORCEWORLDPANNING, 0 },
|
||||
{ "propermonsterfallingdamage", MITYPE_SETFLAG3, LEVEL3_PROPERMONSTERFALLINGDAMAGE, 0 },
|
||||
{ "nobotnodes", MITYPE_IGNORE, 0, 0 }, // Skulltag option: nobotnodes
|
||||
{ "compat_shorttex", MITYPE_COMPATFLAG, COMPATF_SHORTTEX, 0 },
|
||||
{ "compat_stairs", MITYPE_COMPATFLAG, COMPATF_STAIRINDEX, 0 },
|
||||
|
|
|
@ -249,6 +249,7 @@ enum ELevelFlags : unsigned int
|
|||
LEVEL3_EXITSECRETUSED = 0x00000040,
|
||||
LEVEL3_FORCEWORLDPANNING = 0x00000080, // Forces the world panning flag for all textures, even those without it explicitly set.
|
||||
LEVEL3_HIDEAUTHORNAME = 0x00000100,
|
||||
LEVEL3_PROPERMONSTERFALLINGDAMAGE = 0x00000200, // Properly apply falling damage to the monsters
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -413,6 +413,8 @@ enum ActorFlag8
|
|||
MF8_RECREATELIGHTS = 0x00000100, // Internal flag that signifies that the light attachments need to be recreated at the
|
||||
MF8_STOPRAILS = 0x00000200, // [MC] Prevent rails from going further if an actor has this flag.
|
||||
MF8_ABSVIEWANGLES = 0x00000400, // [MC] By default view angle/pitch/roll is an offset. This will make it absolute instead.
|
||||
MF8_FALLDAMAGE = 0x00000800, // Monster will take fall damage regardless of map settings.
|
||||
|
||||
};
|
||||
|
||||
// --- mobj.renderflags ---
|
||||
|
|
|
@ -2345,7 +2345,7 @@ void P_MonsterFallingDamage (AActor *mo)
|
|||
int damage;
|
||||
double vel;
|
||||
|
||||
if (!(mo->Level->flags2 & LEVEL2_MONSTERFALLINGDAMAGE))
|
||||
if (!(mo->Level->flags2 & LEVEL2_MONSTERFALLINGDAMAGE) && !(mo->flags8 & MF8_FALLDAMAGE))
|
||||
return;
|
||||
if (mo->floorsector->Flags & SECF_NOFALLINGDAMAGE)
|
||||
return;
|
||||
|
@ -2359,7 +2359,7 @@ void P_MonsterFallingDamage (AActor *mo)
|
|||
{
|
||||
damage = int((vel - 23)*6);
|
||||
}
|
||||
damage = TELEFRAG_DAMAGE; // always kill 'em
|
||||
if (!(mo->Level->flags3 & LEVEL3_PROPERMONSTERFALLINGDAMAGE)) damage = TELEFRAG_DAMAGE;
|
||||
P_DamageMobj (mo, NULL, NULL, damage, NAME_Falling);
|
||||
}
|
||||
|
||||
|
|
|
@ -325,6 +325,7 @@ static FFlagDef ActorFlagDefs[]=
|
|||
DEFINE_FLAG(MF8, NOFRICTIONBOUNCE, AActor, flags8),
|
||||
DEFINE_FLAG(MF8, RETARGETAFTERSLAM, AActor, flags8),
|
||||
DEFINE_FLAG(MF8, STOPRAILS, AActor, flags8),
|
||||
DEFINE_FLAG(MF8, FALLDAMAGE, AActor, flags8),
|
||||
DEFINE_FLAG(MF8, ABSVIEWANGLES, AActor, flags8),
|
||||
|
||||
// Effect flags
|
||||
|
|
Loading…
Reference in a new issue