|
Odamex
Setting the Standard in Multiplayer Doom
|
00001 // Emacs style mode select -*- C++ -*- 00002 //----------------------------------------------------------------------------- 00003 // 00004 // $Id: m_cheat.h 1788 2010-08-24 04:42:57Z russellrice $ 00005 // 00006 // Copyright (C) 1993-1996 by id Software, Inc. 00007 // Copyright (C) 2006-2010 by The Odamex Team. 00008 // 00009 // This program is free software; you can redistribute it and/or 00010 // modify it under the terms of the GNU General Public License 00011 // as published by the Free Software Foundation; either version 2 00012 // of the License, or (at your option) any later version. 00013 // 00014 // This program is distributed in the hope that it will be useful, 00015 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00017 // GNU General Public License for more details. 00018 // 00019 // DESCRIPTION: 00020 // Cheat code checking. 00021 // 00022 //----------------------------------------------------------------------------- 00023 00024 00025 #ifndef __M_CHEAT_H__ 00026 #define __M_CHEAT_H__ 00027 00028 // 00029 // CHEAT SEQUENCE PACKAGE 00030 // 00031 00032 #define SCRAMBLE(a) \ 00033 ((((a)&1)<<7) + (((a)&2)<<5) + ((a)&4) + (((a)&8)<<1) \ 00034 + (((a)&16)>>1) + ((a)&32) + (((a)&64)>>5) + (((a)&128)>>7)) 00035 00036 typedef struct 00037 { 00038 unsigned char *sequence; 00039 unsigned char *p; 00040 00041 } cheatseq_t; 00042 00043 int cht_CheckCheat (cheatseq_t *cht, char key); 00044 00045 void cht_GetParam (cheatseq_t *cht, char *buffer); 00046 00047 // [RH] Functions that actually perform the cheating 00048 class player_s; 00049 void cht_DoCheat (player_s *player, int cheat); 00050 void cht_Give (player_s *player, const char *item); 00051 void cht_Suicide (player_s *player); 00052 00053 #endif 00054 00055