mirror of
https://github.com/1dot13/source.git
synced 2026-08-19 14:20:30 +02:00
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:
@@ -6224,6 +6224,11 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject )
|
||||
|
||||
// Get base Gun Handling value
|
||||
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
|
||||
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) )
|
||||
{
|
||||
// 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
|
||||
iProjectionModifier = ((FLOAT)GetBestLaserRange( gpItemDescObject ) / CELL_X_SIZE);
|
||||
// Get final laser range
|
||||
@@ -6728,9 +6733,9 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject )
|
||||
sHeight = gItemDescGenRegions[ubNumLine][1].sBottom - sTop;
|
||||
|
||||
// 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
|
||||
INT16 iFinalBestLaserRangeValue = GetAverageBestLaserRange( gpItemDescObject ) / 10;
|
||||
INT16 iFinalBestLaserRangeValue = GetAverageBestLaserRange( gpItemDescObject ) / CELL_X_SIZE;
|
||||
// Get Best Laser Range Modifier value
|
||||
INT16 iBestLaserRangeModifier = iFinalBestLaserRangeValue - iBestLaserRangeValue;
|
||||
|
||||
@@ -7330,6 +7335,11 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject )
|
||||
|
||||
// Get base Reload Cost
|
||||
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
|
||||
INT16 iReloadAPCostModifier = iFinalReloadAPCost - iReloadAPCost;
|
||||
@@ -7394,6 +7404,11 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject )
|
||||
|
||||
// Get final Manual Reload Cost
|
||||
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
|
||||
INT16 iManualReloadAPCost = iFinalManualReloadAPCost;
|
||||
|
||||
@@ -7729,7 +7729,7 @@ void DeleteItemDescriptionBox( )
|
||||
{
|
||||
if (gpAttachSoldier)
|
||||
{
|
||||
UINT8 ubAPCost = 0;
|
||||
INT16 ubAPCost = 0;
|
||||
|
||||
// check for change in attachments
|
||||
//unsigned int originalSize = gOriginalAttachments.size();
|
||||
|
||||
+26
-10
@@ -3817,22 +3817,30 @@ BOOLEAN AutoReload( SOLDIERTYPE * pSoldier )
|
||||
(*pObj)[0]->data.gun.ubGunState |= GS_CARTRIDGE_IN_CHAMBER;
|
||||
(*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
|
||||
if ( gGameOptions.fNewTraitSystem )
|
||||
{
|
||||
// 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 ))
|
||||
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
|
||||
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
|
||||
DeductPoints(pSoldier, Weapon[Item[(pObj)->usItem].ubClassIndex].APsToReloadManually, 0);
|
||||
DeductPoints(pSoldier, sModifiedReloadAP, 0);
|
||||
}
|
||||
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;
|
||||
|
||||
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
|
||||
if ( gGameOptions.fNewTraitSystem )
|
||||
{
|
||||
// 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 ))
|
||||
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
|
||||
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
|
||||
DeductPoints(pSoldier, Weapon[Item[(pObj2)->usItem].ubClassIndex].APsToReloadManually, 0);
|
||||
DeductPoints(pSoldier, sModifiedReloadAP, 0);
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
return( bonus );
|
||||
return( bonus * gItemSettings.fBestLaserRangeModifier );
|
||||
}
|
||||
|
||||
// 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
|
||||
|
||||
+14
-6
@@ -2923,9 +2923,9 @@ INT16 GetAPsToReloadGunWithAmmo( SOLDIERTYPE *pSoldier, OBJECTTYPE * pGun, OBJEC
|
||||
{
|
||||
// wrong size ammo item
|
||||
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
|
||||
return (INT8)((GetAPsToReload(pGun) * APBPConstants[AP_WRONG_MAG])/10);
|
||||
return (INT16)((GetAPsToReload(pGun) * APBPConstants[AP_WRONG_MAG])/10);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2991,22 +2991,30 @@ INT16 GetAPsToAutoReload( SOLDIERTYPE * pSoldier )
|
||||
//<SB> manual recharge
|
||||
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
|
||||
if ( gGameOptions.fNewTraitSystem )
|
||||
{
|
||||
// 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 ))
|
||||
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
|
||||
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
|
||||
return (Weapon[Item[(pObj)->usItem].ubClassIndex].APsToReloadManually);
|
||||
return (sModifiedReloadAP);
|
||||
}
|
||||
else
|
||||
{
|
||||
return (Weapon[Item[(pObj)->usItem].ubClassIndex].APsToReloadManually);
|
||||
return (sModifiedReloadAP);
|
||||
}
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
//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 ) ) );
|
||||
|
||||
@@ -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.
|
||||
//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!
|
||||
|
||||
+33
-7
@@ -5137,8 +5137,15 @@ if (gGameExternalOptions.fUseNewCTHCalculation)
|
||||
// get bonus from effects lasting on the shooter (morale, injury, shock etc.)
|
||||
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
|
||||
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
|
||||
FLOAT fGunBaseDifficulty = fGunDifficulty;
|
||||
FLOAT fGunAimDifficulty = fGunDifficulty;
|
||||
@@ -5336,8 +5343,16 @@ else
|
||||
// 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.
|
||||
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
|
||||
FLOAT iGunBaseDifficulty = iGunDifficulty;
|
||||
FLOAT iGunAimDifficulty = iGunDifficulty;
|
||||
@@ -9310,7 +9325,12 @@ INT32 BulletImpact( SOLDIERTYPE *pFirer, BULLET *pBullet, SOLDIERTYPE * pTarget,
|
||||
|
||||
|
||||
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 )
|
||||
{
|
||||
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.
|
||||
//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
|
||||
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)
|
||||
{
|
||||
@@ -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.
|
||||
//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
|
||||
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)
|
||||
{
|
||||
@@ -11848,11 +11868,17 @@ bool WeaponReady(SOLDIERTYPE * pSoldier)
|
||||
return false;
|
||||
}
|
||||
|
||||
INT8 GetAPsToReload( OBJECTTYPE *pObj )
|
||||
INT16 GetAPsToReload( OBJECTTYPE *pObj )
|
||||
{
|
||||
// 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;
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -514,7 +514,7 @@ UINT16 GetMagSize( OBJECTTYPE *pObj, UINT8 subObject = 0 );
|
||||
UINT16 GetExpMagSize( OBJECTTYPE *pObj );
|
||||
UINT8 GetAmmoType( OBJECTTYPE *pObj );
|
||||
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
|
||||
// was successful and to what degree.
|
||||
|
||||
Reference in New Issue
Block a user