From 411bec6fc490de9d7cc9d15419ace1025f80c4a4 Mon Sep 17 00:00:00 2001 From: ChrisL Date: Wed, 23 Jul 2008 18:12:48 +0000 Subject: [PATCH] More random number adjustments from SpaceViking. Adjusted the default file location so that it doesn't point to a specific drive but, instead, creates builds in whatever driver your code is located on. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@2254 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Tactical/Weapons.cpp | 16 +++++++++++----- ja2_2005Express.vcproj | 6 +++--- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/Tactical/Weapons.cpp b/Tactical/Weapons.cpp index 203d0ec3..d49719fe 100644 --- a/Tactical/Weapons.cpp +++ b/Tactical/Weapons.cpp @@ -2092,7 +2092,8 @@ BOOLEAN UseBlade( SOLDIERTYPE *pSoldier , INT16 sTargetGridNo ) //sprintf( gDebugStr, "Hit Chance: %d %d", (int)uiHitChance, uiDiceRoll ); - if ( iDiceRoll <= iHitChance ) + // WDS 07/19/2008 - Random number use fix + if ( iDiceRoll < iHitChance ) { fGonnaHit = TRUE; @@ -2317,11 +2318,13 @@ BOOLEAN UseHandToHand( SOLDIERTYPE *pSoldier, INT16 sTargetGridNo, BOOLEAN fStea { fFailure=FALSE; + // WDS 07/19/2008 - Random number use fix // Do we have luck on stealing? - if ( iDiceRoll <= iHitChance && iHitChance > 0 ) + if ( iDiceRoll < iHitChance && iHitChance > 0 ) { + // WDS 07/19/2008 - Random number use fix // Do we have the chance to steal more than 1 item? - if (( iDiceRoll <= iHitChance * 2 / 3) || (pTargetSoldier->bCollapsed)) + if (( iDiceRoll < iHitChance * 2 / 3) || (pTargetSoldier->bCollapsed)) { // The item that the enemy holds in his hand before the stealing usOldItem = pTargetSoldier->inv[HANDPOS].usItem; @@ -2472,8 +2475,9 @@ BOOLEAN UseHandToHand( SOLDIERTYPE *pSoldier, INT16 sTargetGridNo, BOOLEAN fStea if ( pSoldier->bTeam == gbPlayerNum && pTargetSoldier->bTeam != gbPlayerNum ) { + // WDS 07/19/2008 - Random number use fix // made an HTH attack; give experience - if ( iDiceRoll <= iHitChance ) + if ( iDiceRoll < iHitChance ) { ubExpGain = 8; @@ -2521,7 +2525,9 @@ BOOLEAN UseHandToHand( SOLDIERTYPE *pSoldier, INT16 sTargetGridNo, BOOLEAN fStea } } - if ( iDiceRoll <= iHitChance || AreInMeanwhile( ) ) + // WDS 07/19/2008 - Random number use fix + if ( iDiceRoll < iHitChance || AreInMeanwhile( ) ) + { // CALCULATE DAMAGE! iImpact = HTHImpact( pSoldier, pTargetSoldier, (iHitChance - iDiceRoll), FALSE ); diff --git a/ja2_2005Express.vcproj b/ja2_2005Express.vcproj index a5c8d010..cddd49f7 100644 --- a/ja2_2005Express.vcproj +++ b/ja2_2005Express.vcproj @@ -1,7 +1,7 @@