added new option to CTHConstants.ini:

IRON_SIGHTS_MAX_APERTURE_MODIFIER = 3.0

This modifies how fast the aperture grows for iron sights when IRON_SIGHTS_MAX_APERTURE_USE_GRADIENT = TRUE

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7504 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
silversurfer
2014-09-10 12:16:45 +00:00
parent 84089c3c0c
commit a2be5b06c2
5 changed files with 8 additions and 3 deletions
+1
View File
@@ -3226,6 +3226,7 @@ void LoadCTHConstants()
gGameCTHConstants.LASER_PERFORMANCE_BONUS_SCOPE = iniReader.ReadFloat("General","LASER_PERFORMANCE_BONUS_SCOPE", 0.0f, 0.0f, 50.0f);
gGameCTHConstants.DEGREES_MAXIMUM_APERTURE = iniReader.ReadFloat("General", "DEGREES_MAXIMUM_APERTURE", 15.0, 0.0, 22.5);
gGameCTHConstants.IRON_SIGHTS_MAX_APERTURE_USE_GRADIENT = iniReader.ReadBoolean("General", "IRON_SIGHTS_MAX_APERTURE_USE_GRADIENT", FALSE);
gGameCTHConstants.IRON_SIGHTS_MAX_APERTURE_MODIFIER = iniReader.ReadFloat("General", "IRON_SIGHTS_MAX_APERTURE_MODIFIER", 3.0f, 2.0f, 5.0f);
gGameCTHConstants.RANGE_COEFFICIENT = iniReader.ReadFloat("General", "RANGE_COEFFICIENT", 2.0, 0.001f, 100.0);
gGameCTHConstants.GRAVITY_COEFFICIENT = iniReader.ReadFloat("General", "GRAVITY_COEFFICIENT", 1.0, 0.001f, 100.0);
gGameCTHConstants.VERTICAL_BIAS = iniReader.ReadFloat("General", "VERTICAL_BIAS", 1.0f, 0.01f, 2.0f);
+1
View File
@@ -1933,6 +1933,7 @@ typedef struct
FLOAT LASER_PERFORMANCE_BONUS_SCOPE; // percentage bonus to base aperture size for laser pointers when using scopes
FLOAT DEGREES_MAXIMUM_APERTURE; // Maximum possible aperture for a 100% muzzle sway shot. Decrease to make all shots more accurate.
BOOLEAN IRON_SIGHTS_MAX_APERTURE_USE_GRADIENT; // Use new curve instead of linear function to get the max aperture at target range for iron sights.
FLOAT IRON_SIGHTS_MAX_APERTURE_MODIFIER; // Modifier that is used to make aperture grow slower/faster when IRON_SIGHTS_MAX_APERTURE_USE_GRADIENT is TRUE.
FLOAT RANGE_COEFFICIENT; // Determines maximum range which decides when gravity forces bullets to drop
FLOAT GRAVITY_COEFFICIENT; // Changes the way gravity works in the game. Higher values mean bullets don't drop as quickly after reaching max range.
FLOAT VERTICAL_BIAS; // This float can be used to reduce the chance of missing too far upwards or downwards (compared to left/right).
+2 -1
View File
@@ -2560,7 +2560,8 @@ BOOLEAN DrawCTHIndicator()
// At 1 tile distance iBasicAperture will be the same as before. That's the common start.
if ( gGameCTHConstants.IRON_SIGHTS_MAX_APERTURE_USE_GRADIENT && gCTHDisplay.ScopeMagFactor <= 1.0 && !pSoldier->IsValidAlternativeFireMode( pSoldier->aiData.bAimTime, gCTHDisplay.iTargetGridNo ) )
iBasicAperture = iBasicAperture * ( 1 / sqrt( d2DDistance / FLOAT(CELL_X_SIZE) ) / 4.0 + 0.75 );
iBasicAperture = iBasicAperture * ( 1 / sqrt( d2DDistance / FLOAT(CELL_X_SIZE) ) / gGameCTHConstants.IRON_SIGHTS_MAX_APERTURE_MODIFIER
+ (gGameCTHConstants.IRON_SIGHTS_MAX_APERTURE_MODIFIER - 1) / gGameCTHConstants.IRON_SIGHTS_MAX_APERTURE_MODIFIER );
// iron sights can get a percentage bonus to make them overall better but only when not shooting from hip
if ( gCTHDisplay.ScopeMagFactor <= 1.0 && !pSoldier->IsValidAlternativeFireMode( pSoldier->aiData.bAimTime, gCTHDisplay.iTargetGridNo ) )
+2 -1
View File
@@ -7820,7 +7820,8 @@ void AdjustTargetCenterPoint( SOLDIERTYPE *pShooter, INT32 iTargetGridNo, FLOAT
// At 1 tile distance iBasicAperture will be the same as before. That's the common start.
if ( gGameCTHConstants.IRON_SIGHTS_MAX_APERTURE_USE_GRADIENT && gCTHDisplay.ScopeMagFactor <= 1.0 && !pShooter->IsValidAlternativeFireMode( pShooter->aiData.bAimTime, gCTHDisplay.iTargetGridNo ) )
iBasicAperture = iBasicAperture * ( 1 / sqrt( d2DDistance / FLOAT(CELL_X_SIZE) ) / 4.0 + 0.75 );
iBasicAperture = iBasicAperture * ( 1 / sqrt( d2DDistance / FLOAT(CELL_X_SIZE) ) / gGameCTHConstants.IRON_SIGHTS_MAX_APERTURE_MODIFIER
+ (gGameCTHConstants.IRON_SIGHTS_MAX_APERTURE_MODIFIER - 1) / gGameCTHConstants.IRON_SIGHTS_MAX_APERTURE_MODIFIER );
// iron sights can get a percentage bonus to make them overall better but only when not shooting from hip
if ( gCTHDisplay.ScopeMagFactor <= 1.0 && !pShooter->IsValidAlternativeFireMode( pShooter->aiData.bAimTime, gCTHDisplay.iTargetGridNo ) )
+2 -1
View File
@@ -9110,7 +9110,8 @@ UINT32 AICalcChanceToHitGun(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT16 ubAimTim
// At 1 tile distance iBasicAperture will be the same as before. That's the common start.
if ( gGameCTHConstants.IRON_SIGHTS_MAX_APERTURE_USE_GRADIENT && dMagFactor <= 1.0 && !pSoldier->IsValidAlternativeFireMode( ubAimTime, sGridNo ) )
dBasicAperture = dBasicAperture * ( 1 / sqrt( d2DDistance / FLOAT(CELL_X_SIZE) ) / 4.0 + 0.75 );
dBasicAperture = dBasicAperture * ( 1 / sqrt( d2DDistance / FLOAT(CELL_X_SIZE) ) / gGameCTHConstants.IRON_SIGHTS_MAX_APERTURE_MODIFIER
+ (gGameCTHConstants.IRON_SIGHTS_MAX_APERTURE_MODIFIER - 1) / gGameCTHConstants.IRON_SIGHTS_MAX_APERTURE_MODIFIER );
// iron sights can get a percentage bonus to make them overall better but only when not shooting from hip
if ( dMagFactor <= 1.0 && !pSoldier->IsValidAlternativeFireMode( ubAimTime, sGridNo ) )