mirror of
https://github.com/1dot13/source.git
synced 2026-09-09 14:46:05 +02:00
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:
@@ -78,8 +78,21 @@ UINT32 PreRandom( UINT32 uiRange )
|
|||||||
|
|
||||||
//Go to the next index.
|
//Go to the next index.
|
||||||
guiPreRandomIndex++;
|
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;
|
guiPreRandomIndex = 0;
|
||||||
|
}
|
||||||
return uiNum;
|
return uiNum;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3476,7 +3476,13 @@ void SMInvClickCallback( MOUSE_REGION * pRegion, INT32 iReason )
|
|||||||
invWidth = 314;
|
invWidth = 314;
|
||||||
|
|
||||||
//InitItemStackPopup( gpSMCurrentMerc, (UINT8)uiHandPos, SM_ITEMDESC_START_X, SM_ITEMDESC_START_Y, SM_ITEMDESC_WIDTH, SM_ITEMDESC_HEIGHT );
|
//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 )
|
if( guiTacticalInterfaceFlags & INTERFACE_SHOPKEEP_INTERFACE )
|
||||||
return;
|
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 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1717,7 +1717,9 @@ BOOLEAN UseGun( SOLDIERTYPE *pSoldier , INT16 sTargetGridNo )
|
|||||||
}
|
}
|
||||||
|
|
||||||
// big penalty to hit
|
// big penalty to hit
|
||||||
if(uiHitChance < 30)
|
// WDS 07/06/2008 fix randoms
|
||||||
|
//if(uiHitChance < 30)
|
||||||
|
if(uiHitChance <= 30)
|
||||||
uiHitChance = MINCHANCETOHIT;
|
uiHitChance = MINCHANCETOHIT;
|
||||||
else
|
else
|
||||||
uiHitChance -= 30;
|
uiHitChance -= 30;
|
||||||
@@ -1750,7 +1752,9 @@ BOOLEAN UseGun( SOLDIERTYPE *pSoldier , INT16 sTargetGridNo )
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
fGonnaHit = uiDiceRoll <= uiHitChance;
|
// WDS 07/06/2008 fix randoms
|
||||||
|
//fGonnaHit = uiDiceRoll <= uiHitChance;
|
||||||
|
fGonnaHit = uiDiceRoll = uiHitChance;
|
||||||
|
|
||||||
// GET TARGET XY VALUES
|
// GET TARGET XY VALUES
|
||||||
ConvertGridNoToCenterCellXY( sTargetGridNo, &sXMapPos, &sYMapPos );
|
ConvertGridNoToCenterCellXY( sTargetGridNo, &sXMapPos, &sYMapPos );
|
||||||
|
|||||||
Reference in New Issue
Block a user