AmmoTypes.xml: tag <canGoThrough> replaced with <usPiercePersonChanceModifier> (unsigned integer). If value is > 0, a bullet can pierce a person after hitting. Higher values increase the chance to do so. Vehicles can now be pierced as well.

Requires GameDir >= r2360.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8378 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2017-01-27 22:35:31 +00:00
parent fd09d16b4d
commit d2a4d53a0a
3 changed files with 11 additions and 8 deletions
+6 -3
View File
@@ -3112,9 +3112,10 @@ BOOLEAN BulletHitMerc( BULLET * pBullet, STRUCTURE * pStructure, BOOLEAN fIntend
}
SWeaponHit.ubSpecial = ubSpecial;
// Flugente: we already accounted in the impact calculation whether this is a vehicle or not. Vehicles can be pierced just as well.
// now check to see if the bullet goes THROUGH this person! (not vehicles)
// HEADROCK HAM 5: Attacking weapon already defined above.
if ( !(pTarget->flags.uiStatusFlags & SOLDIER_VEHICLE) && (AmmoTypes[ubAmmoType].canGoThrough) && !EXPLOSIVE_GUN( usAttackingWeapon ) )
if ( AmmoTypes[ubAmmoType].usPiercePersonChanceModifier > 0 && !EXPLOSIVE_GUN( usAttackingWeapon ) )
{
// if we do more damage than expected, then the bullet will be more likely
// to be lodged in the body
@@ -3130,7 +3131,9 @@ BOOLEAN BulletHitMerc( BULLET * pBullet, STRUCTURE * pStructure, BOOLEAN fIntend
{
iImpact = iDamage;
}
uiChanceThrough = (UINT8) __max( 0, ( iImpact - 20 ) );
// Flugente: a separate modifier for chance to go through
uiChanceThrough = (UINT32)__max( 0, (iImpact - 20) + AmmoTypes[ubAmmoType].usPiercePersonChanceModifier );
if (PreRandom( 100 ) < uiChanceThrough )
{
// bullet MAY go through
@@ -3460,7 +3463,7 @@ INT32 HandleBulletStructureInteraction( BULLET * pBullet, STRUCTURE * pStructure
iImpactReduction = StructureResistanceIncreasedByRange( iImpactReduction, pBullet->iRange, pBullet->iLoop );
iImpactReduction = (INT32) (iImpactReduction * AmmoTypes[ubAmmoType].structureImpactReductionMultiplier / max(1,AmmoTypes[ubAmmoType].structureImpactReductionDivisor));
//switch (pBullet->pFirer->inv[ pBullet->pFirer->ubAttackingHand ][0]->data.gun.ubGunAmmoType)
//{
// case AMMO_HP:
+1 -1
View File
@@ -230,7 +230,7 @@ typedef struct
// minimum damage can be zero
BOOLEAN zeroMinimumDamage;
BOOLEAN canGoThrough;
UINT16 usPiercePersonChanceModifier;
BOOLEAN standardIssue;
UINT8 numberOfBullets;
INT32 multipleBulletDamageMultiplier;
+4 -4
View File
@@ -64,7 +64,7 @@ ammotypeStartElementHandle(void *userData, const XML_Char *name, const XML_Char
strcmp(name, "beforeArmourDamageDivisor") == 0 ||
strcmp(name, "multipleBulletDamageDivisor") == 0 ||
strcmp(name, "zeroMinimumDamage") == 0 ||
strcmp(name, "canGoThrough") == 0 ||
strcmp(name, "usPiercePersonChanceModifier") == 0 ||
strcmp(name, "standardIssue") == 0 ||
strcmp(name, "numberOfBullets") == 0 ||
//zilpin: pellet spread patterns externalized in XML
@@ -218,10 +218,10 @@ ammotypeEndElementHandle(void *userData, const XML_Char *name)
pData->curElement = ELEMENT;
pData->curAmmoType.zeroMinimumDamage = (BOOLEAN) atol(pData->szCharData);
}
else if(strcmp(name, "canGoThrough") == 0)
else if(strcmp(name, "usPiercePersonChanceModifier") == 0)
{
pData->curElement = ELEMENT;
pData->curAmmoType.canGoThrough = (BOOLEAN) atol(pData->szCharData);
pData->curAmmoType.usPiercePersonChanceModifier = (UINT16)atol( pData->szCharData );
}
else if(strcmp(name, "standardIssue") == 0)
{
@@ -448,7 +448,7 @@ BOOLEAN WriteAmmoTypeStats()
FilePrintf(hFile,"\t\t<afterArmourDamageMultiplier>%d</afterArmourDamageMultiplier>\r\n", AmmoTypes[cnt].afterArmourDamageMultiplier );
FilePrintf(hFile,"\t\t<afterArmourDamageDivisor>%d</afterArmourDamageDivisor>\r\n", AmmoTypes[cnt].afterArmourDamageDivisor );
FilePrintf(hFile,"\t\t<zeroMinimumDamage>%d</zeroMinimumDamage>\r\n", AmmoTypes[cnt].zeroMinimumDamage );
FilePrintf(hFile,"\t\t<canGoThrough>%d</canGoThrough>\r\n", AmmoTypes[cnt].canGoThrough );
FilePrintf(hFile,"\t\t<usPiercePersonChanceModifier>%d</usPiercePersonChanceModifier>\r\n", AmmoTypes[cnt].usPiercePersonChanceModifier );
FilePrintf(hFile,"\t\t<standardIssue>%d</standardIssue>\r\n", AmmoTypes[cnt].standardIssue );
FilePrintf(hFile,"\t\t<numberOfBullets>%d</numberOfBullets>\r\n", AmmoTypes[cnt].numberOfBullets );
FilePrintf(hFile,"\t\t<multipleBulletDamageMultiplier>%d</multipleBulletDamageMultiplier>\r\n", AmmoTypes[cnt].multipleBulletDamageMultiplier );