mirror of
https://github.com/1dot13/source.git
synced 2026-08-05 14:00: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:
+4
-4
@@ -12863,7 +12863,7 @@ FLOAT GetBestScopeMagnificationFactor( SOLDIERTYPE *pSoldier, OBJECTTYPE * pObj,
|
||||
// Actual Scope Mag Factor is what we get at the distance the target's at.
|
||||
ActualCurrentFactor = __min(CurrentFactor, (TargetMagFactor/rangeModifier));
|
||||
|
||||
if (ActualCurrentFactor >= CurrentFactor)
|
||||
if (ActualCurrentFactor >= CurrentFactor * gGameCTHConstants.AIM_TOO_CLOSE_THRESHOLD)
|
||||
{
|
||||
// This scope gives no penalty. Record this as the best factor found so far.
|
||||
BestFactor = CurrentFactor;
|
||||
@@ -12872,7 +12872,7 @@ FLOAT GetBestScopeMagnificationFactor( SOLDIERTYPE *pSoldier, OBJECTTYPE * pObj,
|
||||
else
|
||||
{
|
||||
// This scopes gives a penalty for shooting under its range.
|
||||
FLOAT dScopePenaltyRatio = (CurrentFactor * rangeModifier / TargetMagFactor);
|
||||
FLOAT dScopePenaltyRatio = (CurrentFactor * gGameCTHConstants.AIM_TOO_CLOSE_THRESHOLD * rangeModifier / TargetMagFactor);
|
||||
INT32 iScopePenalty = (INT32)((dScopePenaltyRatio * gGameCTHConstants.AIM_TOO_CLOSE_SCOPE) * (CurrentFactor / 2));
|
||||
|
||||
// There's no previous scope to compare with so record this as the best factor for now.
|
||||
@@ -12893,7 +12893,7 @@ FLOAT GetBestScopeMagnificationFactor( SOLDIERTYPE *pSoldier, OBJECTTYPE * pObj,
|
||||
// Actual Scope Mag Factor is what we get at the distance the target's at.
|
||||
ActualCurrentFactor = __min(CurrentFactor, (TargetMagFactor/rangeModifier));
|
||||
|
||||
if (ActualCurrentFactor >= CurrentFactor)
|
||||
if (ActualCurrentFactor >= CurrentFactor * gGameCTHConstants.AIM_TOO_CLOSE_THRESHOLD)
|
||||
{
|
||||
// This scope gives no penalty. Is it any better than the ones we've already processed?
|
||||
if (iBestTotalPenalty <= 0 && CurrentFactor > BestFactor)
|
||||
@@ -12906,7 +12906,7 @@ FLOAT GetBestScopeMagnificationFactor( SOLDIERTYPE *pSoldier, OBJECTTYPE * pObj,
|
||||
else
|
||||
{
|
||||
// This scope will give a penalty if used. Is it worth using compared to other scopes found?
|
||||
FLOAT dScopePenaltyRatio = (CurrentFactor * rangeModifier / TargetMagFactor);
|
||||
FLOAT dScopePenaltyRatio = (CurrentFactor * gGameCTHConstants.AIM_TOO_CLOSE_THRESHOLD * rangeModifier / TargetMagFactor);
|
||||
INT32 iScopePenalty = (INT32)((dScopePenaltyRatio * gGameCTHConstants.AIM_TOO_CLOSE_SCOPE) * (CurrentFactor / 2));
|
||||
|
||||
// Is this scope any better than the ones we've already processed?
|
||||
|
||||
Reference in New Issue
Block a user