- added 'kill baddies' cheat - does the same thing as 'kill monsters' only it ignores friendly monsters

This commit is contained in:
Rachael Alexanderson 2017-07-19 15:02:46 -04:00
parent 62a4eb6b6d
commit 5918167fb3
5 changed files with 16 additions and 5 deletions

View File

@ -219,7 +219,8 @@ enum ECheatCommand
CHT_BUDDHA,
CHT_NOCLIP2,
CHT_BUDDHA2,
CHT_GOD2
CHT_GOD2,
CHT_MASSACRE2
};
void StartChunk (int id, uint8_t **stream);

View File

@ -321,8 +321,9 @@ void cht_DoCheat (player_t *player, int cheat)
break;
case CHT_MASSACRE:
case CHT_MASSACRE2:
{
int killcount = P_Massacre ();
int killcount = P_Massacre (cheat == CHT_MASSACRE2);
// killough 3/22/98: make more intelligent about plural
// Ty 03/27/98 - string(s) *not* externalized
mysnprintf (msgbuild, countof(msgbuild), "%d Monster%s Killed", killcount, killcount==1 ? "" : "s");

View File

@ -3592,7 +3592,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_BossDeath)
//
//----------------------------------------------------------------------------
int P_Massacre ()
int P_Massacre (bool baddies)
{
// jff 02/01/98 'em' cheat - kill all monsters
// partially taken from Chi's .46 port
@ -3606,7 +3606,7 @@ int P_Massacre ()
while ( (actor = iterator.Next ()) )
{
if (!(actor->flags2 & MF2_DORMANT) && (actor->flags3 & MF3_ISMONSTER))
if (!(actor->flags2 & MF2_DORMANT) && (actor->flags3 & MF3_ISMONSTER) && (!baddies || !(actor->flags & MF_FRIENDLY)))
{
killcount += actor->Massacre();
}

View File

@ -68,7 +68,7 @@ void A_FaceTarget(AActor *actor);
void A_Face(AActor *self, AActor *other, DAngle max_turn = 0., DAngle max_pitch = 270., DAngle ang_offset = 0., DAngle pitch_offset = 0., int flags = 0, double z_add = 0);
bool CheckBossDeath (AActor *);
int P_Massacre ();
int P_Massacre (bool baddies = false);
bool P_CheckMissileRange (AActor *actor);
#define SKULLSPEED (20.)

View File

@ -1966,6 +1966,15 @@ CCMD (kill)
Net_WriteByte (DEM_GENERICCHEAT);
Net_WriteByte (CHT_MASSACRE);
}
else if (!stricmp (argv[1], "baddies"))
{
// Kill all the unfriendly monsters
if (CheckCheatmode ())
return;
Net_WriteByte (DEM_GENERICCHEAT);
Net_WriteByte (CHT_MASSACRE2);
}
else
{
Net_WriteByte (DEM_KILLCLASSCHEAT);