"Wut?"
No, seriously.
The way the headshot damage multiplier works currently, it's applied to the raw damage amount before damage is dealt to either the head or the body. Consequently, the multiplier affects the damage dealt to both. Apart from the silliness of having a multiplier always be applied to damage to the head (though granted, changing this by having a separate damage amount for heads, while perhaps the better solution on paper, would break backwards compatibility with all existing weapon mutators), this approach suffers from a lack of flexibility that I feel has become a sticking point in the quest for balanced weapons. What if you want a weapon to be particularly good at removing heads without doing insane amounts of damage to the body at the same time? Or, what if you want a weapon to be particularly bad at removing heads, without suffering a damage penalty? (Chainsaw, I'm looking at you.) Under the current system, neither is possible.
There is a solution to this problem: Adding another damage multiplier property to KFWeaponDamageType, called HeadShotDamageMultHead, and having the original HeadShotDamageMult property apply only to damage to the body. The appropriately altered section of KFMonster.TakeDamage() would look like this:
For those who might be wondering, the LastDamageAmount variable is used by RemoveHead, which deals that amount of damage, plus 25% of the specimen's maximum health, to the body. Given that the TakeDamage function itself also applies that damage amount further down, the net result is that the decapitating attack deals double damage to the body. Personally that strikes me as rather strange, and I'd be tempted to call it an oversight if not for the line that sets LastDamageAmount's value specifically for that purpose. Still, I think it should probably be removed (leaving just the 25% part).
Also - though this should hopefully go without saying - the various new local variables would have to be declared as well. No challenges there.
Now, you're probably hoping for some practical examples here. Unfortunately I'm going to have to disappoint you, as I'm deliberately omitting any such examples from this thread - they belong in threads about their respective perks instead. I'm really just posting this thread so that I can link to it in the others without explaining it several times over. Further, as it's an implementation detail that, in its own right, doesn't affect gameplay at all, there isn't a whole lot of room for community debate. Sorry.
Still, if you do have any comments about it, even if only to point out bugs in the code, then by all means.
No, seriously.
The way the headshot damage multiplier works currently, it's applied to the raw damage amount before damage is dealt to either the head or the body. Consequently, the multiplier affects the damage dealt to both. Apart from the silliness of having a multiplier always be applied to damage to the head (though granted, changing this by having a separate damage amount for heads, while perhaps the better solution on paper, would break backwards compatibility with all existing weapon mutators), this approach suffers from a lack of flexibility that I feel has become a sticking point in the quest for balanced weapons. What if you want a weapon to be particularly good at removing heads without doing insane amounts of damage to the body at the same time? Or, what if you want a weapon to be particularly bad at removing heads, without suffering a damage penalty? (Chainsaw, I'm looking at you.) Under the current system, neither is possible.
There is a solution to this problem: Adding another damage multiplier property to KFWeaponDamageType, called HeadShotDamageMultHead, and having the original HeadShotDamageMult property apply only to damage to the body. The appropriately altered section of KFMonster.TakeDamage() would look like this:
Code:
if ( (bDecapitated || bIsHeadShot) && class<DamTypeBurned>(DamageType) == none && class<DamTypeFlamethrower>(DamageType) == none )
{
[COLOR=yellow]HeadDamage = Damage;[/COLOR]
if(class<KFWeaponDamageType>(damageType)!=none)
[COLOR=yellow]{
HeadDamageMultBody = class<KFWeaponDamageType>(damageType).default.HeadShotDamageMult;
HeadDamageMultHead = class<KFWeaponDamageType>(damageType).default.HeadShotDamageMultHead;[/COLOR]
Damage = Damage * HeadDamageMultBody;
[COLOR=yellow]// Set -1 as the default value in KFWeaponDamageType, to be inherited by weapons that don't set it to anything else,
// and have it mimic the current behaviour
if ( HeadDamageMultHead == -1 )
HeadDamage = HeadDamage * HeadDamageMultBody;
else
HeadDamage = HeadDamage * HeadDamageMultHead;
}[/COLOR]
if ( class<DamTypeMelee>(damageType) == none && KFPRI != none &&
KFPRI.ClientVeteranSkill != none )
{
[COLOR=yellow]PerkHeadDamageMult = KFPRI.ClientVeteranSkill.Static.GetHeadShotDamMulti(KFPRI);[/COLOR]
Damage = float(Damage) * [COLOR=yellow]PerkHeadDamageMult;
HeadDamage = float(HeadDamage) * PerkHeadDamageMult;[/COLOR]
}
LastDamageAmount = Damage;
if( !bDecapitated )
{
if( bIsHeadShot )
{
// Play a sound when someone gets a headshot TODO: Put in the real sound here
if( bIsHeadShot )
{
PlaySound(sound'KF_EnemyGlobalSndTwo.Impact_Skull', SLOT_None,2.0,true,500);
}
HeadHealth -= [COLOR=yellow]HeadDamage[/COLOR];
if( HeadHealth <= 0 || Damage > Health )
{
// Award headshot here, not when zombie died.
if( Class<KFWeaponDamageType>(damageType)!=None && instigatedBy!=None && KFPlayerController(instigatedBy.Controller)!=None )
{
bLaserSightedEBRM14Headshotted = M14EBRBattleRifle(instigatedBy.Weapon) != none && M14EBRBattleRifle(instigatedBy.Weapon).bLaserActive;
Class<KFWeaponDamageType>(damageType).Static.ScoredHeadshot(KFSteamStatsAndAchievements(PlayerController(instigatedBy.Controller).SteamStatsAndAchievements), bLaserSightedEBRM14Headshotted);
}
RemoveHead();
}
}
}
}
Also - though this should hopefully go without saying - the various new local variables would have to be declared as well. No challenges there.
Now, you're probably hoping for some practical examples here. Unfortunately I'm going to have to disappoint you, as I'm deliberately omitting any such examples from this thread - they belong in threads about their respective perks instead. I'm really just posting this thread so that I can link to it in the others without explaining it several times over. Further, as it's an implementation detail that, in its own right, doesn't affect gameplay at all, there isn't a whole lot of room for community debate. Sorry.
Still, if you do have any comments about it, even if only to point out bugs in the code, then by all means.