new modifiers for item properties:

- APs to reload
- APs to reload manually
- max distance for messy death
- gun handling
- best laser range

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6472 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
silversurfer
2013-10-06 12:50:36 +00:00
parent c16971b9f2
commit 9eedf3d45d
10 changed files with 211 additions and 47 deletions
+57 -5
View File
@@ -2405,7 +2405,11 @@ void LoadItemSettings()
{ {
CIniReader iniReader(ITEM_SETTINGS_FILE); CIniReader iniReader(ITEM_SETTINGS_FILE);
// values to fine-tune weapon overheating for different weapon types // -------------- COMMON MODIFIERS ----------------
gItemSettings.fBestLaserRangeModifier = iniReader.ReadFloat ("Common Settings","BEST_LASER_RANGE_MODIFIER", 1.0f, 0.1f, 5.0f);
// -------------- WEAPON MODIFIERS ----------------
// values to fine-tune weapon overheating
// --------- PISTOLS ---------- // --------- PISTOLS ----------
gItemSettings.fOverheatJamThresholdModifierGun[GUN_PISTOL] = iniReader.ReadFloat ("Weapon Settings","OVERHEATING_JAM_THRESHOLD_PISTOL_MODIFIER", 1.0f, 0.1f, 10.0f); gItemSettings.fOverheatJamThresholdModifierGun[GUN_PISTOL] = iniReader.ReadFloat ("Weapon Settings","OVERHEATING_JAM_THRESHOLD_PISTOL_MODIFIER", 1.0f, 0.1f, 10.0f);
gItemSettings.fOverheatDamageThresholdModifierGun[GUN_PISTOL] = iniReader.ReadFloat ("Weapon Settings","OVERHEATING_DAMAGE_THRESHOLD_PISTOL_MODIFIER", 1.0f, 0.1f, 10.0f); gItemSettings.fOverheatDamageThresholdModifierGun[GUN_PISTOL] = iniReader.ReadFloat ("Weapon Settings","OVERHEATING_DAMAGE_THRESHOLD_PISTOL_MODIFIER", 1.0f, 0.1f, 10.0f);
@@ -2452,7 +2456,7 @@ void LoadItemSettings()
gItemSettings.fOverheatTemperatureModifierLauncher = iniReader.ReadFloat ("Weapon Settings","OVERHEATING_TEMPERATURE_LAUNCHER_MODIFIER", 1.0f, 0.1f, 10.0f); gItemSettings.fOverheatTemperatureModifierLauncher = iniReader.ReadFloat ("Weapon Settings","OVERHEATING_TEMPERATURE_LAUNCHER_MODIFIER", 1.0f, 0.1f, 10.0f);
gItemSettings.fOverheatCooldownModifierLauncher = iniReader.ReadFloat ("Weapon Settings","OVERHEATING_COOLDOWN_LAUNCHER_MODIFIER", 1.0f, 0.1f, 10.0f); gItemSettings.fOverheatCooldownModifierLauncher = iniReader.ReadFloat ("Weapon Settings","OVERHEATING_COOLDOWN_LAUNCHER_MODIFIER", 1.0f, 0.1f, 10.0f);
// values to adjust weapon range for different weapon types // values to adjust weapon range
gItemSettings.fRangeModifierGun[GUN_PISTOL] = iniReader.ReadFloat ("Weapon Settings","RANGE_PISTOL_MODIFIER", 1.0f, 0.1f, 5.0f); gItemSettings.fRangeModifierGun[GUN_PISTOL] = iniReader.ReadFloat ("Weapon Settings","RANGE_PISTOL_MODIFIER", 1.0f, 0.1f, 5.0f);
gItemSettings.fRangeModifierGun[GUN_M_PISTOL] = iniReader.ReadFloat ("Weapon Settings","RANGE_MP_MODIFIER", 1.0f, 0.1f, 5.0f); gItemSettings.fRangeModifierGun[GUN_M_PISTOL] = iniReader.ReadFloat ("Weapon Settings","RANGE_MP_MODIFIER", 1.0f, 0.1f, 5.0f);
gItemSettings.fRangeModifierGun[GUN_SMG] = iniReader.ReadFloat ("Weapon Settings","RANGE_SMG_MODIFIER", 1.0f, 0.1f, 5.0f); gItemSettings.fRangeModifierGun[GUN_SMG] = iniReader.ReadFloat ("Weapon Settings","RANGE_SMG_MODIFIER", 1.0f, 0.1f, 5.0f);
@@ -2464,7 +2468,7 @@ void LoadItemSettings()
// -------- LAUNCHERs --------- // -------- LAUNCHERs ---------
gItemSettings.fRangeModifierLauncher = iniReader.ReadFloat ("Weapon Settings","RANGE_LAUNCHER_MODIFIER", 1.0f, 0.1f, 5.0f); gItemSettings.fRangeModifierLauncher = iniReader.ReadFloat ("Weapon Settings","RANGE_LAUNCHER_MODIFIER", 1.0f, 0.1f, 5.0f);
// values to adjust damage for different weapon types // values to adjust damage
// ----------- GUNS ----------- // ----------- GUNS -----------
gItemSettings.fDamageModifierGun[GUN_PISTOL] = iniReader.ReadFloat ("Weapon Settings","DAMAGE_PISTOL_MODIFIER", 1.0f, 0.1f, 5.0f); gItemSettings.fDamageModifierGun[GUN_PISTOL] = iniReader.ReadFloat ("Weapon Settings","DAMAGE_PISTOL_MODIFIER", 1.0f, 0.1f, 5.0f);
gItemSettings.fDamageModifierGun[GUN_M_PISTOL] = iniReader.ReadFloat ("Weapon Settings","DAMAGE_MP_MODIFIER", 1.0f, 0.1f, 5.0f); gItemSettings.fDamageModifierGun[GUN_M_PISTOL] = iniReader.ReadFloat ("Weapon Settings","DAMAGE_MP_MODIFIER", 1.0f, 0.1f, 5.0f);
@@ -2494,7 +2498,7 @@ void LoadItemSettings()
gItemSettings.fShotsPer4TurnsModifierTentacle = iniReader.ReadFloat ("Weapon Settings","SP4T_TENTACLE_MODIFIER", 1.0f, 0.1f, 5.0f); gItemSettings.fShotsPer4TurnsModifierTentacle = iniReader.ReadFloat ("Weapon Settings","SP4T_TENTACLE_MODIFIER", 1.0f, 0.1f, 5.0f);
gItemSettings.fShotsPer4TurnsModifierThrowKnife = iniReader.ReadFloat ("Weapon Settings","SP4T_THROWKNIFE_MODIFIER", 1.0f, 0.1f, 5.0f); gItemSettings.fShotsPer4TurnsModifierThrowKnife = iniReader.ReadFloat ("Weapon Settings","SP4T_THROWKNIFE_MODIFIER", 1.0f, 0.1f, 5.0f);
// values to adjust Burst APs for different weapon types // values to adjust Burst APs
gItemSettings.fBurstAPModifierGun[GUN_PISTOL] = iniReader.ReadFloat ("Weapon Settings","BURST_AP_PISTOL_MODIFIER", 1.0f, 0.1f, 5.0f); gItemSettings.fBurstAPModifierGun[GUN_PISTOL] = iniReader.ReadFloat ("Weapon Settings","BURST_AP_PISTOL_MODIFIER", 1.0f, 0.1f, 5.0f);
gItemSettings.fBurstAPModifierGun[GUN_M_PISTOL] = iniReader.ReadFloat ("Weapon Settings","BURST_AP_MP_MODIFIER", 1.0f, 0.1f, 5.0f); gItemSettings.fBurstAPModifierGun[GUN_M_PISTOL] = iniReader.ReadFloat ("Weapon Settings","BURST_AP_MP_MODIFIER", 1.0f, 0.1f, 5.0f);
gItemSettings.fBurstAPModifierGun[GUN_SMG] = iniReader.ReadFloat ("Weapon Settings","BURST_AP_SMG_MODIFIER", 1.0f, 0.1f, 5.0f); gItemSettings.fBurstAPModifierGun[GUN_SMG] = iniReader.ReadFloat ("Weapon Settings","BURST_AP_SMG_MODIFIER", 1.0f, 0.1f, 5.0f);
@@ -2504,7 +2508,7 @@ void LoadItemSettings()
gItemSettings.fBurstAPModifierGun[GUN_LMG] = iniReader.ReadFloat ("Weapon Settings","BURST_AP_LMG_MODIFIER", 1.0f, 0.1f, 5.0f); gItemSettings.fBurstAPModifierGun[GUN_LMG] = iniReader.ReadFloat ("Weapon Settings","BURST_AP_LMG_MODIFIER", 1.0f, 0.1f, 5.0f);
gItemSettings.fBurstAPModifierGun[GUN_SHOTGUN] = iniReader.ReadFloat ("Weapon Settings","BURST_AP_SHOTGUN_MODIFIER", 1.0f, 0.1f, 5.0f); gItemSettings.fBurstAPModifierGun[GUN_SHOTGUN] = iniReader.ReadFloat ("Weapon Settings","BURST_AP_SHOTGUN_MODIFIER", 1.0f, 0.1f, 5.0f);
// values to adjust Auto Fire APs for different weapon types // values to adjust Auto Fire APs
gItemSettings.fAFShotsPer5APModifierGun[GUN_PISTOL] = iniReader.ReadFloat ("Weapon Settings","AF_SP5AP_PISTOL_MODIFIER", 1.0f, 0.1f, 5.0f); gItemSettings.fAFShotsPer5APModifierGun[GUN_PISTOL] = iniReader.ReadFloat ("Weapon Settings","AF_SP5AP_PISTOL_MODIFIER", 1.0f, 0.1f, 5.0f);
gItemSettings.fAFShotsPer5APModifierGun[GUN_M_PISTOL] = iniReader.ReadFloat ("Weapon Settings","AF_SP5AP_MP_MODIFIER", 1.0f, 0.1f, 5.0f); gItemSettings.fAFShotsPer5APModifierGun[GUN_M_PISTOL] = iniReader.ReadFloat ("Weapon Settings","AF_SP5AP_MP_MODIFIER", 1.0f, 0.1f, 5.0f);
gItemSettings.fAFShotsPer5APModifierGun[GUN_SMG] = iniReader.ReadFloat ("Weapon Settings","AF_SP5AP_SMG_MODIFIER", 1.0f, 0.1f, 5.0f); gItemSettings.fAFShotsPer5APModifierGun[GUN_SMG] = iniReader.ReadFloat ("Weapon Settings","AF_SP5AP_SMG_MODIFIER", 1.0f, 0.1f, 5.0f);
@@ -2513,6 +2517,54 @@ void LoadItemSettings()
gItemSettings.fAFShotsPer5APModifierGun[GUN_AS_RIFLE] = iniReader.ReadFloat ("Weapon Settings","AF_SP5AP_AR_MODIFIER", 1.0f, 0.1f, 5.0f); gItemSettings.fAFShotsPer5APModifierGun[GUN_AS_RIFLE] = iniReader.ReadFloat ("Weapon Settings","AF_SP5AP_AR_MODIFIER", 1.0f, 0.1f, 5.0f);
gItemSettings.fAFShotsPer5APModifierGun[GUN_LMG] = iniReader.ReadFloat ("Weapon Settings","AF_SP5AP_LMG_MODIFIER", 1.0f, 0.1f, 5.0f); gItemSettings.fAFShotsPer5APModifierGun[GUN_LMG] = iniReader.ReadFloat ("Weapon Settings","AF_SP5AP_LMG_MODIFIER", 1.0f, 0.1f, 5.0f);
gItemSettings.fAFShotsPer5APModifierGun[GUN_SHOTGUN] = iniReader.ReadFloat ("Weapon Settings","AF_SP5AP_SHOTGUN_MODIFIER", 1.0f, 0.1f, 5.0f); gItemSettings.fAFShotsPer5APModifierGun[GUN_SHOTGUN] = iniReader.ReadFloat ("Weapon Settings","AF_SP5AP_SHOTGUN_MODIFIER", 1.0f, 0.1f, 5.0f);
// values to adjust AP to Reload
gItemSettings.fAPtoReloadModifierGun[GUN_PISTOL] = iniReader.ReadFloat ("Weapon Settings","AP_RELOAD_PISTOL_MODIFIER", 1.0f, 0.1f, 5.0f);
gItemSettings.fAPtoReloadModifierGun[GUN_M_PISTOL] = iniReader.ReadFloat ("Weapon Settings","AP_RELOAD_MP_MODIFIER", 1.0f, 0.1f, 5.0f);
gItemSettings.fAPtoReloadModifierGun[GUN_SMG] = iniReader.ReadFloat ("Weapon Settings","AP_RELOAD_SMG_MODIFIER", 1.0f, 0.1f, 5.0f);
gItemSettings.fAPtoReloadModifierGun[GUN_RIFLE] = iniReader.ReadFloat ("Weapon Settings","AP_RELOAD_RIFLE_MODIFIER", 1.0f, 0.1f, 5.0f);
gItemSettings.fAPtoReloadModifierGun[GUN_SN_RIFLE] = iniReader.ReadFloat ("Weapon Settings","AP_RELOAD_SNIPER_MODIFIER", 1.0f, 0.1f, 5.0f);
gItemSettings.fAPtoReloadModifierGun[GUN_AS_RIFLE] = iniReader.ReadFloat ("Weapon Settings","AP_RELOAD_AR_MODIFIER", 1.0f, 0.1f, 5.0f);
gItemSettings.fAPtoReloadModifierGun[GUN_LMG] = iniReader.ReadFloat ("Weapon Settings","AP_RELOAD_LMG_MODIFIER", 1.0f, 0.1f, 5.0f);
gItemSettings.fAPtoReloadModifierGun[GUN_SHOTGUN] = iniReader.ReadFloat ("Weapon Settings","AP_RELOAD_SHOTGUN_MODIFIER", 1.0f, 0.1f, 5.0f);
gItemSettings.fAPtoReloadModifierLauncher = iniReader.ReadFloat ("Weapon Settings","AP_RELOAD_LAUNCHER_MODIFIER", 1.0f, 0.1f, 5.0f);
// values to adjust AP to re-chamber/pump
gItemSettings.fAPtoReloadManuallyModifierGun[GUN_PISTOL] = iniReader.ReadFloat ("Weapon Settings","AP_RELOAD_MAN_PISTOL_MODIFIER", 1.0f, 0.1f, 5.0f);
gItemSettings.fAPtoReloadManuallyModifierGun[GUN_M_PISTOL] = iniReader.ReadFloat ("Weapon Settings","AP_RELOAD_MAN_MP_MODIFIER", 1.0f, 0.1f, 5.0f);
gItemSettings.fAPtoReloadManuallyModifierGun[GUN_SMG] = iniReader.ReadFloat ("Weapon Settings","AP_RELOAD_MAN_SMG_MODIFIER", 1.0f, 0.1f, 5.0f);
gItemSettings.fAPtoReloadManuallyModifierGun[GUN_RIFLE] = iniReader.ReadFloat ("Weapon Settings","AP_RELOAD_MAN_RIFLE_MODIFIER", 1.0f, 0.1f, 5.0f);
gItemSettings.fAPtoReloadManuallyModifierGun[GUN_SN_RIFLE] = iniReader.ReadFloat ("Weapon Settings","AP_RELOAD_MAN_SNIPER_MODIFIER", 1.0f, 0.1f, 5.0f);
gItemSettings.fAPtoReloadManuallyModifierGun[GUN_AS_RIFLE] = iniReader.ReadFloat ("Weapon Settings","AP_RELOAD_MAN_AR_MODIFIER", 1.0f, 0.1f, 5.0f);
gItemSettings.fAPtoReloadManuallyModifierGun[GUN_LMG] = iniReader.ReadFloat ("Weapon Settings","AP_RELOAD_MAN_LMG_MODIFIER", 1.0f, 0.1f, 5.0f);
gItemSettings.fAPtoReloadManuallyModifierGun[GUN_SHOTGUN] = iniReader.ReadFloat ("Weapon Settings","AP_RELOAD_MAN_SHOTGUN_MODIFIER", 1.0f, 0.1f, 5.0f);
gItemSettings.fAPtoReloadManuallyModifierLauncher = iniReader.ReadFloat ("Weapon Settings","AP_RELOAD_MAN_LAUNCHER_MODIFIER", 1.0f, 0.1f, 5.0f);
// values to adjust max distance for messy death
gItemSettings.fDistMessyModifierGun[GUN_PISTOL] = iniReader.ReadFloat ("Weapon Settings","DIST_MESSY_PISTOL_MODIFIER", 1.0f, 0.1f, 5.0f);
gItemSettings.fDistMessyModifierGun[GUN_M_PISTOL] = iniReader.ReadFloat ("Weapon Settings","DIST_MESSY_MP_MODIFIER", 1.0f, 0.1f, 5.0f);
gItemSettings.fDistMessyModifierGun[GUN_SMG] = iniReader.ReadFloat ("Weapon Settings","DIST_MESSY_SMG_MODIFIER", 1.0f, 0.1f, 5.0f);
gItemSettings.fDistMessyModifierGun[GUN_RIFLE] = iniReader.ReadFloat ("Weapon Settings","DIST_MESSY_RIFLE_MODIFIER", 1.0f, 0.1f, 5.0f);
gItemSettings.fDistMessyModifierGun[GUN_SN_RIFLE] = iniReader.ReadFloat ("Weapon Settings","DIST_MESSY_SNIPER_MODIFIER", 1.0f, 0.1f, 5.0f);
gItemSettings.fDistMessyModifierGun[GUN_AS_RIFLE] = iniReader.ReadFloat ("Weapon Settings","DIST_MESSY_AR_MODIFIER", 1.0f, 0.1f, 5.0f);
gItemSettings.fDistMessyModifierGun[GUN_LMG] = iniReader.ReadFloat ("Weapon Settings","DIST_MESSY_LMG_MODIFIER", 1.0f, 0.1f, 5.0f);
gItemSettings.fDistMessyModifierGun[GUN_SHOTGUN] = iniReader.ReadFloat ("Weapon Settings","DIST_MESSY_SHOTGUN_MODIFIER", 1.0f, 0.1f, 5.0f);
// values to adjust weapon handling
gItemSettings.fHandlingModifierGun[GUN_PISTOL] = iniReader.ReadFloat ("Weapon Settings","HANDLING_PISTOL_MODIFIER", 1.0f, 0.1f, 5.0f);
gItemSettings.fHandlingModifierGun[GUN_M_PISTOL] = iniReader.ReadFloat ("Weapon Settings","HANDLING_MP_MODIFIER", 1.0f, 0.1f, 5.0f);
gItemSettings.fHandlingModifierGun[GUN_SMG] = iniReader.ReadFloat ("Weapon Settings","HANDLING_SMG_MODIFIER", 1.0f, 0.1f, 5.0f);
gItemSettings.fHandlingModifierGun[GUN_RIFLE] = iniReader.ReadFloat ("Weapon Settings","HANDLING_RIFLE_MODIFIER", 1.0f, 0.1f, 5.0f);
gItemSettings.fHandlingModifierGun[GUN_SN_RIFLE] = iniReader.ReadFloat ("Weapon Settings","HANDLING_SNIPER_MODIFIER", 1.0f, 0.1f, 5.0f);
gItemSettings.fHandlingModifierGun[GUN_AS_RIFLE] = iniReader.ReadFloat ("Weapon Settings","HANDLING_AR_MODIFIER", 1.0f, 0.1f, 5.0f);
gItemSettings.fHandlingModifierGun[GUN_LMG] = iniReader.ReadFloat ("Weapon Settings","HANDLING_LMG_MODIFIER", 1.0f, 0.1f, 5.0f);
gItemSettings.fHandlingModifierGun[GUN_SHOTGUN] = iniReader.ReadFloat ("Weapon Settings","HANDLING_SHOTGUN_MODIFIER", 1.0f, 0.1f, 5.0f);
gItemSettings.fHandlingModifierLauncher = iniReader.ReadFloat ("Weapon Settings","HANDLING_LAUNCHER_MODIFIER", 1.0f, 0.1f, 5.0f);
// -------------- ARMOR MODIFIERS ----------------
// ------------ EXPLOSIVE MODIFIERS --------------
} }
INT16 DynamicAdjustAPConstants(INT16 iniReadValue, INT16 iniDefaultValue, BOOLEAN reverse) INT16 DynamicAdjustAPConstants(INT16 iniReadValue, INT16 iniDefaultValue, BOOLEAN reverse)
+23 -4
View File
@@ -1742,7 +1742,11 @@ typedef struct
// silversurfer: item property modifiers // silversurfer: item property modifiers
typedef struct typedef struct
{ {
// weapon overheating modifiers for the different weapon types // -------------- COMMON MODIFIERS ----------------
FLOAT fBestLaserRangeModifier;
// -------------- WEAPON MODIFIERS ----------------
// weapon overheating modifiers
FLOAT fOverheatJamThresholdModifierGun[9]; FLOAT fOverheatJamThresholdModifierGun[9];
FLOAT fOverheatDamageThresholdModifierGun[9]; FLOAT fOverheatDamageThresholdModifierGun[9];
FLOAT fOverheatTemperatureModifierGun[9]; FLOAT fOverheatTemperatureModifierGun[9];
@@ -1751,10 +1755,10 @@ typedef struct
FLOAT fOverheatDamageThresholdModifierLauncher; FLOAT fOverheatDamageThresholdModifierLauncher;
FLOAT fOverheatTemperatureModifierLauncher; FLOAT fOverheatTemperatureModifierLauncher;
FLOAT fOverheatCooldownModifierLauncher; FLOAT fOverheatCooldownModifierLauncher;
// range modifiers for different weapon types // range modifiers
FLOAT fRangeModifierGun[9]; FLOAT fRangeModifierGun[9];
FLOAT fRangeModifierLauncher; FLOAT fRangeModifierLauncher;
// damage modifiers for different weapon types // damage modifiers
FLOAT fDamageModifierGun[9]; FLOAT fDamageModifierGun[9];
FLOAT fDamageModifierBlade; FLOAT fDamageModifierBlade;
FLOAT fDamageModifierPunch; FLOAT fDamageModifierPunch;
@@ -1766,10 +1770,25 @@ typedef struct
FLOAT fShotsPer4TurnsModifierPunch; FLOAT fShotsPer4TurnsModifierPunch;
FLOAT fShotsPer4TurnsModifierTentacle; FLOAT fShotsPer4TurnsModifierTentacle;
FLOAT fShotsPer4TurnsModifierThrowKnife; FLOAT fShotsPer4TurnsModifierThrowKnife;
// Burst AP modifiers for different weapon types // Burst AP modifiers
FLOAT fBurstAPModifierGun[9]; FLOAT fBurstAPModifierGun[9];
// AP modifiers for Auto Fire Shots per 5 AP (bAutofireShotsPerFiveAP) // AP modifiers for Auto Fire Shots per 5 AP (bAutofireShotsPerFiveAP)
FLOAT fAFShotsPer5APModifierGun[9]; FLOAT fAFShotsPer5APModifierGun[9];
// AP to Reload modifiers
FLOAT fAPtoReloadModifierGun[9];
FLOAT fAPtoReloadModifierLauncher;
// AP to Reload manually modifiers
FLOAT fAPtoReloadManuallyModifierGun[9];
FLOAT fAPtoReloadManuallyModifierLauncher;
// Max Distance for messy shot modifiers
FLOAT fDistMessyModifierGun[9];
// Handling modifiers
FLOAT fHandlingModifierGun[9];
FLOAT fHandlingModifierLauncher;
// -------------- ARMOR MODIFIERS ----------------
// ------------ EXPLOSIVE MODIFIERS --------------
}ITEM_SETTINGS; }ITEM_SETTINGS;
+18 -3
View File
@@ -6224,6 +6224,11 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject )
// Get base Gun Handling value // Get base Gun Handling value
UINT16 iHandlingValue = Weapon[ gpItemDescObject->usItem ].ubHandling; UINT16 iHandlingValue = Weapon[ gpItemDescObject->usItem ].ubHandling;
// modify by ini values
if ( Item[ gpItemDescObject->usItem ].usItemClass == IC_GUN )
iHandlingValue *= gItemSettings.fHandlingModifierGun[ Weapon[ gpItemDescObject->usItem ].ubWeaponType ];
else if ( Item[ gpItemDescObject->usItem ].usItemClass == IC_LAUNCHER )
iHandlingValue *= gItemSettings.fHandlingModifierLauncher;
// Get modifier // Get modifier
INT16 iHandlingModifier = (iHandlingValue * GetPercentHandlingModifier( gpItemDescObject , ANIM_STAND )) / 100; INT16 iHandlingModifier = (iHandlingValue * GetPercentHandlingModifier( gpItemDescObject , ANIM_STAND )) / 100;
@@ -6564,7 +6569,7 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject )
&& (gGameCTHConstants.LASER_PERFORMANCE_BONUS_HIP + gGameCTHConstants.LASER_PERFORMANCE_BONUS_IRON + gGameCTHConstants.LASER_PERFORMANCE_BONUS_SCOPE != 0) ) && (gGameCTHConstants.LASER_PERFORMANCE_BONUS_HIP + gGameCTHConstants.LASER_PERFORMANCE_BONUS_IRON + gGameCTHConstants.LASER_PERFORMANCE_BONUS_SCOPE != 0) )
{ {
// Get base laser range // Get base laser range
iProjectionValue = __max(0, Item[ gpItemDescObject->usItem ].bestlaserrange / CELL_X_SIZE); iProjectionValue = __max(0, Item[ gpItemDescObject->usItem ].bestlaserrange * gItemSettings.fBestLaserRangeModifier / CELL_X_SIZE);
// Get best laser range // Get best laser range
iProjectionModifier = ((FLOAT)GetBestLaserRange( gpItemDescObject ) / CELL_X_SIZE); iProjectionModifier = ((FLOAT)GetBestLaserRange( gpItemDescObject ) / CELL_X_SIZE);
// Get final laser range // Get final laser range
@@ -6728,9 +6733,9 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject )
sHeight = gItemDescGenRegions[ubNumLine][1].sBottom - sTop; sHeight = gItemDescGenRegions[ubNumLine][1].sBottom - sTop;
// Get base Best Laser Range value // Get base Best Laser Range value
INT16 iBestLaserRangeValue = Item[ gpItemDescObject->usItem ].bestlaserrange / 10; INT16 iBestLaserRangeValue = Item[ gpItemDescObject->usItem ].bestlaserrange * gItemSettings.fBestLaserRangeModifier / CELL_X_SIZE;
// Get final Best Laser Range value // Get final Best Laser Range value
INT16 iFinalBestLaserRangeValue = GetAverageBestLaserRange( gpItemDescObject ) / 10; INT16 iFinalBestLaserRangeValue = GetAverageBestLaserRange( gpItemDescObject ) / CELL_X_SIZE;
// Get Best Laser Range Modifier value // Get Best Laser Range Modifier value
INT16 iBestLaserRangeModifier = iFinalBestLaserRangeValue - iBestLaserRangeValue; INT16 iBestLaserRangeModifier = iFinalBestLaserRangeValue - iBestLaserRangeValue;
@@ -7330,6 +7335,11 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject )
// Get base Reload Cost // Get base Reload Cost
INT16 iReloadAPCost = Weapon[ gpItemDescObject->usItem ].APsToReload; INT16 iReloadAPCost = Weapon[ gpItemDescObject->usItem ].APsToReload;
// modify by ini values
if ( Item[ gpItemDescObject->usItem ].usItemClass == IC_GUN )
iReloadAPCost *= gItemSettings.fAPtoReloadModifierGun[ Weapon[ gpItemDescObject->usItem ].ubWeaponType ];
else if ( Item[ gpItemDescObject->usItem ].usItemClass == IC_LAUNCHER )
iReloadAPCost *= gItemSettings.fAPtoReloadModifierLauncher;
// Get Reload Cost Modifier // Get Reload Cost Modifier
INT16 iReloadAPCostModifier = iFinalReloadAPCost - iReloadAPCost; INT16 iReloadAPCostModifier = iFinalReloadAPCost - iReloadAPCost;
@@ -7394,6 +7404,11 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject )
// Get final Manual Reload Cost // Get final Manual Reload Cost
INT16 iFinalManualReloadAPCost = Weapon[ gpItemDescObject->usItem ].APsToReloadManually; INT16 iFinalManualReloadAPCost = Weapon[ gpItemDescObject->usItem ].APsToReloadManually;
// modify by ini values
if ( Item[ gpItemDescObject->usItem ].usItemClass == IC_GUN )
iFinalManualReloadAPCost *= gItemSettings.fAPtoReloadManuallyModifierGun[ Weapon[ gpItemDescObject->usItem ].ubWeaponType ];
else if ( Item[ gpItemDescObject->usItem ].usItemClass == IC_LAUNCHER )
iFinalManualReloadAPCost *= gItemSettings.fAPtoReloadManuallyModifierLauncher;
// Get base Manual Reload Cost // Get base Manual Reload Cost
INT16 iManualReloadAPCost = iFinalManualReloadAPCost; INT16 iManualReloadAPCost = iFinalManualReloadAPCost;
+1 -1
View File
@@ -7729,7 +7729,7 @@ void DeleteItemDescriptionBox( )
{ {
if (gpAttachSoldier) if (gpAttachSoldier)
{ {
UINT8 ubAPCost = 0; INT16 ubAPCost = 0;
// check for change in attachments // check for change in attachments
//unsigned int originalSize = gOriginalAttachments.size(); //unsigned int originalSize = gOriginalAttachments.size();
+26 -10
View File
@@ -3817,22 +3817,30 @@ BOOLEAN AutoReload( SOLDIERTYPE * pSoldier )
(*pObj)[0]->data.gun.ubGunState |= GS_CARTRIDGE_IN_CHAMBER; (*pObj)[0]->data.gun.ubGunState |= GS_CARTRIDGE_IN_CHAMBER;
(*pObj)[0]->data.gun.ubGunState &= ~GS_WEAPON_BEING_RELOADED; (*pObj)[0]->data.gun.ubGunState &= ~GS_WEAPON_BEING_RELOADED;
INT16 sModifiedReloadAP = Weapon[Item[(pObj)->usItem].ubClassIndex].APsToReloadManually;
// modify by ini values
if ( Item[ pObj->usItem ].usItemClass == IC_GUN )
sModifiedReloadAP *= gItemSettings.fAPtoReloadManuallyModifierGun[ Weapon[ pObj->usItem ].ubWeaponType ];
else if ( Item[ pObj->usItem ].usItemClass == IC_LAUNCHER )
sModifiedReloadAP *= gItemSettings.fAPtoReloadManuallyModifierLauncher;
//////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////
// STOMP traits - SANDRO // STOMP traits - SANDRO
if ( gGameOptions.fNewTraitSystem ) if ( gGameOptions.fNewTraitSystem )
{ {
// Sniper trait makes chambering a round faster // Sniper trait makes chambering a round faster
if (( Weapon[Item[(pObj)->usItem].ubClassIndex].ubWeaponType == GUN_SN_RIFLE || Weapon[Item[(pObj)->usItem].ubClassIndex].ubWeaponType == GUN_RIFLE ) && HAS_SKILL_TRAIT( pSoldier, SNIPER_NT )) if (( Weapon[Item[(pObj)->usItem].ubClassIndex].ubWeaponType == GUN_SN_RIFLE || Weapon[Item[(pObj)->usItem].ubClassIndex].ubWeaponType == GUN_RIFLE ) && HAS_SKILL_TRAIT( pSoldier, SNIPER_NT ))
DeductPoints(pSoldier, ((Weapon[Item[(pObj)->usItem].ubClassIndex].APsToReloadManually * (100 - gSkillTraitValues.ubSNChamberRoundAPsReduction * NUM_SKILL_TRAITS( pSoldier, SNIPER_NT )))/100), 0); DeductPoints(pSoldier, ((sModifiedReloadAP * (100 - gSkillTraitValues.ubSNChamberRoundAPsReduction * NUM_SKILL_TRAITS( pSoldier, SNIPER_NT )))/100), 0);
// Ranger trait makes pumping shotguns faster // Ranger trait makes pumping shotguns faster
else if (( Weapon[Item[(pObj)->usItem].ubClassIndex].ubWeaponType == GUN_SHOTGUN ) && HAS_SKILL_TRAIT( pSoldier, RANGER_NT )) else if (( Weapon[Item[(pObj)->usItem].ubClassIndex].ubWeaponType == GUN_SHOTGUN ) && HAS_SKILL_TRAIT( pSoldier, RANGER_NT ))
DeductPoints(pSoldier, ((Weapon[Item[(pObj)->usItem].ubClassIndex].APsToReloadManually * (100 - gSkillTraitValues.ubRAPumpShotgunsAPsReduction * NUM_SKILL_TRAITS( pSoldier, RANGER_NT )))/100), 0); DeductPoints(pSoldier, ((sModifiedReloadAP * (100 - gSkillTraitValues.ubRAPumpShotgunsAPsReduction * NUM_SKILL_TRAITS( pSoldier, RANGER_NT )))/100), 0);
else else
DeductPoints(pSoldier, Weapon[Item[(pObj)->usItem].ubClassIndex].APsToReloadManually, 0); DeductPoints(pSoldier, sModifiedReloadAP, 0);
} }
else else
{ {
DeductPoints(pSoldier, Weapon[Item[(pObj)->usItem].ubClassIndex].APsToReloadManually, 0); DeductPoints(pSoldier, sModifiedReloadAP, 0);
} }
//////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -3861,22 +3869,30 @@ BOOLEAN AutoReload( SOLDIERTYPE * pSoldier )
{ {
(*pObj2)[0]->data.gun.ubGunState |= GS_CARTRIDGE_IN_CHAMBER; (*pObj2)[0]->data.gun.ubGunState |= GS_CARTRIDGE_IN_CHAMBER;
INT16 sModifiedReloadAP = Weapon[Item[(pObj2)->usItem].ubClassIndex].APsToReloadManually;
// modify by ini values
if ( Item[ pObj2->usItem ].usItemClass == IC_GUN )
sModifiedReloadAP *= gItemSettings.fAPtoReloadManuallyModifierGun[ Weapon[ pObj2->usItem ].ubWeaponType ];
else if ( Item[ pObj2->usItem ].usItemClass == IC_LAUNCHER )
sModifiedReloadAP *= gItemSettings.fAPtoReloadManuallyModifierLauncher;
//////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////
// STOMP traits - SANDRO // STOMP traits - SANDRO
if ( gGameOptions.fNewTraitSystem ) if ( gGameOptions.fNewTraitSystem )
{ {
// Sniper trait makes chambering a round faster // Sniper trait makes chambering a round faster
if (( Weapon[Item[(pObj2)->usItem].ubClassIndex].ubWeaponType == GUN_SN_RIFLE || Weapon[Item[(pObj2)->usItem].ubClassIndex].ubWeaponType == GUN_RIFLE ) && HAS_SKILL_TRAIT( pSoldier, SNIPER_NT )) if (( Weapon[Item[(pObj2)->usItem].ubClassIndex].ubWeaponType == GUN_SN_RIFLE || Weapon[Item[(pObj2)->usItem].ubClassIndex].ubWeaponType == GUN_RIFLE ) && HAS_SKILL_TRAIT( pSoldier, SNIPER_NT ))
DeductPoints(pSoldier, ((Weapon[Item[(pObj2)->usItem].ubClassIndex].APsToReloadManually * (100 - gSkillTraitValues.ubSNChamberRoundAPsReduction * NUM_SKILL_TRAITS( pSoldier, SNIPER_NT )))/100), 0); DeductPoints(pSoldier, ((sModifiedReloadAP * (100 - gSkillTraitValues.ubSNChamberRoundAPsReduction * NUM_SKILL_TRAITS( pSoldier, SNIPER_NT )))/100), 0);
// Ranger trait makes pumping shotguns faster // Ranger trait makes pumping shotguns faster
else if (( Weapon[Item[(pObj2)->usItem].ubClassIndex].ubWeaponType == GUN_SHOTGUN ) && HAS_SKILL_TRAIT( pSoldier, RANGER_NT )) else if (( Weapon[Item[(pObj2)->usItem].ubClassIndex].ubWeaponType == GUN_SHOTGUN ) && HAS_SKILL_TRAIT( pSoldier, RANGER_NT ))
DeductPoints(pSoldier, ((Weapon[Item[(pObj2)->usItem].ubClassIndex].APsToReloadManually * (100 - gSkillTraitValues.ubRAPumpShotgunsAPsReduction * NUM_SKILL_TRAITS( pSoldier, RANGER_NT )))/100), 0); DeductPoints(pSoldier, ((sModifiedReloadAP * (100 - gSkillTraitValues.ubRAPumpShotgunsAPsReduction * NUM_SKILL_TRAITS( pSoldier, RANGER_NT )))/100), 0);
else else
DeductPoints(pSoldier, Weapon[Item[(pObj2)->usItem].ubClassIndex].APsToReloadManually, 0); DeductPoints(pSoldier, sModifiedReloadAP, 0);
} }
else else
{ {
DeductPoints(pSoldier, Weapon[Item[(pObj2)->usItem].ubClassIndex].APsToReloadManually, 0); DeductPoints(pSoldier, sModifiedReloadAP, 0);
} }
//////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -13564,7 +13580,7 @@ INT16 GetAverageBestLaserRange( OBJECTTYPE * pObj )
bonus = bonus / numModifiers; bonus = bonus / numModifiers;
} }
return( bonus ); return( bonus * gItemSettings.fBestLaserRangeModifier );
} }
// get the best laser range from the weapon and attachments // get the best laser range from the weapon and attachments
@@ -13584,7 +13600,7 @@ INT16 GetBestLaserRange( OBJECTTYPE * pObj )
} }
} }
return( range ); return( range * gItemSettings.fBestLaserRangeModifier );
} }
// HEADROCK: This function determines the bipod bonii of the gun or its attachments // HEADROCK: This function determines the bipod bonii of the gun or its attachments
+14 -6
View File
@@ -2923,9 +2923,9 @@ INT16 GetAPsToReloadGunWithAmmo( SOLDIERTYPE *pSoldier, OBJECTTYPE * pGun, OBJEC
{ {
// wrong size ammo item // wrong size ammo item
if( gGameOptions.fNewTraitSystem && HAS_SKILL_TRAIT( pSoldier, AMBIDEXTROUS_NT ) ) // SANDRO - added Ambidextrous check if( gGameOptions.fNewTraitSystem && HAS_SKILL_TRAIT( pSoldier, AMBIDEXTROUS_NT ) ) // SANDRO - added Ambidextrous check
return (INT8)((((GetAPsToReload(pGun) * APBPConstants[AP_WRONG_MAG])/10)*(100 - gSkillTraitValues.ubAMReloadSpeedLoose)/100) + 0.5); return (INT16)((((GetAPsToReload(pGun) * APBPConstants[AP_WRONG_MAG])/10)*(100 - gSkillTraitValues.ubAMReloadSpeedLoose)/100) + 0.5);
else else
return (INT8)((GetAPsToReload(pGun) * APBPConstants[AP_WRONG_MAG])/10); return (INT16)((GetAPsToReload(pGun) * APBPConstants[AP_WRONG_MAG])/10);
} }
else else
{ {
@@ -2991,22 +2991,30 @@ INT16 GetAPsToAutoReload( SOLDIERTYPE * pSoldier )
//<SB> manual recharge //<SB> manual recharge
if ((*pObj)[0]->data.gun.ubGunShotsLeft && !((*pObj)[0]->data.gun.ubGunState & GS_CARTRIDGE_IN_CHAMBER) ) if ((*pObj)[0]->data.gun.ubGunShotsLeft && !((*pObj)[0]->data.gun.ubGunState & GS_CARTRIDGE_IN_CHAMBER) )
{ {
INT16 sModifiedReloadAP = Weapon[Item[(pObj)->usItem].ubClassIndex].APsToReloadManually;
// modify by ini values
if ( Item[ pObj->usItem ].usItemClass == IC_GUN )
sModifiedReloadAP *= gItemSettings.fAPtoReloadManuallyModifierGun[ Weapon[ pObj->usItem ].ubWeaponType ];
else if ( Item[ pObj->usItem ].usItemClass == IC_LAUNCHER )
sModifiedReloadAP *= gItemSettings.fAPtoReloadManuallyModifierLauncher;
//////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////
// STOMP traits - SANDRO // STOMP traits - SANDRO
if ( gGameOptions.fNewTraitSystem ) if ( gGameOptions.fNewTraitSystem )
{ {
// Sniper trait makes chambering a round faster // Sniper trait makes chambering a round faster
if (( Weapon[Item[(pObj)->usItem].ubClassIndex].ubWeaponType == GUN_SN_RIFLE || Weapon[Item[(pObj)->usItem].ubClassIndex].ubWeaponType == GUN_RIFLE ) && HAS_SKILL_TRAIT( pSoldier, SNIPER_NT )) if (( Weapon[Item[(pObj)->usItem].ubClassIndex].ubWeaponType == GUN_SN_RIFLE || Weapon[Item[(pObj)->usItem].ubClassIndex].ubWeaponType == GUN_RIFLE ) && HAS_SKILL_TRAIT( pSoldier, SNIPER_NT ))
return ( (INT16)(((Weapon[Item[(pObj)->usItem].ubClassIndex].APsToReloadManually * (100 - gSkillTraitValues.ubSNChamberRoundAPsReduction * NUM_SKILL_TRAITS( pSoldier, SNIPER_NT )))/100) + 0.5)); return ( (INT16)(((sModifiedReloadAP * (100 - gSkillTraitValues.ubSNChamberRoundAPsReduction * NUM_SKILL_TRAITS( pSoldier, SNIPER_NT )))/100) + 0.5));
// Ranger trait makes pumping shotguns faster // Ranger trait makes pumping shotguns faster
else if (( Weapon[Item[(pObj)->usItem].ubClassIndex].ubWeaponType == GUN_SHOTGUN ) && HAS_SKILL_TRAIT( pSoldier, RANGER_NT )) else if (( Weapon[Item[(pObj)->usItem].ubClassIndex].ubWeaponType == GUN_SHOTGUN ) && HAS_SKILL_TRAIT( pSoldier, RANGER_NT ))
return ( (INT16)(((Weapon[Item[(pObj)->usItem].ubClassIndex].APsToReloadManually * (100 - gSkillTraitValues.ubRAPumpShotgunsAPsReduction * NUM_SKILL_TRAITS( pSoldier, RANGER_NT )))/100) + 0.5)); return ( (INT16)(((sModifiedReloadAP * (100 - gSkillTraitValues.ubRAPumpShotgunsAPsReduction * NUM_SKILL_TRAITS( pSoldier, RANGER_NT )))/100) + 0.5));
else else
return (Weapon[Item[(pObj)->usItem].ubClassIndex].APsToReloadManually); return (sModifiedReloadAP);
} }
else else
{ {
return (Weapon[Item[(pObj)->usItem].ubClassIndex].APsToReloadManually); return (sModifiedReloadAP);
} }
//////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////
} }
+14 -2
View File
@@ -6370,7 +6370,13 @@ void SoldierGotHitGunFire( SOLDIERTYPE *pSoldier, UINT16 usWeaponIndex, INT16 sD
{ {
// HEADROCK HAM 3.6: Reattached "Max Distance For Messy Death" tag from the XML! God knows why it wasn't attached when they MADE THAT TAG. // HEADROCK HAM 3.6: Reattached "Max Distance For Messy Death" tag from the XML! God knows why it wasn't attached when they MADE THAT TAG.
//if (SpacesAway( pSoldier->sGridNo, Menptr[ubAttackerID].sGridNo ) <= Weapon[usWeaponIndex].maxdistformessydeath || (SpacesAway( pSoldier->sGridNo, Menptr[ubAttackerID].sGridNo ) <= MAX_BARRETT_DISTANCE_FOR_MESSY_DEATH && usWeaponIndex == BARRETT )) //if (SpacesAway( pSoldier->sGridNo, Menptr[ubAttackerID].sGridNo ) <= Weapon[usWeaponIndex].maxdistformessydeath || (SpacesAway( pSoldier->sGridNo, Menptr[ubAttackerID].sGridNo ) <= MAX_BARRETT_DISTANCE_FOR_MESSY_DEATH && usWeaponIndex == BARRETT ))
if (SpacesAway( pSoldier->sGridNo, Menptr[ubAttackerID].sGridNo ) <= Weapon[usWeaponIndex].maxdistformessydeath)
UINT8 ubDistMessy = Weapon[ usWeaponIndex ].maxdistformessydeath;
// modify by ini values
if ( Item[ usWeaponIndex ].usItemClass == IC_GUN )
ubDistMessy *= gItemSettings.fDistMessyModifierGun[ Weapon[ usWeaponIndex ].ubWeaponType ];
if (SpacesAway( pSoldier->sGridNo, Menptr[ubAttackerID].sGridNo ) <= ubDistMessy)
{ {
usNewGridNo = NewGridNo( pSoldier->sGridNo, (INT8)( DirectionInc( pSoldier->ubDirection ) ) ); usNewGridNo = NewGridNo( pSoldier->sGridNo, (INT8)( DirectionInc( pSoldier->ubDirection ) ) );
@@ -6393,7 +6399,13 @@ void SoldierGotHitGunFire( SOLDIERTYPE *pSoldier, UINT16 usWeaponIndex, INT16 sD
{ {
// HEADROCK HAM 3.6: Reattached "Max Distance For Messy Death" tag from the XML! God knows why it wasn't attached when they MADE THAT TAG. // HEADROCK HAM 3.6: Reattached "Max Distance For Messy Death" tag from the XML! God knows why it wasn't attached when they MADE THAT TAG.
//if (SpacesAway( pSoldier->sGridNo, Menptr[ubAttackerID].sGridNo ) <= Weapon[usWeaponIndex].maxdistformessydeath || (SpacesAway( pSoldier->sGridNo, Menptr[ubAttackerID].sGridNo ) <= MAX_BARRETT_DISTANCE_FOR_MESSY_DEATH && usWeaponIndex == BARRETT )) //if (SpacesAway( pSoldier->sGridNo, Menptr[ubAttackerID].sGridNo ) <= Weapon[usWeaponIndex].maxdistformessydeath || (SpacesAway( pSoldier->sGridNo, Menptr[ubAttackerID].sGridNo ) <= MAX_BARRETT_DISTANCE_FOR_MESSY_DEATH && usWeaponIndex == BARRETT ))
if (SpacesAway( pSoldier->sGridNo, Menptr[ubAttackerID].sGridNo ) <= Weapon[usWeaponIndex].maxdistformessydeath)
UINT8 ubDistMessy = Weapon[ usWeaponIndex ].maxdistformessydeath;
// modify by ini values
if ( Item[ usWeaponIndex ].usItemClass == IC_GUN )
ubDistMessy *= gItemSettings.fDistMessyModifierGun[ Weapon[ usWeaponIndex ].ubWeaponType ];
if (SpacesAway( pSoldier->sGridNo, Menptr[ubAttackerID].sGridNo ) <= ubDistMessy)
{ {
// possibly play torso explosion anim! // possibly play torso explosion anim!
+32 -6
View File
@@ -5137,8 +5137,15 @@ if (gGameExternalOptions.fUseNewCTHCalculation)
// get bonus from effects lasting on the shooter (morale, injury, shock etc.) // get bonus from effects lasting on the shooter (morale, injury, shock etc.)
fBaseModifier += CalcNewChanceToHitBaseEffectBonus(pSoldier); fBaseModifier += CalcNewChanceToHitBaseEffectBonus(pSoldier);
// Handling value modified by ini
UINT8 ubModifiedHandling = Weapon[ usInHand ].ubHandling;
if ( Item[ usInHand ].usItemClass == IC_GUN )
ubModifiedHandling *= gItemSettings.fHandlingModifierGun[ Weapon[ usInHand ].ubWeaponType ];
else if ( Item[ usInHand ].usItemClass == IC_LAUNCHER )
ubModifiedHandling *= gItemSettings.fHandlingModifierLauncher;
// Calculate how easy it is to handle the weapon // Calculate how easy it is to handle the weapon
FLOAT fGunDifficulty = (FLOAT)(( Weapon[ usInHand ].ubHandling * (100 - GetPercentReadyTimeAPReduction(pInHand) )) / 100); FLOAT fGunDifficulty = (FLOAT)(( ubModifiedHandling * (100 - GetPercentReadyTimeAPReduction(pInHand) )) / 100);
fGunDifficulty *= (FLOAT)(100 / APBPConstants[AP_MAXIMUM]); // Adjust for 100AP/25AP fGunDifficulty *= (FLOAT)(100 / APBPConstants[AP_MAXIMUM]); // Adjust for 100AP/25AP
FLOAT fGunBaseDifficulty = fGunDifficulty; FLOAT fGunBaseDifficulty = fGunDifficulty;
FLOAT fGunAimDifficulty = fGunDifficulty; FLOAT fGunAimDifficulty = fGunDifficulty;
@@ -5336,8 +5343,16 @@ else
// START OLD VERSION OF NCTH CALCULATION // START OLD VERSION OF NCTH CALCULATION
////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////
// Handling value modified by ini
UINT8 ubModifiedHandling = Weapon[ usInHand ].ubHandling;
if ( Item[ usInHand ].usItemClass == IC_GUN )
ubModifiedHandling *= gItemSettings.fHandlingModifierGun[ Weapon[ usInHand ].ubWeaponType ];
else if ( Item[ usInHand ].usItemClass == IC_LAUNCHER )
ubModifiedHandling *= gItemSettings.fHandlingModifierLauncher;
// Calculate how easy it is to handle this gun. // Calculate how easy it is to handle this gun.
FLOAT iGunDifficulty = (FLOAT)(( Weapon[ usInHand ].ubHandling * (100 - GetPercentReadyTimeAPReduction(pInHand) )) / 100); FLOAT iGunDifficulty = (FLOAT)(( ubModifiedHandling * (100 - GetPercentReadyTimeAPReduction(pInHand) )) / 100);
iGunDifficulty *= (FLOAT)(100 / APBPConstants[AP_MAXIMUM]); // Adjust for 100AP/25AP iGunDifficulty *= (FLOAT)(100 / APBPConstants[AP_MAXIMUM]); // Adjust for 100AP/25AP
FLOAT iGunBaseDifficulty = iGunDifficulty; FLOAT iGunBaseDifficulty = iGunDifficulty;
FLOAT iGunAimDifficulty = iGunDifficulty; FLOAT iGunAimDifficulty = iGunDifficulty;
@@ -9311,6 +9326,11 @@ INT32 BulletImpact( SOLDIERTYPE *pFirer, BULLET *pBullet, SOLDIERTYPE * pTarget,
AdjustImpactByHitLocation( iImpact, ubHitLocation, &iImpact, &iImpactForCrits ); AdjustImpactByHitLocation( iImpact, ubHitLocation, &iImpact, &iImpactForCrits );
UINT8 ubDistMessy = Weapon[ usAttackingWeapon ].maxdistformessydeath;
// modify by ini values
if ( Item[ usAttackingWeapon ].usItemClass == IC_GUN )
ubDistMessy *= gItemSettings.fDistMessyModifierGun[ Weapon[ usAttackingWeapon ].ubWeaponType ];
switch( ubHitLocation ) switch( ubHitLocation )
{ {
case AIM_SHOT_HEAD: case AIM_SHOT_HEAD:
@@ -9318,7 +9338,7 @@ INT32 BulletImpact( SOLDIERTYPE *pFirer, BULLET *pBullet, SOLDIERTYPE * pTarget,
// HEADROCK HAM 3.6: Reattached "Max Distance For Messy Death" tag from the XML! God knows why it wasn't attached when they MADE THAT TAG. // HEADROCK HAM 3.6: Reattached "Max Distance For Messy Death" tag from the XML! God knows why it wasn't attached when they MADE THAT TAG.
//if ( PythSpacesAway( pFirer->sGridNo, pTarget->sGridNo ) <= MAX_DISTANCE_FOR_MESSY_DEATH || (PythSpacesAway( pFirer->sGridNo, pTarget->sGridNo ) <= MAX_BARRETT_DISTANCE_FOR_MESSY_DEATH && pFirer->usAttackingWeapon == BARRETT )) //if ( PythSpacesAway( pFirer->sGridNo, pTarget->sGridNo ) <= MAX_DISTANCE_FOR_MESSY_DEATH || (PythSpacesAway( pFirer->sGridNo, pTarget->sGridNo ) <= MAX_BARRETT_DISTANCE_FOR_MESSY_DEATH && pFirer->usAttackingWeapon == BARRETT ))
// HEADROCK HAM 5.1: Using usAttackingWeapon // HEADROCK HAM 5.1: Using usAttackingWeapon
if ( PythSpacesAway( sOrigGridNo, pTarget->sGridNo ) <= Weapon[ usAttackingWeapon ].maxdistformessydeath ) if ( PythSpacesAway( sOrigGridNo, pTarget->sGridNo ) <= ubDistMessy )
{ {
if (iImpactForCrits > MIN_DAMAGE_FOR_INSTANT_KILL && iImpactForCrits < pTarget->stats.bLife) if (iImpactForCrits > MIN_DAMAGE_FOR_INSTANT_KILL && iImpactForCrits < pTarget->stats.bLife)
{ {
@@ -9372,7 +9392,7 @@ INT32 BulletImpact( SOLDIERTYPE *pFirer, BULLET *pBullet, SOLDIERTYPE * pTarget,
// HEADROCK HAM 3.6: Reattached "Max Distance For Messy Death" tag from the XML! God knows why it wasn't attached when they MADE THAT TAG. // HEADROCK HAM 3.6: Reattached "Max Distance For Messy Death" tag from the XML! God knows why it wasn't attached when they MADE THAT TAG.
//if ( PythSpacesAway( pFirer->sGridNo, pTarget->sGridNo ) <= MAX_DISTANCE_FOR_MESSY_DEATH || (PythSpacesAway( pFirer->sGridNo, pTarget->sGridNo ) <= MAX_BARRETT_DISTANCE_FOR_MESSY_DEATH && pFirer->usAttackingWeapon == BARRETT )) //if ( PythSpacesAway( pFirer->sGridNo, pTarget->sGridNo ) <= MAX_DISTANCE_FOR_MESSY_DEATH || (PythSpacesAway( pFirer->sGridNo, pTarget->sGridNo ) <= MAX_BARRETT_DISTANCE_FOR_MESSY_DEATH && pFirer->usAttackingWeapon == BARRETT ))
// HEADROCK HAM 5.1: Using usAttackingWeapon // HEADROCK HAM 5.1: Using usAttackingWeapon
if ( PythSpacesAway( sOrigGridNo, pTarget->sGridNo ) <= Weapon[ usAttackingWeapon ].maxdistformessydeath ) if ( PythSpacesAway( sOrigGridNo, pTarget->sGridNo ) <= ubDistMessy )
{ {
if (iImpact > MIN_DAMAGE_FOR_INSTANT_KILL && iImpact < pTarget->stats.bLife) if (iImpact > MIN_DAMAGE_FOR_INSTANT_KILL && iImpact < pTarget->stats.bLife)
{ {
@@ -11848,11 +11868,17 @@ bool WeaponReady(SOLDIERTYPE * pSoldier)
return false; return false;
} }
INT8 GetAPsToReload( OBJECTTYPE *pObj ) INT16 GetAPsToReload( OBJECTTYPE *pObj )
{ {
// DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("GetAPsToReload")); // DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("GetAPsToReload"));
// modify by ini values
FLOAT fModifier = 1.0;
if ( Item[ pObj->usItem ].usItemClass == IC_GUN )
fModifier = gItemSettings.fAPtoReloadModifierGun[ Weapon[ pObj->usItem ].ubWeaponType ];
else if ( Item[ pObj->usItem ].usItemClass == IC_LAUNCHER )
fModifier = gItemSettings.fAPtoReloadModifierLauncher;
return ( Weapon[ pObj->usItem ].APsToReload * return ( Weapon[ pObj->usItem ].APsToReload * fModifier *
( 100 - GetPercentReloadTimeAPReduction(pObj) ) ) / 100; ( 100 - GetPercentReloadTimeAPReduction(pObj) ) ) / 100;
} }
+1 -1
View File
@@ -514,7 +514,7 @@ UINT16 GetMagSize( OBJECTTYPE *pObj, UINT8 subObject = 0 );
UINT16 GetExpMagSize( OBJECTTYPE *pObj ); UINT16 GetExpMagSize( OBJECTTYPE *pObj );
UINT8 GetAmmoType( OBJECTTYPE *pObj ); UINT8 GetAmmoType( OBJECTTYPE *pObj );
bool WeaponReady(SOLDIERTYPE * pSoldier); bool WeaponReady(SOLDIERTYPE * pSoldier);
INT8 GetAPsToReload( OBJECTTYPE *pObj ); INT16 GetAPsToReload( OBJECTTYPE *pObj );
// HEADROCK HAM 3.4: Estimate bullets left in gun. Returns an "errorcode" telling the calling function if the check // HEADROCK HAM 3.4: Estimate bullets left in gun. Returns an "errorcode" telling the calling function if the check
// was successful and to what degree. // was successful and to what degree.
+24 -8
View File
@@ -2347,22 +2347,30 @@ INT8 TryToReload( SOLDIERTYPE * pSoldier )
{ {
(*pObj)[0]->data.gun.ubGunState |= GS_CARTRIDGE_IN_CHAMBER; (*pObj)[0]->data.gun.ubGunState |= GS_CARTRIDGE_IN_CHAMBER;
INT16 sModifiedReloadAP = Weapon[Item[(pObj)->usItem].ubClassIndex].APsToReloadManually;
// modify by ini values
if ( Item[ pObj->usItem ].usItemClass == IC_GUN )
sModifiedReloadAP *= gItemSettings.fAPtoReloadManuallyModifierGun[ Weapon[ pObj->usItem ].ubWeaponType ];
else if ( Item[ pObj->usItem ].usItemClass == IC_LAUNCHER )
sModifiedReloadAP *= gItemSettings.fAPtoReloadManuallyModifierLauncher;
//////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////
// STOMP traits - SANDRO // STOMP traits - SANDRO
if ( gGameOptions.fNewTraitSystem ) if ( gGameOptions.fNewTraitSystem )
{ {
// Sniper trait makes chambering a round faster // Sniper trait makes chambering a round faster
if (( Weapon[Item[(pObj)->usItem].ubClassIndex].ubWeaponType == GUN_SN_RIFLE || Weapon[Item[(pObj)->usItem].ubClassIndex].ubWeaponType == GUN_RIFLE ) && HAS_SKILL_TRAIT( pSoldier, SNIPER_NT )) if (( Weapon[Item[(pObj)->usItem].ubClassIndex].ubWeaponType == GUN_SN_RIFLE || Weapon[Item[(pObj)->usItem].ubClassIndex].ubWeaponType == GUN_RIFLE ) && HAS_SKILL_TRAIT( pSoldier, SNIPER_NT ))
DeductPoints(pSoldier, (INT16)(((Weapon[Item[(pObj)->usItem].ubClassIndex].APsToReloadManually * (100 - gSkillTraitValues.ubSNChamberRoundAPsReduction * NUM_SKILL_TRAITS( pSoldier, SNIPER_NT )))/100) + 0.5), 0); DeductPoints(pSoldier, (INT16)(((sModifiedReloadAP * (100 - gSkillTraitValues.ubSNChamberRoundAPsReduction * NUM_SKILL_TRAITS( pSoldier, SNIPER_NT )))/100) + 0.5), 0);
// Ranger trait makes pumping shotguns faster // Ranger trait makes pumping shotguns faster
else if (( Weapon[Item[(pObj)->usItem].ubClassIndex].ubWeaponType == GUN_SHOTGUN ) && HAS_SKILL_TRAIT( pSoldier, RANGER_NT )) else if (( Weapon[Item[(pObj)->usItem].ubClassIndex].ubWeaponType == GUN_SHOTGUN ) && HAS_SKILL_TRAIT( pSoldier, RANGER_NT ))
DeductPoints(pSoldier, (INT16)(((Weapon[Item[(pObj)->usItem].ubClassIndex].APsToReloadManually * (100 - gSkillTraitValues.ubRAPumpShotgunsAPsReduction * NUM_SKILL_TRAITS( pSoldier, RANGER_NT )))/100) + 0.5), 0); DeductPoints(pSoldier, (INT16)(((sModifiedReloadAP * (100 - gSkillTraitValues.ubRAPumpShotgunsAPsReduction * NUM_SKILL_TRAITS( pSoldier, RANGER_NT )))/100) + 0.5), 0);
else else
DeductPoints(pSoldier, Weapon[Item[(pObj)->usItem].ubClassIndex].APsToReloadManually, 0); DeductPoints(pSoldier, sModifiedReloadAP, 0);
} }
else else
{ {
DeductPoints(pSoldier, Weapon[Item[(pObj)->usItem].ubClassIndex].APsToReloadManually, 0); DeductPoints(pSoldier, sModifiedReloadAP, 0);
} }
//////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -2392,22 +2400,30 @@ INT8 TryToReload( SOLDIERTYPE * pSoldier )
{ {
(*pObj2)[0]->data.gun.ubGunState |= GS_CARTRIDGE_IN_CHAMBER; (*pObj2)[0]->data.gun.ubGunState |= GS_CARTRIDGE_IN_CHAMBER;
INT16 sModifiedReloadAP = Weapon[Item[(pObj2)->usItem].ubClassIndex].APsToReloadManually;
// modify by ini values
if ( Item[ pObj2->usItem ].usItemClass == IC_GUN )
sModifiedReloadAP *= gItemSettings.fAPtoReloadManuallyModifierGun[ Weapon[ pObj2->usItem ].ubWeaponType ];
else if ( Item[ pObj2->usItem ].usItemClass == IC_LAUNCHER )
sModifiedReloadAP *= gItemSettings.fAPtoReloadManuallyModifierLauncher;
//////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////
// STOMP traits - SANDRO (well, I don't know any one-handed sniper rifle, but what the hell...) // STOMP traits - SANDRO (well, I don't know any one-handed sniper rifle, but what the hell...)
if ( gGameOptions.fNewTraitSystem ) if ( gGameOptions.fNewTraitSystem )
{ {
// Sniper trait makes chambering a round faster // Sniper trait makes chambering a round faster
if (( Weapon[Item[(pObj2)->usItem].ubClassIndex].ubWeaponType == GUN_SN_RIFLE || Weapon[Item[(pObj2)->usItem].ubClassIndex].ubWeaponType == GUN_RIFLE ) && HAS_SKILL_TRAIT( pSoldier, SNIPER_NT )) if (( Weapon[Item[(pObj2)->usItem].ubClassIndex].ubWeaponType == GUN_SN_RIFLE || Weapon[Item[(pObj2)->usItem].ubClassIndex].ubWeaponType == GUN_RIFLE ) && HAS_SKILL_TRAIT( pSoldier, SNIPER_NT ))
DeductPoints(pSoldier, (INT16)(((Weapon[Item[(pObj2)->usItem].ubClassIndex].APsToReloadManually * (100 - gSkillTraitValues.ubSNChamberRoundAPsReduction * NUM_SKILL_TRAITS( pSoldier, SNIPER_NT )))/100) + 0.5), 0); DeductPoints(pSoldier, (INT16)(((sModifiedReloadAP * (100 - gSkillTraitValues.ubSNChamberRoundAPsReduction * NUM_SKILL_TRAITS( pSoldier, SNIPER_NT )))/100) + 0.5), 0);
// Ranger trait makes pumping shotguns faster // Ranger trait makes pumping shotguns faster
else if (( Weapon[Item[(pObj2)->usItem].ubClassIndex].ubWeaponType == GUN_SHOTGUN ) && HAS_SKILL_TRAIT( pSoldier, RANGER_NT )) else if (( Weapon[Item[(pObj2)->usItem].ubClassIndex].ubWeaponType == GUN_SHOTGUN ) && HAS_SKILL_TRAIT( pSoldier, RANGER_NT ))
DeductPoints(pSoldier, (INT16)(((Weapon[Item[(pObj2)->usItem].ubClassIndex].APsToReloadManually * (100 - gSkillTraitValues.ubRAPumpShotgunsAPsReduction * NUM_SKILL_TRAITS( pSoldier, RANGER_NT )))/100) + 0.5), 0); DeductPoints(pSoldier, (INT16)(((sModifiedReloadAP * (100 - gSkillTraitValues.ubRAPumpShotgunsAPsReduction * NUM_SKILL_TRAITS( pSoldier, RANGER_NT )))/100) + 0.5), 0);
else else
DeductPoints(pSoldier, Weapon[Item[(pObj2)->usItem].ubClassIndex].APsToReloadManually, 0); DeductPoints(pSoldier, sModifiedReloadAP, 0);
} }
else else
{ {
DeductPoints(pSoldier, Weapon[Item[(pObj2)->usItem].ubClassIndex].APsToReloadManually, 0); DeductPoints(pSoldier, sModifiedReloadAP, 0);
} }
//////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////