mirror of
https://github.com/1dot13/source.git
synced 2026-08-12 14:10:23 +02:00
New modifier for NCTH to alter the behaviour of the scope penalty:
- AIM_TOO_CLOSE_THRESHOLD = 0.8 This defines the point within scope range where the penalty starts. http://www.ja-galaxy-forum.com/ubbthreads.php/topics/334158/Re:_(Potential)_NCTH_Code_Chan#Post334158 git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7328 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -5466,10 +5466,10 @@ if (gGameExternalOptions.fUseNewCTHCalculation)
|
||||
// factor in scopes under their range
|
||||
if ( !pSoldier->IsValidAlternativeFireMode( ubAimTime, sGridNo ) )
|
||||
{
|
||||
if (fScopeMagFactor > 1.0 && iRange < (INT32)uiBestScopeRange)
|
||||
if (fScopeMagFactor > 1.0 && iRange < (INT32)(uiBestScopeRange * gGameCTHConstants.AIM_TOO_CLOSE_THRESHOLD))
|
||||
{
|
||||
// Calculate how much penalty this scope should give at this range
|
||||
FLOAT dScopePenaltyRatio = ((FLOAT)uiBestScopeRange / (FLOAT)iRange);
|
||||
FLOAT dScopePenaltyRatio = ((FLOAT)uiBestScopeRange * gGameCTHConstants.AIM_TOO_CLOSE_THRESHOLD / (FLOAT)iRange);
|
||||
FLOAT iScopePenalty = (FLOAT)(dScopePenaltyRatio * gGameCTHConstants.AIM_TOO_CLOSE_SCOPE * (fScopeMagFactor /2));
|
||||
fAimModifier += iScopePenalty;
|
||||
}
|
||||
@@ -6322,10 +6322,10 @@ else
|
||||
// factor in scopes under their range
|
||||
if ( !pSoldier->IsValidAlternativeFireMode( ubAimTime, sGridNo ) )
|
||||
{
|
||||
if (iScopeMagFactor > 1.0 && iRange < (INT32)uiBestScopeRange)
|
||||
if (iScopeMagFactor > 1.0 && iRange < (INT32)(uiBestScopeRange * gGameCTHConstants.AIM_TOO_CLOSE_THRESHOLD))
|
||||
{
|
||||
// Calculate how much penalty this scope should give at this range
|
||||
FLOAT dScopePenaltyRatio = ((FLOAT)uiBestScopeRange / (FLOAT)iRange);
|
||||
FLOAT dScopePenaltyRatio = ((FLOAT)uiBestScopeRange * gGameCTHConstants.AIM_TOO_CLOSE_THRESHOLD / (FLOAT)iRange);
|
||||
INT32 iScopePenalty = (INT32)(dScopePenaltyRatio * gGameCTHConstants.AIM_TOO_CLOSE_SCOPE * (iScopeMagFactor /2));
|
||||
iMaxAimBonus += iScopePenalty;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user