- Added GOD2 and BUDDHA2 cheats.

- Ensures that not even telefrag damage can kill the player.
- Fixed: Players with NODAMAGE could still hurt and kill themselves via
voodoo dolls.
This commit is contained in:
MajorCooke 2014-10-24 19:31:28 -05:00 committed by Christoph Oelckers
parent 1c500cead6
commit b980069367
6 changed files with 52 additions and 8 deletions

View File

@ -124,6 +124,15 @@ CCMD (god)
Net_WriteByte (CHT_GOD);
}
CCMD(god2)
{
if (CheckCheatmode())
return;
Net_WriteByte(DEM_GENERICCHEAT);
Net_WriteByte(CHT_GOD2);
}
CCMD (iddqd)
{
if (CheckCheatmode ())
@ -142,6 +151,15 @@ CCMD (buddha)
Net_WriteByte(CHT_BUDDHA);
}
CCMD(buddha2)
{
if (CheckCheatmode())
return;
Net_WriteByte(DEM_GENERICCHEAT);
Net_WriteByte(CHT_BUDDHA2);
}
CCMD (notarget)
{
if (CheckCheatmode ())

View File

@ -205,6 +205,8 @@ typedef enum
CF_DOUBLEFIRINGSPEED= 1 << 21, // Player owns a double firing speed artifact
CF_EXTREMELYDEAD = 1 << 22, // [RH] Reliably let the status bar know about extreme deaths.
CF_INFINITEAMMO = 1 << 23, // Player owns an infinite ammo artifact
CF_BUDDHA2 = 1 << 24, // [MC] Absolute buddha. No voodoo can kill it either.
CF_GODMODE2 = 1 << 25, // [MC] Absolute godmode. No voodoo can kill it either.
CF_BUDDHA = 1 << 27, // [SP] Buddha mode - take damage, but don't die
CF_NOCLIP2 = 1 << 30, // [RH] More Quake-like noclip
} cheat_t;

View File

@ -219,7 +219,9 @@ enum ECheatCommand
CHT_GIMMIEJ,
CHT_GIMMIEZ,
CHT_BUDDHA,
CHT_NOCLIP2
CHT_NOCLIP2,
CHT_BUDDHA2,
CHT_GOD2
};
void StartChunk (int id, BYTE **stream);

View File

@ -99,6 +99,23 @@ void cht_DoCheat (player_t *player, int cheat)
msg = GStrings("TXT_BUDDHAOFF");
break;
case CHT_GOD2:
player->cheats ^= CF_GODMODE2;
if (player->cheats & CF_GODMODE2)
msg = GStrings("STSTR_DQD2ON");
else
msg = GStrings("STSTR_DQD2OFF");
ST_SetNeedRefresh();
break;
case CHT_BUDDHA2:
player->cheats ^= CF_BUDDHA2;
if (player->cheats & CF_BUDDHA2)
msg = GStrings("TXT_BUDDHA2ON");
else
msg = GStrings("TXT_BUDDHA2OFF");
break;
case CHT_NOCLIP:
player->cheats ^= CF_NOCLIP;
if (player->cheats & CF_NOCLIP)

View File

@ -938,7 +938,7 @@ int P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage,
FState * woundstate = NULL;
PainChanceList * pc = NULL;
bool justhit = false;
if (target == NULL || !((target->flags & MF_SHOOTABLE) || (target->flags6 & MF6_VULNERABLE)))
{ // Shouldn't happen
return -1;
@ -1209,8 +1209,10 @@ int P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage,
if (!(flags & DMG_FORCED))
{
// check the real player, not a voodoo doll here for invulnerability effects
if (damage < TELEFRAG_DAMAGE && ((player->mo->flags2 & MF2_INVULNERABLE) ||
(player->cheats & CF_GODMODE)))
if ((damage < TELEFRAG_DAMAGE && ((player->mo->flags2 & MF2_INVULNERABLE) ||
(player->cheats & CF_GODMODE))) ||
(player->cheats & CF_GODMODE2) || (player->mo->flags5 & MF5_NODAMAGE))
//Absolutely no hurting if NODAMAGE is involved. Same for GODMODE2.
{ // player is invulnerable, so don't hurt him
return -1;
}
@ -1259,9 +1261,8 @@ int P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage,
// This does not save the player if damage >= TELEFRAG_DAMAGE, still need to
// telefrag him right? ;) (Unfortunately the damage is "absorbed" by armor,
// but telefragging should still do enough damage to kill the player)
if ((player->cheats & CF_BUDDHA) && damage < TELEFRAG_DAMAGE
// Ignore players that are already dead.
&& player->playerstate != PST_DEAD)
// Ignore players that are already dead.
if ((player->cheats & CF_BUDDHA2) || ((player->cheats & CF_BUDDHA) && damage < TELEFRAG_DAMAGE) && player->playerstate != PST_DEAD)
{
// If this is a voodoo doll we need to handle the real player as well.
player->mo->health = target->health = player->health = 1;
@ -1677,7 +1678,7 @@ void P_PoisonDamage (player_t *player, AActor *source, int damage,
target->health -= damage;
if (target->health <= 0)
{ // Death
if (player->cheats & CF_BUDDHA && damage < TELEFRAG_DAMAGE)
if ((player->cheats & CF_BUDDHA && damage < TELEFRAG_DAMAGE) || (player->cheats & CF_BUDDHA2))
{ // [SP] Save the player...
player->health = target->health = 1;
}

View File

@ -292,6 +292,8 @@ STSTR_MUS = "Music Change";
STSTR_NOMUS = "IMPOSSIBLE SELECTION";
STSTR_DQDON = "Degreelessness Mode ON";
STSTR_DQDOFF = "Degreelessness Mode OFF";
STSTR_DQD2ON = "Ultimate Degreelessness Mode ON";
STSTR_DQD2OFF = "Ultimate Degreelessness Mode OFF";
STSTR_KFAADDED = "Very Happy Ammo Added";
STSTR_FAADDED = "Ammo (no keys) Added";
STSTR_NCON = "No Clipping Mode ON";
@ -303,6 +305,8 @@ STSTR_CHOPPERS = "... doesn't suck - GM";
STSTR_CLEV = "Changing Level...\n";
TXT_BUDDHAON = "Buddha mode ON";
TXT_BUDDHAOFF = "Buddha mode OFF";
TXT_BUDDHA2ON = "Ultimate Buddha Mode ON";
TXT_BUDDHA2OFF = "Ultimate Buddha Mode OFF";
TXT_DEFAULTPICKUPMSG = "You got a pickup";
E1TEXT =