Reduce zed's stun time

This commit is contained in:
Anton Tarasenko 2021-06-12 20:18:22 +07:00
parent c536198a52
commit 710bc8e504
2 changed files with 10 additions and 6 deletions

View File

@ -121,8 +121,8 @@ simulated event SetAnimAction(name NewAction)
function float GetStunDurationMult(Pawn instigatedBy, Vector hitLocation, Vector momentum, class<NiceWeaponDamageType> damageType, function float GetStunDurationMult(Pawn instigatedBy, Vector hitLocation, Vector momentum, class<NiceWeaponDamageType> damageType,
float headshotLevel, KFPlayerReplicationInfo KFPRI){ float headshotLevel, KFPlayerReplicationInfo KFPRI){
if(headshotLevel > 0) if(headshotLevel > 0)
return 1.0; return stunDurationMultiplier;
return 0.5; return 0.5 * stunDurationMultiplier;
} }
function SpawnTwoShots(){ function SpawnTwoShots(){

View File

@ -49,6 +49,8 @@ enum EPainReaction{
// but can be configured by changing a variable's value) // but can be configured by changing a variable's value)
// Defines if zed is currently stunned // Defines if zed is currently stunned
var bool bIsStunned; var bool bIsStunned;
// By how much to change stun duration for the zed?
var float stunDurationMultiplier;
// Stun score (defined as ratio of the default health), required to stun a zed; // Stun score (defined as ratio of the default health), required to stun a zed;
// always expected to be positive. // always expected to be positive.
var float stunThreshold; var float stunThreshold;
@ -1190,11 +1192,12 @@ function float GetstunDurationMult( Pawn instigatedBy,
KFPlayerReplicationInfo KFPRI){ KFPlayerReplicationInfo KFPRI){
local class<NiceVeterancyTypes> niceVet; local class<NiceVeterancyTypes> niceVet;
// Default out // Default out
if(KFPRI == none) return 1.0; if(KFPRI == none) return stunDurationMultiplier;
niceVet = class<NiceVeterancyTypes>(KFPRI.ClientVeteranSkill); niceVet = class<NiceVeterancyTypes>(KFPRI.ClientVeteranSkill);
if(niceVet == none) return 1.0; if(niceVet == none) return stunDurationMultiplier;
// Perk's bonuses out // Perk's bonuses out
return niceVet.static.stunDurationMult( KFPRI, self, KFPawn(instigatedBy), return stunDurationMultiplier *
niceVet.static.stunDurationMult( KFPRI, self, KFPawn(instigatedBy),
damageType); damageType);
} }
function bool IsStunPossible(){ function bool IsStunPossible(){
@ -2094,6 +2097,7 @@ state ZombieDying {
} }
defaultproperties defaultproperties
{ {
stunDurationMultiplier=0.5
StunThreshold=0.666000 StunThreshold=0.666000
remainingStuns=-1 remainingStuns=-1
lastStunTime=-1.000000 lastStunTime=-1.000000