- added a new dmflag to allow killing all monsters spawned by a boss brain's cubes after killing the brain (for those who like clean level statistics.)

SVN r2385 (trunk)
This commit is contained in:
Christoph Oelckers 2010-06-20 17:57:32 +00:00
parent 503b934938
commit b8db84b6bc
5 changed files with 20 additions and 1 deletions

View file

@ -260,7 +260,7 @@ enum
MF4_NOEXTREMEDEATH = 0x10000000, // this projectile or weapon never gibs its victim
MF4_EXTREMEDEATH = 0x20000000, // this projectile or weapon always gibs its victim
MF4_FRIGHTENED = 0x40000000, // Monster runs away from player
/* = 0x80000000, */
MF4_BOSSSPAWNED = 0x80000000, // Spawned by a boss spawn cube
// --- mobj.flags5 ---

View file

@ -459,6 +459,7 @@ CVAR (Flag, sv_chasecam, dmflags2, DF2_CHASECAM);
CVAR (Flag, sv_disallowsuicide, dmflags2, DF2_NOSUICIDE);
CVAR (Flag, sv_noautoaim, dmflags2, DF2_NOAUTOAIM);
CVAR (Flag, sv_dontcheckammo, dmflags2, DF2_DONTCHECKAMMO);
CVAR (Flag, sv_killbossmonst, dmflags2, DF2_KILLBOSSMONST);
//==========================================================================
//

View file

@ -293,6 +293,7 @@ enum
DF2_NOSUICIDE = 1 << 22, // Players are not allowed to suicide.
DF2_NOAUTOAIM = 1 << 23, // Players cannot use autoaim.
DF2_DONTCHECKAMMO = 1 << 24, // Don't Check ammo when switching weapons.
DF2_KILLBOSSMONST = 1 << 25, // Kills all monsters spawned by a boss cube when the boss dies
};
// [RH] Compatibility flags.

View file

@ -76,6 +76,21 @@ DEFINE_ACTION_FUNCTION(AActor, A_BrainDie)
if ((deathmatch || alwaysapplydmflags) && (dmflags & DF_NO_EXIT))
return;
// New dmflag: Kill all boss spawned monsters before ending the level.
if (dmflags2 & DF2_KILLBOSSMONST)
{
TThinkerIterator<AActor> it;
AActor *mo;
while ((mo = it.Next()))
{
if (mo->flags4 & MF4_BOSSSPAWNED)
{
P_DamageMobj(mo, self, self, mo->health, NAME_None,
DMG_NO_ARMOR|DMG_FORCED|DMG_THRUSTLESS|DMG_NO_FACTOR);
}
}
}
G_ExitLevel (0, false);
}
@ -250,6 +265,7 @@ static void SpawnFly(AActor *self, const PClass *spawntype, FSoundID sound)
// telefrag anything in this spot
P_TeleportMove (newmobj, newmobj->x, newmobj->y, newmobj->z, true);
}
newmobj->flags4 |= MF4_BOSSSPAWNED;
}
}

View file

@ -1048,6 +1048,7 @@ static menuitem_t DMFlagsItems[] = {
{ bitflag, "Allow spying", {&dmflags2}, {1}, {0}, {0}, {(value_t *)DF2_DISALLOW_SPYING} },
{ bitflag, "Chasecam cheat", {&dmflags2}, {0}, {0}, {0}, {(value_t *)DF2_CHASECAM} },
{ bitflag, "Check ammo for weapon switch", {&dmflags2}, {1}, {0}, {0}, {(value_t *)DF2_DONTCHECKAMMO} },
{ bitflag, "Killing boss brain kills all its monsters", {&dmflags2}, {0}, {0}, {0}, {(value_t *)DF2_KILLBOSSMONST} },
{ redtext, " ", {NULL}, {0}, {0}, {0}, {NULL} },
{ whitetext,"Deathmatch Settings", {NULL}, {0}, {0}, {0}, {NULL} },