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:
Overhaul
2007-07-09 11:06:57 +00:00
parent d318885593
commit ec4d1f6e24
2 changed files with 22 additions and 3 deletions
+17 -2
View File
@@ -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;
+5 -1
View File
@@ -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 ) );
}
}