diff --git a/Cheats.h b/Cheats.h index 28cede82..d3c9f4c8 100644 --- a/Cheats.h +++ b/Cheats.h @@ -3,7 +3,8 @@ #include "Language Defines.h" -extern UINT8 gubCheatLevel; +extern UINT8 gubCheatLevel; +extern BOOLEAN gfGodModeCheat; // GLOBALS FOR CHEAT MODE...... #ifdef JA2TESTVERSION diff --git a/SaveLoadGame.cpp b/SaveLoadGame.cpp index d1054395..93f8759a 100644 --- a/SaveLoadGame.cpp +++ b/SaveLoadGame.cpp @@ -6737,6 +6737,7 @@ BOOLEAN LoadSavedGame( int ubSavedGameID ) ACTIVATE_CHEAT_LEVEL(); else RESET_CHEAT_LEVEL(); + gfGodModeCheat = FALSE; #endif #ifdef JA2BETAVERSION diff --git a/Strategic/Auto Resolve.cpp b/Strategic/Auto Resolve.cpp index 2ca00412..a0cb05e4 100644 --- a/Strategic/Auto Resolve.cpp +++ b/Strategic/Auto Resolve.cpp @@ -90,7 +90,6 @@ INT32 giMaxMilitiaToRender = 20;//Changes depending on merc amount extern UINT8 gubReinforcementMinEnemyStaticGroupSize; extern BOOLEAN gfStrategicMilitiaChangesMade; -extern BOOLEAN gfGodModeCheat; extern void ResetMilitia(); extern BOOLEAN AutoReload( SOLDIERTYPE *pSoldier ); diff --git a/Strategic/Game Init.cpp b/Strategic/Game Init.cpp index 96de80e7..c2c386bd 100644 --- a/Strategic/Game Init.cpp +++ b/Strategic/Game Init.cpp @@ -103,7 +103,8 @@ extern BOOLEAN gfGamePaused; extern UNDERGROUND_SECTORINFO* FindUnderGroundSector( INT16 sMapX, INT16 sMapY, UINT8 bMapZ ); -UINT8 gubCheatLevel = STARTING_CHEAT_LEVEL; +UINT8 gubCheatLevel = STARTING_CHEAT_LEVEL; +BOOLEAN gfGodModeCheat = FALSE; UINT8 gubScreenCount=0; @@ -1230,6 +1231,7 @@ void ReStartingGame() gubCheatLevel = STARTING_CHEAT_LEVEL; else gubCheatLevel = 0; + gfGodModeCheat = FALSE; } diff --git a/Strategic/mapscreen.cpp b/Strategic/mapscreen.cpp index 0764b28e..42ffd2eb 100644 --- a/Strategic/mapscreen.cpp +++ b/Strategic/mapscreen.cpp @@ -708,7 +708,6 @@ extern CHAR16 gzUserDefinedButton1[ 128 ]; extern CHAR16 gzUserDefinedButton2[ 128 ]; extern BOOLEAN gfMilitiaPopupCreated; -extern BOOLEAN gfGodModeCheat; #ifdef JA2TESTVERSION extern INT16 MSYS_CurrentMX; diff --git a/Tactical/Soldier Control.cpp b/Tactical/Soldier Control.cpp index f6308fac..d441d69e 100644 --- a/Tactical/Soldier Control.cpp +++ b/Tactical/Soldier Control.cpp @@ -1713,7 +1713,6 @@ PaletteReplacementType *guipPaletteReplacements = NULL; extern BOOLEAN fReDrawFace; extern UINT8 gubWaitingForAllMercsToExitCode; BOOLEAN gfGetNewPathThroughPeople = FALSE; -BOOLEAN gfGodModeCheat = FALSE; // LOCAL FUNCTIONS // DO NOT CALL UNLESS THROUGH EVENT_SetSoldierPosition diff --git a/Tactical/Turn Based Input.cpp b/Tactical/Turn Based Input.cpp index 00b10641..86b8bba4 100644 --- a/Tactical/Turn Based Input.cpp +++ b/Tactical/Turn Based Input.cpp @@ -218,7 +218,6 @@ extern int iWindowedMode; extern OBJECTTYPE *gpItemDescObject; extern BOOLEAN gfInItemStackPopup; extern BOOLEAN gfInKeyRingPopup; -extern BOOLEAN gfGodModeCheat; //Little functions called by keyboard input diff --git a/Tactical/Weapons.cpp b/Tactical/Weapons.cpp index d14a73ce..39ad253d 100644 --- a/Tactical/Weapons.cpp +++ b/Tactical/Weapons.cpp @@ -4,7 +4,7 @@ #include "sgp.h" #include "overhead types.h" #include "Sound Control.h" - + #include "Cheats.h" #include "overhead.h" #include "Event Pump.h" #include "weapons.h" @@ -8343,6 +8343,11 @@ INT32 BulletImpact( SOLDIERTYPE *pFirer, BULLET *pBullet, SOLDIERTYPE * pTarget, } } + if (gfGodModeCheat && pTarget->bTeam == OUR_TEAM) + { + uiCritChance = 0;//no crit against player in god mode either + } + // SANDRO - with new traits, the chance for stat loss is higher as we are now able to repair it if ((PreRandom( uiCritChance ) + 1) > (UINT8)(gGameOptions.fNewTraitSystem ? gSkillTraitValues.ubDamageNeededToLoseStats : CRITICAL_HIT_THRESHOLD)) {