Hardcoded classes removed #8

Merged
NikC- merged 8 commits from :zedtest4 into master 2022-01-21 20:40:09 +03:00
Showing only changes of commit 08ff5df2e7 - Show all commits

View File

@ -750,6 +750,7 @@ function ModFireDamage( out int damage,
if(bFireImmune) if(bFireImmune)
damage /= 10; damage /= 10;
} }
function ModHeadDamage( out int damage, function ModHeadDamage( out int damage,
Pawn instigatedBy, Pawn instigatedBy,
Vector hitLocation, Vector hitLocation,
@ -757,22 +758,30 @@ function ModHeadDamage( out int damage,
class<NiceWeaponDamageType> dmgType, class<NiceWeaponDamageType> dmgType,
float headshotLevel, float headshotLevel,
KFPlayerReplicationInfo KFPRI, KFPlayerReplicationInfo KFPRI,
optional float lockonTime){ optional float lockonTime)
{
local bool shouldCountHS; local bool shouldCountHS;
local NicePlayerController nicePlayer; local NicePlayerController nicePlayer;
local class<NiceVeterancyTypes> niceVet; local class<NiceVeterancyTypes> niceVet;
if(instigatedBy != none)
if (instigatedBy != none)
nicePlayer = NicePlayerController(instigatedBy.Controller); nicePlayer = NicePlayerController(instigatedBy.Controller);
shouldCountHS = (lockonTime >= dmgType.default.lockonTime) shouldCountHS = (lockonTime >= dmgType.default.lockonTime)
&& (headshotLevel > dmgType.default.prReqMultiplier); && (headshotLevel > dmgType.default.prReqMultiplier);
// Weapon damage bonus // Weapon damage bonus
if(dmgType != none && shouldCountHS) if (dmgType != none && shouldCountHS)
damage *= dmgType.default.HeadShotDamageMult; damage *= dmgType.default.HeadShotDamageMult;
// Perk damage bonus // Perk damage bonus
if (KFPRI != none)
{
niceVet = class<NiceVeterancyTypes>(KFPRI.ClientVeteranSkill); niceVet = class<NiceVeterancyTypes>(KFPRI.ClientVeteranSkill);
if(KFPRI != none && niceVet != none) if (niceVet != none)
damage *= niceVet.static.GetNiceHeadShotDamMulti(KFPRI, self, dmgType); damage *= niceVet.static.GetNiceHeadShotDamMulti(KFPRI, self, dmgType);
}
} }
// This function must record damage actual value in 'damage' variable and // This function must record damage actual value in 'damage' variable and
// return value that will decide stun/flinch // return value that will decide stun/flinch
function int ModBodyDamage( out int damage, function int ModBodyDamage( out int damage,