SpaceViking's random number and CTH adjustments.

OIV Graphic alignment correction.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@2242 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
ChrisL
2008-07-17 00:16:16 +00:00
parent ad96055687
commit ec87dd51e6
3 changed files with 32 additions and 5 deletions
+14 -1
View File
@@ -78,8 +78,21 @@ UINT32 PreRandom( UINT32 uiRange )
//Go to the next index.
guiPreRandomIndex++;
if( guiPreRandomIndex >= (UINT32)MAX_PREGENERATED_NUMS )
//if( guiPreRandomIndex >= (UINT32)MAX_PREGENERATED_NUMS )
// guiPreRandomIndex = 0;
// WDS 07/06/2008 fix prerandom
if (guiPreRandomIndex == MAX_PREGENERATED_NUMS / 2) {
// [0..(MAX_PREGENERATED_NUMS/2) -1]
for( unsigned idx = 0; idx < MAX_PREGENERATED_NUMS / 2; ++idx ) {
guiPreRandomNums[ idx ] = rand();
}
} else if (guiPreRandomIndex >= (UINT32)MAX_PREGENERATED_NUMS ) {
// MAX_PREGENERATED_NUMS/2 .. MAX_PREGENERATED_NUMS-1]
for( unsigned idx = MAX_PREGENERATED_NUMS / 2; idx < MAX_PREGENERATED_NUMS; ++idx ) {
guiPreRandomNums[ idx ] = rand();
}
guiPreRandomIndex = 0;
}
return uiNum;
}
+12 -2
View File
@@ -3476,7 +3476,13 @@ void SMInvClickCallback( MOUSE_REGION * pRegion, INT32 iReason )
invWidth = 314;
//InitItemStackPopup( gpSMCurrentMerc, (UINT8)uiHandPos, SM_ITEMDESC_START_X, SM_ITEMDESC_START_Y, SM_ITEMDESC_WIDTH, SM_ITEMDESC_HEIGHT );
InitItemStackPopup( gpSMCurrentMerc, (UINT8)uiHandPos, 248, INV_INTERFACE_START_Y, invWidth, ( SCREEN_HEIGHT - INV_INTERFACE_START_Y ) );
//CHRISL: In OIV mode, we don't want to offset the keyring popup.
UINT8 inv_interface_start_x;
if(UsingNewInventorySystem() == false)
inv_interface_start_x = 213;
else
inv_interface_start_x = 248;
InitItemStackPopup( gpSMCurrentMerc, (UINT8)uiHandPos, inv_interface_start_x, INV_INTERFACE_START_Y, invWidth, ( SCREEN_HEIGHT - INV_INTERFACE_START_Y ) );
}
}
@@ -6373,7 +6379,11 @@ void BeginKeyPanelFromKeyShortcut( )
if( guiTacticalInterfaceFlags & INTERFACE_SHOPKEEP_INTERFACE )
return;
InitKeyRingPopup( pSoldier, 35, sStartYPosition, sWidth, sHeight );
//CHRISL: In OIV mode, we don't want to offset the keyring popup.
if(UsingNewInventorySystem() == false)
InitKeyRingPopup( pSoldier, 0, sStartYPosition, sWidth, sHeight );
else
InitKeyRingPopup( pSoldier, 35, sStartYPosition, sWidth, sHeight );
}
+6 -2
View File
@@ -1717,7 +1717,9 @@ BOOLEAN UseGun( SOLDIERTYPE *pSoldier , INT16 sTargetGridNo )
}
// big penalty to hit
if(uiHitChance < 30)
// WDS 07/06/2008 fix randoms
//if(uiHitChance < 30)
if(uiHitChance <= 30)
uiHitChance = MINCHANCETOHIT;
else
uiHitChance -= 30;
@@ -1750,7 +1752,9 @@ BOOLEAN UseGun( SOLDIERTYPE *pSoldier , INT16 sTargetGridNo )
}
#endif
fGonnaHit = uiDiceRoll <= uiHitChance;
// WDS 07/06/2008 fix randoms
//fGonnaHit = uiDiceRoll <= uiHitChance;
fGonnaHit = uiDiceRoll = uiHitChance;
// GET TARGET XY VALUES
ConvertGridNoToCenterCellXY( sTargetGridNo, &sXMapPos, &sYMapPos );