god mode cheat code tweaks + preventing ability damage

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9098 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Shadooow
2021-06-22 00:20:12 +00:00
parent bdbe1ffe65
commit da940db97c
8 changed files with 12 additions and 7 deletions
+6 -1
View File
@@ -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))
{