Talk:Shotgun: Difference between revisions
mNo edit summary |
mNo edit summary |
||
(2 intermediate revisions by the same user not shown) | |||
Line 12: | Line 12: | ||
}</pre></blockquote></small> | }</pre></blockquote></small> | ||
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? | 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). | 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. | 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. |
Latest revision as of 20:17, 13 October 2012
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.