From 23660d8040c61f8d135cc69ef761e977d5cb78d6 Mon Sep 17 00:00:00 2001 From: zicodxx <> Date: Sat, 17 Jul 2010 12:08:45 +0000 Subject: [PATCH] Implenented POBOYS cheat as equivalent to D2's DELSHIFTB --- CHANGELOG.txt | 1 + main/game.c | 4 ++-- main/gamecntl.c | 13 +++++++++++++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index e972d909c..d0c50b5a1 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -4,6 +4,7 @@ D1X-Rebirth Changelog -------- main/gamesave.c, main/render.c: Removed OGL hack to fix overlapping room in D1 lvl19 and rather move vertex a little. Still a hack but now without messing Depth test main/gameseg.c, main/render.c: Instead of screwing by possibly using negative array indicies in find_seg_side() return -1. In ordering segments make this result in unimportant order; Taking in some Asserts which were disabled years ago by me. Let's fix this for real when we get to it +main/game.c, main/gamecntl.c: Implenented POBOYS cheat as equivalent to D2's DELSHIFTB 20100716 -------- diff --git a/main/game.c b/main/game.c index c1354a388..d9dbad2c4 100644 --- a/main/game.c +++ b/main/game.c @@ -927,6 +927,7 @@ extern int cheat_cloak_index; extern int cheat_shield_index; extern int cheat_warp_index; extern int cheat_astral_index; +extern int cheat_poboys_index; extern int cheat_turbomode_index; extern int cheat_wowie2_index; extern int cheat_newlife_index; @@ -962,8 +963,7 @@ window *game_setup(void) Endlevel_sequence = 0; cheat_enable_index = 0; - cheat_wowie_index = cheat_allkeys_index = cheat_invuln_index = cheat_cloak_index = cheat_shield_index = cheat_warp_index = cheat_astral_index = 0; - cheat_turbomode_index = cheat_wowie2_index = 0; + cheat_wowie_index = cheat_allkeys_index = cheat_invuln_index = cheat_cloak_index = cheat_shield_index = cheat_warp_index = cheat_astral_index = cheat_poboys_index = cheat_turbomode_index = cheat_wowie2_index = 0; set_screen_mode(SCREEN_GAME); game_wind = window_create(&grd_curscreen->sc_canvas, 0, 0, SWIDTH, SHEIGHT, game_handler, NULL); diff --git a/main/gamecntl.c b/main/gamecntl.c index 94c0c33ec..bc90ff1c5 100644 --- a/main/gamecntl.c +++ b/main/gamecntl.c @@ -938,6 +938,7 @@ ubyte cheat_cloak[] = {KEY_G,KEY_U,KEY_I,KEY_L,KEY_E}; ubyte cheat_shield[] = {KEY_T,KEY_W,KEY_I,KEY_L,KEY_I,KEY_G,KEY_H,KEY_T}; ubyte cheat_warp[] = {KEY_F,KEY_A,KEY_R,KEY_M,KEY_E,KEY_R,KEY_J,KEY_O,KEY_E}; ubyte cheat_astral[] = {KEY_A,KEY_S,KEY_T,KEY_R,KEY_A,KEY_L}; +ubyte cheat_poboys[] = {KEY_P,KEY_O,KEY_B,KEY_O,KEY_Y,KEY_S}; #define NUM_NEW_CHEATS 5 ubyte new_cheats[]= { KEY_B^0xaa, KEY_B^0xaa, KEY_B^0xaa, KEY_F^0xaa, KEY_A^0xaa, @@ -954,6 +955,7 @@ KEY_N^0xaa, KEY_D^0xaa, KEY_X^0xaa, KEY_X^0xaa, KEY_A^0xaa }; #define CHEAT_SHIELD_LENGTH (sizeof(cheat_shield) / sizeof(*cheat_shield)) #define CHEAT_WARP_LENGTH (sizeof(cheat_warp) / sizeof(*cheat_warp)) #define CHEAT_ASTRAL_LENGTH (sizeof(cheat_astral) / sizeof(*cheat_astral)) +#define CHEAT_POBOYS_LENGTH (sizeof(cheat_poboys) / sizeof(*cheat_poboys)) #define CHEAT_TURBOMODE_OFS 0 #define CHEAT_WOWIE2_OFS 1 @@ -973,6 +975,7 @@ int cheat_cloak_index; int cheat_shield_index; int cheat_warp_index; int cheat_astral_index; +int cheat_poboys_index; int cheat_turbomode_index; int cheat_wowie2_index; int cheat_newlife_index; @@ -1176,6 +1179,16 @@ void FinalCheats(int key) else cheat_astral_index = 0; + if (!(Game_mode&GM_MULTI) && key == cheat_poboys[cheat_poboys_index]) { + if (++cheat_poboys_index == CHEAT_POBOYS_LENGTH) { + digi_play_sample( SOUND_CHEATER, F1_0); + kill_and_so_forth(); + cheat_poboys_index = 0; + } + } + else + cheat_poboys_index = 0; + if (!(Game_mode&GM_MULTI) && key == (0xaa^new_cheats[cheat_turbomode_index*NUM_NEW_CHEATS+CHEAT_TURBOMODE_OFS])) { if (++cheat_turbomode_index == CHEAT_TURBOMODE_LENGTH) { Game_turbo_mode ^= 1;