TWJunky wrote on Fri, 11 September 2020 02:54Can somebody please let me know the formula for this bAutofireShotsPerFiveAP
Exact formula from CalcAPsToAutofire:
aps = ( ( APBPConstants[AUTOFIRE_SHOTS_AP_VALUE] * bDoAutofire * bBaseActionPoints ) / GetAutofireShotsPerFiveAPs(pObj) + (APBPConstants[AP_MAXIMUM] - 1) ) / APBPConstants[AP_MAXIMUM];
aps = ( aps * ( 100 - GetPercentAPReduction(pSoldier, pObj) ) ) / 100;
Where GetAutofireShotsPerFiveAPs is calculated directly from bAutofireShotsPerFiveAP:
UINT8 GetAutofireShotsPerFiveAPs( OBJECTTYPE *pObj )
{
// HEADROCK HAM B2.6: Added overall modifier
if (Weapon[ pObj->usItem ].bAutofireShotsPerFiveAP > 0)
{
UINT8 usAutoFireShots = Weapon[ pObj->usItem ].bAutofireShotsPerFiveAP;
// modify by ini values
if ( Item[ pObj->usItem ].usItemClass == IC_GUN )
usAutoFireShots *= gItemSettings.fAFShotsPer5APModifierGun[ Weapon[ pObj->usItem ].ubWeaponType ];
// WANNE: Fix by Headrock
// Weapons shouldn't ever lose their Bp5AP due to this modifier.
return __max((usAutoFireShots + gGameExternalOptions.bAutofireBulletsPer5APModifier), 1);
}
else
return 0;
}
From APBPConstants.ini
;***********************************************************************
;* The following is used with the weapons.xml: bAutofireShotsPerFiveAP *
;* to determine how many AP we actually want the value to represent. *
;* "FiveAP" is right for a 25AP system, but 20 is more appropriate for *
;* a 100AP system. *
;***********************************************************************
AUTOFIRE_SHOTS_AP_VALUE = 20