diff --git a/source/blood/src/messages.cpp b/source/blood/src/messages.cpp index 0e3a5fcf6..6e3a64994 100644 --- a/source/blood/src/messages.cpp +++ b/source/blood/src/messages.cpp @@ -50,16 +50,15 @@ void sub_5A928(void) const char *SetGodMode(bool god) { playerSetGodMode(gMe, god); + bPlayerCheated = true; return gMe->godMode? GStrings("TXTB_GODMODE") : GStrings("TXTB_NOTGODMODE"); } -void SetClipMode(bool noclip) +const char *SetClipMode(bool noclip) { gNoClip = noclip; - if (gNoClip) - viewSetMessage(GStrings("TXTB_NOCLIP")); - else - viewSetMessage(GStrings("TXTB_NOCLIPOFF")); + bPlayerCheated = true; + return gNoClip? GStrings("TXTB_NOCLIP") : GStrings("TXTB_NOCLIPOFF"); } void packStuff(PLAYER *pPlayer) @@ -312,18 +311,6 @@ void ProcessCheat(CHEATCODE nCheatCode, char* pzArgs) case kCheatSatchel: SetToys(true); break; - case kCheatEvaGalli: - SetClipMode(!gNoClip); - break; - case kCheatMpkfa: - viewSetMessage(SetGodMode(!gMe->godMode)); - break; - case kCheatCapInMyAss: - viewSetMessage(SetGodMode(false)); - break; - case kCheatNoCapInMyAss: - viewSetMessage(SetGodMode(true)); - break; case kCheatIdaho: SetWeapons(true); break; @@ -468,6 +455,9 @@ const char* GameInterface::GenericCheat(int player, int cheat) case CHT_GODON: return SetGodMode(true); + case CHT_NOCLIP: + return SetClipMode(!gNoClip); + default: return nullptr; } @@ -514,7 +504,7 @@ static cheatseq_t s_CheatInfo[] = { {"CLARICE", nullptr, doCheat, 0 }, // CLARICE (Gives 100% body armor, 100% fire armor, 100% spirit armor) {"FORK YOU", nullptr, doCheat, 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, 0 }, // LIEBERMAN (Sets the you cheated flag to true, at the end of the level you will see that you have cheated) - {"EVA GALLI", nullptr, doCheat, 0 }, // EVA GALLI (Disable/enable clipping (grant the ability to walk through walls)) + {"EVA GALLI", "noclip" }, // EVA GALLI (Disable/enable clipping (grant the ability to walk through walls)) {"RATE", nullptr, doCheat, 1 }, // RATE (Display frame rate (doesn't count as a cheat)) {"GOONIES", nullptr, doCheat, 0 }, // GOONIES (Enable full map. Displays the message "YOU HAVE THE MAP".) //{"SPIELBERG", nullptr, doCheatnumparms != 2) @@ -236,7 +221,6 @@ int32_t registerosdcommands(void) { C_RegisterFunction("map","map : loads the given map", osdcmd_map); C_RegisterFunction("give","give : gives requested item", osdcmd_give); - C_RegisterFunction("noclip","noclip: toggles clipping mode", osdcmd_noclip); C_RegisterFunction("levelwarp","levelwarp : warp to episode 'e' and map 'm'", osdcmd_levelwarp); C_RegisterFunction("warptocoords","warptocoords [x] [y] [z] [ang] (optional) [horiz] (optional): warps the player to the specified coordinates",osdcmd_warptocoords); C_RegisterFunction("third_person_view", "Switch to third person view", osdcmd_third_person_view); diff --git a/source/core/cheathandler.cpp b/source/core/cheathandler.cpp index c9cd26f52..1db34d66b 100644 --- a/source/core/cheathandler.cpp +++ b/source/core/cheathandler.cpp @@ -115,9 +115,15 @@ bool Cheat_Responder (event_t *ev) { if (CheatAddKey (cheats, (uint8_t)ev->data2, &eat)) { - if (cheats->DontCheck || CheckCheatmode ()) + if (cheats->DontCheck || !CheckCheatmode ()) { - eat |= cheats->Handler (cheats); + if (cheats->Handler) + eat |= cheats->Handler (cheats); + else if (cheats->ccmd) + { + eat = true; + C_DoCommand(cheats->ccmd); + } } } else if (cheats->Pos - cheats->Sequence > 2) diff --git a/source/core/cheats.cpp b/source/core/cheats.cpp index ece52227b..1a00e7e3e 100644 --- a/source/core/cheats.cpp +++ b/source/core/cheats.cpp @@ -121,4 +121,13 @@ CCMD(godoff) } } +CCMD(noclip) +{ + if (!CheckCheatmode(true, true)) + { + Net_WriteByte(DEM_GENERICCHEAT); + Net_WriteByte(CHT_NOCLIP); + } +} + diff --git a/source/core/d_protocol.h b/source/core/d_protocol.h index e3cf62b79..8b58c4ef4 100644 --- a/source/core/d_protocol.h +++ b/source/core/d_protocol.h @@ -99,7 +99,8 @@ enum ECheat CHT_NONE, CHT_GOD, CHT_GODON, - CHT_GODOFF + CHT_GODOFF, + CHT_NOCLIP, }; typedef void(*NetCommandHandler)(int player, uint8_t **stream, bool skip); diff --git a/source/exhumed/CMakeLists.txt b/source/exhumed/CMakeLists.txt index 57c9df1a2..e24689f2b 100644 --- a/source/exhumed/CMakeLists.txt +++ b/source/exhumed/CMakeLists.txt @@ -6,6 +6,7 @@ set( PCH_SOURCES src/bubbles.cpp src/bullet.cpp src/cd.cpp + src/cheats.cpp src/enginesubs.cpp src/exhumed.cpp src/fish.cpp diff --git a/source/exhumed/src/cheats.cpp b/source/exhumed/src/cheats.cpp new file mode 100644 index 000000000..3a68eefa6 --- /dev/null +++ b/source/exhumed/src/cheats.cpp @@ -0,0 +1,180 @@ +//------------------------------------------------------------------------- +/* +Copyright (C) 2010-2019 EDuke32 developers and contributors +Copyright (C) 2019 sirlemonhead, Nuke.YKT +This file is part of PCExhumed. +PCExhumed is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License version 2 +as published by the Free Software Foundation. +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +See the GNU General Public License for more details. +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ +//------------------------------------------------------------------------- +#include "ns.h" +#include "compat.h" +#include "common.h" +#include "engine.h" +#include "exhumed.h" +#include "sequence.h" +#include "names.h" +#include "player.h" +#include "ps_input.h" +#include "sound.h" +#include "view.h" +#include "status.h" +#include "version.h" +#include "gamecvars.h" +#include "savegamehelp.h" +#include "c_dispatch.h" +#include "raze_sound.h" +#include "gamestate.h" +#include "c_console.h" +#include "cheathandler.h" +#include "inputstate.h" +#include "d_protocol.h" +#include "gstrings.h" + +BEGIN_PS_NS + + +static const char* GodCheat(int nPlayer, int state) +{ + if (state == -1) + { + if (PlayerList[nPlayer].invincibility >= 0) + PlayerList[nPlayer].invincibility = -1; + else + PlayerList[nPlayer].invincibility = 0; + } + else PlayerList[nPlayer].invincibility = -state; + + return GStrings(PlayerList[nPlayer].invincibility ? "TXT_EX_DEITYON" : "TXT_EX_DEITYOFF"); +} + +static const char* SlipCheat() +{ + if (bSlipMode == false) + { + bSlipMode = true; + return GStrings("TXT_EX_SLIPON"); + } + else + { + bSlipMode = false; + return GStrings("TXT_EX_SLIPOFF"); + } +} + + + +const char* GameInterface::GenericCheat(int player, int cheat) +{ + switch (cheat) + { + case CHT_GOD: + return GodCheat(player, -1); + + case CHT_GODOFF: + return GodCheat(player, 0); + + case CHT_GODON: + return GodCheat(player, 1); + + case CHT_NOCLIP: + return SlipCheat(); + + default: + return nullptr; + } +} + +static bool HollyCheat(cheatseq_t* c) +{ + // Do the closest thing to this cheat that's available. + C_ToggleConsole(); + return true; +} + +static bool KimberlyCheat(cheatseq_t* c) +{ + Printf(PRINT_NOTIFY, "%s\n", GStrings("TXT_EX_SWEETIE")); + 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")); + bDoFlashes = !bDoFlashes; + g_visibility = 2048 + 512 - g_visibility; // let there be light - for real! + return true; +} + +static bool KeyCheat(cheatseq_t* c) +{ + lLocalCodes |= kButtonCheatKeys; + return true; +} + +static bool SnakeCheat(cheatseq_t* c) +{ + if (!nNetPlayerCount) + { + if (bSnakeCam == false) + { + bSnakeCam = true; + Printf(PRINT_NOTIFY, "%s\n", GStrings("TXT_EX_SNAKEON")); + } + else { + bSnakeCam = false; + Printf(PRINT_NOTIFY, "%s\n", GStrings("TXT_EX_SNAKEOFF")); + } + } + return true; +} + +static bool SphereCheat(cheatseq_t* c) +{ + Printf(PRINT_NOTIFY, "%s\n", GStrings("TXT_EX_FULLMAP")); + GrabMap(); + bShowTowers = true; + 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}, + {"lobodeity", "god" }, + {"lobolite", nullptr, LiteCheat, 0}, + {"lobopick", nullptr, KeyCheat, 0}, + {"loboslip", "noclip" }, + {"lobosnake", nullptr, SnakeCheat, 0}, + {"lobosphere", nullptr, SphereCheat, 0}, + {"loboswag", nullptr, SwagCheat, 0}, + {"loboxy", "stat printcoords", nullptr, true}, +}; + + +void InitCheats() +{ + SetCheats(excheats, countof(excheats)); +} + +END_PS_NS diff --git a/source/exhumed/src/exhumed.cpp b/source/exhumed/src/exhumed.cpp index 5d9eef9fc..3fdc282b1 100644 --- a/source/exhumed/src/exhumed.cpp +++ b/source/exhumed/src/exhumed.cpp @@ -61,6 +61,7 @@ extern short bLockPan; void uploadCinemaPalettes(); int32_t registerosdcommands(void); void InitFonts(); +void InitCheats(); int EndLevel = false; @@ -102,7 +103,6 @@ void CopyTileToBitmap(short nSrcTile, short nDestTile, int xPos, int yPos); void EraseScreen(int nVal); void LoadStatus(); void MySetView(int x1, int y1, int x2, int y2); -void mysetbrightness(char al); char sHollyStr[40]; @@ -196,147 +196,6 @@ void ShutDown(void) //UnInitFX(); } - -static const char* GodCheat(int nPlayer, int state) -{ - if (state == -1) - { - if (PlayerList[nPlayer].invincibility >= 0) - PlayerList[nPlayer].invincibility = -1; - else - PlayerList[nPlayer].invincibility = 0; - } - else PlayerList[nPlayer].invincibility = -state; - - return GStrings(PlayerList[nPlayer].invincibility ? "TXT_EX_DEITYON" : "TXT_EX_DEITYOFF"); -} - -const char* GameInterface::GenericCheat(int player, int cheat) -{ - switch (cheat) - { - case CHT_GOD: - return GodCheat(player, -1); - - case CHT_GODOFF: - return GodCheat(player, 0); - - case CHT_GODON: - return GodCheat(player, 1); - - default: - return nullptr; - } -} - -static bool HollyCheat(cheatseq_t* c) -{ - // Do the closest thing to this cheat that's available. - C_ToggleConsole(); - return true; -} - -static bool KimberlyCheat(cheatseq_t* c) -{ - Printf(PRINT_NOTIFY, "%s\n", GStrings("TXT_EX_SWEETIE")); - 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")); - bDoFlashes = !bDoFlashes; - return true; -} - -static bool KeyCheat(cheatseq_t* c) -{ - lLocalCodes |= kButtonCheatKeys; - return true; -} - -bool SlipCheat(cheatseq_t* c) -{ - if (!nNetPlayerCount) - { - if (bSlipMode == false) - { - bSlipMode = true; - Printf(PRINT_NOTIFY, "%s\n", GStrings("TXT_EX_SLIPON")); - } - else { - bSlipMode = false; - Printf(PRINT_NOTIFY, "%s\n", GStrings("TXT_EX_SLIPOFF")); - } - } - return true; -} - -static bool SnakeCheat(cheatseq_t* c) -{ - if (!nNetPlayerCount) - { - if (bSnakeCam == false) - { - bSnakeCam = true; - Printf(PRINT_NOTIFY, "%s\n", GStrings("TXT_EX_SNAKEON")); - } - else { - bSnakeCam = false; - Printf(PRINT_NOTIFY, "%s\n", GStrings("TXT_EX_SNAKEOFF")); - } - } - return true; -} - -static bool SphereCheat(cheatseq_t* c) -{ - Printf(PRINT_NOTIFY, "%s\n", GStrings("TXT_EX_FULLMAP")); - GrabMap(); - bShowTowers = true; - return true; -} - -static bool SwagCheat(cheatseq_t* c) -{ - lLocalCodes |= kButtonCheatItems; - return true; -} - -static bool CoordCheat(cheatseq_t* c) -{ - C_DoCommand("stat printcoords"); - return true; -} - - -static cheatseq_t excheats[] = { - {"holly", nullptr, HollyCheat, 0}, - {"kimberly", nullptr, KimberlyCheat, 0}, - {"lobocop", nullptr, CopCheat, 0}, - {"lobodeity", "god" }, - {"lobolite", nullptr, LiteCheat, 0}, - {"lobopick", nullptr, KeyCheat, 0}, - {"loboslip", nullptr, SlipCheat, 0}, - {"lobosnake", nullptr, SnakeCheat, 0}, - {"lobosphere", nullptr, SphereCheat, 0}, - {"loboswag", nullptr, SwagCheat, 0}, - {"loboxy", nullptr, CoordCheat, true}, -}; - - -void mysetbrightness(char nBrightness) -{ - g_visibility = 2048 - (nBrightness << 9); -} - - void DoClockBeep() { for (int i = headspritestat[407]; i != -1; i = nextspritestat[i]) { @@ -625,7 +484,7 @@ void GameInterface::app_init() mi->cdSongId = (nTrack % 8) + 11; } - SetCheats(excheats, countof(excheats)); + InitCheats(); registerosdcommands(); if (nNetPlayerCount == -1) { diff --git a/source/exhumed/src/exhumed.h b/source/exhumed/src/exhumed.h index 22b9abc4c..349d76b56 100644 --- a/source/exhumed/src/exhumed.h +++ b/source/exhumed/src/exhumed.h @@ -74,8 +74,6 @@ void mydeletesprite(int nSprite); void GrabPalette(); -void mysetbrightness(char nBrightness); - void StartFadeIn(); void InitSpiritHead(); @@ -157,6 +155,7 @@ extern short nRedTicks; extern short nClockVal; extern short bSlipMode; +extern short bDoFlashes; extern int bVanilla; diff --git a/source/exhumed/src/osdcmds.cpp b/source/exhumed/src/osdcmds.cpp index aa27a1f1f..d0c26fe67 100644 --- a/source/exhumed/src/osdcmds.cpp +++ b/source/exhumed/src/osdcmds.cpp @@ -34,21 +34,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. BEGIN_PS_NS -bool SlipCheat(cheatseq_t* c); - -static int osdcmd_noclip(CCmdFuncPtr) -{ - if (!nNetPlayerCount && !bInDemo) - { - SlipCheat(nullptr); - } - else - { - Printf("noclip: Not in a single-player game.\n"); - } - - return CCMD_OK; -} static int osdcmd_map(CCmdFuncPtr parm) { @@ -212,7 +197,6 @@ int32_t registerosdcommands(void) C_RegisterFunction("map","map : loads the given map", osdcmd_map); C_RegisterFunction("exitmap", "exits current map", osdcmd_exitmap); C_RegisterFunction("doors", "opens/closes doors", osdcmd_doors); - C_RegisterFunction("noclip","noclip: toggles clipping mode", osdcmd_noclip); C_RegisterFunction("spawn","spawn : spawns a creature",osdcmd_spawn); C_RegisterFunction("warptocoords","warptocoords [x] [y] [z] [ang] (optional) [horiz] (optional): warps the player to the specified coordinates",osdcmd_warptocoords); C_RegisterFunction("third_person_view", "Switch to third person view", osdcmd_third_person_view); diff --git a/source/games/duke/src/ccmds.cpp b/source/games/duke/src/ccmds.cpp index 0fcf58875..45422dddc 100644 --- a/source/games/duke/src/ccmds.cpp +++ b/source/games/duke/src/ccmds.cpp @@ -38,7 +38,6 @@ Modifications for JonoF's port by Jonathon Fowler (jf@jonof.id.au) BEGIN_DUKE_NS bool cheatGod(cheatseq_t*); -bool cheatClip(cheatseq_t*); bool cheatWeapons(cheatseq_t* s); bool cheatStuff(cheatseq_t* s); bool cheatKeys(cheatseq_t* s); @@ -120,20 +119,6 @@ static int ccmd_map(CCmdFuncPtr parm) return CCMD_OK; } -static int ccmd_noclip(CCmdFuncPtr) -{ - if (numplayers == 1 && ps[myconnectindex].gm & MODE_GAME) - { - cheatClip(nullptr); - } - else - { - Printf("noclip: Not in a single-player game.\n"); - } - - return CCMD_OK; -} - static int ccmd_restartmap(CCmdFuncPtr) { if (ps[myconnectindex].gm & MODE_GAME && ud.multimode == 1) @@ -323,7 +308,6 @@ int registerosdcommands(void) C_RegisterFunction("map","map : warp to the given map, identified by its name", ccmd_map); C_RegisterFunction("levelwarp","levelwarp : warp to episode 'e' and map 'm'", ccmd_levelwarp); C_RegisterFunction("give","give : gives requested item", ccmd_give); - C_RegisterFunction("noclip","noclip: toggles clipping mode", ccmd_noclip); C_RegisterFunction("restartmap", "restartmap: restarts the current map", ccmd_restartmap); C_RegisterFunction("spawn","spawn [palnum] [cstat] [ang] [x y z]: spawns a sprite with the given properties",ccmd_spawn); C_RegisterFunction("warptocoords","warptocoords [x] [y] [z] [ang] (optional) [horiz] (optional): warps the player to the specified coordinates",osdcmd_warptocoords); diff --git a/source/games/duke/src/cheats.cpp b/source/games/duke/src/cheats.cpp index 47960dbf5..b24cb9cb2 100644 --- a/source/games/duke/src/cheats.cpp +++ b/source/games/duke/src/cheats.cpp @@ -105,6 +105,10 @@ const char* GameInterface::GenericCheat(int player, int cheat) case CHT_GODON: return cheatGod(player, 1); + case CHT_NOCLIP: + ud.clipping = 1 - ud.clipping; + return quoteMgr.GetQuote(ud.clipping ? QUOTE_CHEAT_NOCLIP : QUOTE_CHEAT_NOCLIP); + default: return nullptr; } @@ -170,13 +174,6 @@ static bool cheatDebug(cheatseq_t *) return true; } -bool cheatClip(cheatseq_t *) -{ - ud.clipping = 1-ud.clipping; - FTA(112+ud.clipping,&ps[myconnectindex]); - return true; -} - static bool cheatAllen(cheatseq_t *) { FTA(79,&ps[myconnectindex]); @@ -458,7 +455,7 @@ static cheatseq_t dukecheats[] = { { "dnshowmap", nullptr, cheatMap }, { "dnkroz", "god" }, { "dnallen", nullptr, cheatAllen }, - { "dnclip", nullptr, cheatClip }, + { "dnclip", "noclip" }, { "dnweapons", nullptr, cheatWeapons }, { "dninventory", nullptr, cheatInventory }, { "dnkeys", nullptr, cheatKeys }, @@ -481,7 +478,7 @@ static cheatseq_t ww2cheats[] = { "gi2matt", nullptr, cheatTodd }, { "gi2showmap", nullptr, cheatMap }, { "gi2ryan", "god" }, - { "gi2clip", nullptr, cheatClip }, + { "gi2clip", "noclip" }, { "gi2weapons", nullptr, cheatWeapons }, { "gi2inventory", nullptr, cheatInventory }, { "gi2debug", nullptr, cheatDebug, 1 }, @@ -502,7 +499,7 @@ static cheatseq_t namcheats[] = { { "nvamatt", nullptr, cheatTodd }, { "nvashowmap", nullptr, cheatMap }, { "nvagod", "god" }, - { "nvaclip", nullptr, cheatClip }, + { "nvaclip", "noclip" }, { "nvaweapons", nullptr, cheatWeapons }, { "nvainventory",nullptr, cheatInventory }, { "nvadebug", nullptr, cheatDebug, 1 }, @@ -527,7 +524,7 @@ static cheatseq_t rrcheats[] = { { "rdrafael", nullptr, cheatTodd }, { "rdshowmap", nullptr, cheatMap }, { "rdelvis", "god" }, - { "rdclip", nullptr, cheatClip }, + { "rdclip", "noclip" }, { "rdguns", nullptr, cheatWeapons }, { "rdinventory", nullptr, cheatInventory }, { "rdkeys", nullptr, cheatKeys }, diff --git a/source/games/duke/src/constants.h b/source/games/duke/src/constants.h index 68351c6c6..62c95a254 100644 --- a/source/games/duke/src/constants.h +++ b/source/games/duke/src/constants.h @@ -210,6 +210,7 @@ enum EQuote QUOTE_NVG_OFF = 107, QUOTE_VIEW_MODE_OFF = 109, QUOTE_SHOW_MAP_ON = 111, + QUOTE_CHEAT_CLIP = 112, QUOTE_CHEAT_NOCLIP = 113, QUOTE_SAVE_BAD_VERSION = 114, QUOTE_RESERVED = 115, diff --git a/source/sw/src/cheats.cpp b/source/sw/src/cheats.cpp index f669976c8..ac2dc762d 100644 --- a/source/sw/src/cheats.cpp +++ b/source/sw/src/cheats.cpp @@ -74,7 +74,6 @@ const char *GameInterface::CheckCheatMode() return nullptr; } - const char *GameInterface::GenericCheat(int player, int cheat) { switch (cheat) @@ -91,6 +90,10 @@ const char *GameInterface::GenericCheat(int player, int cheat) GodMode = 1; // fixme: Make god mode a player property. return GStrings("GOD MODE: ON"); + case CHT_NOCLIP: + Player[player].Flags ^= PF_CLIP_CHEAT; + return GStrings(Player[player].Flags & PF_CLIP_CHEAT ? "CLIPPING: OFF" : "CLIPPING: ON"); + default: return nullptr; } @@ -214,15 +217,6 @@ bool AmmoCheat(cheatseq_t* c) return true; } -bool ClipCheat(cheatseq_t* c) -{ - PLAYERp pp; - if (!(pp = checkCheat(c))) return false; - FLIP(pp->Flags, PF_CLIP_CHEAT); - PutStringInfo(pp, GStrings(TEST(pp->Flags, PF_CLIP_CHEAT) ? "CLIPPING: OFF" : "CLIPPING: ON")); - return true; -} - bool WarpCheat(cheatseq_t* c) { PLAYERp pp; @@ -442,7 +436,7 @@ static cheatseq_t swcheats[] = { {"lwguns", nullptr, WeaponCheat, 0}, {"lwtrek##", nullptr, WarpCheat, 0}, {"lwgreed", nullptr, EveryCheatToggle, 0}, - {"lwghost", nullptr, ClipCheat, 0}, + {"lwghost", "noclip" }, {"lwstart", nullptr, RestartCheat, 0}, {"lwloc", nullptr, LocCheat, 0}, {"lwmap", nullptr, MapCheat, 0}, diff --git a/source/sw/src/game.h b/source/sw/src/game.h index 732c82286..08dedd4ed 100644 --- a/source/sw/src/game.h +++ b/source/sw/src/game.h @@ -1021,41 +1021,42 @@ extern PLAYER Player[MAX_SW_PLAYERS_REG+1]; // Player Flags // -#define PF_DEAD (BIT(1)) -#define PF_JUMPING (BIT(2)) -#define PF_FALLING (BIT(3)) -#define PF_LOCK_CRAWL (BIT(4)) -#define PF_LOCK_HORIZ (BIT(5)) -#define PF_LOOKING (BIT(6)) -#define PF_PLAYER_MOVED (BIT(7)) -#define PF_PLAYER_RIDING (BIT(8)) -#define PF_AUTO_AIM (BIT(9)) -#define PF_RECOIL (BIT(10)) - -#define PF_FLYING (BIT(11)) -#define PF_WEAPON_RETRACT (BIT(12)) -#define PF_PICKED_UP_AN_UZI (BIT(13)) -#define PF_CRAWLING (BIT(14)) -#define PF_CLIMBING (BIT(15)) -#define PF_SWIMMING (BIT(16)) -#define PF_DIVING (BIT(17)) -#define PF_DIVING_IN_LAVA (BIT(18)) -#define PF_TWO_UZI (BIT(19)) -#define PF_TURN_180 (BIT(21)) -#define PF_DEAD_HEAD (BIT(22)) // are your a dead head -#define PF_HEAD_CONTROL (BIT(23)) // have control of turning when a head? -#define PF_CLIP_CHEAT (BIT(24)) // cheat for wall clipping -#define PF_SLIDING (BIT(25)) // cheat for wall clipping -#define PF_VIEW_FROM_OUTSIDE (BIT(26)) -#define PF_VIEW_OUTSIDE_WEAPON (BIT(27)) -#define PF_VIEW_FROM_CAMERA (BIT(28)) -#define PF_TANK (BIT(29)) // Doin the tank thang -#define PF_MOUSE_AIMING_ON (BIT(30)) -#define PF_WEAPON_DOWN (BIT(31)) - -#define PF2_TELEPORTED (BIT(0)) -#define PF2_INPUT_CAN_TURN (BIT(1)) // Allow calling DoPlayerTurn from getinput -#define PF2_INPUT_CAN_AIM (BIT(2)) // Allow calling DoPlayerHorizon from getinput +enum +{ + PF_DEAD = (BIT(1)), + PF_JUMPING = (BIT(2)), + PF_FALLING = (BIT(3)), + PF_LOCK_CRAWL = (BIT(4)), + PF_LOCK_HORIZ = (BIT(5)), + PF_LOOKING = (BIT(6)), + PF_PLAYER_MOVED = (BIT(7)), + PF_PLAYER_RIDING = (BIT(8)), + PF_AUTO_AIM = (BIT(9)), + PF_RECOIL = (BIT(10)), + PF_FLYING = (BIT(11)), + PF_WEAPON_RETRACT = (BIT(12)), + PF_PICKED_UP_AN_UZI = (BIT(13)), + PF_CRAWLING = (BIT(14)), + PF_CLIMBING = (BIT(15)), + PF_SWIMMING = (BIT(16)), + PF_DIVING = (BIT(17)), + PF_DIVING_IN_LAVA = (BIT(18)), + PF_TWO_UZI = (BIT(19)), + PF_TURN_180 = (BIT(21)), + PF_DEAD_HEAD = (BIT(22)), // are your a dead head + PF_HEAD_CONTROL = (BIT(23)), // have control of turning when a head? + PF_CLIP_CHEAT = (BIT(24)), // cheat for wall clipping + PF_SLIDING = (BIT(25)), // cheat for wall clipping + PF_VIEW_FROM_OUTSIDE = (BIT(26)), + PF_VIEW_OUTSIDE_WEAPON= (BIT(27)), + PF_VIEW_FROM_CAMERA = (BIT(28)), + PF_TANK = (BIT(29)), // Doin the tank thang + PF_MOUSE_AIMING_ON = (BIT(30)), + PF_WEAPON_DOWN = (BIT(31)), + PF2_TELEPORTED = (BIT(0)), + PF2_INPUT_CAN_TURN = (BIT(1)), // Allow calling DoPlayerTurn from getinput + PF2_INPUT_CAN_AIM = (BIT(2)), // Allow calling DoPlayerHorizon from getinput +}; /////////////////////////////////////////////////////////////////////////////////////////// // diff --git a/source/sw/src/osdcmds.cpp b/source/sw/src/osdcmds.cpp index 5f32c248a..57b39136d 100644 --- a/source/sw/src/osdcmds.cpp +++ b/source/sw/src/osdcmds.cpp @@ -100,12 +100,6 @@ static int osdcmd_map(CCmdFuncPtr parm) return CCMD_OK; } -static int osdcmd_noclip(CCmdFuncPtr) -{ - C_DoCommand("activatecheat lwghost"); - return CCMD_OK; -} - int osdcmd_restartmap(CCmdFuncPtr) { C_DoCommand("activatecheat lwstart"); @@ -295,7 +289,6 @@ int32_t registerosdcommands(void) C_RegisterFunction("give","give : 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("noclip","noclip: toggles clipping mode", osdcmd_noclip); C_RegisterFunction("levelwarp", "levelwarp : warp to level", osdcmd_levelwarp); C_RegisterFunction("restartmap", "restartmap: restarts the current map", osdcmd_restartmap); C_RegisterFunction("warptocoords","warptocoords [x] [y] [z] [ang] (optional) [horiz] (optional): warps the player to the specified coordinates",osdcmd_warptocoords);