2015-05-19 21:54:34 +00:00
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
/*
|
|
|
|
Copyright (C) 1997, 2005 - 3D Realms Entertainment
|
|
|
|
|
|
|
|
This file is part of Shadow Warrior version 1.2
|
|
|
|
|
|
|
|
Shadow Warrior is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU General Public License
|
|
|
|
as published by the Free Software Foundation; either version 2
|
|
|
|
of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
Original Source: 1997 - Frank Maddin and Jim Norwood
|
|
|
|
Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
|
|
|
|
*/
|
|
|
|
//-------------------------------------------------------------------------
|
2019-11-17 17:02:17 +00:00
|
|
|
|
2019-10-09 16:09:05 +00:00
|
|
|
#include "ns.h"
|
|
|
|
|
2015-05-19 21:54:34 +00:00
|
|
|
#include "build.h"
|
|
|
|
|
|
|
|
#include "names2.h"
|
|
|
|
#include "panel.h"
|
|
|
|
#include "game.h"
|
|
|
|
#include "mytypes.h"
|
2020-08-05 22:18:45 +00:00
|
|
|
#include "misc.h"
|
2015-05-19 21:54:34 +00:00
|
|
|
|
2019-10-25 22:32:49 +00:00
|
|
|
#include "gamecontrol.h"
|
2019-12-09 20:19:05 +00:00
|
|
|
#include "gstrings.h"
|
2020-08-12 20:24:51 +00:00
|
|
|
#include "cheathandler.h"
|
2015-05-19 21:54:34 +00:00
|
|
|
//#include "inv.h"
|
|
|
|
|
2019-10-09 16:09:05 +00:00
|
|
|
BEGIN_SW_NS
|
2015-05-19 21:54:34 +00:00
|
|
|
|
2015-05-19 21:58:29 +00:00
|
|
|
SWBOOL CheatInputMode = FALSE;
|
|
|
|
SWBOOL EveryCheat = FALSE;
|
2020-03-01 15:33:06 +00:00
|
|
|
SWBOOL mapcheat = false;
|
2020-08-12 20:24:51 +00:00
|
|
|
extern SWBOOL FAF_DebugView;
|
2015-05-19 21:54:34 +00:00
|
|
|
|
2019-11-17 17:02:17 +00:00
|
|
|
const char *CheatKeyType;
|
|
|
|
void KeysCheat(PLAYERp pp, const char *cheat_string);
|
|
|
|
|
2020-08-12 20:24:51 +00:00
|
|
|
static PLAYERp checkCheat(cheatseq_t* c)
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
2020-08-12 20:24:51 +00:00
|
|
|
if (CommEnabled)
|
|
|
|
return nullptr;
|
2015-05-19 21:54:34 +00:00
|
|
|
|
2020-08-12 20:24:51 +00:00
|
|
|
if (Skill >= 3 && !c->DontCheck)
|
|
|
|
{
|
|
|
|
PutStringInfo(&Player[screenpeek], GStrings("TXTS_TOOSKILLFUL"));
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
return &Player[screenpeek];
|
2015-05-19 21:54:34 +00:00
|
|
|
}
|
|
|
|
|
2020-08-12 20:24:51 +00:00
|
|
|
bool RestartCheat(cheatseq_t* c)
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
2020-08-12 20:24:51 +00:00
|
|
|
if (!checkCheat(c)) return false;
|
2015-05-19 21:54:34 +00:00
|
|
|
ExitLevel = TRUE;
|
2020-08-12 20:24:51 +00:00
|
|
|
return true;
|
2015-05-19 21:54:34 +00:00
|
|
|
}
|
|
|
|
|
2020-08-12 20:24:51 +00:00
|
|
|
bool RoomCheat(cheatseq_t* c)
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
|
|
|
FAF_DebugView ^= 1;
|
2020-08-12 20:24:51 +00:00
|
|
|
return true;
|
2015-05-19 21:54:34 +00:00
|
|
|
}
|
|
|
|
|
2020-08-12 20:24:51 +00:00
|
|
|
bool NextCheat(cheatseq_t* c)
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
2020-08-12 20:24:51 +00:00
|
|
|
if (!checkCheat(c)) return false;
|
2015-05-19 21:54:34 +00:00
|
|
|
Level++;
|
|
|
|
ExitLevel = TRUE;
|
2020-08-12 20:24:51 +00:00
|
|
|
return true;
|
2015-05-19 21:54:34 +00:00
|
|
|
}
|
|
|
|
|
2020-08-12 20:24:51 +00:00
|
|
|
bool PrevCheat(cheatseq_t* c)
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
2020-08-12 20:24:51 +00:00
|
|
|
if (!checkCheat(c)) return false;
|
2015-05-19 21:54:34 +00:00
|
|
|
Level--;
|
|
|
|
ExitLevel = TRUE;
|
2020-08-12 20:24:51 +00:00
|
|
|
return true;
|
2015-05-19 21:54:34 +00:00
|
|
|
}
|
|
|
|
|
2020-08-12 20:24:51 +00:00
|
|
|
bool MapCheat(cheatseq_t* c)
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
2020-08-12 20:24:51 +00:00
|
|
|
PLAYERp pp;
|
|
|
|
if (!(pp=checkCheat(c))) return false;
|
2020-03-01 15:33:06 +00:00
|
|
|
mapcheat = !mapcheat;
|
2019-12-31 21:05:23 +00:00
|
|
|
// Need to do this differently. The code here was completely broken.
|
2020-03-01 15:33:06 +00:00
|
|
|
PutStringInfo(pp, GStrings(mapcheat ? "TXT_AMON" : "TXT_AMOFF"));
|
2020-08-12 20:24:51 +00:00
|
|
|
return true;
|
2015-05-19 21:54:34 +00:00
|
|
|
}
|
|
|
|
|
2020-08-12 20:24:51 +00:00
|
|
|
bool LocCheat(cheatseq_t* c)
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
2020-08-12 20:24:51 +00:00
|
|
|
if (!checkCheat(c)) return false;
|
2015-05-19 21:58:29 +00:00
|
|
|
extern SWBOOL LocationInfo;
|
2015-05-19 21:54:34 +00:00
|
|
|
LocationInfo++;
|
|
|
|
if (LocationInfo > 2)
|
|
|
|
LocationInfo = 0;
|
2020-08-12 20:24:51 +00:00
|
|
|
return true;
|
2015-05-19 21:54:34 +00:00
|
|
|
}
|
|
|
|
|
2020-08-12 20:24:51 +00:00
|
|
|
bool WeaponCheat(cheatseq_t* c)
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
2020-08-12 20:24:51 +00:00
|
|
|
if (!checkCheat(c)) return false;
|
2015-05-19 21:54:34 +00:00
|
|
|
PLAYERp p;
|
|
|
|
short pnum;
|
|
|
|
unsigned int i;
|
|
|
|
USERp u;
|
|
|
|
|
|
|
|
TRAVERSE_CONNECT(pnum)
|
|
|
|
{
|
|
|
|
p = &Player[pnum];
|
|
|
|
u = User[p->PlayerSprite];
|
|
|
|
|
2019-11-30 06:10:58 +00:00
|
|
|
if (!TEST(p->Flags, PF_TWO_UZI))
|
|
|
|
{
|
|
|
|
SET(p->Flags, PF_TWO_UZI);
|
|
|
|
SET(p->Flags, PF_PICKED_UP_AN_UZI);
|
|
|
|
}
|
|
|
|
|
2015-05-19 21:54:34 +00:00
|
|
|
// ALL WEAPONS
|
|
|
|
if (!SW_SHAREWARE)
|
|
|
|
p->WpnFlags = 0xFFFFFFFF;
|
|
|
|
else
|
|
|
|
p->WpnFlags = 0x0000207F; // Disallows high weapon cheat in shareware
|
|
|
|
|
|
|
|
for (i = 0; i < SIZ(p->WpnAmmo); i++)
|
|
|
|
{
|
|
|
|
p->WpnAmmo[i] = DamageData[i].max_ammo;
|
|
|
|
}
|
|
|
|
|
2020-01-23 17:55:37 +00:00
|
|
|
p->WpnShotgunAuto = 50;
|
|
|
|
p->WpnRocketHeat = 5;
|
|
|
|
p->WpnRocketNuke = 1;
|
|
|
|
|
|
|
|
PlayerUpdateWeapon(p, u->WeaponNum);
|
|
|
|
}
|
2020-08-12 20:24:51 +00:00
|
|
|
return true;
|
2020-01-23 17:55:37 +00:00
|
|
|
}
|
|
|
|
|
2020-08-12 20:24:51 +00:00
|
|
|
bool AmmoCheat(cheatseq_t* c)
|
2020-01-23 17:55:37 +00:00
|
|
|
{
|
2020-08-12 20:24:51 +00:00
|
|
|
if (!checkCheat(c)) return false;
|
2020-01-23 17:55:37 +00:00
|
|
|
PLAYERp p;
|
|
|
|
short pnum;
|
|
|
|
unsigned int i;
|
|
|
|
USERp u;
|
|
|
|
|
|
|
|
TRAVERSE_CONNECT(pnum)
|
|
|
|
{
|
|
|
|
p = &Player[pnum];
|
|
|
|
u = User[p->PlayerSprite];
|
|
|
|
|
|
|
|
p->WpnShotgunAuto = 50;
|
|
|
|
p->WpnRocketHeat = 5;
|
|
|
|
p->WpnRocketNuke = 1;
|
|
|
|
|
|
|
|
for (i = 0; i < SIZ(p->WpnAmmo); i++)
|
|
|
|
{
|
|
|
|
p->WpnAmmo[i] = DamageData[i].max_ammo;
|
|
|
|
}
|
|
|
|
|
2015-05-19 21:54:34 +00:00
|
|
|
PlayerUpdateWeapon(p, u->WeaponNum);
|
|
|
|
}
|
2020-08-12 20:24:51 +00:00
|
|
|
return true;
|
2015-05-19 21:54:34 +00:00
|
|
|
}
|
|
|
|
|
2020-08-12 20:24:51 +00:00
|
|
|
bool GodCheat(cheatseq_t* c)
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
2020-08-12 20:24:51 +00:00
|
|
|
PLAYERp pp;
|
|
|
|
if (!(pp = checkCheat(c))) return false;
|
2015-05-19 21:54:34 +00:00
|
|
|
//
|
|
|
|
// GOD mode
|
|
|
|
//
|
|
|
|
GodMode ^= 1;
|
|
|
|
|
2019-12-09 20:19:05 +00:00
|
|
|
PutStringInfo(pp, GStrings(GodMode? "GOD MODE: ON" : "GOD MODE: OFF"));
|
2020-08-12 20:24:51 +00:00
|
|
|
return true;
|
2015-05-19 21:54:34 +00:00
|
|
|
}
|
|
|
|
|
2020-08-12 20:24:51 +00:00
|
|
|
bool ClipCheat(cheatseq_t* c)
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
2020-08-12 20:24:51 +00:00
|
|
|
PLAYERp pp;
|
|
|
|
if (!(pp = checkCheat(c))) return false;
|
2015-05-19 21:54:34 +00:00
|
|
|
FLIP(pp->Flags, PF_CLIP_CHEAT);
|
2020-08-12 20:24:51 +00:00
|
|
|
PutStringInfo(pp, GStrings(TEST(pp->Flags, PF_CLIP_CHEAT) ? "CLIPPING: OFF" : "CLIPPING: ON"));
|
|
|
|
return true;
|
2015-05-19 21:54:34 +00:00
|
|
|
}
|
|
|
|
|
2020-08-12 20:24:51 +00:00
|
|
|
bool WarpCheat(cheatseq_t* c)
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
2020-08-12 20:24:51 +00:00
|
|
|
PLAYERp pp;
|
|
|
|
if (!(pp = checkCheat(c))) return false;
|
2015-05-19 21:54:34 +00:00
|
|
|
int level_num;
|
|
|
|
|
2020-08-12 20:24:51 +00:00
|
|
|
level_num = atol((char*)c->Args);
|
2015-05-19 21:54:34 +00:00
|
|
|
|
2020-03-06 15:49:55 +00:00
|
|
|
//int episode_num;
|
2015-05-19 21:54:34 +00:00
|
|
|
//DSPRINTF(ds,"ep %d, lev %d",episode_num, level_num);
|
|
|
|
//MONO_PRINT(ds);
|
|
|
|
|
2020-08-12 20:24:51 +00:00
|
|
|
if (!pp) return true;
|
2015-05-19 21:54:34 +00:00
|
|
|
if (!SW_SHAREWARE)
|
|
|
|
{
|
|
|
|
if (level_num > 28 || level_num < 1)
|
2020-08-12 20:24:51 +00:00
|
|
|
return false;
|
2015-05-19 21:54:34 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (level_num > 4 || level_num < 1)
|
2020-08-12 20:24:51 +00:00
|
|
|
return false;
|
2015-05-19 21:54:34 +00:00
|
|
|
}
|
2020-02-13 23:37:15 +00:00
|
|
|
if (TEST(pp->Flags, PF_DEAD))
|
2020-08-12 20:24:51 +00:00
|
|
|
return true;
|
2020-02-13 23:37:15 +00:00
|
|
|
|
2015-05-19 21:54:34 +00:00
|
|
|
|
|
|
|
Level = level_num;
|
|
|
|
ExitLevel = TRUE;
|
|
|
|
|
2019-12-09 20:19:05 +00:00
|
|
|
sprintf(ds, "%s %1d", GStrings("TXT_ENTERING"), Level);
|
2015-05-19 21:54:34 +00:00
|
|
|
PutStringInfo(pp, ds);
|
2020-08-12 20:24:51 +00:00
|
|
|
return true;
|
2015-05-19 21:54:34 +00:00
|
|
|
}
|
|
|
|
|
2020-08-12 20:24:51 +00:00
|
|
|
bool ItemCheat(cheatseq_t* c)
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
2020-08-12 20:24:51 +00:00
|
|
|
PLAYERp pp;
|
|
|
|
if (!(pp = checkCheat(c))) return false;
|
2015-05-19 21:54:34 +00:00
|
|
|
//
|
|
|
|
// Get all ITEMS
|
|
|
|
//
|
|
|
|
PLAYERp p;
|
|
|
|
short pnum;
|
|
|
|
short inv;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
PutStringInfo(pp, "ITEMS");
|
|
|
|
|
|
|
|
TRAVERSE_CONNECT(pnum)
|
|
|
|
{
|
|
|
|
p = &Player[pnum];
|
|
|
|
memset(p->HasKey, TRUE, sizeof(p->HasKey));
|
|
|
|
|
|
|
|
p->WpnShotgunAuto = 50;
|
|
|
|
p->WpnRocketHeat = 5;
|
|
|
|
p->WpnRocketNuke = 1;
|
|
|
|
p->Armor = 100;
|
|
|
|
|
|
|
|
for (inv = 0; inv < MAX_INVENTORY; inv++)
|
|
|
|
{
|
|
|
|
p->InventoryPercent[inv] = 100;
|
|
|
|
//p->InventoryAmount[inv] = 1;
|
|
|
|
p->InventoryAmount[inv] = InventoryData[inv].MaxInv;
|
|
|
|
//PlayerUpdateInventory(p, inv);
|
|
|
|
}
|
|
|
|
|
|
|
|
PlayerUpdateInventory(p, p->InventoryNum);
|
|
|
|
//p->InventoryNum = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i=0; i<numsectors; i++)
|
|
|
|
{
|
|
|
|
if (SectUser[i] && SectUser[i]->stag == SECT_LOCK_DOOR)
|
|
|
|
SectUser[i]->number = 0; // unlock all doors of this type
|
|
|
|
}
|
|
|
|
|
2020-08-12 20:24:51 +00:00
|
|
|
WeaponCheat(c);
|
|
|
|
return true;
|
2015-05-19 21:54:34 +00:00
|
|
|
}
|
|
|
|
|
2020-08-12 20:24:51 +00:00
|
|
|
bool InventoryCheat(cheatseq_t* c)
|
2020-01-23 17:55:37 +00:00
|
|
|
{
|
2020-08-12 20:24:51 +00:00
|
|
|
PLAYERp pp;
|
|
|
|
if (!(pp = checkCheat(c))) return false;
|
2020-01-23 17:55:37 +00:00
|
|
|
//
|
|
|
|
// Get all ITEMS
|
|
|
|
//
|
|
|
|
PLAYERp p;
|
|
|
|
short pnum;
|
|
|
|
short inv;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
PutStringInfo(pp, "INVENTORY");
|
|
|
|
|
|
|
|
TRAVERSE_CONNECT(pnum)
|
|
|
|
{
|
|
|
|
p = &Player[pnum];
|
|
|
|
|
|
|
|
p->WpnShotgunAuto = 50;
|
|
|
|
p->WpnRocketHeat = 5;
|
|
|
|
p->WpnRocketNuke = 1;
|
|
|
|
p->Armor = 100;
|
|
|
|
|
|
|
|
for (inv = 0; inv < MAX_INVENTORY; inv++)
|
|
|
|
{
|
|
|
|
p->InventoryPercent[inv] = 100;
|
|
|
|
//p->InventoryAmount[inv] = 1;
|
|
|
|
p->InventoryAmount[inv] = InventoryData[inv].MaxInv;
|
|
|
|
//PlayerUpdateInventory(p, inv);
|
|
|
|
}
|
|
|
|
|
|
|
|
PlayerUpdateInventory(p, p->InventoryNum);
|
|
|
|
//p->InventoryNum = 0;
|
|
|
|
}
|
2020-08-12 20:24:51 +00:00
|
|
|
return true;
|
2020-01-23 17:55:37 +00:00
|
|
|
}
|
|
|
|
|
2020-08-12 20:24:51 +00:00
|
|
|
bool ArmorCheat(cheatseq_t* c)
|
2020-01-23 17:55:37 +00:00
|
|
|
{
|
2020-08-12 20:24:51 +00:00
|
|
|
PLAYERp pp;
|
|
|
|
if (!(pp = checkCheat(c))) return false;
|
2020-01-23 17:55:37 +00:00
|
|
|
short pnum;
|
|
|
|
const char *str = nullptr;
|
|
|
|
|
|
|
|
TRAVERSE_CONNECT(pnum)
|
|
|
|
{
|
|
|
|
if (User[Player[pnum].PlayerSprite]->Health < pp->MaxHealth)
|
|
|
|
str = "ARMOR";
|
|
|
|
Player[pnum].Armor = 100;
|
|
|
|
}
|
|
|
|
if (str) PutStringInfo(pp, GStrings(str));
|
2020-08-12 20:24:51 +00:00
|
|
|
return true;
|
2020-01-23 17:55:37 +00:00
|
|
|
}
|
|
|
|
|
2020-08-12 20:24:51 +00:00
|
|
|
bool HealCheat(cheatseq_t* c)
|
2019-11-17 17:02:17 +00:00
|
|
|
{
|
2020-08-12 20:24:51 +00:00
|
|
|
PLAYERp pp;
|
|
|
|
if (!(pp = checkCheat(c))) return false;
|
2019-11-17 17:02:17 +00:00
|
|
|
short pnum;
|
2019-12-09 20:19:05 +00:00
|
|
|
const char *str = nullptr;
|
2019-11-17 17:02:17 +00:00
|
|
|
|
|
|
|
TRAVERSE_CONNECT(pnum)
|
|
|
|
{
|
|
|
|
if (User[Player[pnum].PlayerSprite]->Health < pp->MaxHealth)
|
2019-12-09 20:19:05 +00:00
|
|
|
str = "TXTS_ADDEDHEALTH";
|
2019-11-17 17:02:17 +00:00
|
|
|
User[Player[pnum].PlayerSprite]->Health += 25;
|
|
|
|
}
|
2019-12-09 20:19:05 +00:00
|
|
|
if (str) PutStringInfo(pp, GStrings(str));
|
2020-08-12 20:24:51 +00:00
|
|
|
return true;
|
2019-11-17 17:02:17 +00:00
|
|
|
}
|
|
|
|
|
2020-08-12 20:24:51 +00:00
|
|
|
bool KeyCheat(cheatseq_t* c)
|
2019-11-17 17:02:17 +00:00
|
|
|
{
|
2020-08-12 20:24:51 +00:00
|
|
|
PLAYERp pp;
|
|
|
|
if (!(pp = checkCheat(c))) return false;
|
2019-11-17 17:02:17 +00:00
|
|
|
// Get KEYS
|
|
|
|
PLAYERp p;
|
|
|
|
short pnum;
|
2020-08-12 20:24:51 +00:00
|
|
|
const char *cp = (char*)c->Args;
|
2019-12-09 20:19:05 +00:00
|
|
|
const char *str = "TXT_GIVEKEY";
|
2019-11-17 17:02:17 +00:00
|
|
|
int keynum = 0;
|
|
|
|
|
|
|
|
keynum = atol(cp);
|
|
|
|
|
|
|
|
TRAVERSE_CONNECT(pnum)
|
|
|
|
{
|
|
|
|
p = &Player[pnum];
|
2020-08-12 20:24:51 +00:00
|
|
|
if (keynum >= 1 && keynum <= 8)
|
2019-11-17 17:02:17 +00:00
|
|
|
{
|
|
|
|
if (p->HasKey[keynum-1] == FALSE)
|
|
|
|
{
|
|
|
|
p->HasKey[keynum-1] = TRUE; // cards: 0=red 1=blue 2=green 3=yellow | keys: 4=gold 5=silver 6=bronze 7=red
|
2019-12-09 20:19:05 +00:00
|
|
|
str = "TXT_KEYGIVEN";
|
2019-11-17 17:02:17 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
p->HasKey[keynum-1] = FALSE;
|
2019-12-09 20:19:05 +00:00
|
|
|
str = "TXT_KEYREMOVED";
|
2019-11-17 17:02:17 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-12-09 20:19:05 +00:00
|
|
|
PutStringInfo(pp, GStrings(str));
|
2020-08-12 20:24:51 +00:00
|
|
|
return true;
|
2019-11-17 17:02:17 +00:00
|
|
|
}
|
|
|
|
|
2020-08-12 20:24:51 +00:00
|
|
|
bool KeysCheat(cheatseq_t* c)
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
2020-08-12 20:24:51 +00:00
|
|
|
PLAYERp pp;
|
|
|
|
if (!(pp = checkCheat(c))) return false;
|
|
|
|
// Get KEYS
|
|
|
|
PLAYERp p;
|
|
|
|
short pnum;
|
|
|
|
const char* str = "TXT_GIVEKEY";
|
|
|
|
int keynum = 0;
|
2015-05-19 21:54:34 +00:00
|
|
|
|
2020-08-12 20:24:51 +00:00
|
|
|
TRAVERSE_CONNECT(pnum)
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
2020-08-12 20:24:51 +00:00
|
|
|
p = &Player[pnum];
|
|
|
|
memset(p->HasKey, TRUE, sizeof(p->HasKey));
|
2015-05-19 21:54:34 +00:00
|
|
|
}
|
2020-08-12 20:24:51 +00:00
|
|
|
PutStringInfo(pp, GStrings(str));
|
|
|
|
return true;
|
2015-05-19 21:54:34 +00:00
|
|
|
}
|
|
|
|
|
2020-08-12 20:24:51 +00:00
|
|
|
bool EveryCheatToggle(cheatseq_t* c)
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
2020-08-12 20:24:51 +00:00
|
|
|
EveryCheat ^= 1;
|
|
|
|
return WeaponCheat(c) && GodCheat(c) && ItemCheat(c);
|
|
|
|
}
|
2015-05-19 21:54:34 +00:00
|
|
|
|
|
|
|
|
2020-08-12 20:24:51 +00:00
|
|
|
static cheatseq_t swcheats[] = {
|
|
|
|
{"swgod", GodCheat, 0},
|
|
|
|
{"swchan", GodCheat, 0},
|
|
|
|
{"swgimme", ItemCheat, 0},
|
|
|
|
{"swmedic", HealCheat, 0},
|
|
|
|
{"swkey#", KeyCheat, 0},
|
|
|
|
{"swkeys", KeysCheat, 0},
|
|
|
|
{"swammo", AmmoCheat, 0},
|
|
|
|
{"swarmor", ArmorCheat, 0},
|
|
|
|
{"switems", ItemCheat, 0},
|
|
|
|
{"swguns", WeaponCheat, 0},
|
2015-05-19 21:54:34 +00:00
|
|
|
{"swtrek##", WarpCheat, 0},
|
|
|
|
{"swgreed", EveryCheatToggle, 0},
|
2020-08-12 20:24:51 +00:00
|
|
|
{"swghost", ClipCheat, 0},
|
2015-05-19 21:54:34 +00:00
|
|
|
{"swstart", RestartCheat, 0},
|
|
|
|
{"swloc", LocCheat, 0},
|
|
|
|
{"swmap", MapCheat, 0},
|
2020-08-12 20:24:51 +00:00
|
|
|
{"swroom", RoomCheat, true}, // Room above room dbug
|
2015-05-19 21:54:34 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2020-08-12 20:24:51 +00:00
|
|
|
void InitCheats()
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
2020-08-12 20:24:51 +00:00
|
|
|
SetCheats(swcheats, countof(swcheats));
|
2015-05-19 21:54:34 +00:00
|
|
|
}
|
2020-08-12 20:24:51 +00:00
|
|
|
|
2019-10-09 16:09:05 +00:00
|
|
|
END_SW_NS
|