slightly modified the damage formula from r8370

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8371 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
silversurfer
2017-01-22 14:09:26 +00:00
parent a6b2568e24
commit 4f8498e5ef
+5 -7
View File
@@ -1340,13 +1340,11 @@ BOOLEAN CheckForGunJam( SOLDIERTYPE * pSoldier )
{
if ( PreRandom( 100 ) < ( Item[(*pObj).usItem].usDamageChance + ( 100 - condition ) / 5 ) )
{
// damage depends on gun status. The better the status the less damage it takes. Leave a chance for 0 damage.
UINT32 uiJamDamage = __max( 0, PreRandom( 5 - UINT32(condition / 30.0f) ) );
if ( uiJamDamage > 0 )
{
(*pObj)[0]->data.objectStatus -= __min( uiJamDamage, (*pObj)[0]->data.objectStatus );
(*pObj)[0]->data.sRepairThreshold -= __min( uiJamDamage, (*pObj)[0]->data.sRepairThreshold );
}
// damage depends on gun status. The better the status the less damage it takes.
UINT32 uiJamDamage = 1 + PreRandom( 5 - UINT32(condition / 30.0f) );
(*pObj)[0]->data.objectStatus -= __min( uiJamDamage, (*pObj)[0]->data.objectStatus );
(*pObj)[0]->data.sRepairThreshold -= __min( uiJamDamage, (*pObj)[0]->data.sRepairThreshold );
}
}