mirror of
https://github.com/1dot13/source.git
synced 2026-07-29 13:52:17 +02:00
Fix to stackable throwables:
Stop assertion failure for stack of 6 throwables. Report correct damage and AP for stacked throwables. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@1036 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+17
-2
@@ -1170,7 +1170,14 @@ UINT8 BaseAPsToShootOrStab( INT8 bAPs, INT8 bAimSkill, OBJECTTYPE * pObj )
|
||||
// Shots per turn rating is for max. aimSkill(100), drops down to 1/2 at = 0
|
||||
// DIVIDE BY 4 AT THE END HERE BECAUSE THE SHOTS PER TURN IS NOW QUADRUPLED!
|
||||
// NB need to define shots per turn for ALL Weapons then.
|
||||
rof = Weapon[ pObj->usItem ].ubShotsPer4Turns + GetRateOfFireBonus(pObj);
|
||||
// 0verhaul: Do not calculate rate of fire bonus for stackable items (knives)
|
||||
// Their info is an array of item status, not weapon info, and they don't repeat
|
||||
// fire anyway.
|
||||
rof = Weapon[ pObj->usItem ].ubShotsPer4Turns;
|
||||
if (Item[ pObj->usItem ].ubPerPocket == 0)
|
||||
{
|
||||
rof += GetRateOfFireBonus(pObj);
|
||||
}
|
||||
|
||||
//Bottom = ( ( 50 + (bAimSkill / 2) ) * rof ) / 4;
|
||||
|
||||
@@ -1180,7 +1187,15 @@ UINT8 BaseAPsToShootOrStab( INT8 bAPs, INT8 bAimSkill, OBJECTTYPE * pObj )
|
||||
//return( ( ( ( 100 * Top ) / Bottom ) + 1) / 2);
|
||||
|
||||
// Snap: Refactored the formula to reduce the number of integer divisions
|
||||
Top = 8 * bAPs * ( 100 - GetPercentAPReduction(pObj) );
|
||||
Top = 8 * bAPs;
|
||||
if (Item[ pObj->usItem ].ubPerPocket == 0)
|
||||
{
|
||||
Top *= ( 100 - GetPercentAPReduction(pObj) );
|
||||
}
|
||||
else
|
||||
{
|
||||
Top *= 100;
|
||||
}
|
||||
Bottom = ( 100 + bAimSkill ) * rof;
|
||||
// (this will round to the nearest integer)
|
||||
return ( Top + Bottom / 2 ) / Bottom;
|
||||
|
||||
@@ -5690,7 +5690,11 @@ UINT8 GetDamage ( OBJECTTYPE *pObj )
|
||||
}
|
||||
else
|
||||
{
|
||||
UINT8 ubDamage = Weapon[ pObj->usItem ].ubImpact + GetDamageBonus(pObj);
|
||||
UINT8 ubDamage = Weapon[ pObj->usItem ].ubImpact;
|
||||
if (Item[ pObj->usItem ].ubPerPocket == 0)
|
||||
{
|
||||
ubDamage += GetDamageBonus(pObj);
|
||||
}
|
||||
return min(255, (UINT8)( (ubDamage) + ( (double)ubDamage / 100) * gGameExternalOptions.ubGunDamageMultiplier ) );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user