Talk:Shotgun - Tripwire Interactive Wiki

  • Please make sure you are familiar with the forum rules. You can find them here: https://forums.tripwireinteractive.com/index.php?threads/forum-rules.2334636/

Head shot damage calculation

Something bizarre about the way ShotgunBullet.uc handles its head shot damage, in ProcessTouch() at line 154:

if (Pawn(Other) != none && Pawn(Other).IsHeadShot(HitLocation, X, 1.0))
{
	Pawn(Other).TakeDamage(Damage * HeadShotDamageMult, Instigator, HitLocation, MomentumTransfer * Normal(Velocity), MyDamageType);
}
else
{
	Other.TakeDamage(Damage, Instigator, HitLocation, MomentumTransfer * Normal(Velocity), MyDamageType);
}

If you actually test this code you'll see that the second case is the only code that gets executed, thus ignoring the class's own HeadShotDamageMulti variable. Is this a bug or is it intentional? The same applies to HuskGunProjectile.

So this leaves head damage multiplying to KFMonster.uc, which takes it from the damage class (the shotgun's damage class states x1.1 damage, as defined in KFWeaponDamageType).

It seems all weapons exclusively use the damagetype class to specify the head shot multiplier, EXCEPT the crossbow and M99 which use a value of 1.0 in the damagetype classes and instead pass the calculated value directly to the pawn from ProcessTouch.