mirror of
https://github.com/1dot13/source.git
synced 2026-09-09 14:46:05 +02:00
The flak jacket bonus now also applies to fragments.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8124 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+1
-1
@@ -3081,7 +3081,7 @@ BOOLEAN BulletHitMerc( BULLET * pBullet, STRUCTURE * pStructure, BOOLEAN fIntend
|
|||||||
// adjust for bullet going through person
|
// adjust for bullet going through person
|
||||||
iImpact -= CalcBodyImpactReduction( ubAmmoType, ubHitLocation );
|
iImpact -= CalcBodyImpactReduction( ubAmmoType, ubHitLocation );
|
||||||
// adjust for other side of armour!
|
// adjust for other side of armour!
|
||||||
iImpact -= TotalArmourProtection( pTarget, ubHitLocation, iImpact, ubAmmoType );
|
iImpact -= TotalArmourProtection( pTarget, ubHitLocation, iImpact, ubAmmoType, pBullet->fFragment );
|
||||||
if (iImpact > 0)
|
if (iImpact > 0)
|
||||||
{
|
{
|
||||||
pBullet->iImpact = (INT8) iImpact;
|
pBullet->iImpact = (INT8) iImpact;
|
||||||
|
|||||||
+34
-8
@@ -9391,7 +9391,7 @@ INT32 ArmourProtection( SOLDIERTYPE * pTarget, UINT16 ubArmourType, INT16 * pbSt
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
INT32 TotalArmourProtection( SOLDIERTYPE * pTarget, UINT8 ubHitLocation, INT32 iImpact, UINT8 ubAmmoType )
|
INT32 TotalArmourProtection( SOLDIERTYPE * pTarget, UINT8 ubHitLocation, INT32 iImpact, UINT8 ubAmmoType, BOOLEAN fConsiderFlak )
|
||||||
{
|
{
|
||||||
INT32 iTotalProtection = 0, iSlot;
|
INT32 iTotalProtection = 0, iSlot;
|
||||||
OBJECTTYPE * pArmour;
|
OBJECTTYPE * pArmour;
|
||||||
@@ -9405,7 +9405,7 @@ INT32 TotalArmourProtection( SOLDIERTYPE * pTarget, UINT8 ubHitLocation, INT32 i
|
|||||||
//bDummyStatus = pVehicleList[ pTarget->bVehicleID ].sExternalArmorLocationsStatus[ ubHitLocation ];
|
//bDummyStatus = pVehicleList[ pTarget->bVehicleID ].sExternalArmorLocationsStatus[ ubHitLocation ];
|
||||||
|
|
||||||
iTotalProtection += ArmourProtection( pTarget, (UINT8) pVehicleList[ pTarget->bVehicleID ].sArmourType, &bDummyStatus, iImpact, ubAmmoType, &dummyCoverage );
|
iTotalProtection += ArmourProtection( pTarget, (UINT8) pVehicleList[ pTarget->bVehicleID ].sArmourType, &bDummyStatus, iImpact, ubAmmoType, &dummyCoverage );
|
||||||
|
|
||||||
//pVehicleList[ pTarget->bVehicleID ].sExternalArmorLocationsStatus[ ubHitLocation ] = bDummyStatus;
|
//pVehicleList[ pTarget->bVehicleID ].sExternalArmorLocationsStatus[ ubHitLocation ] = bDummyStatus;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -9435,7 +9435,16 @@ INT32 TotalArmourProtection( SOLDIERTYPE * pTarget, UINT8 ubHitLocation, INT32 i
|
|||||||
for (attachmentList::iterator iter = (*pVestPack)[0]->attachments.begin(); iter != (*pVestPack)[0]->attachments.end(); ++iter) {
|
for (attachmentList::iterator iter = (*pVestPack)[0]->attachments.begin(); iter != (*pVestPack)[0]->attachments.end(); ++iter) {
|
||||||
if (Item[iter->usItem].usItemClass == IC_ARMOUR && (*iter)[0]->data.objectStatus > 0 )
|
if (Item[iter->usItem].usItemClass == IC_ARMOUR && (*iter)[0]->data.objectStatus > 0 )
|
||||||
{
|
{
|
||||||
iTotalProtection += ArmourProtection( pTarget, Item[iter->usItem].ubClassIndex, &((*iter)[0]->data.objectStatus), iImpact, ubAmmoType, &plateHit );
|
INT32 protection = ArmourProtection( pTarget, Item[iter->usItem].ubClassIndex, &((*iter)[0]->data.objectStatus), iImpact, ubAmmoType, &plateHit );
|
||||||
|
|
||||||
|
if ( fConsiderFlak && Item[iter->usItem].flakjacket )
|
||||||
|
{
|
||||||
|
// increase value for flak jackets!
|
||||||
|
protection *= 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
iTotalProtection += protection;
|
||||||
|
|
||||||
if ( (*iter)[0]->data.objectStatus < USABLE )
|
if ( (*iter)[0]->data.objectStatus < USABLE )
|
||||||
{
|
{
|
||||||
pVestPack->RemoveAttachment(&(*iter));
|
pVestPack->RemoveAttachment(&(*iter));
|
||||||
@@ -9459,19 +9468,27 @@ INT32 TotalArmourProtection( SOLDIERTYPE * pTarget, UINT8 ubHitLocation, INT32 i
|
|||||||
if (Item[iter->usItem].usItemClass == IC_ARMOUR && (*iter)[0]->data.objectStatus > 0 && iter->exists())
|
if (Item[iter->usItem].usItemClass == IC_ARMOUR && (*iter)[0]->data.objectStatus > 0 && iter->exists())
|
||||||
{
|
{
|
||||||
// bullet got through jacket; apply ceramic plate armour
|
// bullet got through jacket; apply ceramic plate armour
|
||||||
iTotalProtection += ArmourProtection( pTarget, Item[iter->usItem].ubClassIndex, &((*iter)[0]->data.objectStatus), iImpact, ubAmmoType, &plateHit );
|
INT32 protection = ArmourProtection( pTarget, Item[iter->usItem].ubClassIndex, &((*iter)[0]->data.objectStatus), iImpact, ubAmmoType, &plateHit );
|
||||||
|
|
||||||
|
if ( fConsiderFlak && Item[iter->usItem].flakjacket )
|
||||||
|
{
|
||||||
|
// increase value for flak jackets!
|
||||||
|
protection *= 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
iTotalProtection += protection;
|
||||||
|
|
||||||
if ( (*iter)[0]->data.objectStatus < USABLE )
|
if ( (*iter)[0]->data.objectStatus < USABLE )
|
||||||
{
|
{
|
||||||
// destroy plates!
|
// destroy plates!
|
||||||
pArmour->RemoveAttachment(&(*iter));
|
pArmour->RemoveAttachment(&(*iter));
|
||||||
DirtyMercPanelInterface( pTarget, DIRTYLEVEL2 );
|
DirtyMercPanelInterface( pTarget, DIRTYLEVEL2 );
|
||||||
//#ifdef ENGLISH
|
|
||||||
if ( pTarget->bTeam == gbPlayerNum )
|
if ( pTarget->bTeam == gbPlayerNum )
|
||||||
{
|
{
|
||||||
// report plates destroyed!
|
// report plates destroyed!
|
||||||
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, gzLateLocalizedString[61], pTarget->name );
|
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, gzLateLocalizedString[61], pTarget->name );
|
||||||
}
|
}
|
||||||
//#endif
|
|
||||||
}
|
}
|
||||||
break;//original code only used the first ceramic plate
|
break;//original code only used the first ceramic plate
|
||||||
}
|
}
|
||||||
@@ -9480,7 +9497,16 @@ INT32 TotalArmourProtection( SOLDIERTYPE * pTarget, UINT8 ubHitLocation, INT32 i
|
|||||||
// if the plate didn't stop the bullet...
|
// if the plate didn't stop the bullet...
|
||||||
if ( iImpact > iTotalProtection )
|
if ( iImpact > iTotalProtection )
|
||||||
{
|
{
|
||||||
iTotalProtection += ArmourProtection( pTarget, Item[pArmour->usItem].ubClassIndex, &((*pArmour)[0]->data.objectStatus), iImpact, ubAmmoType, &plateHit );
|
INT32 protection = ArmourProtection( pTarget, Item[pArmour->usItem].ubClassIndex, &((*pArmour)[0]->data.objectStatus), iImpact, ubAmmoType, &plateHit );
|
||||||
|
|
||||||
|
if ( fConsiderFlak && Item[pArmour->usItem].flakjacket )
|
||||||
|
{
|
||||||
|
// increase value for flak jackets!
|
||||||
|
protection *= 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
iTotalProtection += protection;
|
||||||
|
|
||||||
if ( (*pArmour)[0]->data.objectStatus < USABLE )
|
if ( (*pArmour)[0]->data.objectStatus < USABLE )
|
||||||
{
|
{
|
||||||
//Madd: put any attachments that someone might have added to the armour in the merc's inventory
|
//Madd: put any attachments that someone might have added to the armour in the merc's inventory
|
||||||
@@ -9631,7 +9657,7 @@ INT32 BulletImpact( SOLDIERTYPE *pFirer, BULLET *pBullet, SOLDIERTYPE * pTarget,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
iTotalArmourProtection = TotalArmourProtection( pTarget, ubHitLocation, iOrigImpact, ubAmmoType );
|
iTotalArmourProtection = TotalArmourProtection( pTarget, ubHitLocation, iOrigImpact, ubAmmoType, pBullet->fFragment );
|
||||||
iImpact = iOrigImpact - iTotalArmourProtection;
|
iImpact = iOrigImpact - iTotalArmourProtection;
|
||||||
|
|
||||||
// sevenfm: store armour protection
|
// sevenfm: store armour protection
|
||||||
|
|||||||
+1
-1
@@ -488,7 +488,7 @@ extern BOOLEAN IsGunWeaponModeCapable( OBJECTTYPE* pObject, WeaponMode weaponMod
|
|||||||
extern BOOLEAN IsGunBurstCapable( OBJECTTYPE* pObject, BOOLEAN fNotify, SOLDIERTYPE *pSoldier = NULL );
|
extern BOOLEAN IsGunBurstCapable( OBJECTTYPE* pObject, BOOLEAN fNotify, SOLDIERTYPE *pSoldier = NULL );
|
||||||
extern BOOLEAN IsGunAutofireCapable( OBJECTTYPE* pObject );
|
extern BOOLEAN IsGunAutofireCapable( OBJECTTYPE* pObject );
|
||||||
extern INT32 CalcBodyImpactReduction( UINT8 ubAmmoType, UINT8 ubHitLocation );
|
extern INT32 CalcBodyImpactReduction( UINT8 ubAmmoType, UINT8 ubHitLocation );
|
||||||
extern INT32 TotalArmourProtection( SOLDIERTYPE * pTarget, UINT8 ubHitLocation, INT32 iImpact, UINT8 ubAmmoType );
|
INT32 TotalArmourProtection( SOLDIERTYPE * pTarget, UINT8 ubHitLocation, INT32 iImpact, UINT8 ubAmmoType, BOOLEAN fConsiderFlak );
|
||||||
extern INT32 ArmourPercent( SOLDIERTYPE * pSoldier );
|
extern INT32 ArmourPercent( SOLDIERTYPE * pSoldier );
|
||||||
|
|
||||||
extern void GetTargetWorldPositions( SOLDIERTYPE *pSoldier, INT32 sTargetGridNo, FLOAT *pdXPos, FLOAT *pdYPos, FLOAT *pdZPos );
|
extern void GetTargetWorldPositions( SOLDIERTYPE *pSoldier, INT32 sTargetGridNo, FLOAT *pdXPos, FLOAT *pdYPos, FLOAT *pdZPos );
|
||||||
|
|||||||
Reference in New Issue
Block a user