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
This commit is contained in:
ChrisL
2008-07-23 18:12:48 +00:00
parent 75c937544a
commit 411bec6fc4
2 changed files with 14 additions and 8 deletions
+11 -5
View File
@@ -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 );