| 1 | /* |
| 2 | * Descent 3 |
| 3 | * Copyright (C) 2024 Parallax Software |
| 4 | * |
| 5 | * This program is free software: you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License as published by |
| 7 | * the Free Software Foundation, either version 3 of the License, or |
| 8 | * (at your option) any later version. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 17 | |
| 18 | --- HISTORICAL COMMENTS FOLLOW --- |
| 19 | |
| 20 | * $Logfile: /DescentIII/Main/GameCheat.cpp $ |
| 21 | * $Revision: 32 $ |
| 22 | * $Date: 10/20/99 5:40p $ |
| 23 | * $Author: Chris $ |
| 24 | * |
| 25 | * Code for in-game cheats |
| 26 | * |
| 27 | * $Log: /DescentIII/Main/GameCheat.cpp $ |
| 28 | * |
| 29 | * 32 10/20/99 5:40p Chris |
| 30 | * Added the Red Guidebot |
| 31 | * |
| 32 | * 31 7/15/99 6:38p Jeff |
| 33 | * added outlinemode cheat code and rendering stats cheat |
| 34 | * |
| 35 | * 30 5/21/99 10:43p Jeff |
| 36 | * don't delete guidebot on kill robots cheat |
| 37 | * |
| 38 | * 29 5/10/99 1:00a Jeff |
| 39 | * release cheat codes |
| 40 | * |
| 41 | * 28 5/09/99 10:48p Jason |
| 42 | * change game cheats slightly |
| 43 | * |
| 44 | * 27 5/04/99 9:27p Jeff |
| 45 | * quad super lasers on cheat |
| 46 | * |
| 47 | * 26 5/04/99 8:45p Jeff |
| 48 | * quad super lasers on cheat |
| 49 | * |
| 50 | * 25 5/01/99 12:53a Jeff |
| 51 | * made fullmap cheat a 'cheater' cheat |
| 52 | * |
| 53 | * 24 4/30/99 8:31p Jeff |
| 54 | * added fullmap cheat |
| 55 | * |
| 56 | * 23 4/19/99 12:09a Matt |
| 57 | * Added Teletubbies cheat. |
| 58 | * |
| 59 | * 22 3/05/99 5:36p Kevin |
| 60 | * Changed framrate cheat back to 'frametime' |
| 61 | * |
| 62 | * 21 3/04/99 7:08p Jeff |
| 63 | * only give max ammo on weapon cheat |
| 64 | * |
| 65 | * 20 3/04/99 3:20p Jeff |
| 66 | * include only whats allowed for oem |
| 67 | * |
| 68 | * 19 3/03/99 4:07p Jeff |
| 69 | * new oem cheat codes |
| 70 | * |
| 71 | * 18 2/28/99 9:28p Jeff |
| 72 | * |
| 73 | * 17 2/24/99 11:21a Jason |
| 74 | * Fixed bugs for OEM build |
| 75 | * |
| 76 | * 16 2/10/99 6:55p Jeff |
| 77 | * added proxmines to the game |
| 78 | * |
| 79 | * 15 2/02/99 8:43a Chris |
| 80 | * I made buildings with AI work correctly (ie really big robots should be |
| 81 | * buildings) |
| 82 | * anim to and from states are now shorts instead of bytes |
| 83 | * |
| 84 | * 14 1/31/99 7:25p Matt |
| 85 | * Renamed a bunch of functions to have HUD capitalized |
| 86 | * |
| 87 | * 13 1/29/99 2:08p Jeff |
| 88 | * localization |
| 89 | * |
| 90 | * 12 1/21/99 11:15p Jeff |
| 91 | * pulled out some structs and defines from header files and moved them |
| 92 | * into seperate header files so that multiplayer dlls don't require major |
| 93 | * game headers, just those new headers. Side effect is a shorter build |
| 94 | * time. Also cleaned up some header file #includes that weren't needed. |
| 95 | * This affected polymodel.h, object.h, player.h, vecmat.h, room.h, |
| 96 | * manage.h and multi.h |
| 97 | * |
| 98 | * 11 12/15/98 4:28p Jeff |
| 99 | * added mission data information to the pilot files to save what the |
| 100 | * highest level they achieved on a mission is. Added level select dialog |
| 101 | * (not hooked up) and level warp cheat. |
| 102 | * |
| 103 | * 10 12/11/98 10:36a Jason |
| 104 | * fixed external |
| 105 | * |
| 106 | * 9 10/20/98 6:33p Jeff |
| 107 | * added cool texture cheat (badtexture) |
| 108 | * |
| 109 | * 8 10/19/98 10:23p Jeff |
| 110 | * added cheats to start/stop rt log profiling |
| 111 | * |
| 112 | * 7 10/19/98 7:18p Matt |
| 113 | * Added system to support different types of damage to the player and |
| 114 | * have these different types make different sounds. |
| 115 | * |
| 116 | * 6 10/18/98 9:24p Jeff |
| 117 | * fixed frametime cheat |
| 118 | * |
| 119 | * 5 10/17/98 6:08p Jeff |
| 120 | * weapon cheat gives quad |
| 121 | * |
| 122 | * 4 10/15/98 1:32p Jeff |
| 123 | * added suicide cheat |
| 124 | * |
| 125 | * 3 10/14/98 1:02p Jason |
| 126 | * fixed FindSoundName issues |
| 127 | * |
| 128 | * 2 10/11/98 3:01a Jeff |
| 129 | * moved from TelCom into here |
| 130 | * |
| 131 | * $NoKeywords: $ |
| 132 | */ |
| 133 | |
| 134 | #include "player.h"cxx . . $ `<file>/Descent3/player.h`/ |
| 135 | #include "object.h"cxx . . $ `<file>/Descent3/object.h`/ |
| 136 | #include "hud.h"cxx . . $ `<file>/Descent3/hud.h`/ |
| 137 | #include "weapon.h"cxx . . $ `<file>/Descent3/weapon.h`/ |
| 138 | #include "hlsoundlib.h"cxx . . $ `<file>/sndlib/hlsoundlib.h`/ |
| 139 | #include "game.h"cxx . . $ `<file>/Descent3/game.h`/ |
| 140 | #include "ddio.h"cxx . . $ `<file>/ddio/ddio.h`/ |
| 141 | #include "soundload.h"cxx . . $ `<file>/sndlib/soundload.h`/ |
| 142 | #include "sounds.h"cxx . . $ `<file>/Descent3/sounds.h`/ |
| 143 | #include "damage.h"cxx . . $ `<file>/Descent3/damage.h`/ |
| 144 | #include "rtperformance.h"cxx . . $ `<file>/rtperformance/rtperformance.h`/ |
| 145 | #include "object_lighting.h"cxx . . $ `<file>/Descent3/object_lighting.h`/ |
| 146 | #include "gamesequence.h"cxx . . $ `<file>/Descent3/gamesequence.h`/ |
| 147 | #include "multi.h"cxx . . $ `<file>/Descent3/multi.h`/ |
| 148 | #include "stringtable.h"cxx . . $ `<file>/Descent3/stringtable.h`/ |
| 149 | #include "ship.h"cxx . . $ `<file>/Descent3/ship.h`/ |
| 150 | #include "render.h"cxx . . $ `<file>/Descent3/render.h`/ |
| 151 | #include "renderer.h"cxx . . $ `<file>/lib/renderer.h`/ |
| 152 | |
| 153 | #define CHEATSPOTcxx . . $ `Descent3/GameCheat.cpp:153:9`! 14 |
| 154 | bool IsCheatercxx . . $ IsCheater. = false; |
| 155 | bool Display_renderer_statscxx . . $ Display_renderer_stats. = false; |
| 156 | uint8_tcxx . . $ uint8_t# Outline_release_modecxx . . $ Outline_release_mode. = 0; |
| 157 | |
| 158 | char CheatBuffercxx . . $ CheatBuffer.[] = "AAAAAAAAAAAAAAA"; |
| 159 | char OldCheatBuffercxx . . $ OldCheatBuffer.[] = "AAAAAAAAAAAAAAA"; |
| 160 | extern bool Force_one_texturecxx . . $ Force_one_texture.; |
| 161 | extern uint8_tcxx . . $ uint8_t# AutomapVisMapcxx . . $ AutomapVisMap.[MAX_ROOMScxx . . $ `Descent3/room.h:377:9`!]; |
| 162 | |
| 163 | const char *LamerCheatscxx . . $ LamerCheats.[] = { |
| 164 | "?E9FI=()", // gabbagabbahey |
| 165 | "=-OQESN1", // motherlode |
| 166 | "C<G2DAIV", // zingermans |
| 167 | "%>OQB9T@", // eatangelos |
| 168 | ",/,JCQ/7", // alifalafel |
| 169 | "-4ACVPFF", // delshiftb |
| 170 | "-JQ\"B(F$", // farmerjoe |
| 171 | "TIHB;B&H", // freespace |
| 172 | "=!9:S>!?", // gowingnut |
| 173 | ":3FGG1MP", // honestbob |
| 174 | "$'R&?FTU", // rockrgrl |
| 175 | "EP=$>I<%", // blimpiebest |
| 176 | "#+'T50IS", // mightyaphrodite |
| 177 | "J4D!JG56", // freeitup |
| 178 | "-KAM'<VQ", // yummyfunyon |
| 179 | "=8AB4C8=", // longchimp |
| 180 | "AVAC>2:)", // zodisgod |
| 181 | "U1/C;>AH", // chowyunfat |
| 182 | "JRF0H(!P", // phantasm |
| 183 | "!@3/L5KE", // blackdove |
| 184 | "F1*GOG2(", // mortality |
| 185 | "6\"BI<-BE", // monkeydance |
| 186 | "#/;=3J8F", // nosferatu |
| 187 | "J#.DEJCT", // pandorasbox |
| 188 | }; |
| 189 | #define N_LAMER_CHEATScxx . . $ `Descent3/GameCheat.cpp:189:9`! (sizeof(LamerCheats) / sizeof(*LamerCheats)) |
| 190 | |
| 191 | /* |
| 192 | Demo Cheat Codes |
| 193 | ================ |
| 194 | BLIMPIEBEST = all weapons |
| 195 | MIGHTYAPHRODITE = cloak on/off |
| 196 | FREEITUP = all robots dead |
| 197 | YUMMYFUNYON = invulnerable on/off |
| 198 | FRAMETIME = framerate |
| 199 | LONGCHIMP = 3rd person view |
| 200 | BADTEXTURE = destroy all textures, use bad bitmap |
| 201 | ZODISGOD = suicide |
| 202 | */ |
| 203 | |
| 204 | /* |
| 205 | OEM Cheat Codes |
| 206 | =============== |
| 207 | CHOWYUNFAT = all weapons |
| 208 | PHANTASM = cloak on/off |
| 209 | BLACKDOVE = all robots dead |
| 210 | MORTALITY = invulnerable on/off |
| 211 | MRSHOWBIZ = framerate |
| 212 | MONKEYDANCE = 3rd person view |
| 213 | GARBARGE = destroy all textures, use bad bitmap |
| 214 | NOSFERATU = suicide |
| 215 | PANDORASBOX = level warp |
| 216 | */ |
| 217 | |
| 218 | /* |
| 219 | Release Cheat Codes |
| 220 | =================== |
| 221 | IVEGOTIT = all weapons |
| 222 | TESTICUS = cloak on/off |
| 223 | DEADOFNIGHT = all robots dead |
| 224 | BURGERGOD = invulnerable on/off |
| 225 | FRAMELENGTH = framerate |
| 226 | BYEBYEMONKEY = 3rd person view |
| 227 | SHENANIGANS = destroy all textures, use bad bitmap |
| 228 | TUBERACER = suicide |
| 229 | MORECLANG = level warp |
| 230 | TELETUBBIES = TeletubbiesCheat |
| 231 | TREESQUID = Fullmap |
| 232 | RENDERSTAT = Rendering stats |
| 233 | OUTLINEM = Cycle outline modes |
| 234 | */ |
| 235 | |
| 236 | // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
| 237 | // NOTE TO ADD A CHEATCODE |
| 238 | // GRAB THE LATEST VERSION OF WINCRYPT FROM JEFF |
| 239 | // BELOW, ONLY THE FIRST QUOTED STRING PER CHEAT MATTERS |
| 240 | // THE OTHER QUOTED STRINGS ARE TO TOSS THE HACKERS |
| 241 | // SOME FUN. |
| 242 | // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
| 243 | const char *WeaponsCheatcxx . . $ WeaponsCheat. = "BH;URJH," |
| 244 | "8DS#"; |
| 245 | const char *CloakCheatcxx . . $ CloakCheat. = "L_QM[=^)" |
| 246 | "@-:!("; |
| 247 | const char *KillRobotsCheatcxx . . $ KillRobotsCheat. = "KMGKKG4D" |
| 248 | "~"; |
| 249 | const char *InvulnCheatcxx . . $ InvulnCheat. = "BBG\\Q90L" |
| 250 | "}FQC.>$"; |
| 251 | const char *FrametimeCheatcxx . . $ FrametimeCheat. = ";;24E1)]" |
| 252 | "=="; |
| 253 | const char *CameraCheatcxx . . $ CameraCheat. = "X2OHN*2(" |
| 254 | "K<?@!"; |
| 255 | const char *CoolTexturescxx . . $ CoolTextures. = "/Q/NGQ\\," |
| 256 | "%*HD@"; |
| 257 | const char *SuicideCheatcxx . . $ SuicideCheat. = "\\S3YGK=N" |
| 258 | "&D+#"; |
| 259 | const char *LevelWarpCheatcxx . . $ LevelWarpCheat. = "*JYO]9<G" |
| 260 | "()()"; |
| 261 | const char *TeletubbiesCheatcxx . . $ TeletubbiesCheat. = "I@\\LQOKM" |
| 262 | ":):/;)>:("; |
| 263 | const char *FullmapCheatcxx . . $ FullmapCheat. = "4V\\9EI:'" |
| 264 | "\"#$NNW@"; |
| 265 | const char *OutlineModeCheatcxx . . $ OutlineModeCheat. = "*HAFW1ZI" |
| 266 | " (-'\"#"; |
| 267 | const char *PolygonCountCheatcxx . . $ PolygonCountCheat. = "MMQ6TXHU" |
| 268 | "hj@(x`"; |
| 269 | |
| 270 | #ifdef USE_RTP |
| 271 | const char *StartLogCheat = ";IT.*+E3" |
| 272 | "%^VXKS;JKS"; // startrtlog |
| 273 | const char *StopLogCheat = "GE8FHH6*" |
| 274 | "_=JJDK"; // stoprtlog |
| 275 | #endif |
| 276 | |
| 277 | // these are cheat codes from the demo/oem carried over as they aren't cheats |
| 278 | const char *OLDDEMO_FrametimeCheatcxx . . $ OLDDEMO_FrametimeCheat. = "B'&>;6V4"; // frametime |
| 279 | const char *OLDOEM_FrametimeCheatcxx . . $ OLDOEM_FrametimeCheat. = "F+NDOJ'<"; // mrshowbiz |
| 280 | const char *OLDDEMO_CoolTexturescxx . . $ OLDDEMO_CoolTextures. = "QG1EG+H+"; // badtexture |
| 281 | const char *OLDOEM_CoolTexturescxx . . $ OLDOEM_CoolTextures. = "5UU(I'0="; // garbarge |
| 282 | |
| 283 | const char *jcryptcxx . . $ jcrypt(fb58d2e09a2a1ce6).(const char *plainstring) { |
| 284 | int i, t, len; |
| 285 | static char cryptstring[20]; |
| 286 | |
| 287 | len = strlen(plainstring); |
| 288 | if (len > 8) |
| 289 | len = 8; |
| 290 | |
| 291 | for (i = 0; i < len; i++) { |
| 292 | cryptstring[i] = 0; |
| 293 | |
| 294 | for (t = 0; t < 8; t++) { |
| 295 | cryptstring[i] ^= (plainstring[t] ^ plainstring[i % (t + 2)]); |
| 296 | cryptstring[i] %= 57; |
| 297 | cryptstring[i] += 39; |
| 298 | } |
| 299 | } |
| 300 | cryptstring[i] = 0; |
| 301 | return cryptstring; |
| 302 | } |
| 303 | |
| 304 | const char *oldjcryptcxx . . $ oldjcrypt(fb58d2e09a2a1ce6).(const char *plainstring) { |
| 305 | int i, t, len; |
| 306 | static char cryptstring[20]; |
| 307 | |
| 308 | len = strlen(plainstring); |
| 309 | if (len > 8) |
| 310 | len = 8; |
| 311 | |
| 312 | for (i = 0; i < len; i++) { |
| 313 | cryptstring[i] = 0; |
| 314 | |
| 315 | for (t = 0; t < 8; t++) { |
| 316 | cryptstring[i] ^= (plainstring[t] ^ plainstring[i % (t + 1)]); |
| 317 | cryptstring[i] %= 54; |
| 318 | cryptstring[i] += 33; |
| 319 | } |
| 320 | } |
| 321 | cryptstring[i] = 0; |
| 322 | return cryptstring; |
| 323 | } |
| 324 | |
| 325 | // Tells others that we are cheating |
| 326 | void SendCheaterAttemptTextcxx . . $ SendCheaterAttemptText(49f6e7a06ebc5aa8).() { |
| 327 | char str[255]; |
| 328 | snprintf(str, sizeof(str), TXT_CHEATATTEMPTcxx . . $ `Descent3/stringtable.h:560:9`!, Playerscxx . . $ Players.[Player_numcxx . . $ Player_num.].callsigncxx . . $ player#callsign.); |
| 329 | |
| 330 | if (Netgamecxx . . $ Netgame..local_rolecxx . . $ netgame_info#local_role. == LR_SERVERcxx . . $ `Descent3/multi_external.h:129:9`!) |
| 331 | MultiSendMessageFromServercxx . . $ MultiSendMessageFromServer(99469d7ff9a1485a).(GR_RGBcxx . . $ GR_RGB(530956271a9518a5).(255, 0, 0), str); |
| 332 | else |
| 333 | MultiSendMessageToServercxx . . $ MultiSendMessageToServer(99469d7ff9a1485a).(0, str); |
| 334 | } |
| 335 | |
| 336 | void DemoCheatscxx . . $ DemoCheats(d4f767463ce0a6b3).(int key) { |
| 337 | static int snd_cheat = -1; |
| 338 | int i; |
| 339 | const char *cryptstring, *oldcryptstring; |
| 340 | |
| 341 | if (snd_cheat == -1) { |
| 342 | snd_cheat = SOUND_CHEATERcxx . . $ `Descent3/sounds.h:124:9`!; |
| 343 | } |
| 344 | |
| 345 | key = ddio_KeyToAsciicxx . . $ ddio_KeyToAscii(7864480464b09eea).(key); |
| 346 | |
| 347 | for (i = 0; i < 15; i++) { |
| 348 | CheatBuffercxx . . $ CheatBuffer.[i] = CheatBuffercxx . . $ CheatBuffer.[i + 1]; |
| 349 | OldCheatBuffercxx . . $ OldCheatBuffer.[i] = OldCheatBuffercxx . . $ OldCheatBuffer.[i + 1]; |
| 350 | } |
| 351 | |
| 352 | CheatBuffercxx . . $ CheatBuffer.[CHEATSPOTcxx . . $ `Descent3/GameCheat.cpp:153:9`!] = key; |
| 353 | OldCheatBuffercxx . . $ OldCheatBuffer.[CHEATSPOTcxx . . $ `Descent3/GameCheat.cpp:153:9`!] = key; |
| 354 | |
| 355 | cryptstring = jcryptcxx . . $ jcrypt(fb58d2e09a2a1ce6).(&CheatBuffercxx . . $ CheatBuffer.[7]); |
| 356 | oldcryptstring = oldjcryptcxx . . $ oldjcrypt(fb58d2e09a2a1ce6).(&OldCheatBuffercxx . . $ OldCheatBuffer.[7]); |
| 357 | |
| 358 | for (i = 0; i < N_LAMER_CHEATScxx . . $ `Descent3/GameCheat.cpp:189:9`!; i++) { |
| 359 | if (!(strcmp(oldcryptstring, LamerCheatscxx . . $ LamerCheats.[i]))) { |
| 360 | if (snd_cheat != -1) |
| 361 | Sound_systemcxx . . $ Sound_system..Play2dSoundcxx . . $ hlsSystem#Play2dSound(d251026853493025).(snd_cheat); |
| 362 | |
| 363 | if (Game_modecxx . . $ Game_mode. & GM_MULTIcxx . . $ `Descent3/game.h:288:9`!) { |
| 364 | SendCheaterAttemptTextcxx . . $ SendCheaterAttemptText(49f6e7a06ebc5aa8).(); |
| 365 | } else { |
| 366 | AddHUDMessagecxx . . $ AddHUDMessage(f90d95ab21fd6d97).(TXT_LAMERcxx . . $ `Descent3/stringtable.h:561:9`!); |
| 367 | Objectscxx . . $ Objects.[Playerscxx . . $ Players.[Player_numcxx . . $ Player_num.].objnumcxx . . $ player#objnum.].shieldscxx . . $ object#shields. = 1; |
| 368 | Playerscxx . . $ Players.[Player_numcxx . . $ Player_num.].energycxx . . $ player#energy. = 1; |
| 369 | } |
| 370 | } |
| 371 | } |
| 372 | |
| 373 | if (!(memcmp(cryptstring, FrametimeCheatcxx . . $ FrametimeCheat., 8)) || !(memcmp(oldcryptstring, OLDDEMO_FrametimeCheatcxx . . $ OLDDEMO_FrametimeCheat., 8)) || |
| 374 | !(memcmp(oldcryptstring, OLDOEM_FrametimeCheatcxx . . $ OLDOEM_FrametimeCheat., 8))) { |
| 375 | Hud_stat_maskcxx . . $ Hud_stat_mask. ^= STAT_FPScxx . . $ `Descent3/hud.h:275:9`!; |
| 376 | bool enabled = (bool)((Hud_stat_maskcxx . . $ Hud_stat_mask. & STAT_FPScxx . . $ `Descent3/hud.h:275:9`!) != 0); |
| 377 | AddHUDMessagecxx . . $ AddHUDMessage(f90d95ab21fd6d97).(TXT_FRAMETIMEMSGcxx . . $ `Descent3/stringtable.h:562:9`!, (enabled) ? TXT_ENABLEDcxx . . $ `Descent3/stringtable.h:563:9`! : TXT_DISABLEDcxx . . $ `Descent3/stringtable.h:564:9`!); |
| 378 | } |
| 379 | |
| 380 | if (!(memcmp(cryptstring, CoolTexturescxx . . $ CoolTextures., 8)) || !(memcmp(oldcryptstring, OLDDEMO_CoolTexturescxx . . $ OLDDEMO_CoolTextures., 8)) || |
| 381 | !(memcmp(oldcryptstring, OLDOEM_CoolTexturescxx . . $ OLDOEM_CoolTextures., 8))) { |
| 382 | Force_one_texturecxx . . $ Force_one_texture. = !Force_one_texturecxx . . $ Force_one_texture.; |
| 383 | AddHUDMessagecxx . . $ AddHUDMessage(f90d95ab21fd6d97).("%s", (Force_one_texturecxx . . $ Force_one_texture.) ? TXT_COOLTEXTUREScxx . . $ `Descent3/stringtable.h:565:9`! : TXT_NORMALTEXTUREScxx . . $ `Descent3/stringtable.h:566:9`!); |
| 384 | } |
| 385 | |
| 386 | if (!(memcmp(cryptstring, CameraCheatcxx . . $ CameraCheat., 8))) { |
| 387 | Player_has_cameracxx . . $ Player_has_camera. = !Player_has_cameracxx . . $ Player_has_camera.; |
| 388 | } |
| 389 | |
| 390 | #ifdef USE_RTP |
| 391 | if (!(memcmp(cryptstring, StartLogCheat, 8))) { |
| 392 | rtp_StartLog(); |
| 393 | } |
| 394 | |
| 395 | if (!(memcmp(cryptstring, StopLogCheat, 8))) { |
| 396 | rtp_StopLog(); |
| 397 | } |
| 398 | #endif |
| 399 | |
| 400 | if (!(memcmp(cryptstring, TeletubbiesCheatcxx . . $ TeletubbiesCheat., 8))) { |
| 401 | int merc_sun = FindTextureNamecxx . . $ FindTextureName(5c4306d8553b3696).("MercSun11"); |
| 402 | int camile_sun = FindTextureNamecxx . . $ FindTextureName(5c4306d8553b3696).("CamileSun"); |
| 403 | if ((merc_sun != -1) && (camile_sun != -1)) |
| 404 | GameTexturescxx . . $ GameTextures.[merc_sun].bm_handlecxx . . $ texture#bm_handle. = GameTexturescxx . . $ GameTextures.[camile_sun].bm_handlecxx . . $ texture#bm_handle.; |
| 405 | } |
| 406 | |
| 407 | static int state = 0; |
| 408 | if (!(memcmp(cryptstring, OutlineModeCheatcxx . . $ OutlineModeCheat., 8))) { |
| 409 | uint8_tcxx . . $ uint8_t# new_mode; |
| 410 | char buffer[128]; |
| 411 | switch (state) { |
| 412 | case 0: |
| 413 | new_mode = 1; |
| 414 | // state = 1; |
| 415 | state = 3; |
| 416 | strcpy(buffer, "Mine Outline Enabled"); |
| 417 | break; |
| 418 | case 1: |
| 419 | new_mode = 2; |
| 420 | strcpy(buffer, "Object Outline Enabled"); |
| 421 | state = 2; |
| 422 | break; |
| 423 | case 2: |
| 424 | new_mode = 3; |
| 425 | strcpy(buffer, "Mine and Object Outline Enabled"); |
| 426 | state = 3; |
| 427 | break; |
| 428 | case 3: |
| 429 | new_mode = 0; |
| 430 | strcpy(buffer, "Disabled"); |
| 431 | state = 0; |
| 432 | break; |
| 433 | default: |
| 434 | new_mode = 1; |
| 435 | strcpy(buffer, "Mine Outline Enabled"); |
| 436 | state = 1; |
| 437 | break; |
| 438 | } |
| 439 | |
| 440 | Outline_release_modecxx . . $ Outline_release_mode. = new_mode; |
| 441 | |
| 442 | AddHUDMessagecxx . . $ AddHUDMessage(f90d95ab21fd6d97).("Outline mode: %s", buffer); |
| 443 | } |
| 444 | |
| 445 | if (!(memcmp(cryptstring, PolygonCountCheatcxx . . $ PolygonCountCheat., 8))) { |
| 446 | Display_renderer_statscxx . . $ Display_renderer_stats. = !Display_renderer_statscxx . . $ Display_renderer_stats.; |
| 447 | AddHUDMessagecxx . . $ AddHUDMessage(f90d95ab21fd6d97).("Renderer Stats: %s", (Display_renderer_statscxx . . $ Display_renderer_stats.) ? "On" : "Off"); |
| 448 | } |
| 449 | |
| 450 | if (Game_modecxx . . $ Game_mode. & GM_MULTIcxx . . $ `Descent3/game.h:288:9`!) |
| 451 | return; |
| 452 | |
| 453 | //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
| 454 | // Anything below this line won't be called |
| 455 | // in a multiplayer game |
| 456 | //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
| 457 | |
| 458 | if (!(memcmp(cryptstring, FullmapCheatcxx . . $ FullmapCheat., 8))) { |
| 459 | AddHUDMessagecxx . . $ AddHUDMessage(f90d95ab21fd6d97).(TXT_FULLMAPcxx . . $ `Descent3/stringtable.h:692:9`!); |
| 460 | |
| 461 | for (int i = 0; i < MAX_ROOMScxx . . $ `Descent3/room.h:377:9`!; i++) { |
| 462 | if (!(Roomscxx . . $ Rooms.[i].flagscxx . . $ room#flags. & RF_SECRETcxx . . $ `Descent3/room_external.h:201:9`!)) |
| 463 | AutomapVisMapcxx . . $ AutomapVisMap.[i] = 1; |
| 464 | } |
| 465 | |
| 466 | if (snd_cheat != -1) |
| 467 | Sound_systemcxx . . $ Sound_system..Play2dSoundcxx . . $ hlsSystem#Play2dSound(d251026853493025).(snd_cheat); |
| 468 | IsCheatercxx . . $ IsCheater. = true; |
| 469 | Playerscxx . . $ Players.[Player_numcxx . . $ Player_num.].scorecxx . . $ player#score. = 0; |
| 470 | } |
| 471 | |
| 472 | if (!(memcmp(cryptstring, LevelWarpCheatcxx . . $ LevelWarpCheat., 8))) { |
| 473 | // gets highest level flown for mission |
| 474 | Game_interface_modecxx . . $ Game_interface_mode. = GAME_LEVEL_WARPcxx . . $ `Descent3/gamesequence.h:144:9`!; |
| 475 | IsCheatercxx . . $ IsCheater. = true; |
| 476 | Playerscxx . . $ Players.[Player_numcxx . . $ Player_num.].scorecxx . . $ player#score. = 0; |
| 477 | } |
| 478 | |
| 479 | if (!(memcmp(cryptstring, InvulnCheatcxx . . $ InvulnCheat., 8))) { |
| 480 | if (Playerscxx . . $ Players.[Player_numcxx . . $ Player_num.].flagscxx . . $ player#flags. & PLAYER_FLAGS_INVULNERABLEcxx . . $ `Descent3/player_external.h:79:9`!) { |
| 481 | MakePlayerVulnerablecxx . . $ MakePlayerVulnerable(d4f767463ce0a6b3).(Player_numcxx . . $ Player_num.); |
| 482 | AddHUDMessagecxx . . $ AddHUDMessage(f90d95ab21fd6d97).(TXT_INVULNCHEATONcxx . . $ `Descent3/stringtable.h:567:9`!); |
| 483 | } else { |
| 484 | MakePlayerInvulnerablecxx . . $ MakePlayerInvulnerable(a421cb528a2d8d2f).(Player_numcxx . . $ Player_num., 10000); |
| 485 | AddHUDMessagecxx . . $ AddHUDMessage(f90d95ab21fd6d97).(TXT_INVULNCHEATcxx . . $ `Descent3/stringtable.h:568:9`!); |
| 486 | if (snd_cheat != -1) |
| 487 | Sound_systemcxx . . $ Sound_system..Play2dSoundcxx . . $ hlsSystem#Play2dSound(d251026853493025).(snd_cheat); |
| 488 | } |
| 489 | IsCheatercxx . . $ IsCheater. = true; |
| 490 | Playerscxx . . $ Players.[Player_numcxx . . $ Player_num.].scorecxx . . $ player#score. = 0; |
| 491 | } |
| 492 | |
| 493 | if (!(memcmp(cryptstring, CloakCheatcxx . . $ CloakCheat., 8))) { |
| 494 | if (Player_objectcxx . . $ Player_object.->effect_infocxx . . $ object#effect_info.->type_flagscxx . . $ effect_info_s#type_flags. & EF_CLOAKEDcxx . . $ `Descent3/object_external.h:197:9`!) { |
| 495 | MakeObjectVisiblecxx . . $ MakeObjectVisible(419c470199a90a97).(Player_objectcxx . . $ Player_object.); |
| 496 | AddHUDMessagecxx . . $ AddHUDMessage(f90d95ab21fd6d97).(TXT_CLOAKCHEATOFFcxx . . $ `Descent3/stringtable.h:569:9`!); |
| 497 | } else { |
| 498 | MakeObjectInvisiblecxx . . $ MakeObjectInvisible(3cdd7424a643b971).(Player_objectcxx . . $ Player_object., 10000); |
| 499 | AddHUDMessagecxx . . $ AddHUDMessage(f90d95ab21fd6d97).(TXT_CLOAKCHEATONcxx . . $ `Descent3/stringtable.h:570:9`!); |
| 500 | if (snd_cheat != -1) |
| 501 | Sound_systemcxx . . $ Sound_system..Play2dSoundcxx . . $ hlsSystem#Play2dSound(d251026853493025).(snd_cheat); |
| 502 | } |
| 503 | IsCheatercxx . . $ IsCheater. = true; |
| 504 | Playerscxx . . $ Players.[Player_numcxx . . $ Player_num.].scorecxx . . $ player#score. = 0; |
| 505 | } |
| 506 | |
| 507 | if (!(memcmp(cryptstring, WeaponsCheatcxx . . $ WeaponsCheat., 8))) { |
| 508 | |
| 509 | #ifdef DEMO |
| 510 | Players[Player_num].weapon_flags = HAS_FLAG(LASER_INDEX) | HAS_FLAG(VAUSS_INDEX) | HAS_FLAG(SUPER_LASER_INDEX) | |
| 511 | HAS_FLAG(NAPALM_INDEX) | HAS_FLAG(CONCUSSION_INDEX) | HAS_FLAG(HOMING_INDEX) | |
| 512 | HAS_FLAG(FRAG_INDEX) | HAS_FLAG(FLARE_INDEX); |
| 513 | #elif OEM |
| 514 | Players[Player_num].weapon_flags = |
| 515 | HAS_FLAG(LASER_INDEX) | HAS_FLAG(VAUSS_INDEX) | HAS_FLAG(MICROWAVE_INDEX) | HAS_FLAG(PLASMA_INDEX) | |
| 516 | HAS_FLAG(SUPER_LASER_INDEX) | HAS_FLAG(MASSDRIVER_INDEX) | HAS_FLAG(NAPALM_INDEX) | HAS_FLAG(CONCUSSION_INDEX) | |
| 517 | HAS_FLAG(HOMING_INDEX) | HAS_FLAG(IMPACTMORTAR_INDEX) | HAS_FLAG(FRAG_INDEX) | HAS_FLAG(GUIDED_INDEX) | |
| 518 | HAS_FLAG(NAPALMROCKET_INDEX) | HAS_FLAG(CYCLONE_INDEX); |
| 519 | |
| 520 | #else |
| 521 | Playerscxx . . $ Players.[Player_numcxx . . $ Player_num.].weapon_flagscxx . . $ player#weapon_flags. = 0xFFFFFFFF; |
| 522 | #endif |
| 523 | |
| 524 | int i; |
| 525 | for (i = 0; i < MAX_PLAYER_WEAPONScxx . . $ `Descent3/player_external_struct.h:91:9`!; i++) { |
| 526 | if (HAS_FLAGcxx . . $ `Descent3/weapon.h:215:9`!(i)) { |
| 527 | Playerscxx . . $ Players.[Player_numcxx . . $ Player_num.].weapon_ammocxx . . $ player#weapon_ammo.[i] = Shipscxx . . $ Ships.[Playerscxx . . $ Players.[Player_numcxx . . $ Player_num.].ship_indexcxx . . $ player#ship_index.].max_ammocxx . . $ ship#max_ammo.[i]; |
| 528 | } |
| 529 | } |
| 530 | |
| 531 | Playerscxx . . $ Players.[Player_numcxx . . $ Player_num.].energycxx . . $ player#energy. = 200.0f; |
| 532 | Objectscxx . . $ Objects.[Playerscxx . . $ Players.[Player_numcxx . . $ Player_num.].objnumcxx . . $ player#objnum.].shieldscxx . . $ object#shields. = 200.0f; |
| 533 | Playerscxx . . $ Players.[Player_numcxx . . $ Player_num.].afterburn_time_leftcxx . . $ player#afterburn_time_left. = AFTERBURN_TIMEcxx . . $ `Descent3/player.h:394:9`!; |
| 534 | Objectscxx . . $ Objects.[Playerscxx . . $ Players.[Player_numcxx . . $ Player_num.].objnumcxx . . $ player#objnum.].dynamic_wbcxx . . $ object#dynamic_wb.[LASER_INDEXcxx . . $ `Descent3/weapon_external.h:22:9`!].flagscxx . . $ dynamic_wb_info#flags. |= DWBF_QUADcxx . . $ `lib/robotfirestruct_external.h:47:9`!; |
| 535 | Objectscxx . . $ Objects.[Playerscxx . . $ Players.[Player_numcxx . . $ Player_num.].objnumcxx . . $ player#objnum.].dynamic_wbcxx . . $ object#dynamic_wb.[SUPER_LASER_INDEXcxx . . $ `Descent3/weapon_external.h:27:9`!].flagscxx . . $ dynamic_wb_info#flags. |= DWBF_QUADcxx . . $ `lib/robotfirestruct_external.h:47:9`!; |
| 536 | |
| 537 | int quad_id = FindObjectIDNamecxx . . $ FindObjectIDName(5c4306d8553b3696).("QuadLaser"); |
| 538 | if (quad_id > -1) { |
| 539 | Playerscxx . . $ Players.[Player_numcxx . . $ Player_num.].inventorycxx . . $ player#inventory..Addcxx . . $ Inventory#Add(122d808d8b1091da).(OBJ_POWERUPcxx . . $ `Descent3/object_external.h:167:9`!, quad_id, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, -1, -1, INVF_MISSIONITEMcxx . . $ `Descent3/Inventory.h:193:9`! | INVF_TIMEOUTONSPEWcxx . . $ `Descent3/Inventory.h:198:9`!); |
| 540 | } |
| 541 | |
| 542 | int c_id, b_id, s_id, g_id, p_id; |
| 543 | int c_pid, b_pid, s_pid, g_pid, p_pid; |
| 544 | int amount; |
| 545 | #ifdef DEMO |
| 546 | c_id = -1; |
| 547 | b_id = -1; |
| 548 | s_id = -1; |
| 549 | g_id = FindWeaponName("Gunboy"); |
| 550 | p_id = -1; |
| 551 | |
| 552 | c_pid = -1; |
| 553 | b_pid = -1; |
| 554 | s_pid = -1; |
| 555 | g_pid = FindObjectIDName("gunboypowerup"); |
| 556 | p_pid = -1; |
| 557 | |
| 558 | amount = 12; |
| 559 | #elif OEM |
| 560 | c_id = -1; |
| 561 | b_id = FindWeaponName("Betty"); |
| 562 | s_id = FindWeaponName("SeekerMine"); |
| 563 | g_id = FindWeaponName("Gunboy"); |
| 564 | p_id = -1; |
| 565 | |
| 566 | c_pid = -1; |
| 567 | b_pid = FindObjectIDName("Betty4pack"); |
| 568 | s_pid = FindObjectIDName("Seeker3pack"); |
| 569 | g_pid = FindObjectIDName("gunboypowerup"); |
| 570 | p_pid = -1; |
| 571 | |
| 572 | amount = 12; |
| 573 | #else |
| 574 | c_id = FindWeaponNamecxx . . $ FindWeaponName(5c4306d8553b3696).("Chaff"); |
| 575 | b_id = FindWeaponNamecxx . . $ FindWeaponName(5c4306d8553b3696).("Betty"); |
| 576 | s_id = FindWeaponNamecxx . . $ FindWeaponName(5c4306d8553b3696).("SeekerMine"); |
| 577 | g_id = FindWeaponNamecxx . . $ FindWeaponName(5c4306d8553b3696).("Gunboy"); |
| 578 | p_id = FindWeaponNamecxx . . $ FindWeaponName(5c4306d8553b3696).("ProxMine"); |
| 579 | |
| 580 | c_pid = FindObjectIDNamecxx . . $ FindObjectIDName(5c4306d8553b3696).("chaff"); |
| 581 | b_pid = FindObjectIDNamecxx . . $ FindObjectIDName(5c4306d8553b3696).("Betty4pack"); |
| 582 | s_pid = FindObjectIDNamecxx . . $ FindObjectIDName(5c4306d8553b3696).("Seeker3pack"); |
| 583 | g_pid = FindObjectIDNamecxx . . $ FindObjectIDName(5c4306d8553b3696).("gunboypowerup"); |
| 584 | p_pid = FindObjectIDNamecxx . . $ FindObjectIDName(5c4306d8553b3696).("ProxMinepowerup"); |
| 585 | |
| 586 | amount = 30; |
| 587 | |
| 588 | #endif |
| 589 | |
| 590 | if (c_pid == -1) |
| 591 | c_pid = FindObjectIDNamecxx . . $ FindObjectIDName(5c4306d8553b3696).("Shield"); |
| 592 | if (b_pid == -1) |
| 593 | b_pid = FindObjectIDNamecxx . . $ FindObjectIDName(5c4306d8553b3696).("Energy"); |
| 594 | if (s_pid == -1) |
| 595 | s_pid = FindObjectIDNamecxx . . $ FindObjectIDName(5c4306d8553b3696).("Shield"); |
| 596 | if (g_pid == -1) |
| 597 | g_pid = FindObjectIDNamecxx . . $ FindObjectIDName(5c4306d8553b3696).("Energy"); |
| 598 | if (p_pid == -1) |
| 599 | p_pid = FindObjectIDNamecxx . . $ FindObjectIDName(5c4306d8553b3696).("Shield"); |
| 600 | |
| 601 | objectcxx . . $ object# *objp = &Objectscxx . . $ Objects.[Playerscxx . . $ Players.[Player_numcxx . . $ Player_num.].objnumcxx . . $ player#objnum.]; |
| 602 | for (i = 0; i < amount; i++) { |
| 603 | if (c_id != -1) |
| 604 | Playerscxx . . $ Players.[Player_numcxx . . $ Player_num.].counter_measurescxx . . $ player#counter_measures..Addcxx . . $ Inventory#Add(122d808d8b1091da).(OBJ_WEAPONcxx . . $ `Descent3/object_external.h:165:9`!, c_id, objp, OBJ_POWERUPcxx . . $ `Descent3/object_external.h:167:9`!, c_pid); |
| 605 | if (b_id != -1) |
| 606 | Playerscxx . . $ Players.[Player_numcxx . . $ Player_num.].counter_measurescxx . . $ player#counter_measures..Addcxx . . $ Inventory#Add(122d808d8b1091da).(OBJ_WEAPONcxx . . $ `Descent3/object_external.h:165:9`!, b_id, objp, OBJ_POWERUPcxx . . $ `Descent3/object_external.h:167:9`!, b_pid); |
| 607 | if (s_id != -1) |
| 608 | Playerscxx . . $ Players.[Player_numcxx . . $ Player_num.].counter_measurescxx . . $ player#counter_measures..Addcxx . . $ Inventory#Add(122d808d8b1091da).(OBJ_WEAPONcxx . . $ `Descent3/object_external.h:165:9`!, s_id, objp, OBJ_POWERUPcxx . . $ `Descent3/object_external.h:167:9`!, s_pid); |
| 609 | if (g_id != -1) |
| 610 | Playerscxx . . $ Players.[Player_numcxx . . $ Player_num.].counter_measurescxx . . $ player#counter_measures..Addcxx . . $ Inventory#Add(122d808d8b1091da).(OBJ_WEAPONcxx . . $ `Descent3/object_external.h:165:9`!, g_id, objp, OBJ_POWERUPcxx . . $ `Descent3/object_external.h:167:9`!, g_pid); |
| 611 | if (p_id != -1) |
| 612 | Playerscxx . . $ Players.[Player_numcxx . . $ Player_num.].counter_measurescxx . . $ player#counter_measures..Addcxx . . $ Inventory#Add(122d808d8b1091da).(OBJ_WEAPONcxx . . $ `Descent3/object_external.h:165:9`!, p_id, objp, OBJ_POWERUPcxx . . $ `Descent3/object_external.h:167:9`!, p_pid); |
| 613 | } |
| 614 | |
| 615 | AddHUDMessagecxx . . $ AddHUDMessage(f90d95ab21fd6d97).(TXT_ALLWEAPONScxx . . $ `Descent3/stringtable.h:571:9`!); |
| 616 | if (snd_cheat != -1) |
| 617 | Sound_systemcxx . . $ Sound_system..Play2dSoundcxx . . $ hlsSystem#Play2dSound(d251026853493025).(snd_cheat); |
| 618 | IsCheatercxx . . $ IsCheater. = true; |
| 619 | Playerscxx . . $ Players.[Player_numcxx . . $ Player_num.].scorecxx . . $ player#score. = 0; |
| 620 | } |
| 621 | |
| 622 | if (!(memcmp(cryptstring, KillRobotsCheatcxx . . $ KillRobotsCheat., 8))) { |
| 623 | AddHUDMessagecxx . . $ AddHUDMessage(f90d95ab21fd6d97).(TXT_ALLROBOTSDEADcxx . . $ `Descent3/stringtable.h:572:9`!); |
| 624 | if (snd_cheat != -1) |
| 625 | Sound_systemcxx . . $ Sound_system..Play2dSoundcxx . . $ hlsSystem#Play2dSound(d251026853493025).(snd_cheat); |
| 626 | |
| 627 | for (int i = 0; i < MAX_OBJECTScxx . . $ `lib/object_external_struct.h:107:9`!; i++) { |
| 628 | if (Objectscxx . . $ Objects.[i].typecxx . . $ object#type. == OBJ_ROBOTcxx . . $ `Descent3/object_external.h:162:9`! || (Objectscxx . . $ Objects.[i].typecxx . . $ object#type. == OBJ_BUILDINGcxx . . $ `Descent3/object_external.h:176:9`! && Objectscxx . . $ Objects.[i].ai_infocxx . . $ object#ai_info.)) { |
| 629 | if (Objectscxx . . $ Objects.[i].idcxx . . $ object#id. != ROBOT_GUIDEBOTcxx . . $ `Descent3/object_external.h:354:9`! && Objectscxx . . $ Objects.[i].idcxx . . $ object#id. != ROBOT_GUIDEBOTREDcxx . . $ `Descent3/object_external.h:355:9`!) { |
| 630 | // spare the guidebots |
| 631 | SetObjectDeadFlagcxx . . $ SetObjectDeadFlag(80a724877f6428f2).(&Objectscxx . . $ Objects.[i]); |
| 632 | } |
| 633 | } |
| 634 | } |
| 635 | IsCheatercxx . . $ IsCheater. = true; |
| 636 | Playerscxx . . $ Players.[Player_numcxx . . $ Player_num.].scorecxx . . $ player#score. = 0; |
| 637 | } |
| 638 | |
| 639 | if (!(memcmp(cryptstring, SuicideCheatcxx . . $ SuicideCheat., 8))) { |
| 640 | //"ZOD Strikes Revenge" |
| 641 | static uint8_tcxx . . $ uint8_t# buffer[20] = {0x80, 0x95, 0x9E, 0xFA, 0x89, 0xAE, 0xA8, 0xB3, 0xB1, 0xBF, |
| 642 | 0xA9, 0xFA, 0x88, 0xBF, 0xAC, 0xBF, 0xB4, 0xBD, 0xBF, 0xDA}; |
| 643 | char tb[20]; |
| 644 | |
| 645 | for (int i = 0; i < 20; i++) { |
| 646 | tb[i] = buffer[i] ^ 0xDA; |
| 647 | } |
| 648 | |
| 649 | AddHUDMessagecxx . . $ AddHUDMessage(f90d95ab21fd6d97).(tb); |
| 650 | ApplyDamageToPlayercxx . . $ ApplyDamageToPlayer(1fbfa7277d8ac7b4).(&Objectscxx . . $ Objects.[Playerscxx . . $ Players.[Player_numcxx . . $ Player_num.].objnumcxx . . $ player#objnum.], NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, PD_ENERGY_WEAPONcxx . . $ `Descent3/damage_external.h:24:9`!, |
| 651 | Objectscxx . . $ Objects.[Playerscxx . . $ Players.[Player_numcxx . . $ Player_num.].objnumcxx . . $ player#objnum.].shieldscxx . . $ object#shields. + 10); |
| 652 | memset(tb, 0, 20); |
| 653 | } |
| 654 | } |