mirror of
https://github.com/1dot13/source.git
synced 2026-08-05 14:00:23 +02:00
Fix: mouse position was not restored after a message box was closed
Modified the Ranger trait to make it more useful after loosing all survival bonuses: - aim click bonus for shotguns is now again 1 (hunter) or 2 (ranger) - new aim click bonus for rifles that is half the shotgun bonus. With the default value of "1" this means 0 for hunter and 1 for ranger. This does NOT stack with the sniper bonus! It's one or the other depending on which is higher. - new speed bonus to reloading single shells into shotguns - new range bonus for shotguns of 10% (hunter) or 20% (ranger) EDB now displays the trait modified values for: - Gun Range - Draw Cost git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7761 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+23
-10
@@ -3008,20 +3008,33 @@ INT16 GetAPsToReloadGunWithAmmo( SOLDIERTYPE *pSoldier, OBJECTTYPE * pGun, OBJEC
|
||||
// individually loaded guns
|
||||
int reload = 0;
|
||||
int rounds = __min((GetMagSize(pGun)-(*pGun)[0]->data.gun.ubGunShotsLeft), Magazine[Item[pAmmo->usItem].ubClassIndex].ubMagSize);
|
||||
FLOAT fSpeedBonus = 1.0;
|
||||
|
||||
// Ambidextrous check
|
||||
if( gGameOptions.fNewTraitSystem && HAS_SKILL_TRAIT( pSoldier, AMBIDEXTROUS_NT ) )
|
||||
fSpeedBonus *= (FLOAT)(100 - gSkillTraitValues.ubAMReloadSpeedLoose) / 100.0;
|
||||
|
||||
// Ranger bonus to reload shotgun shells manually
|
||||
if( Weapon[ pGun->usItem ].ubWeaponType == GUN_SHOTGUN && HAS_SKILL_TRAIT( pSoldier, RANGER_NT ) )
|
||||
fSpeedBonus *= (FLOAT)(100 - gSkillTraitValues.ubRAReloadSpeedShotgunsManual * NUM_SKILL_TRAITS( pSoldier, RANGER_NT ) ) / 100.0;
|
||||
|
||||
// limit bonus to proper values
|
||||
fSpeedBonus = __min( 1.0, __max( 0.1, fSpeedBonus ) );
|
||||
|
||||
if(!((*pGun)[0]->data.gun.ubGunState & GS_WEAPON_BEING_RELOADED))
|
||||
{
|
||||
reload = GetAPsToReload(pGun);
|
||||
// SANDRO - added Ambidextrous check
|
||||
reload = GetAPsToReload(pGun) * fSpeedBonus;
|
||||
/* // SANDRO - added Ambidextrous check
|
||||
if( gGameOptions.fNewTraitSystem && HAS_SKILL_TRAIT( pSoldier, AMBIDEXTROUS_NT ) )
|
||||
{
|
||||
reload = (INT16)(reload * (100 - gSkillTraitValues.ubAMReloadSpeedMagazines)/100);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
if(usAllAPs == 1)
|
||||
{
|
||||
for(int i = 1; i <= rounds; i++)
|
||||
{
|
||||
// SANDRO - added Ambidextrous check
|
||||
/* // SANDRO - added Ambidextrous check
|
||||
if( gGameOptions.fNewTraitSystem && HAS_SKILL_TRAIT( pSoldier, AMBIDEXTROUS_NT ) )
|
||||
{
|
||||
if(EnoughPoints(pSoldier,(reload + (i * (INT16)((APBPConstants[AP_RELOAD_LOOSE]*(100 - gSkillTraitValues.ubAMReloadSpeedLoose)/100) + 0.5))),0,FALSE) == FALSE)
|
||||
@@ -3031,23 +3044,23 @@ INT16 GetAPsToReloadGunWithAmmo( SOLDIERTYPE *pSoldier, OBJECTTYPE * pGun, OBJEC
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(EnoughPoints(pSoldier,(reload + (i * APBPConstants[AP_RELOAD_LOOSE])),0,FALSE) == FALSE)
|
||||
{*/
|
||||
if(EnoughPoints(pSoldier,(reload + (i * (INT16)(APBPConstants[AP_RELOAD_LOOSE] * fSpeedBonus + 0.5))),0,FALSE) == FALSE)
|
||||
{
|
||||
rounds = i-1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// }
|
||||
}
|
||||
}
|
||||
else if (usAllAPs == 2)
|
||||
rounds = 1;
|
||||
|
||||
// SANDRO - added Ambidextrous check
|
||||
/* // SANDRO - added Ambidextrous check
|
||||
if( gGameOptions.fNewTraitSystem && HAS_SKILL_TRAIT( pSoldier, AMBIDEXTROUS_NT ) )
|
||||
return (reload + ((INT16) (rounds * (APBPConstants[AP_RELOAD_LOOSE]*(100 - gSkillTraitValues.ubAMReloadSpeedLoose)/100) + 0.5)));
|
||||
else
|
||||
return (reload + (rounds * APBPConstants[AP_RELOAD_LOOSE]));
|
||||
else*/
|
||||
return (reload + (rounds * (INT16)(APBPConstants[AP_RELOAD_LOOSE] * fSpeedBonus + 0.5)));
|
||||
}
|
||||
|
||||
return GetAPsToReload(pGun); // added by SANDRO - safety check
|
||||
|
||||
Reference in New Issue
Block a user