mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-10 14:52:01 +00:00
- run most cheats through the network.
The remaining excpetions are the "give" CCMD and any level change action. Unfortunately the implementation of most cheats is not multiplayer safe so right now it'd only be useful for demo recording (assuming that worked to begin with... ;))
This commit is contained in:
parent
a0874a26a7
commit
3e5e956b72
20 changed files with 401 additions and 473 deletions
|
@ -285,51 +285,48 @@ static int parseArgs(char *pzArgs, int *nArg1, int *nArg2)
|
|||
return 2;
|
||||
}
|
||||
|
||||
void ProcessCheat(CHEATCODE nCheatCode, char* pzArgs)
|
||||
const char* GameInterface::GenericCheat(int player, int cheat)
|
||||
{
|
||||
dassert(nCheatCode > kCheatNone && nCheatCode < kCheatMax);
|
||||
|
||||
if (nCheatCode == kCheatRate)
|
||||
{
|
||||
r_showfps = !r_showfps;
|
||||
return;
|
||||
}
|
||||
if (gGameOptions.nGameType != 0)
|
||||
return;
|
||||
// message processing is not perfect because many cheats output multiple messages.
|
||||
if (gGameOptions.nGameType != 0) // sp only for now.
|
||||
return nullptr;
|
||||
int nEpisode, nLevel;
|
||||
switch (nCheatCode)
|
||||
|
||||
switch (cheat)
|
||||
{
|
||||
case CHT_GOD:
|
||||
return SetGodMode(!gMe->godMode);
|
||||
|
||||
case CHT_GODOFF:
|
||||
return SetGodMode(false);
|
||||
|
||||
case CHT_GODON:
|
||||
return SetGodMode(true);
|
||||
|
||||
case CHT_NOCLIP:
|
||||
return SetClipMode(!gNoClip);
|
||||
|
||||
case kCheatSpielberg:
|
||||
// demo record
|
||||
break;
|
||||
case kCheat1:
|
||||
SetAmmo(true);
|
||||
break;
|
||||
case kCheatGriswold:
|
||||
SetArmor(true);
|
||||
// demo record
|
||||
break;
|
||||
case kCheatSatchel:
|
||||
SetToys(true);
|
||||
break;
|
||||
case kCheatIdaho:
|
||||
SetWeapons(true);
|
||||
break;
|
||||
case kCheatKevorkian:
|
||||
actDamageSprite(gMe->nSprite, gMe->pSprite, DAMAGE_TYPE_2, 8000);
|
||||
viewSetMessage(GStrings("TXTB_KEVORKIAN"));
|
||||
break;
|
||||
return GStrings("TXTB_KEVORKIAN");
|
||||
|
||||
case kCheatMcGee:
|
||||
{
|
||||
if (!gMe->pXSprite->burnTime)
|
||||
evPost(gMe->nSprite, 3, 0, kCallbackFXFlameLick);
|
||||
actBurnSprite(actSpriteIdToOwnerId(gMe->nSprite), gMe->pXSprite, 2400);
|
||||
viewSetMessage(GStrings("TXTB_FIRED"));
|
||||
break;
|
||||
return GStrings("TXTB_FIRED");
|
||||
}
|
||||
case kCheatEdmark:
|
||||
actDamageSprite(gMe->nSprite, gMe->pSprite, DAMAGE_TYPE_3, 8000);
|
||||
viewSetMessage(GStrings("TXTB_THEDAYS"));
|
||||
break;
|
||||
return GStrings("TXTB_THEDAYS");
|
||||
|
||||
case kCheatKrueger:
|
||||
{
|
||||
actHealDude(gMe->pXSprite, 200, 200);
|
||||
|
@ -337,8 +334,7 @@ void ProcessCheat(CHEATCODE nCheatCode, char* pzArgs)
|
|||
if (!gMe->pXSprite->burnTime)
|
||||
evPost(gMe->nSprite, 3, 0, kCallbackFXFlameLick);
|
||||
actBurnSprite(actSpriteIdToOwnerId(gMe->nSprite), gMe->pXSprite, 2400);
|
||||
viewSetMessage(GStrings("TXTB_RETARD"));
|
||||
break;
|
||||
return GStrings("TXTB_RETARD");
|
||||
}
|
||||
case kCheatSterno:
|
||||
gMe->blindEffect = 250;
|
||||
|
@ -349,17 +345,10 @@ void ProcessCheat(CHEATCODE nCheatCode, char* pzArgs)
|
|||
case kCheatSpork:
|
||||
actHealDude(gMe->pXSprite, 200, 200);
|
||||
break;
|
||||
case kCheatGoonies:
|
||||
SetMap(!gFullMap);
|
||||
break;
|
||||
case kCheatClarice:
|
||||
if (!VanillaMode())
|
||||
{
|
||||
viewSetMessage(GStrings("TXTB_HALFARMOR"));
|
||||
for (int i = 0; i < 3; i++)
|
||||
gMe->armor[i] = 1600;
|
||||
}
|
||||
break;
|
||||
for (int i = 0; i < 3; i++)
|
||||
gMe->armor[i] = 1600;
|
||||
return GStrings("TXTB_HALFARMOR");
|
||||
case kCheatFrankenstein:
|
||||
gMe->packSlots[0].curAmount = 100;
|
||||
break;
|
||||
|
@ -386,19 +375,6 @@ void ProcessCheat(CHEATCODE nCheatCode, char* pzArgs)
|
|||
case kCheatJoJo:
|
||||
ToggleDelirium();
|
||||
break;
|
||||
case kCheatRate: // show FPS, handled before (dead code), leave here for safety
|
||||
return;
|
||||
case kCheatMario:
|
||||
if (parseArgs(pzArgs, &nEpisode, &nLevel) == 2)
|
||||
LevelWarp(nEpisode, nLevel);
|
||||
break;
|
||||
case kCheatCalgon:
|
||||
if (parseArgs(pzArgs, &nEpisode, &nLevel) == 2)
|
||||
LevelWarp(nEpisode, nLevel);
|
||||
else
|
||||
if (!VanillaMode())
|
||||
levelEndLevel(0);
|
||||
break;
|
||||
case kCheatLaraCroft:
|
||||
SetInfiniteAmmo(!gInfiniteAmmo);
|
||||
SetWeapons(gInfiniteAmmo);
|
||||
|
@ -416,7 +392,7 @@ void ProcessCheat(CHEATCODE nCheatCode, char* pzArgs)
|
|||
SetWooMode(true);
|
||||
break;
|
||||
case kCheatCousteau:
|
||||
actHealDude(gMe->pXSprite,200,200);
|
||||
actHealDude(gMe->pXSprite, 200, 200);
|
||||
gMe->packSlots[1].curAmount = 100;
|
||||
if (!VanillaMode())
|
||||
gMe->pwUpTime[kPwUpDivingSuit] = gPowerUpInfo[kPwUpDivingSuit].bonusTime;
|
||||
|
@ -436,79 +412,72 @@ void ProcessCheat(CHEATCODE nCheatCode, char* pzArgs)
|
|||
gMe->curWeapon = 0;
|
||||
gMe->nextWeapon = 1;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
bPlayerCheated = true;
|
||||
}
|
||||
|
||||
const char* GameInterface::GenericCheat(int player, int cheat)
|
||||
{
|
||||
switch (cheat)
|
||||
{
|
||||
case CHT_GOD:
|
||||
return SetGodMode(!gMe->godMode);
|
||||
|
||||
case CHT_GODOFF:
|
||||
return SetGodMode(false);
|
||||
|
||||
case CHT_GODON:
|
||||
return SetGodMode(true);
|
||||
|
||||
case CHT_NOCLIP:
|
||||
return SetClipMode(!gNoClip);
|
||||
|
||||
default:
|
||||
return nullptr;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
template<CHEATCODE code> bool doCheat(cheatseq_t *c)
|
||||
static bool cheatGoonies(cheatseq_t*)
|
||||
{
|
||||
ProcessCheat(code, (char*)c->Args);
|
||||
return true;
|
||||
SetMap(!gFullMap);
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool cheatMario(cheatseq_t* c)
|
||||
{
|
||||
int nEpisode, nLevel;
|
||||
if (parseArgs((char*)c->Args, &nEpisode, &nLevel) == 2)
|
||||
LevelWarp(nEpisode, nLevel);
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool cheatCalgon(cheatseq_t*)
|
||||
{
|
||||
levelEndLevel(0);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
static cheatseq_t s_CheatInfo[] = {
|
||||
{"MPKFA", "god" }, // MPKFA (Invincibility)
|
||||
{"CAPINMYASS", "godoff" }, // CAPINMYASS (Disable invincibility )
|
||||
{"NOCAPINMYASS", "godon" }, // NOCAPINMYASS (Invincibility)
|
||||
{"I WANNA BE LIKE KEVIN", "godon" }, // I WANNA BE LIKE KEVIN (Invincibility)
|
||||
{"IDAHO", nullptr, doCheat<kCheatIdaho>, 0 }, // IDAHO (All weapons and full ammo)
|
||||
{"MONTANA", nullptr, doCheat<kCheatMontana>, 0 }, // MONTANA (All weapons, full ammo and all items)
|
||||
{"GRISWOLD", nullptr, doCheat<kCheatGriswold>, 0 }, // GRISWOLD (Full armor (same effect as getting super armor))
|
||||
{"EDMARK", nullptr, doCheat<kCheatEdmark>, 0 }, // EDMARK (Does a lot of fire damage to you (if you have 200HP and 200 fire armor then you can survive). Displays the message "THOSE WERE THE DAYS".)
|
||||
{"TEQUILA", nullptr, doCheat<kCheatTequila>, 0 }, // TEQUILA (Guns akimbo power-up)
|
||||
{"BUNZ", nullptr, doCheat<kCheatBunz>, 0 }, // BUNZ (All weapons, full ammo, and guns akimbo power-up)
|
||||
{"FUNKY SHOES", nullptr, doCheat<kCheatFunkyShoes>, 0 }, // FUNKY SHOES (Gives jump boots item and activates it)
|
||||
{"GATEKEEPER", nullptr, doCheat<kCheatGateKeeper>, 0 }, // GATEKEEPER (Sets the you cheated flag to true, at the end of the level you will see that you have cheated)
|
||||
{"KEYMASTER", nullptr, doCheat<kCheatKeyMaster>, 0 }, // KEYMASTER (All keys)
|
||||
{"JOJO", nullptr, doCheat<kCheatJoJo>, 0 }, // JOJO (Drunk mode (same effect as getting bitten by red spider))
|
||||
{"SATCHEL", nullptr, doCheat<kCheatSatchel>, 0 }, // SATCHEL (Full inventory)
|
||||
{"SPORK", nullptr, doCheat<kCheatSpork>, 0 }, // SPORK (200% health (same effect as getting life seed))
|
||||
{"ONERING", nullptr, doCheat<kCheatOneRing>, 0 }, // ONERING (Cloak of invisibility power-up)
|
||||
{"MARIO###", nullptr, doCheat<kCheatMario>, 0 }, // MARIO (Warp to level E M, e.g.: MARIO 1 3 will take you to Phantom Express)
|
||||
{"CALGON", nullptr, doCheat<kCheatCalgon>, 0 }, // CALGON (Jumps to next level or can be used like MARIO with parameters)
|
||||
{"KEVORKIAN", nullptr, doCheat<kCheatKevorkian>, 0 }, // KEVORKIAN (Does a lot of physical damage to you (if you have 200HP and 200 fire armor then you can survive). Displays the message "KEVORKIAN APPROVES".)
|
||||
{"MCGEE", nullptr, doCheat<kCheatMcGee>, 0 }, // MCGEE (Sets you on fire. Displays the message "YOU'RE FIRED".)
|
||||
{"KRUEGER", nullptr, doCheat<kCheatKrueger>, 0 }, // KRUEGER (200% health, but sets you on fire. Displays the message "FLAME RETARDANT".)
|
||||
{"CHEESEHEAD", nullptr, doCheat<kCheatCheeseHead>, 0 }, // CHEESEHEAD (100% diving suit)
|
||||
{"COUSTEAU", nullptr, doCheat<kCheatCousteau>, 0 }, // COUSTEAU (200% health and diving suit)
|
||||
{"VOORHEES", nullptr, doCheat<kCheatVoorhees>, 0 }, // VOORHEES (Death mask power-up)
|
||||
{"LARA CROFT", nullptr, doCheat<kCheatLaraCroft>, 0 }, // LARA CROFT (All weapons and infinite ammo. Displays the message "LARA RULES". Typing it the second time will lose all weapons and ammo.)
|
||||
{"HONGKONG", nullptr, doCheat<kCheatHongKong>, 0 }, // HONGKONG (All weapons and infinite ammo)
|
||||
{"FRANKENSTEIN", nullptr, doCheat<kCheatFrankenstein>, 0 }, // FRANKENSTEIN (100% med-kit)
|
||||
{"STERNO", nullptr, doCheat<kCheatSterno>, 0 }, // STERNO (Temporary blindness (same effect as getting bitten by green spider))
|
||||
{"CLARICE", nullptr, doCheat<kCheatClarice>, 0 }, // CLARICE (Gives 100% body armor, 100% fire armor, 100% spirit armor)
|
||||
{"FORK YOU", nullptr, doCheat<kCheatForkYou>, 0 }, // FORK YOU (Drunk mode, 1HP, no armor, no weapons, no ammo, no items, no keys, no map, guns akimbo power-up)
|
||||
{"LIEBERMAN", nullptr, doCheat<kCheatLieberMan>, 0 }, // LIEBERMAN (Sets the you cheated flag to true, at the end of the level you will see that you have cheated)
|
||||
{"EVA GALLI", "noclip" }, // EVA GALLI (Disable/enable clipping (grant the ability to walk through walls))
|
||||
{"RATE", nullptr, doCheat<kCheatRate>, 1 }, // RATE (Display frame rate (doesn't count as a cheat))
|
||||
{"GOONIES", nullptr, doCheat<kCheatGoonies>, 0 }, // GOONIES (Enable full map. Displays the message "YOU HAVE THE MAP".)
|
||||
{"MPKFA", nullptr, SendGenericCheat, 0, CHT_GOD },
|
||||
{"CAPINMYASS", nullptr, SendGenericCheat, 0, CHT_GODOFF },
|
||||
{"NOCAPINMYASS", nullptr, SendGenericCheat, 0, CHT_GODON },
|
||||
{"I WANNA BE LIKE KEVIN", nullptr, SendGenericCheat, 0, CHT_GODON },
|
||||
{"IDAHO", "give weapons" },
|
||||
{"GRISWOLD", "give armor" },
|
||||
{"MONTANA", nullptr, SendGenericCheat, 0, kCheatMontana }, // MONTANA (All weapons, full ammo and all items)
|
||||
{"EDMARK", nullptr, SendGenericCheat, 0, kCheatEdmark }, // EDMARK (Does a lot of fire damage to you (if you have 200HP and 200 fire armor then you can survive). Displays the message "THOSE WERE THE DAYS".)
|
||||
{"TEQUILA", nullptr, SendGenericCheat, 0, kCheatTequila }, // TEQUILA (Guns akimbo power-up)
|
||||
{"BUNZ", nullptr, SendGenericCheat, 0, kCheatBunz }, // BUNZ (All weapons, full ammo, and guns akimbo power-up)
|
||||
{"FUNKY SHOES", nullptr, SendGenericCheat, 0, kCheatFunkyShoes }, // FUNKY SHOES (Gives jump boots item and activates it)
|
||||
{"GATEKEEPER", nullptr, SendGenericCheat, 0, kCheatGateKeeper }, // GATEKEEPER (Sets the you cheated flag to true, at the end of the level you will see that you have cheated)
|
||||
{"KEYMASTER", nullptr, SendGenericCheat, 0, kCheatKeyMaster }, // KEYMASTER (All keys)
|
||||
{"JOJO", nullptr, SendGenericCheat, 0, kCheatJoJo }, // JOJO (Drunk mode (same effect as getting bitten by red spider))
|
||||
{"SATCHEL", nullptr, SendGenericCheat, 0, kCheatSatchel }, // SATCHEL (Full inventory)
|
||||
{"SPORK", nullptr, SendGenericCheat, 0, kCheatSpork }, // SPORK (200% health (same effect as getting life seed))
|
||||
{"ONERING", nullptr, SendGenericCheat, 0, kCheatOneRing }, // ONERING (Cloak of invisibility power-up)
|
||||
{"MARIO###", nullptr, cheatMario }, // MARIO (Warp to level E M, e.g.: MARIO 1 3 will take you to Phantom Express)
|
||||
{"CALGON", nullptr, cheatCalgon }, // CALGON (Jumps to next level)
|
||||
{"KEVORKIAN", nullptr, SendGenericCheat, 0, kCheatKevorkian }, // KEVORKIAN (Does a lot of physical damage to you (if you have 200HP and 200 fire armor then you can survive). Displays the message "KEVORKIAN APPROVES".)
|
||||
{"MCGEE", nullptr, SendGenericCheat, 0, kCheatMcGee }, // MCGEE (Sets you on fire. Displays the message "YOU'RE FIRED".)
|
||||
{"KRUEGER", nullptr, SendGenericCheat, 0, kCheatKrueger }, // KRUEGER (200% health, but sets you on fire. Displays the message "FLAME RETARDANT".)
|
||||
{"CHEESEHEAD", nullptr, SendGenericCheat, 0, kCheatCheeseHead }, // CHEESEHEAD (100% diving suit)
|
||||
{"COUSTEAU", nullptr, SendGenericCheat, 0, kCheatCousteau }, // COUSTEAU (200% health and diving suit)
|
||||
{"VOORHEES", nullptr, SendGenericCheat, 0, kCheatVoorhees }, // VOORHEES (Death mask power-up)
|
||||
{"LARA CROFT", nullptr, SendGenericCheat, 0, kCheatLaraCroft }, // LARA CROFT (All weapons and infinite ammo. Displays the message "LARA RULES". Typing it the second time will lose all weapons and ammo.)
|
||||
{"HONGKONG", nullptr, SendGenericCheat, 0, kCheatHongKong }, // HONGKONG (All weapons and infinite ammo)
|
||||
{"FRANKENSTEIN", nullptr, SendGenericCheat, 0, kCheatFrankenstein }, // FRANKENSTEIN (100% med-kit)
|
||||
{"STERNO", nullptr, SendGenericCheat, 0, kCheatSterno }, // STERNO (Temporary blindness (same effect as getting bitten by green spider))
|
||||
{"CLARICE", nullptr, SendGenericCheat, 0, kCheatClarice }, // CLARICE (Gives 100% body armor, 100% fire armor, 100% spirit armor)
|
||||
{"FORK YOU", nullptr, SendGenericCheat, 0, kCheatForkYou }, // FORK YOU (Drunk mode, 1HP, no armor, no weapons, no ammo, no items, no keys, no map, guns akimbo power-up)
|
||||
{"LIEBERMAN", nullptr, SendGenericCheat, 0, kCheatLieberMan }, // LIEBERMAN (Sets the you cheated flag to true, at the end of the level you will see that you have cheated)
|
||||
{"EVA GALLI", nullptr, SendGenericCheat, 0, CHT_NOCLIP },
|
||||
{"RATE", "toggle r_showfps", nullptr, 1 }, // RATE (Display frame rate (doesn't count as a cheat))
|
||||
{"GOONIES", nullptr, cheatGoonies, 0 }, // GOONIES (Enable full map. Displays the message "YOU HAVE THE MAP".)
|
||||
//{"SPIELBERG", nullptr, doCheat<kCheatSpielberg, 1 }, // SPIELBERG (Disables all cheats. If number values corresponding to a level and episode number are entered after the cheat word (i.e. "spielberg 1 3" for Phantom Express), you will be spawned to said level and the game will begin recording a demo from your actions.)
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
void cheatReset(void)
|
||||
|
|
|
@ -39,50 +39,6 @@ enum MESSAGE_PRIORITY {
|
|||
MESSAGE_PRIORITY_SYSTEM = 100
|
||||
};
|
||||
|
||||
enum CHEATCODE
|
||||
{
|
||||
kCheatNone = 0,
|
||||
|
||||
kCheat1 = 1000, // refills ammo, no cheat code for it
|
||||
kCheatGriswold,
|
||||
kCheatSatchel,
|
||||
kCheatEvaGalli,
|
||||
kCheatMpkfa,
|
||||
kCheatCapInMyAss,
|
||||
kCheatNoCapInMyAss,
|
||||
kCheatIdaho,
|
||||
kCheatKevorkian,
|
||||
kCheatMcGee,
|
||||
kCheatEdmark,
|
||||
kCheatKrueger,
|
||||
kCheatSterno,
|
||||
kCheat14, // quake effect, not used
|
||||
kCheatSpork,
|
||||
kCheatGoonies,
|
||||
kCheatClarice,
|
||||
kCheatFrankenstein,
|
||||
kCheatCheeseHead,
|
||||
kCheatTequila,
|
||||
kCheatFunkyShoes,
|
||||
kCheatKeyMaster,
|
||||
kCheatOneRing,
|
||||
kCheatVoorhees,
|
||||
kCheatJoJo,
|
||||
kCheatGateKeeper,
|
||||
kCheatRate,
|
||||
kCheatMario,
|
||||
kCheatLaraCroft,
|
||||
kCheatHongKong,
|
||||
kCheatMontana,
|
||||
kCheatBunz,
|
||||
kCheatCousteau,
|
||||
kCheatForkYou,
|
||||
kCheatLieberMan,
|
||||
kCheatSpielberg,
|
||||
kCheatCalgon,
|
||||
kCheatMax
|
||||
};
|
||||
|
||||
extern bool bPlayerCheated;
|
||||
void cheatReset(void);
|
||||
|
||||
|
|
|
@ -40,6 +40,8 @@
|
|||
#include "printf.h"
|
||||
#include "gamestruct.h"
|
||||
#include "utf8.h"
|
||||
#include "d_protocol.h"
|
||||
#include "d_net.h"
|
||||
|
||||
static cheatseq_t *cheatlist;
|
||||
static int numcheats;
|
||||
|
@ -136,6 +138,13 @@ bool Cheat_Responder (event_t *ev)
|
|||
return eat;
|
||||
}
|
||||
|
||||
bool SendGenericCheat(cheatseq_t* cheat)
|
||||
{
|
||||
Net_WriteByte(DEM_GENERICCHEAT);
|
||||
Net_WriteByte(cheat->Param);
|
||||
return true;
|
||||
}
|
||||
|
||||
void PlaybackCheat(const char *p)
|
||||
{
|
||||
if (!CheckCheatmode(true))
|
||||
|
|
|
@ -6,6 +6,7 @@ struct cheatseq_t
|
|||
const char* ccmd;
|
||||
bool (*Handler)(cheatseq_t *);
|
||||
uint8_t DontCheck;
|
||||
uint8_t Param;
|
||||
// This is working data for processing the cheat
|
||||
uint8_t CurrentArg;
|
||||
uint8_t Args[6];
|
||||
|
@ -16,3 +17,5 @@ struct event_t;
|
|||
bool Cheat_Responder(event_t* ev);
|
||||
void SetCheats(cheatseq_t *cht, int count);
|
||||
void PlaybackCheat(const char* p);
|
||||
bool SendGenericCheat(cheatseq_t* cheat);
|
||||
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
**
|
||||
*/
|
||||
|
||||
#include "build.h"
|
||||
#include "gamestruct.h"
|
||||
#include "printf.h"
|
||||
#include "c_cvars.h"
|
||||
|
@ -130,4 +131,11 @@ CCMD(noclip)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
CCMD(allmap)
|
||||
{
|
||||
if (!CheckCheatmode(true, false))
|
||||
{
|
||||
gFullMap = !gFullMap;
|
||||
Printf("%s\n", GStrings(gFullMap ? "SHOW MAP: ON" : "SHOW MAP: OFF"));
|
||||
}
|
||||
}
|
|
@ -2,9 +2,8 @@
|
|||
|
||||
#include <stdint.h>
|
||||
#include "c_cvars.h"
|
||||
#include "d_protocol.h"
|
||||
|
||||
EXTERN_CVAR(Bool, sv_cheats)
|
||||
|
||||
void genericCheat(int player, uint8_t** stream, bool skip);
|
||||
|
||||
|
||||
|
|
|
@ -101,6 +101,53 @@ enum ECheat
|
|||
CHT_GODON,
|
||||
CHT_GODOFF,
|
||||
CHT_NOCLIP,
|
||||
|
||||
// Duke et.al.
|
||||
CHT_UNLOCK,
|
||||
CHT_CASHMAN,
|
||||
CHT_HYPER,
|
||||
CHT_KILL,
|
||||
CHT_BIKE,
|
||||
CHT_BOAT,
|
||||
CHT_TONY,
|
||||
CHT_VAN,
|
||||
CHT_RHETT,
|
||||
CHT_AARON,
|
||||
CHT_NOCHEAT,
|
||||
CHT_DRINK,
|
||||
CHT_SEASICK,
|
||||
CHT_KFC,
|
||||
CHT_MONSTERS,
|
||||
|
||||
// Blood
|
||||
kCheatSatchel,
|
||||
kCheatKevorkian,
|
||||
kCheatMcGee,
|
||||
kCheatEdmark,
|
||||
kCheatKrueger,
|
||||
kCheatSterno,
|
||||
kCheat14, // quake effect, not used
|
||||
kCheatSpork,
|
||||
kCheatClarice,
|
||||
kCheatFrankenstein,
|
||||
kCheatCheeseHead,
|
||||
kCheatTequila,
|
||||
kCheatFunkyShoes,
|
||||
kCheatKeyMaster,
|
||||
kCheatOneRing,
|
||||
kCheatVoorhees,
|
||||
kCheatJoJo,
|
||||
kCheatGateKeeper,
|
||||
kCheatLaraCroft,
|
||||
kCheatHongKong,
|
||||
kCheatMontana,
|
||||
kCheatBunz,
|
||||
kCheatCousteau,
|
||||
kCheatForkYou,
|
||||
kCheatLieberMan,
|
||||
kCheatSpielberg,
|
||||
|
||||
CHT_MAX
|
||||
};
|
||||
|
||||
typedef void(*NetCommandHandler)(int player, uint8_t **stream, bool skip);
|
||||
|
|
|
@ -106,12 +106,6 @@ static bool KimberlyCheat(cheatseq_t* c)
|
|||
return true;
|
||||
}
|
||||
|
||||
static bool CopCheat(cheatseq_t* c)
|
||||
{
|
||||
lLocalCodes |= kButtonCheatGuns;
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool LiteCheat(cheatseq_t* c)
|
||||
{
|
||||
Printf(PRINT_NOTIFY, "%s\n", GStrings("TXT_EX_FLASHES"));
|
||||
|
@ -120,12 +114,6 @@ static bool LiteCheat(cheatseq_t* c)
|
|||
return true;
|
||||
}
|
||||
|
||||
static bool KeyCheat(cheatseq_t* c)
|
||||
{
|
||||
lLocalCodes |= kButtonCheatKeys;
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool SnakeCheat(cheatseq_t* c)
|
||||
{
|
||||
if (!nNetPlayerCount)
|
||||
|
@ -151,23 +139,17 @@ static bool SphereCheat(cheatseq_t* c)
|
|||
return true;
|
||||
}
|
||||
|
||||
static bool SwagCheat(cheatseq_t* c)
|
||||
{
|
||||
lLocalCodes |= kButtonCheatItems;
|
||||
return true;
|
||||
}
|
||||
|
||||
static cheatseq_t excheats[] = {
|
||||
{"holly", nullptr, HollyCheat, 0},
|
||||
{"kimberly", nullptr, KimberlyCheat, 0},
|
||||
{"lobocop", nullptr, CopCheat, 0},
|
||||
{"lobocop", "give weapons" },
|
||||
{"lobodeity", "god" },
|
||||
{"lobolite", nullptr, LiteCheat, 0},
|
||||
{"lobopick", nullptr, KeyCheat, 0},
|
||||
{"lobopick", "give keys" },
|
||||
{"loboslip", "noclip" },
|
||||
{"lobosnake", nullptr, SnakeCheat, 0},
|
||||
{"lobosnake", nullptr, SnakeCheat },
|
||||
{"lobosphere", nullptr, SphereCheat, 0},
|
||||
{"loboswag", nullptr, SwagCheat, 0},
|
||||
{"loboswag", "give inventory" },
|
||||
{"loboxy", "stat printcoords", nullptr, true},
|
||||
};
|
||||
|
||||
|
|
|
@ -31,6 +31,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|||
#include "ps_input.h"
|
||||
#include "cheathandler.h"
|
||||
#include "gamestate.h"
|
||||
#include "mmulti.h"
|
||||
|
||||
BEGIN_PS_NS
|
||||
|
||||
|
@ -184,6 +185,46 @@ static int osdcmd_third_person_view(CCmdFuncPtr parm)
|
|||
return CCMD_OK;
|
||||
}
|
||||
|
||||
static int ccmd_give(CCmdFuncPtr parm)
|
||||
{
|
||||
if (PlayerList[myconnectindex].nHealth <= 0 || nNetPlayerCount)
|
||||
{
|
||||
Printf("give: Cannot give while dead or not in a single-player game.\n");
|
||||
return CCMD_OK;
|
||||
}
|
||||
|
||||
if (parm->numparms != 1) return CCMD_SHOWHELP;
|
||||
|
||||
cheatseq_t* cs = (cheatseq_t*)(intptr_t)1;
|
||||
if (!stricmp(parm->parms[0], "all"))
|
||||
{
|
||||
lLocalCodes |= kButtonCheatGuns | kButtonCheatItems | kButtonCheatKeys;
|
||||
}
|
||||
else if (!stricmp(parm->parms[0], "health"))
|
||||
{
|
||||
PlayerList[myconnectindex].nHealth = 800;
|
||||
}
|
||||
else if (!stricmp(parm->parms[0], "weapons"))
|
||||
{
|
||||
lLocalCodes |= kButtonCheatGuns;
|
||||
}
|
||||
else if (!stricmp(parm->parms[0], "keys"))
|
||||
{
|
||||
lLocalCodes |= kButtonCheatKeys;
|
||||
}
|
||||
else if (!stricmp(parm->parms[0], "inventory"))
|
||||
{
|
||||
lLocalCodes |= kButtonCheatItems;
|
||||
}
|
||||
else if (!stricmp(parm->parms[0], "items"))
|
||||
{
|
||||
lLocalCodes |= kButtonCheatItems | kButtonCheatKeys;
|
||||
}
|
||||
else return CCMD_SHOWHELP;
|
||||
return CCMD_OK;
|
||||
}
|
||||
|
||||
|
||||
static int osdcmd_noop(CCmdFuncPtr parm)
|
||||
{
|
||||
// this is for silencing key bindings only.
|
||||
|
@ -202,6 +243,7 @@ int32_t registerosdcommands(void)
|
|||
C_RegisterFunction("third_person_view", "Switch to third person view", osdcmd_third_person_view);
|
||||
C_RegisterFunction("coop_view", "Switch player to view from in coop", osdcmd_noop);
|
||||
C_RegisterFunction("show_weapon", "Show opponents' weapons", osdcmd_noop);
|
||||
C_RegisterFunction("give", "give <all|health|weapons|keys|inventory>: gives requested item", ccmd_give);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -1286,13 +1286,13 @@ loc_1AB8E:
|
|||
FillWeapons(nPlayer);
|
||||
StatusMessage(150, "All weapons loaded for player");
|
||||
}
|
||||
else if (buttons & kButtonCheatKeys) // LOBOPICK cheat
|
||||
if (buttons & kButtonCheatKeys) // LOBOPICK cheat
|
||||
{
|
||||
PlayerList[nPlayer].keys = 0xFFFF;
|
||||
StatusMessage(150, "All keys loaded for player");
|
||||
RefreshStatus();
|
||||
}
|
||||
else if (buttons & kButtonCheatItems) // LOBOSWAG cheat
|
||||
if (buttons & kButtonCheatItems) // LOBOSWAG cheat
|
||||
{
|
||||
FillItems(nPlayer);
|
||||
StatusMessage(150, "All items loaded for player");
|
||||
|
|
|
@ -42,6 +42,7 @@ bool cheatWeapons(cheatseq_t* s);
|
|||
bool cheatStuff(cheatseq_t* s);
|
||||
bool cheatKeys(cheatseq_t* s);
|
||||
bool cheatInventory(cheatseq_t* s);
|
||||
bool cheatItems(cheatseq_t* s);
|
||||
|
||||
static void dowarp(MapRecord *map)
|
||||
{
|
||||
|
@ -232,6 +233,10 @@ static int ccmd_give(CCmdFuncPtr parm)
|
|||
{
|
||||
cheatInventory(cs);
|
||||
}
|
||||
else if (!stricmp(parm->parms[0], "items"))
|
||||
{
|
||||
cheatItems(cs);
|
||||
}
|
||||
else return CCMD_SHOWHELP;
|
||||
return CCMD_OK;
|
||||
}
|
||||
|
|
|
@ -55,7 +55,7 @@ const char *GameInterface::CheckCheatMode()
|
|||
}
|
||||
|
||||
|
||||
const char *cheatGod(int myconnectindex, int state)
|
||||
static const char *cheatGod(int myconnectindex, int state)
|
||||
{
|
||||
if (state == -1) state = 1 - ud.god;
|
||||
ud.god = state;
|
||||
|
@ -91,6 +91,46 @@ const char *cheatGod(int myconnectindex, int state)
|
|||
}
|
||||
}
|
||||
|
||||
static const char* cheatUnlock()
|
||||
{
|
||||
if (VOLUMEONE) return nullptr;
|
||||
for (int i = numsectors - 1; i >= 0; i--) //Unlock
|
||||
{
|
||||
int j = sector[i].lotag;
|
||||
if (j == -1 || j == 32767) continue;
|
||||
if ((j & 0x7fff) > 2)
|
||||
{
|
||||
if (j & (0xffff - 16384))
|
||||
sector[i].lotag &= (0xffff - 16384);
|
||||
operatesectors(i, ps[myconnectindex].i);
|
||||
}
|
||||
}
|
||||
fi.operateforcefields(ps[myconnectindex].i, -1);
|
||||
return quoteMgr.GetQuote(QUOTE_CHEAT_UNLOCK);
|
||||
}
|
||||
|
||||
static const char *cheatKfc(int player)
|
||||
{
|
||||
for (int i = 0; i < 7; i++)
|
||||
{
|
||||
int spr = fi.spawn(ps[player].i, TILE_HEN);
|
||||
sprite[spr].pal = 1;
|
||||
sprite[spr].xrepeat = sprite[spr].xrepeat << 2;
|
||||
sprite[spr].yrepeat = sprite[spr].yrepeat << 2;
|
||||
}
|
||||
return quoteMgr.GetQuote(QUOTE_CHEAT_KFC);
|
||||
}
|
||||
|
||||
static const char * cheatMonsters()
|
||||
{
|
||||
static char textbuf[64];
|
||||
if (++actor_tog == 3) actor_tog = 0;
|
||||
static const char* s[] = { "OPTVAL_ON", "OPTVAL_OFF", "TXT_ON2" };
|
||||
mysnprintf(textbuf, 64, "%s: %s", GStrings("NETMNU_MONSTERS"), GStrings(s[actor_tog]));
|
||||
return textbuf;
|
||||
}
|
||||
|
||||
|
||||
|
||||
const char* GameInterface::GenericCheat(int player, int cheat)
|
||||
{
|
||||
|
@ -109,6 +149,69 @@ const char* GameInterface::GenericCheat(int player, int cheat)
|
|||
ud.clipping = 1 - ud.clipping;
|
||||
return quoteMgr.GetQuote(ud.clipping ? QUOTE_CHEAT_NOCLIP : QUOTE_CHEAT_NOCLIP);
|
||||
|
||||
case CHT_UNLOCK:
|
||||
return cheatUnlock();
|
||||
|
||||
case CHT_CASHMAN:
|
||||
ud.cashman = 1 - ud.cashman;
|
||||
return nullptr;
|
||||
|
||||
case CHT_HYPER:
|
||||
ps[player].steroids_amount = 399;
|
||||
return quoteMgr.GetQuote(QUOTE_CHEAT_STEROIDS);
|
||||
|
||||
case CHT_KILL:
|
||||
quickkill(&ps[player]);
|
||||
return quoteMgr.GetQuote(QUOTE_CHEAT_KILL);
|
||||
|
||||
case CHT_MONSTERS:
|
||||
return cheatMonsters();
|
||||
|
||||
case CHT_BIKE:
|
||||
OnMotorcycle(&ps[player], 0);
|
||||
ps[player].ammo_amount[MOTORCYCLE_WEAPON] = max_ammo_amount[MOTORCYCLE_WEAPON];
|
||||
return quoteMgr.GetQuote(QUOTE_ON_BIKE);
|
||||
|
||||
case CHT_BOAT:
|
||||
OnBoat(&ps[player], 0);
|
||||
ps[player].ammo_amount[BOAT_WEAPON] = max_ammo_amount[BOAT_WEAPON];
|
||||
return quoteMgr.GetQuote(QUOTE_ON_BOAT);
|
||||
|
||||
case CHT_TONY:
|
||||
enemysizecheat = 2;
|
||||
return nullptr;
|
||||
|
||||
case CHT_VAN:
|
||||
enemysizecheat = 3;
|
||||
return nullptr;
|
||||
|
||||
case CHT_RHETT:
|
||||
ud.god = 0;
|
||||
ps[player].gotweapon.Zero();
|
||||
ps[player].curr_weapon = KNEE_WEAPON;
|
||||
ps[player].nocheat = 1;
|
||||
sprite[ps[player].i].extra = 1;
|
||||
return quoteMgr.GetQuote(QUOTE_YERFUCKED);
|
||||
|
||||
case CHT_AARON:
|
||||
ps[player].DrugMode = !ps[player].DrugMode;
|
||||
return nullptr;
|
||||
|
||||
case CHT_NOCHEAT:
|
||||
ps[player].nocheat = 1;
|
||||
return quoteMgr.GetQuote(QUOTE_NOCHEATS);
|
||||
|
||||
case CHT_DRINK:
|
||||
ps[player].drink_amt = ps[player].drink_amt ? 0 : 90;
|
||||
return quoteMgr.GetQuote(ps[player].drink_amt ? QUOTE_INSTADRUNK : QUOTE_INSTASOBER);
|
||||
|
||||
case CHT_SEASICK:
|
||||
ps[player].sea_sick_stat = !ps[player].sea_sick_stat;
|
||||
return quoteMgr.GetQuote(ps[player].sea_sick_stat ? QUOTE_BOATMODEON : QUOTE_BOATMODEOFF);
|
||||
|
||||
case CHT_KFC:
|
||||
return cheatKfc(player);
|
||||
|
||||
default:
|
||||
return nullptr;
|
||||
}
|
||||
|
@ -210,25 +313,7 @@ static bool cheatLevel(cheatseq_t *s)
|
|||
return true;
|
||||
}
|
||||
|
||||
static bool cheatCoord(cheatseq_t *)
|
||||
{
|
||||
C_DoCommand("stat coord");
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool cheatTime(cheatseq_t *)
|
||||
{
|
||||
C_DoCommand("stat fps");
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool cheatRate(cheatseq_t *)
|
||||
{
|
||||
C_DoCommand("toggle vid_fps");
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool cheatItems(cheatseq_t *)
|
||||
bool cheatItems(cheatseq_t *)
|
||||
{
|
||||
cheatInventory(nullptr);
|
||||
if (!isNamWW2GI()) cheatKeys(nullptr);
|
||||
|
@ -237,48 +322,6 @@ static bool cheatItems(cheatseq_t *)
|
|||
}
|
||||
|
||||
|
||||
static bool cheatView(cheatseq_t *)
|
||||
{
|
||||
if (ps[myconnectindex].OnMotorcycle == 0 && ps[myconnectindex].OnBoat == 0)
|
||||
{
|
||||
if( ps[myconnectindex].over_shoulder_on )
|
||||
ps[myconnectindex].over_shoulder_on = 0;
|
||||
else
|
||||
{
|
||||
ps[myconnectindex].over_shoulder_on = 1;
|
||||
cameradist = 0;
|
||||
cameraclock = INT_MIN;
|
||||
}
|
||||
//FTA(22,&ps[myconnectindex]); this message makes no sense.
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool cheatUnlock(cheatseq_t *)
|
||||
{
|
||||
if (VOLUMEONE) return false;
|
||||
for(int i=numsectors-1;i>=0;i--) //Unlock
|
||||
{
|
||||
int j = sector[i].lotag;
|
||||
if(j == -1 || j == 32767) continue;
|
||||
if( (j & 0x7fff) > 2 )
|
||||
{
|
||||
if( j&(0xffff-16384) )
|
||||
sector[i].lotag &= (0xffff-16384);
|
||||
operatesectors(i,ps[myconnectindex].i);
|
||||
}
|
||||
}
|
||||
fi.operateforcefields(ps[myconnectindex].i,-1);
|
||||
FTA(100,&ps[myconnectindex]);
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool cheatCashman(cheatseq_t *)
|
||||
{
|
||||
ud.cashman = 1-ud.cashman;
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool cheatSkill(cheatseq_t *s)
|
||||
{
|
||||
lastlevel = 0;
|
||||
|
@ -289,6 +332,8 @@ static bool cheatSkill(cheatseq_t *s)
|
|||
return true;
|
||||
}
|
||||
|
||||
// The remaining cheats are client side only.
|
||||
|
||||
static bool cheatBeta(cheatseq_t *)
|
||||
{
|
||||
FTA(105,&ps[myconnectindex]);
|
||||
|
@ -301,21 +346,6 @@ static bool cheatTodd(cheatseq_t *)
|
|||
return true;
|
||||
}
|
||||
|
||||
static bool cheatHyper(cheatseq_t *)
|
||||
{
|
||||
ps[myconnectindex].steroids_amount = 399;
|
||||
FTA(37,&ps[myconnectindex]);
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool cheatMonsters(cheatseq_t *)
|
||||
{
|
||||
if(++actor_tog == 3) actor_tog = 0;
|
||||
static const char *s [] = { "OPTVAL_ON", "OPTVAL_OFF", "TXT_ON2" };
|
||||
Printf(PRINT_NOTIFY, "%s: %s", GStrings("NETMNU_MONSTERS"), GStrings(s[actor_tog]));
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool cheatMap(cheatseq_t *)
|
||||
{
|
||||
gFullMap = !gFullMap;
|
||||
|
@ -323,229 +353,124 @@ static bool cheatMap(cheatseq_t *)
|
|||
return true;
|
||||
}
|
||||
|
||||
static bool cheatKill(cheatseq_t *)
|
||||
{
|
||||
quickkill(&ps[myconnectindex]);
|
||||
FTA(127,&ps[myconnectindex]);
|
||||
return true;
|
||||
}
|
||||
|
||||
// RRRA only cheats
|
||||
|
||||
static bool cheatMotorcycle(cheatseq_t *)
|
||||
{
|
||||
OnMotorcycle(&ps[myconnectindex],0);
|
||||
ps[myconnectindex].ammo_amount[MOTORCYCLE_WEAPON] = max_ammo_amount[MOTORCYCLE_WEAPON];
|
||||
FTA(126,&ps[myconnectindex]);
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool cheatBoat(cheatseq_t *)
|
||||
{
|
||||
OnBoat(&ps[myconnectindex],0);
|
||||
ps[myconnectindex].ammo_amount[BOAT_WEAPON] = max_ammo_amount[BOAT_WEAPON];
|
||||
FTA(136,&ps[myconnectindex]);
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool cheatTony(cheatseq_t *)
|
||||
{
|
||||
enemysizecheat = 2;
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool cheatVan(cheatseq_t *)
|
||||
{
|
||||
enemysizecheat = 3;
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool cheatGary(cheatseq_t *)
|
||||
{
|
||||
S_PlayRRMusic(10);
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool cheatRhett(cheatseq_t *)
|
||||
{
|
||||
ud.god = 0;
|
||||
ps[myconnectindex].gotweapon.Zero();
|
||||
ps[myconnectindex].curr_weapon = KNEE_WEAPON;
|
||||
ps[myconnectindex].nocheat = 1;
|
||||
sprite[ps[myconnectindex].i].extra = 1;
|
||||
FTA(128,&ps[myconnectindex]);
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool cheatAaron(cheatseq_t *)
|
||||
{
|
||||
if (ps[myconnectindex].DrugMode)
|
||||
ps[myconnectindex].DrugMode = 0;
|
||||
else
|
||||
ps[myconnectindex].DrugMode = 5;
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool cheatNocheat(cheatseq_t *)
|
||||
{
|
||||
ps[myconnectindex].nocheat = 1;
|
||||
FTA(130,&ps[myconnectindex]);
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool cheatDrink(cheatseq_t *)
|
||||
{
|
||||
if (ps[myconnectindex].drink_amt)
|
||||
{
|
||||
ps[myconnectindex].drink_amt = 0;
|
||||
FTA(132,&ps[myconnectindex]);
|
||||
}
|
||||
else
|
||||
{
|
||||
ps[myconnectindex].drink_amt = 90;
|
||||
FTA(131,&ps[myconnectindex]);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool cheatSeasick(cheatseq_t *)
|
||||
{
|
||||
if (ps[myconnectindex].sea_sick_stat)
|
||||
{
|
||||
ps[myconnectindex].sea_sick_stat = 0;
|
||||
FTA(129,&ps[myconnectindex]);
|
||||
}
|
||||
else
|
||||
{
|
||||
ps[myconnectindex].sea_sick_stat = 1;
|
||||
FTA(137, &ps[myconnectindex]);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool cheatKfc(cheatseq_t *)
|
||||
{
|
||||
for (int i = 0; i < 7; i++)
|
||||
{
|
||||
int spr = fi.spawn(ps[screenpeek].i,TILE_HEN);
|
||||
sprite[spr].pal = 1;
|
||||
sprite[spr].xrepeat = sprite[spr].xrepeat<<2;
|
||||
sprite[spr].yrepeat = sprite[spr].yrepeat<<2;
|
||||
}
|
||||
FTA(139,&ps[myconnectindex]);
|
||||
return true;
|
||||
}
|
||||
|
||||
static cheatseq_t dukecheats[] = {
|
||||
{ "dncornholio", "god" },
|
||||
{ "dnstuff", nullptr, cheatStuff },
|
||||
{ "dnscotty###", nullptr, cheatLevel },
|
||||
{ "dncoords", nullptr, cheatCoord, 1 },
|
||||
{ "dnview", nullptr, cheatView, 1 },
|
||||
{ "dntime", nullptr, cheatTime, 1 },
|
||||
{ "dnunlock", nullptr, cheatUnlock },
|
||||
{ "dncashman", nullptr, cheatCashman },
|
||||
{ "dnitems", nullptr, cheatItems },
|
||||
{ "dnrate", nullptr, cheatRate, 1 },
|
||||
{ "dnskill#", nullptr, cheatSkill },
|
||||
{ "dncornholio", nullptr, SendGenericCheat, 0, CHT_GOD },
|
||||
{ "dnstuff", "give all", },
|
||||
{ "dnscotty###", nullptr, cheatLevel }, // -> levelwarp
|
||||
{ "dncoords", "stat coord", nullptr, 1 },
|
||||
{ "dnview", "third_person_view",nullptr, 1 },
|
||||
{ "dntime", "stat fps", nullptr, 1 },
|
||||
{ "dnunlock", nullptr, SendGenericCheat, 0, CHT_UNLOCK },
|
||||
{ "dncashman", nullptr, SendGenericCheat, 0, CHT_CASHMAN },
|
||||
{ "dnitems", "give items", },
|
||||
{ "dnrate", "toggle vid_fps", nullptr, 1 },
|
||||
{ "dnskill#", nullptr, cheatSkill }, // restartmap <skill>
|
||||
{ "dnbeta", nullptr, cheatBeta },
|
||||
{ "dnhyper", nullptr, cheatHyper },
|
||||
{ "dnmonsters", nullptr, cheatMonsters },
|
||||
{ "dnhyper", nullptr, SendGenericCheat, 0, CHT_HYPER },
|
||||
{ "dnmonsters", nullptr, SendGenericCheat, 0, CHT_MONSTERS },
|
||||
{ "dntodd", nullptr, cheatTodd },
|
||||
{ "dnshowmap", nullptr, cheatMap },
|
||||
{ "dnkroz", "god" },
|
||||
{ "dnkroz", nullptr, SendGenericCheat, 0, CHT_GOD },
|
||||
{ "dnallen", nullptr, cheatAllen },
|
||||
{ "dnclip", "noclip" },
|
||||
{ "dnweapons", nullptr, cheatWeapons },
|
||||
{ "dninventory", nullptr, cheatInventory },
|
||||
{ "dnkeys", nullptr, cheatKeys },
|
||||
{ "dnclip", nullptr, SendGenericCheat, 0, CHT_NOCLIP },
|
||||
{ "dnweapons", "give weapons" },
|
||||
{ "dninventory", "give inventory" },
|
||||
{ "dnkeys", "give keys" },
|
||||
{ "dndebug", nullptr, cheatDebug, 1 },
|
||||
{ "dncgs", nullptr, cheatKill },
|
||||
{ "dncgs", nullptr, SendGenericCheat, 0, CHT_KILL },
|
||||
};
|
||||
|
||||
static cheatseq_t ww2cheats[] =
|
||||
{
|
||||
// Use the same code prefix as EDuke because 'ww' is not usable here. Since the cheat parser eats input after the second key, this could easily cause interference for WASD users.
|
||||
{ "gi2god", "god" },
|
||||
{ "gi2blood", nullptr, cheatStuff },
|
||||
{ "gi2god", nullptr, SendGenericCheat, 0, CHT_GOD },
|
||||
{ "gi2blood", "give all", },
|
||||
{ "gi2level###", nullptr, cheatLevel },
|
||||
{ "gi2coords", nullptr, cheatCoord, 1 },
|
||||
{ "gi2view", nullptr, cheatView, 1 },
|
||||
{ "gi2time", nullptr, cheatTime, 1 },
|
||||
{ "gi2rate", nullptr, cheatRate, 1 },
|
||||
{ "gi2coords", "stat coord", nullptr, 1 },
|
||||
{ "gi2view", "third_person_view",nullptr, 1 },
|
||||
{ "gi2time", "stat fps", nullptr, 1 },
|
||||
{ "gi2rate", "toggle vid_fps", nullptr, 1 },
|
||||
{ "gi2skill", nullptr, cheatSkill },
|
||||
{ "gi2enemies", nullptr, cheatMonsters },
|
||||
{ "gi2enemies", nullptr, SendGenericCheat, 0, CHT_MONSTERS },
|
||||
{ "gi2matt", nullptr, cheatTodd },
|
||||
{ "gi2showmap", nullptr, cheatMap },
|
||||
{ "gi2ryan", "god" },
|
||||
{ "gi2clip", "noclip" },
|
||||
{ "gi2weapons", nullptr, cheatWeapons },
|
||||
{ "gi2inventory", nullptr, cheatInventory },
|
||||
{ "gi2ryan", nullptr, SendGenericCheat, 0, CHT_GOD },
|
||||
{ "gi2clip", nullptr, SendGenericCheat, 0, CHT_NOCLIP },
|
||||
{ "gi2weapons", "give weapons" },
|
||||
{ "gi2inventory", "give inventory" },
|
||||
{ "gi2debug", nullptr, cheatDebug, 1 },
|
||||
{ "gi2cgs", nullptr, cheatKill },
|
||||
{ "gi2cgs", nullptr, SendGenericCheat, 0, CHT_KILL },
|
||||
};
|
||||
|
||||
static cheatseq_t namcheats[] = {
|
||||
{ "nvacaleb", "god" },
|
||||
{ "nvablood", nullptr, cheatStuff },
|
||||
{ "nvacaleb", nullptr, SendGenericCheat, 0, CHT_GOD },
|
||||
{ "nvablood", "give all", },
|
||||
{ "nvalevel###", nullptr, cheatLevel },
|
||||
{ "nvacoords", nullptr, cheatCoord, 1 },
|
||||
{ "nvaview", nullptr, cheatView, 1 },
|
||||
{ "nvatime", nullptr, cheatTime, 1 },
|
||||
{ "nvarate", nullptr, cheatRate, 1 },
|
||||
{ "nvacoords", "stat coord", nullptr, 1 },
|
||||
{ "nvaview", "third_person_view",nullptr, 1 },
|
||||
{ "nvatime", "stat fps", nullptr, 1 },
|
||||
{ "nvarate", "toggle vid_fps", nullptr, 1 },
|
||||
{ "nvaskill", nullptr, cheatSkill },
|
||||
{ "nvahyper", nullptr, cheatHyper },
|
||||
{ "nvaenemies", nullptr, cheatMonsters },
|
||||
{ "nvahyper", nullptr, SendGenericCheat, 0, CHT_HYPER },
|
||||
{ "nvaenemies", nullptr, SendGenericCheat, 0, CHT_MONSTERS },
|
||||
{ "nvamatt", nullptr, cheatTodd },
|
||||
{ "nvashowmap", nullptr, cheatMap },
|
||||
{ "nvagod", "god" },
|
||||
{ "nvaclip", "noclip" },
|
||||
{ "nvaweapons", nullptr, cheatWeapons },
|
||||
{ "nvainventory",nullptr, cheatInventory },
|
||||
{ "nvagod", nullptr, SendGenericCheat, 0, CHT_GOD },
|
||||
{ "nvaclip", nullptr, SendGenericCheat, 0, CHT_NOCLIP },
|
||||
{ "nvaweapons", "give weapons" },
|
||||
{ "nvainventory","give inventory" },
|
||||
{ "nvadebug", nullptr, cheatDebug, 1 },
|
||||
{ "nvacgs", nullptr, cheatKill },
|
||||
{ "nvacgs", nullptr, SendGenericCheat, 0, CHT_KILL },
|
||||
};
|
||||
|
||||
static cheatseq_t rrcheats[] = {
|
||||
{ "rdhounddog", "god" },
|
||||
{ "rdall", nullptr, cheatStuff },
|
||||
{ "rdall", "give all", },
|
||||
{ "rdmeadow###", nullptr, cheatLevel },
|
||||
{ "rdyerat", nullptr, cheatCoord, 1 },
|
||||
{ "rdview", nullptr, cheatView, 1 },
|
||||
{ "rdtime", nullptr, cheatTime, 1 },
|
||||
{ "rdunlock", nullptr, cheatUnlock },
|
||||
{ "rdcluck", nullptr, cheatCashman },
|
||||
{ "rditems", nullptr, cheatItems },
|
||||
{ "rdrate", nullptr, cheatRate, 1 },
|
||||
{ "rdyerat", "stat coord", nullptr, 1 },
|
||||
{ "rdview", "third_person_view",nullptr, 1 },
|
||||
{ "rdtime", "stat fps", nullptr, 1 },
|
||||
{ "rdunlock", nullptr, SendGenericCheat, 0, CHT_UNLOCK },
|
||||
{ "rdcluck", nullptr, SendGenericCheat, 0, CHT_CASHMAN },
|
||||
{ "rditems", "give items", },
|
||||
{ "rdrate", "toggle vid_fps", nullptr, 1 },
|
||||
{ "rdskill#", nullptr, cheatSkill },
|
||||
{ "rdteachers", nullptr, cheatBeta },
|
||||
{ "rdmoonshine", nullptr, cheatHyper },
|
||||
{ "rdcritters", nullptr, cheatMonsters },
|
||||
{ "rdmoonshine", nullptr, SendGenericCheat, 0, CHT_HYPER },
|
||||
{ "rdcritters", nullptr, SendGenericCheat, 0, CHT_MONSTERS },
|
||||
{ "rdrafael", nullptr, cheatTodd },
|
||||
{ "rdshowmap", nullptr, cheatMap },
|
||||
{ "rdelvis", "god" },
|
||||
{ "rdclip", "noclip" },
|
||||
{ "rdguns", nullptr, cheatWeapons },
|
||||
{ "rdinventory", nullptr, cheatInventory },
|
||||
{ "rdkeys", nullptr, cheatKeys },
|
||||
{ "rdguns", "give weapons" },
|
||||
{ "rdinventory", "give inventory" },
|
||||
{ "rdkeys", "give keys" },
|
||||
{ "rddebug", nullptr, cheatDebug, 1 },
|
||||
{ "rdcgs", nullptr, cheatKill }, // 23 for RR
|
||||
{ "rdcgs", nullptr, SendGenericCheat, 0, CHT_KILL },
|
||||
// RRRA only!
|
||||
{ "rdjoseph", nullptr, cheatMotorcycle },
|
||||
{ "rdmrbill", nullptr, cheatKill },
|
||||
{ "rdtony", nullptr, cheatTony },
|
||||
{ "rdjoseph", nullptr, SendGenericCheat, 0, CHT_BIKE },
|
||||
{ "rdmrbill", nullptr, SendGenericCheat, 0, CHT_KILL },
|
||||
{ "rdtony", nullptr, SendGenericCheat, 0, CHT_TONY },
|
||||
{ "rdgary", nullptr, cheatGary },
|
||||
{ "rdrhett", nullptr, cheatRhett },
|
||||
{ "rdaaron", nullptr, cheatAaron },
|
||||
{ "rdnocheat", nullptr, cheatNocheat },
|
||||
{ "rdwoleslagle",nullptr, cheatDrink },
|
||||
{ "rdmikael", nullptr, cheatStuff },
|
||||
{ "rdgreg", nullptr, cheatSeasick },
|
||||
{ "rdrhett", nullptr, SendGenericCheat, 0, CHT_RHETT },
|
||||
{ "rdaaron", nullptr, SendGenericCheat, 0, CHT_AARON },
|
||||
{ "rdnocheat", nullptr, SendGenericCheat, 0, CHT_NOCHEAT },
|
||||
{ "rdwoleslagle",nullptr, SendGenericCheat, 0, CHT_DRINK },
|
||||
{ "rdmikael", "give all", },
|
||||
{ "rdgreg", nullptr, SendGenericCheat, 0, CHT_SEASICK },
|
||||
//"rdnoah", nullptr, // no-op
|
||||
{ "rdarijit", nullptr, cheatBoat },
|
||||
{ "rddonut", nullptr, cheatBoat },
|
||||
{ "rdkfc", nullptr, cheatKfc },
|
||||
{ "rdvan", nullptr, cheatVan },
|
||||
{ "rdarijit", nullptr, SendGenericCheat, 0, CHT_BOAT },
|
||||
{ "rddonut", nullptr, SendGenericCheat, 0, CHT_BOAT },
|
||||
{ "rdkfc", nullptr, SendGenericCheat, 0, CHT_KFC },
|
||||
{ "rdvan", nullptr, SendGenericCheat, 0, CHT_VAN },
|
||||
};
|
||||
|
||||
void InitCheats()
|
||||
|
|
|
@ -222,6 +222,17 @@ enum EQuote
|
|||
QUOTE_CHEAT_ALL_KEYS = 121,
|
||||
QUOTE_RESERVED4 = 122,
|
||||
QUOTE_SAVE_BAD_PLAYERS = 124,
|
||||
|
||||
QUOTE_ON_BIKE = 126,
|
||||
QUOTE_CHEAT_KILL = 127,
|
||||
QUOTE_YERFUCKED = 128,
|
||||
QUOTE_BOATMODEON = 129,
|
||||
QUOTE_INSTADRUNK = 131,
|
||||
QUOTE_INSTASOBER = 132,
|
||||
QUOTE_NOCHEATS = 139,
|
||||
QUOTE_ON_BOAT = 136,
|
||||
QUOTE_BOATMODEOFF = 137,
|
||||
QUOTE_CHEAT_KFC = 139,
|
||||
};
|
||||
|
||||
enum
|
||||
|
|
|
@ -141,16 +141,6 @@ bool MapCheat(cheatseq_t* c)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool LocCheat(cheatseq_t* c)
|
||||
{
|
||||
if (!checkCheat(c)) return false;
|
||||
extern SWBOOL LocationInfo;
|
||||
LocationInfo++;
|
||||
if (LocationInfo > 2)
|
||||
LocationInfo = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool WeaponCheat(cheatseq_t* c)
|
||||
{
|
||||
if (!checkCheat(c)) return false;
|
||||
|
@ -438,7 +428,7 @@ static cheatseq_t swcheats[] = {
|
|||
{"lwgreed", nullptr, EveryCheatToggle, 0},
|
||||
{"lwghost", "noclip" },
|
||||
{"lwstart", nullptr, RestartCheat, 0},
|
||||
{"lwloc", nullptr, LocCheat, 0},
|
||||
{"lwloc", "stat coord", nullptr, true},
|
||||
{"lwmap", nullptr, MapCheat, 0},
|
||||
{"lwroom", nullptr, RoomCheat, true}, // Room above room dbug
|
||||
};
|
||||
|
|
|
@ -58,7 +58,7 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
|
|||
BEGIN_SW_NS
|
||||
|
||||
static int OverlapDraw = FALSE;
|
||||
extern SWBOOL QuitFlag, LocationInfo, SpriteInfo;
|
||||
extern SWBOOL QuitFlag, SpriteInfo;
|
||||
extern SWBOOL Voxel;
|
||||
extern char buffer[];
|
||||
SWBOOL DrawScreen;
|
||||
|
|
|
@ -79,8 +79,9 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
|
|||
|
||||
//#include "crc32.h"
|
||||
|
||||
CVAR(Bool, sw_ninjahack, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG);
|
||||
CVAR(Bool, sw_ninjahack, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_SERVERINFO);
|
||||
CVAR(Bool, sw_darts, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG);
|
||||
CVAR(Bool, sw_bunnyrockets, false, CVAR_SERVERINFO | CVAR_CHEAT); // This is a cheat, so don't save.
|
||||
|
||||
BEGIN_SW_NS
|
||||
|
||||
|
@ -106,7 +107,6 @@ SWBOOL SavegameLoaded = false;
|
|||
SWBOOL FinishedLevel = false;
|
||||
short screenpeek = 0;
|
||||
|
||||
SWBOOL LocationInfo = 0;
|
||||
void drawoverheadmap(int cposx, int cposy, int czoom, short cang);
|
||||
SWBOOL PreCaching = TRUE;
|
||||
int GodMode = false;
|
||||
|
|
|
@ -53,6 +53,7 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
|
|||
|
||||
EXTERN_CVAR(Bool, sw_ninjahack)
|
||||
EXTERN_CVAR(Bool, sw_darts)
|
||||
EXTERN_CVAR(Bool, sw_bunnyrockets)
|
||||
|
||||
BEGIN_SW_NS
|
||||
|
||||
|
@ -1002,7 +1003,6 @@ struct PLAYERstruct
|
|||
SWBOOL NukeInitialized; // Nuke already has counted down
|
||||
short FistAng; // KungFu attack angle
|
||||
unsigned char WpnKungFuMove; // KungFu special moves
|
||||
SWBOOL BunnyMode; // Can shoot Bunnies out of rocket launcher
|
||||
short HitBy; // SpriteNum of whatever player was last hit by
|
||||
short Reverb; // Player's current reverb setting
|
||||
short Heads; // Number of Accursed Heads orbiting player
|
||||
|
|
|
@ -2249,7 +2249,6 @@ PlayerDeathReset(PLAYERp pp)
|
|||
pp->TestNukeInit = FALSE;
|
||||
pp->InitingNuke = FALSE;
|
||||
pp->NukeInitialized = FALSE;
|
||||
pp->BunnyMode = FALSE;
|
||||
pp->WpnReloadState = 2;
|
||||
|
||||
memset(pp->WpnAmmo,0,sizeof(pp->WpnAmmo));
|
||||
|
@ -2338,7 +2337,6 @@ PlayerGameReset(PLAYERp pp)
|
|||
pp->TestNukeInit = FALSE;
|
||||
pp->InitingNuke = FALSE;
|
||||
pp->NukeInitialized = FALSE;
|
||||
pp->BunnyMode = FALSE;
|
||||
pp->SecretsFound = 0;
|
||||
pp->WpnReloadState = 2;
|
||||
|
||||
|
|
|
@ -181,21 +181,6 @@ static int osdcmd_warptocoords(CCmdFuncPtr parm)
|
|||
return CCMD_OK;
|
||||
}
|
||||
|
||||
static int osdcmd_bunny(CCmdFuncPtr parm)
|
||||
{
|
||||
PLAYERp pp = Player + myconnectindex;
|
||||
|
||||
if (CommEnabled)
|
||||
return CCMD_OK;
|
||||
|
||||
pp->BunnyMode = !pp->BunnyMode;
|
||||
if (pp->BunnyMode)
|
||||
PutStringInfo(pp, "Bunny rockets enabled!");
|
||||
else
|
||||
PutStringInfo(pp, "Bunny rockets disabled!");
|
||||
return CCMD_OK;
|
||||
}
|
||||
|
||||
static int osdcmd_mirror(CCmdFuncPtr parm)
|
||||
{
|
||||
char base[80];
|
||||
|
@ -287,7 +272,6 @@ int32_t registerosdcommands(void)
|
|||
{
|
||||
C_RegisterFunction("map","map <mapfile>: loads the given map", osdcmd_map);
|
||||
C_RegisterFunction("give","give <all|health|weapons|ammo|armor|keys|inventory>: gives requested item", osdcmd_give);
|
||||
C_RegisterFunction("bunny", "bunny: toggles bunny rocket mode", osdcmd_bunny);
|
||||
C_RegisterFunction("mirror_debug", "mirror [mirrornum]: print mirror debug info", osdcmd_mirror);
|
||||
C_RegisterFunction("levelwarp", "levelwarp <num>: warp to level", osdcmd_levelwarp);
|
||||
C_RegisterFunction("restartmap", "restartmap: restarts the current map", osdcmd_restartmap);
|
||||
|
|
|
@ -4519,13 +4519,13 @@ pMicroFire(PANEL_SPRITEp psp)
|
|||
switch (psp->PlayerP->WpnRocketType)
|
||||
{
|
||||
case 0:
|
||||
if (psp->PlayerP->BunnyMode)
|
||||
if (sw_bunnyrockets)
|
||||
InitBunnyRocket(psp->PlayerP);
|
||||
else
|
||||
InitRocket(psp->PlayerP);
|
||||
break;
|
||||
case 1:
|
||||
if (psp->PlayerP->BunnyMode)
|
||||
if (sw_bunnyrockets)
|
||||
InitBunnyRocket(psp->PlayerP);
|
||||
else
|
||||
InitRocket(psp->PlayerP);
|
||||
|
|
Loading…
Reference in a new issue