1 /* KJL 11:24:31 03/21/97 - quick cheat mode stuff */ 2 #include "3dc.h" 3 #include "module.h" 4 #include "inline.h" 5 6 #include "stratdef.h" 7 #include "gamedef.h" 8 #include "gameplat.h" 9 10 #include "bh_types.h" 11 #include "huddefs.h" 12 #include "language.h" 13 #include "cheat.h" 14 #include "weapons.h" 15 #include "equipmnt.h" 16 17 /* Extern for global keyboard buffer */ 18 extern unsigned char KeyboardInput[]; 19 extern void LoadAllWeapons(PLAYER_STATUS *playerStatusPtr); 20 21 HandleCheatModes(void)22void HandleCheatModes(void) 23 { 24 PLAYER_STATUS *playerStatusPtr= (PLAYER_STATUS *) (Player->ObStrategyBlock->SBdataptr); 25 26 #if 1 27 playerStatusPtr->securityClearances = 0; 28 #else 29 /* KJL 16:28:54 05/11/97 - reveal map */ 30 if (KeyboardInput[KEY_F9]) 31 { 32 extern SCENE Global_Scene; 33 extern int ModuleArraySize; 34 MODULE **moduleList; 35 int i; 36 37 moduleList = MainSceneArray[Global_Scene]->sm_marray; 38 39 for(i = 0; i < ModuleArraySize; i++) 40 { 41 MODULE *modulePtr = moduleList[i]; 42 43 if (modulePtr && modulePtr->m_mapptr) 44 { 45 modulePtr->m_flags |= m_flag_visible_on_map; 46 } 47 } 48 NewOnScreenMessage(GetTextString(TEXTSTRING_INGAME_CHEATACTIVATED)); 49 } 50 51 52 //#if !GAMEFLOW_ON 53 #if 0 54 55 /* give all security levels */ 56 if (KeyboardInput[KEY_F10]) 57 { 58 playerStatusPtr->securityClearances = 0xffffffff; 59 NewOnScreenMessage(GetTextString(TEXTSTRING_INGAME_CHEATACTIVATED)); 60 } 61 if (KeyboardInput[KEY_F5]) 62 { 63 playerStatusPtr->securityClearances = 0x3f; 64 NewOnScreenMessage(GetTextString(TEXTSTRING_INGAME_CHEATACTIVATED)); 65 } 66 #endif 67 68 #if 1 69 /* give all weapons & ammo */ 70 if((KeyboardInput[KEY_F11])) 71 { 72 } 73 #endif 74 /* give immortality */ 75 if (KeyboardInput[KEY_F12]) 76 { 77 if(AvP.Network==I_No_Network) 78 { 79 NewOnScreenMessage(GetTextString(TEXTSTRING_INGAME_CHEATACTIVATED)); 80 playerStatusPtr->IsImmortal = 1; 81 } 82 else 83 { 84 /* commit suicide */ 85 CauseDamageToObject(Player->ObStrategyBlock, &certainDeath, ONE_FIXED,NULL); 86 } 87 } 88 #endif 89 } 90 GiveAllWeaponsCheat(void)91void GiveAllWeaponsCheat(void) 92 { 93 PLAYER_STATUS *playerStatusPtr= (PLAYER_STATUS *) (Player->ObStrategyBlock->SBdataptr); 94 95 if(AvP.PlayerType == I_Marine) 96 { 97 int slot = MAX_NO_OF_WEAPON_SLOTS; 98 while(slot--) 99 { 100 PLAYER_WEAPON_DATA *wdPtr = &playerStatusPtr->WeaponSlot[slot]; 101 102 //if (slot == WEAPON_PLASMAGUN || slot == WEAPON_SONICCANNON) continue; 103 104 if (wdPtr->WeaponIDNumber==NULL_WEAPON) continue; 105 106 if (wdPtr->Possessed==-1) continue; /* This weapon not allowed! */ 107 108 wdPtr->Possessed=1; 109 110 /* KJL 21:49:47 05/15/97 - give ammo for weapons, apart from 111 experimental weapons */ 112 if (slot<=WEAPON_SLOT_10) { 113 if (wdPtr->WeaponIDNumber==WEAPON_CUDGEL) { 114 wdPtr->PrimaryMagazinesRemaining=0; 115 } else { 116 wdPtr->PrimaryMagazinesRemaining=50; 117 } 118 } else wdPtr->PrimaryMagazinesRemaining=0; 119 120 if (wdPtr->WeaponIDNumber==WEAPON_PULSERIFLE) { 121 wdPtr->SecondaryRoundsRemaining=(ONE_FIXED*99); 122 } 123 if (wdPtr->WeaponIDNumber==WEAPON_TWO_PISTOLS) { 124 wdPtr->SecondaryMagazinesRemaining=50; 125 } 126 127 128 } 129 GrenadeLauncherData.StandardMagazinesRemaining=50; 130 GrenadeLauncherData.FlareMagazinesRemaining=50; 131 GrenadeLauncherData.ProximityMagazinesRemaining=50; 132 GrenadeLauncherData.FragmentationMagazinesRemaining=50; 133 134 } else if (AvP.PlayerType==I_Predator) { 135 136 int slot = MAX_NO_OF_WEAPON_SLOTS; 137 while(slot--) 138 { 139 PLAYER_WEAPON_DATA *wdPtr = &playerStatusPtr->WeaponSlot[slot]; 140 141 //if (slot == WEAPON_PLASMAGUN || slot == WEAPON_SONICCANNON) continue; 142 143 if (wdPtr->WeaponIDNumber==NULL_WEAPON) continue; 144 145 if (wdPtr->Possessed==-1) continue; /* This weapon not allowed! */ 146 147 if (wdPtr->WeaponIDNumber==WEAPON_PRED_RIFLE) { 148 wdPtr->PrimaryRoundsRemaining+=(ONE_FIXED*SPEARS_PER_PICKUP); 149 if (wdPtr->PrimaryRoundsRemaining>(ONE_FIXED*MAX_SPEARS)) { 150 wdPtr->PrimaryRoundsRemaining=(ONE_FIXED*MAX_SPEARS); 151 } 152 wdPtr->Possessed=1; 153 continue; 154 } 155 156 if (wdPtr->WeaponIDNumber==WEAPON_PRED_DISC) { 157 wdPtr->PrimaryRoundsRemaining+=(ONE_FIXED); 158 if (wdPtr->PrimaryRoundsRemaining>(ONE_FIXED*99)) { 159 wdPtr->PrimaryRoundsRemaining=(ONE_FIXED*99); 160 } 161 wdPtr->Possessed=1; 162 continue; 163 } 164 165 if (wdPtr->WeaponIDNumber==WEAPON_PRED_STAFF) { 166 continue; 167 } 168 169 wdPtr->Possessed=1; 170 171 } 172 } 173 LoadAllWeapons(playerStatusPtr); 174 } 175