Buff enforcer

This commit is contained in:
Anton Tarasenko 2023-01-23 02:03:36 +07:00
commit 2135c0b46b
20 changed files with 288 additions and 156 deletions

View file

@ -68,14 +68,17 @@ static function HitZed(NiceBullet bullet, NiceReplicationInfo niceRI, KFMonster
local NiceHumanPawn nicePawn;
local NicePlayerController nicePlayer;
local class<NiceVeterancyTypes> niceVet;
nicePlayer = NicePlayerController(bullet.Instigator.Controller);
if ( nicePlayer != none && nicePlayer.abilityManager != none
&& nicePlayer.abilityManager.IsAbilityActive(class'NiceSkillEnforcerBruteA'.default.abilityID)) {
headshotLevel = 0.0;
}
bIsHeadshot = (headshotLevel > 0.0);
bIsPreciseHeadshot = (headshotLevel > bullet.charDamageType.default.prReqPrecise);
if(!bullet.bAlreadyHitZed || bIsHeadshot)
HandleCalibration(bIsHeadshot, NiceHumanPawn(bullet.Instigator), NiceMonster(kfZed));
if(bIsHeadshot && bullet.sourceWeapon != none)
bullet.sourceWeapon.lastHeadshotTime = bullet.Level.TimeSeconds;
// Try to get necessary variables and bail in case they're unaccessible
nicePlayer = NicePlayerController(bullet.Instigator.Controller);
if(nicePlayer == none)
return;
nicePawn = NiceHumanPawn(bullet.instigator);

View file

@ -662,10 +662,17 @@ simulated function AccuracyUpdate(float Velocity){}
// This function is called when 'FireRate', 'FireAnimRate' or 'ReloadAnimRate' need to be updated
simulated function UpdateFireSpeed(){
local float fireSpeedMod;
local NicePlayerController nicePlayer;
fireSpeedMod = GetFireSpeed();
if (instigator != none) {
nicePlayer = NicePlayerController(instigator.controller);
}
if(NiceSingle(Weapon) != none || NiceDualies(Weapon) != none)
fireSpeedMod /= (Level.TimeDilation / 1.1);
fireSpeedMod *= 1.0 + 1.1 * (zedTimeFireSpeedUp - 1.0) * (1.1 - Level.TimeDilation);
if(nicePlayer != none && nicePlayer.IsZedTimeActive() && class'NiceVeterancyTypes'.static.HasSkill(nicePlayer, class'NiceSkillEnforcerZEDBarrage')) {
fireSpeedMod *= 2.0;
}
FireRate = default.FireRate / fireSpeedMod;
FireAnimRate = default.FireAnimRate * fireSpeedMod;
ReloadAnimRate = default.ReloadAnimRate * fireSpeedMod;

View file

@ -246,7 +246,7 @@ simulated function PostBeginPlay(){
function bool ShouldLeaveIronsight(){
local class<NiceVeterancyTypes> niceVet;
niceVet = class'NiceVeterancyTypes'.static.GetVeterancy(Instigator.PlayerReplicationInfo);
if(niceVet != none && niceVet.static.hasSkill(NicePlayerController(Instigator.Controller), class'NiceSkillEnforcerUnshakable'))
if(niceVet != none && niceVet.static.hasSkill(NicePlayerController(Instigator.Controller), class'NiceSkillEnforcerUnstoppable'))
return false;
return true;
}

View file

@ -9,5 +9,6 @@ defaultproperties
FireRate=0.200000
DamageMax=63
AmmoClass=class'NiceBenelliAmmo'
Spread=1125.000000
BotRefireRate=0.200000
}

View file

@ -3,4 +3,8 @@ defaultproperties
{
DamageType=class'NiceDamTypeSpas'
AmmoClass=class'NiceSpasAmmo'
FireAnimRate=1.000000
FireRate=0.300000
Spread=625.000000
DamageMax=63
}