From 2bf5f3dbe1dbac904192331dfa8040760730c028 Mon Sep 17 00:00:00 2001 From: Anton Tarasenko Date: Tue, 19 Mar 2024 13:51:38 +0700 Subject: [PATCH 1/4] Fix healing messages not showing up when healed with medic dart --- sources/NiceReplicationInfo.uc | 37 ++++++++++++------- .../BaseWeaponClasses/Medic/NiceMedicGun.uc | 22 ++++++----- 2 files changed, 37 insertions(+), 22 deletions(-) diff --git a/sources/NiceReplicationInfo.uc b/sources/NiceReplicationInfo.uc index a685f4e..01295a2 100644 --- a/sources/NiceReplicationInfo.uc +++ b/sources/NiceReplicationInfo.uc @@ -203,34 +203,45 @@ simulated function RemovePoisonAndBleed(NiceHumanPawn healed) } // Tells server to heal given human pawn. -simulated function ServerHealTarget(NiceHumanPawn healed, float charPotency, - Pawn instigator){ +simulated function ServerHealTarget( + NiceHumanPawn healed, + float charPotency, + Pawn instigator +) { local NiceHumanPawn healer; + local PlayerController healedPC; local KFPlayerReplicationInfo KFPRI; + local NiceMedicGun healingTool; local float healTotal; local float healPotency; + if(instigator == none || healed == none) return; if(healed.health <= 0 || healed.health >= healed.healthMax) return; KFPRI = KFPlayerReplicationInfo(instigator.PlayerReplicationInfo); - if(KFPRI == none || KFPRI.ClientVeteranSkill == none) - return; + if(KFPRI == none || KFPRI.ClientVeteranSkill == none) return; healer = NiceHumanPawn(instigator); - if(healer == none) - return; + if(healer == none) return; + + healingTool = NiceMedicGun(healer.weapon); healPotency = KFPRI.ClientVeteranSkill.static.GetHealPotency(KFPRI); healTotal = charPotency * healPotency; - healer.AlphaAmount = 255; - if(NiceMedicGun(healer.weapon) != none) - NiceMedicGun(healer.weapon).ClientSuccessfulHeal(healer, healed); - if(healed.health >= healed.healthMax){ + if(healingTool != none) { + healingTool.ClientSuccessfulHeal(healer, healed); + } + healedPC = PlayerController(healed.controller); + if(healedPC != none) { + healedPC.ClientMessage( + "You've been healed by" @ healer.GetPlayerName(), + 'CriticalEvent'); + } + if(healed.health >= healed.healthMax) { healed.GiveHealth(healTotal, healed.healthMax); return; } HandleNiceHealingMechanicsAndSkills(healer, healed, healPotency); - if(healed.health < healed.healthMax){ - healed.TakeHealing( healed, healTotal, healPotency, - KFWeapon(instigator.weapon)); + if(healed.health < healed.healthMax) { + healed.TakeHealing(healed, healTotal, healPotency, healingTool); } RemovePoisonAndBleed(healed); } diff --git a/sources/Weapons/BaseWeaponClasses/Medic/NiceMedicGun.uc b/sources/Weapons/BaseWeaponClasses/Medic/NiceMedicGun.uc index 4f37338..f18064d 100644 --- a/sources/Weapons/BaseWeaponClasses/Medic/NiceMedicGun.uc +++ b/sources/Weapons/BaseWeaponClasses/Medic/NiceMedicGun.uc @@ -66,15 +66,19 @@ simulated function WeaponTick(float dt){ } super.WeaponTick(dt); } -simulated function ClientSuccessfulHeal(NiceHumanPawn healer, NiceHumanPawn healed){ - if(healed == none) - return; - if(instigator != none && PlayerController(instigator.controller) != none) - PlayerController(instigator.controller). - ClientMessage("You've healed"@healed.GetPlayerName(), 'CriticalEvent'); - if(NiceHumanPawn(instigator) != none && PlayerController(healed.controller) != none) - PlayerController(healed.controller). - ClientMessage("You've been healed by"@healer.GetPlayerName(), 'CriticalEvent'); + +simulated function ClientSuccessfulHeal( + NiceHumanPawn healer, + NiceHumanPawn healed +){ + if(healed == none) { + return; + } + if(instigator != none && PlayerController(instigator.controller) != none) { + PlayerController(instigator.controller).ClientMessage( + "You've healed" @ healed.GetPlayerName(), + 'CriticalEvent'); + } } defaultproperties -- 2.20.1 From 87f60c9c60c4c0081d4e14d3db8d707f537883f1 Mon Sep 17 00:00:00 2001 From: Anton Tarasenko Date: Tue, 19 Mar 2024 14:34:24 +0700 Subject: [PATCH 2/4] Add visual counter for health regen from healing --- sources/GUI/NiceInteraction.uc | 36 +++++++++++++++++++++++++++++++--- sources/NiceHumanPawn.uc | 2 +- 2 files changed, 34 insertions(+), 4 deletions(-) diff --git a/sources/GUI/NiceInteraction.uc b/sources/GUI/NiceInteraction.uc index a52af06..103d2cd 100644 --- a/sources/GUI/NiceInteraction.uc +++ b/sources/GUI/NiceInteraction.uc @@ -107,6 +107,10 @@ function PostRender(Canvas C) local int x, y, center, barWidth, offset; local int missesWidth, missesHeight, missesSpace; local int missesX, missesY; + local TeamInfo team; + local int healthToGive, totalExpectedHealth; + local float textWidth, textHeight; + local string textToDraw; // local Vector CamPos, ViewDir; // local Rotator CamRot; // local float OffsetX, BarLength, BarHeight, XL, YL, posY; @@ -256,6 +260,32 @@ function PostRender(Canvas C) } } + team = C.ViewPort.Actor.Pawn.PlayerReplicationInfo.Team; + //// Draw health still in regen timer + healthToGive = ScrnHumanPawn(C.ViewPort.Actor.Pawn).clientHealthToGive; + if (healthToGive > 0) { + totalExpectedHealth = healthToGive + C.ViewPort.Actor.Pawn.health;; + C.Font = class'ROHUD'.Static.LoadSmallFontStatic(3); + if (totalExpectedHealth >= C.ViewPort.Actor.Pawn.healthMax) { + if(team.teamIndex == 0) { + C.SetDrawColor(255, 64, 64); + } + else { + C.SetDrawColor( + team.teamColor.R, + team.teamColor.G, + team.teamColor.B); + } + } + else { + C.SetDrawColor(128, 128, 128); + } + textToDraw = "+" $ healthToGive; + C.TextSize(textToDraw, textWidth, textHeight); + C.SetPos(C.ClipX * 0.05, C.ClipY * 0.9); + C.DrawText(textToDraw); + } + //// Draw cooldowns if (nicePlayer.abilityManager == none) return; @@ -273,7 +303,7 @@ function PostRender(Canvas C) { if (niceMutator.niceCounterSet[i].value != 0 || niceMutator.niceCounterSet[i].bShowZeroValue) { - DrawCounter(C, niceMutator.niceCounterSet[i], x, y, C.ViewPort.Actor.Pawn.PlayerReplicationInfo.Team); + DrawCounter(C, niceMutator.niceCounterSet[i], x, y, team); x += 128 + 4; } } @@ -283,7 +313,7 @@ function PostRender(Canvas C) function DrawCounter(Canvas C, NicePack.CounterDisplay counter, int x, int y, TeamInfo team){ local float borderSpace; local Texture textureToDraw; - local float textWidth, textHeight; + local float textWidth, textHeight; local string textToDraw; // Some per-defined values for drawing local int iconSize, backgroundWidth, backgroundHeight; @@ -320,7 +350,7 @@ function DrawAbilityCooldown(Canvas C, int abilityIndex){ local class niceVet; local int x, y; local string textToDraw; - local float textWidth, textHeight; + local float textWidth, textHeight; local NiceAbilityManager.EAbilityState abilityState; if(C == none) return; if(C.ViewPort == none) return; diff --git a/sources/NiceHumanPawn.uc b/sources/NiceHumanPawn.uc index b6f1ece..448e554 100644 --- a/sources/NiceHumanPawn.uc +++ b/sources/NiceHumanPawn.uc @@ -846,7 +846,7 @@ function VeterancyChanged(){ nicePlayer.TriggerSelectEventOnPerkChange(nicePrevPerkClass, class(KFPRI.ClientVeteranSkill)); } - + super.VeterancyChanged(); } simulated function AltFire(optional float F){ -- 2.20.1 From 1bc35cc348d5e23fd76ec61fdbb419e3db0cb23f Mon Sep 17 00:00:00 2001 From: Anton Tarasenko Date: Wed, 20 Mar 2024 20:27:31 +0700 Subject: [PATCH 3/4] Balance adjustments --- sources/Weapons/Playable/Heavy/M41A/NiceM41AAmmo.uc | 4 ++-- sources/Weapons/Playable/Heavy/M41A/NiceM41APickup.uc | 2 +- .../Weapons/Playable/Heavy/M41A/NiceM41APrimaryPickup.uc | 2 +- .../Weapons/Playable/Heavy/M41A/NiceM41AProjectileAmmo.uc | 2 +- sources/Weapons/Playable/SMG/Kriss/NiceDamTypeKrissM.uc | 2 +- sources/Weapons/Playable/SMG/Kriss/NiceKrissMFire.uc | 4 ++-- sources/Weapons/Playable/SMG/MP5M/NiceMP5MFire.uc | 8 ++++---- sources/Weapons/Playable/SMG/MP7M/NiceMP7MFire.uc | 2 +- .../Playable/Shotguns/Boomstick/NiceBoomStickFire.uc | 1 + .../Weapons/Playable/Shotguns/Nailgun/NiceNailGunAmmo.uc | 4 ++-- .../Playable/Shotguns/Nailgun/NiceNailGunPickup.uc | 2 +- 11 files changed, 17 insertions(+), 16 deletions(-) diff --git a/sources/Weapons/Playable/Heavy/M41A/NiceM41AAmmo.uc b/sources/Weapons/Playable/Heavy/M41A/NiceM41AAmmo.uc index 6f7b45b..06e02e2 100644 --- a/sources/Weapons/Playable/Heavy/M41A/NiceM41AAmmo.uc +++ b/sources/Weapons/Playable/Heavy/M41A/NiceM41AAmmo.uc @@ -4,8 +4,8 @@ defaultproperties { WeaponPickupClass=class'NiceM41APickup' AmmoPickupAmount=66 - MaxAmmo=300 - InitialAmount=75 + MaxAmmo=264 + InitialAmount=66 PickupClass=class'NiceM41AAmmoPickup' IconMaterial=Texture'KillingFloorHUD.Generic.HUD' IconCoords=(X1=336,Y1=82,X2=382,Y2=125) diff --git a/sources/Weapons/Playable/Heavy/M41A/NiceM41APickup.uc b/sources/Weapons/Playable/Heavy/M41A/NiceM41APickup.uc index e4df249..4dc3f6f 100644 --- a/sources/Weapons/Playable/Heavy/M41A/NiceM41APickup.uc +++ b/sources/Weapons/Playable/Heavy/M41A/NiceM41APickup.uc @@ -3,7 +3,7 @@ class NiceM41APickup extends NiceM41APrimaryPickup; defaultproperties { crossPerkIndecies(0)=6 - AmmoCost=12 + AmmoCost=24 BuyClipSize=1 SecondaryAmmoShortName="M41A Frag Grenades" PrimaryWeaponPickup=class'NiceM41APrimaryPickup' diff --git a/sources/Weapons/Playable/Heavy/M41A/NiceM41APrimaryPickup.uc b/sources/Weapons/Playable/Heavy/M41A/NiceM41APrimaryPickup.uc index 0f05cc6..808f48a 100644 --- a/sources/Weapons/Playable/Heavy/M41A/NiceM41APrimaryPickup.uc +++ b/sources/Weapons/Playable/Heavy/M41A/NiceM41APrimaryPickup.uc @@ -3,7 +3,7 @@ defaultproperties { cost=750 Weight=7.000000 - AmmoCost=66 + AmmoCost=25 BuyClipSize=66 PowerValue=70 SpeedValue=100 diff --git a/sources/Weapons/Playable/Heavy/M41A/NiceM41AProjectileAmmo.uc b/sources/Weapons/Playable/Heavy/M41A/NiceM41AProjectileAmmo.uc index a778ca5..1887b81 100644 --- a/sources/Weapons/Playable/Heavy/M41A/NiceM41AProjectileAmmo.uc +++ b/sources/Weapons/Playable/Heavy/M41A/NiceM41AProjectileAmmo.uc @@ -3,7 +3,7 @@ defaultproperties { WeaponPickupClass=class'NiceM41APickup' AmmoPickupAmount=1 - MaxAmmo=8 + MaxAmmo=5 InitialAmount=2 IconMaterial=Texture'KillingFloorHUD.Generic.HUD' IconCoords=(X1=434,Y1=253,X2=506,Y2=292) diff --git a/sources/Weapons/Playable/SMG/Kriss/NiceDamTypeKrissM.uc b/sources/Weapons/Playable/SMG/Kriss/NiceDamTypeKrissM.uc index ecb840b..ca8b1c2 100644 --- a/sources/Weapons/Playable/SMG/Kriss/NiceDamTypeKrissM.uc +++ b/sources/Weapons/Playable/SMG/Kriss/NiceDamTypeKrissM.uc @@ -2,6 +2,6 @@ class NiceDamTypeKrissM extends NiceDamageTypeVetDemolitions abstract; defaultproperties { - HeadShotDamageMult=2.000000 + HeadShotDamageMult=1.500000 WeaponClass=class'NiceKrissMMedicGun' } diff --git a/sources/Weapons/Playable/SMG/Kriss/NiceKrissMFire.uc b/sources/Weapons/Playable/SMG/Kriss/NiceKrissMFire.uc index 8502921..60029e5 100644 --- a/sources/Weapons/Playable/SMG/Kriss/NiceKrissMFire.uc +++ b/sources/Weapons/Playable/SMG/Kriss/NiceKrissMFire.uc @@ -13,8 +13,8 @@ defaultproperties ShellEjectBoneName="Shell_eject" NoAmmoSoundRef="KF_MP7Snd.MP7_DryFire" DamageType=class'NiceDamTypeKrissM' - DamageMin=35 - DamageMax=35 + DamageMin=48 + DamageMax=48 Momentum=12500.000000 FireRate=0.040000 AmmoClass=class'NiceKrissMAmmo' diff --git a/sources/Weapons/Playable/SMG/MP5M/NiceMP5MFire.uc b/sources/Weapons/Playable/SMG/MP5M/NiceMP5MFire.uc index 1c3dd73..d636895 100644 --- a/sources/Weapons/Playable/SMG/MP5M/NiceMP5MFire.uc +++ b/sources/Weapons/Playable/SMG/MP5M/NiceMP5MFire.uc @@ -5,9 +5,9 @@ defaultproperties FireEndStereoSoundRef="KF_MP5Snd.MP5_Fire_Loop_End_S" AmbientFireSoundRef="KF_MP5Snd.MP5_Fire_Loop" ProjectileSpeed=21250.000000 - RecoilRate=0.0075000 - maxVerticalRecoilAngle=160 - maxHorizontalRecoilAngle=80 + RecoilRate=0.0100000 + maxVerticalRecoilAngle=40 + maxHorizontalRecoilAngle=20 RecoilVelocityScale=0.000000 ShellEjectClass=Class'ROEffects.KFShellEjectMP5SMG' ShellEjectBoneName="Shell_eject" @@ -15,7 +15,7 @@ defaultproperties DamageType=class'NiceDamTypeMP5M' DamageMin=35 DamageMax=35 - Spread=500.0 + Spread=750.0 SpreadStyle=SS_Random minimalSpreadScale=0.0 activeSpreadScale=0.0 diff --git a/sources/Weapons/Playable/SMG/MP7M/NiceMP7MFire.uc b/sources/Weapons/Playable/SMG/MP7M/NiceMP7MFire.uc index 073c332..cc238c3 100644 --- a/sources/Weapons/Playable/SMG/MP7M/NiceMP7MFire.uc +++ b/sources/Weapons/Playable/SMG/MP7M/NiceMP7MFire.uc @@ -25,7 +25,7 @@ defaultproperties ShakeOffsetRate=(X=1000.000000,Y=1000.000000,Z=1000.000000) ShakeOffsetTime=1.250000 FlashEmitterClass=Class'ROEffects.MuzzleFlash1stMP' - Spread=500.0 + Spread=750.0 SpreadStyle=SS_Random minimalSpreadScale=0.0 activeSpreadScale=0.0 diff --git a/sources/Weapons/Playable/Shotguns/Boomstick/NiceBoomStickFire.uc b/sources/Weapons/Playable/Shotguns/Boomstick/NiceBoomStickFire.uc index ce35d5a..070012c 100644 --- a/sources/Weapons/Playable/Shotguns/Boomstick/NiceBoomStickFire.uc +++ b/sources/Weapons/Playable/Shotguns/Boomstick/NiceBoomStickFire.uc @@ -59,4 +59,5 @@ defaultproperties BotRefireRate=2.500000 aimerror=2.000000 Spread=3000.000000 + FireAnimRate=1.25 } diff --git a/sources/Weapons/Playable/Shotguns/Nailgun/NiceNailGunAmmo.uc b/sources/Weapons/Playable/Shotguns/Nailgun/NiceNailGunAmmo.uc index 6c7fbd8..b0596d7 100644 --- a/sources/Weapons/Playable/Shotguns/Nailgun/NiceNailGunAmmo.uc +++ b/sources/Weapons/Playable/Shotguns/Nailgun/NiceNailGunAmmo.uc @@ -4,8 +4,8 @@ defaultproperties { WeaponPickupClass=class'NiceNailGunPickup' AmmoPickupAmount=42 - MaxAmmo=336 - InitialAmount=84 + MaxAmmo=210 + InitialAmount=52 IconMaterial=Texture'KillingFloorHUD.Generic.HUD' IconCoords=(X1=451,Y1=445,X2=510,Y2=500) } diff --git a/sources/Weapons/Playable/Shotguns/Nailgun/NiceNailGunPickup.uc b/sources/Weapons/Playable/Shotguns/Nailgun/NiceNailGunPickup.uc index 44efb17..cfb7a50 100644 --- a/sources/Weapons/Playable/Shotguns/Nailgun/NiceNailGunPickup.uc +++ b/sources/Weapons/Playable/Shotguns/Nailgun/NiceNailGunPickup.uc @@ -3,7 +3,7 @@ defaultproperties { Weight=8.000000 cost=250 - AmmoCost=17 + AmmoCost=27 BuyClipSize=42 PowerValue=70 SpeedValue=55 -- 2.20.1 From 095157445182025baac2c058d95e1f598cb1b11c Mon Sep 17 00:00:00 2001 From: Anton Tarasenko Date: Fri, 22 Mar 2024 18:48:30 +0700 Subject: [PATCH 4/4] Add stopping power mechanic --- sources/NiceReplicationInfo.uc | 57 +++---- .../Demolitions/NiceDamTypeDemoExplosion.uc | 1 + .../BaseWeaponClasses/NiceWeaponDamageType.uc | 2 + .../Playable/SMG/Kriss/NiceDamTypeKrissM.uc | 1 + .../Playable/SMG/M7A3/NiceDamTypeM7A3M.uc | 1 + .../Playable/SMG/MP5M/NiceDamTypeMP5M.uc | 1 + .../Playable/SMG/MP7M/NiceDamTypeMP7M.uc | 1 + sources/Zeds/Mean/MeanZombieFleshPound.uc | 15 +- sources/Zeds/Nice/NiceZombieBoss.uc | 40 ++--- sources/Zeds/Nice/NiceZombieBossBase.uc | 3 + sources/Zeds/Nice/NiceZombieBrute.uc | 29 +--- sources/Zeds/Nice/NiceZombieBruteBase.uc | 3 +- sources/Zeds/Nice/NiceZombieFleshPound.uc | 20 ++- sources/Zeds/Nice/NiceZombieFleshpoundBase.uc | 2 + sources/Zeds/Nice/NiceZombieGorefast.uc | 14 +- sources/Zeds/Nice/NiceZombieHuskBase.uc | 1 + sources/Zeds/Nice/NiceZombieJason.uc | 19 +-- sources/Zeds/Nice/NiceZombieScrake.uc | 19 +-- sources/Zeds/Nice/NiceZombieScrakeBase.uc | 2 + sources/Zeds/Nice/NiceZombieShiver.uc | 16 +- sources/Zeds/Nice/NiceZombieSiren.uc | 12 +- sources/Zeds/Nice/NiceZombieTeslaHusk.uc | 1 - sources/Zeds/NiceMonster.uc | 144 ++++++++++++------ 23 files changed, 208 insertions(+), 196 deletions(-) diff --git a/sources/NiceReplicationInfo.uc b/sources/NiceReplicationInfo.uc index 01295a2..2da7241 100644 --- a/sources/NiceReplicationInfo.uc +++ b/sources/NiceReplicationInfo.uc @@ -102,31 +102,39 @@ simulated function ServerExplode local Vector dirToVictim; local Vector hitLocation; local float scale1, scale2; + local NiceMonster niceVictim; if(Role < ROLE_Authority) return; foreach VisibleActors(class'Actor', victim, explRadius, explLocation){ - if(victim == none || victim == self) continue; - if(victim.role < ROLE_Authority) continue; - if(ExtendedZCollision(victim) != none) continue; - if(Trigger(victim) != none) continue; - dirToVictim = Normal(victim.location - explLocation); - hitLocation = victim.location - 0.5 * - (victim.collisionHeight + victim.collisionRadius) * dirToVictim; - CalculateDamageScales( scale1, scale2, - victim, explLocation, explRadius, explExp); - // Deal main damage - if(scale1 > 0){ - ServerDealDamage( victim, explDamage * scale1, instigator, - hitLocation, scale1 * momentum * dirToVictim, - explDmgType); - } - // Deal secondary damage - if(allowDoubleExplosion && victim != none && scale2 > 0){ - ServerDealDamage( victim, explDamage * scale2, instigator, - hitLocation, scale2 * momentum * dirToVictim, - explDmgType); - } - if(NiceMonster(victim) != none && NiceMonster(victim).health <= 0) - numKilled ++; + if(victim == none || victim == self) continue; + if(victim.role < ROLE_Authority) continue; + if(ExtendedZCollision(victim) != none) continue; + if(Trigger(victim) != none) continue; + dirToVictim = Normal(victim.location - explLocation); + hitLocation = victim.location - 0.5 * + (victim.collisionHeight + victim.collisionRadius) * dirToVictim; + CalculateDamageScales( scale1, scale2, + victim, explLocation, explRadius, explExp); + // Deal main damage + if(scale1 > 0){ + ServerDealDamage( victim, explDamage * scale1, instigator, + hitLocation, scale1 * momentum * dirToVictim, + explDmgType); + } + // Deal secondary damage + if(allowDoubleExplosion && victim != none && scale2 > 0){ + ServerDealDamage( victim, explDamage * scale2, instigator, + hitLocation, scale2 * momentum * dirToVictim, + explDmgType); + } + niceVictim = NiceMonster(victim); + if(NiceMonster(victim) != none) { + if (NiceMonster(victim).health <= 0) { + numKilled += 1; + } + else { + niceVictim.concussionCountdown = 10.0; + } + } } if(numKilled >= 4) KFGameType(level.game).DramaticEvent(0.05); @@ -272,9 +280,6 @@ simulated function HandleNiceDamageMechanicsAndSkills hasSkill(nicePlayer, class'NiceSkillCommandoTranquilizer'); hasZEDFrenzy = class'NiceVeterancyTypes'.static. hasSkill(nicePlayer, class'NiceSkillMedicZEDFrenzy'); - // Medic's suppression - if(hasTranquilizer) - niceZed.mind = FMin(niceZed.mind, 0.5); // Medic's frenzy if(hasZEDFrenzy && nicePlayer.IsZedTimeActive()){ niceZed.madnessCountDown = diff --git a/sources/Perks/Demolitions/NiceDamTypeDemoExplosion.uc b/sources/Perks/Demolitions/NiceDamTypeDemoExplosion.uc index a640688..78ab779 100644 --- a/sources/Perks/Demolitions/NiceDamTypeDemoExplosion.uc +++ b/sources/Perks/Demolitions/NiceDamTypeDemoExplosion.uc @@ -8,6 +8,7 @@ static function GetHitEffects(out class HitEffects[4], int VictimHealt } defaultproperties { + stoppingPower=0.5 stunMultiplier=0.600000 bIsExplosive=True DeathString="%o filled %k's body with shrapnel." diff --git a/sources/Weapons/BaseWeaponClasses/NiceWeaponDamageType.uc b/sources/Weapons/BaseWeaponClasses/NiceWeaponDamageType.uc index 62fc867..835503b 100644 --- a/sources/Weapons/BaseWeaponClasses/NiceWeaponDamageType.uc +++ b/sources/Weapons/BaseWeaponClasses/NiceWeaponDamageType.uc @@ -27,6 +27,7 @@ var const int MediumZedMinHealth; // If zed's base Health >= this var float PenDmgReduction; // Penetration damage reduction after hitting small zed var float penDecapReduction; // Penetration decapitaion effectiveness reduction after hitting small zed var float penIncapReduction; // Penetration incapacitation (flinch or stun) effectiveness reduction after hitting small zed +var float stoppingPower; // How much stopping power the gun has - % amount zeds will be made to slow down when shot var bool bIsProjectile; // If original damage type's version was derived from 'KFProjectileWeaponDamageType', then set this to true // Scales exp gain according to given HardcoreLevel static function float getScale(int HL){ @@ -88,6 +89,7 @@ defaultproperties BigZedPenDmgReduction=0.500000 BigZedMinHealth=1000 MediumZedPenDmgReduction=0.750000 + stoppingPower=0.0 MediumZedMinHealth=500 PenDmgReduction=0.700000 PawnDamageEmitter=None diff --git a/sources/Weapons/Playable/SMG/Kriss/NiceDamTypeKrissM.uc b/sources/Weapons/Playable/SMG/Kriss/NiceDamTypeKrissM.uc index ca8b1c2..48b3dad 100644 --- a/sources/Weapons/Playable/SMG/Kriss/NiceDamTypeKrissM.uc +++ b/sources/Weapons/Playable/SMG/Kriss/NiceDamTypeKrissM.uc @@ -2,6 +2,7 @@ class NiceDamTypeKrissM extends NiceDamageTypeVetDemolitions abstract; defaultproperties { + stoppingPower=0.25 HeadShotDamageMult=1.500000 WeaponClass=class'NiceKrissMMedicGun' } diff --git a/sources/Weapons/Playable/SMG/M7A3/NiceDamTypeM7A3M.uc b/sources/Weapons/Playable/SMG/M7A3/NiceDamTypeM7A3M.uc index 96d8965..9c584ce 100644 --- a/sources/Weapons/Playable/SMG/M7A3/NiceDamTypeM7A3M.uc +++ b/sources/Weapons/Playable/SMG/M7A3/NiceDamTypeM7A3M.uc @@ -2,6 +2,7 @@ class NiceDamTypeM7A3M extends NiceDamageTypeVetDemolitions abstract; defaultproperties { + stoppingPower=0.15 HeadShotDamageMult=2.000000 WeaponClass=class'NiceM7A3MMedicGun' } diff --git a/sources/Weapons/Playable/SMG/MP5M/NiceDamTypeMP5M.uc b/sources/Weapons/Playable/SMG/MP5M/NiceDamTypeMP5M.uc index ee30a1f..89f2bcb 100644 --- a/sources/Weapons/Playable/SMG/MP5M/NiceDamTypeMP5M.uc +++ b/sources/Weapons/Playable/SMG/MP5M/NiceDamTypeMP5M.uc @@ -2,6 +2,7 @@ class NiceDamTypeMP5M extends NiceDamageTypeVetDemolitions abstract; defaultproperties { + stoppingPower=0.15 HeadShotDamageMult=2.000000 WeaponClass=class'NiceMP5MMedicGun' } diff --git a/sources/Weapons/Playable/SMG/MP7M/NiceDamTypeMP7M.uc b/sources/Weapons/Playable/SMG/MP7M/NiceDamTypeMP7M.uc index 71c97c6..a6274cc 100644 --- a/sources/Weapons/Playable/SMG/MP7M/NiceDamTypeMP7M.uc +++ b/sources/Weapons/Playable/SMG/MP7M/NiceDamTypeMP7M.uc @@ -5,5 +5,6 @@ defaultproperties bPenetrationHSOnly=True MaxPenetrations=1 HeadShotDamageMult=2.250000 + stoppingPower=0.15 WeaponClass=class'NiceMP7MMedicGun' } diff --git a/sources/Zeds/Mean/MeanZombieFleshPound.uc b/sources/Zeds/Mean/MeanZombieFleshPound.uc index 3bb82a0..b7ac20b 100644 --- a/sources/Zeds/Mean/MeanZombieFleshPound.uc +++ b/sources/Zeds/Mean/MeanZombieFleshPound.uc @@ -27,23 +27,20 @@ Ignores StartChargingFP; bFrustrated = false; if(Controller != none) NiceZombieFleshPoundController(Controller).RageFrustrationTimer = 0; - if( Health>0 && !bZapped ) - { - SetGroundSpeed(GetOriginalGroundSpeed()); - } if( Level.NetMode!=NM_DedicatedServer ) ClientChargingAnims(); NetUpdateTime = Level.TimeSeconds - 1; } + simulated function UpdateGroundSpeed() { + super(NiceMonster).UpdateGroundSpeed(); + if (!bShotAnim) { + groundSpeed *= 2.3; + } + } function Tick( float Delta ) { - if( !bShotAnim ) - { - SetGroundSpeed(OriginalGroundSpeed * 2.3);//2.0; - } - // Keep the flesh pound moving toward its target when attacking if( Role == ROLE_Authority && bShotAnim) { diff --git a/sources/Zeds/Nice/NiceZombieBoss.uc b/sources/Zeds/Nice/NiceZombieBoss.uc index 8384766..2c53c56 100644 --- a/sources/Zeds/Nice/NiceZombieBoss.uc +++ b/sources/Zeds/Nice/NiceZombieBoss.uc @@ -915,9 +915,16 @@ state Charging // How many charge attacks we can do randomly 1-3 NumChargeAttacks = Rand(2) + 1; } + simulated function UpdateGroundSpeed() { + super.UpdateGroundSpeed(); + if (bShotAnim) { + groundSpeed *= 1.25; + } else { + groundSpeed *= 2.5; + } + } function EndState() { - SetGroundSpeed(GetOriginalGroundSpeed()); bChargingPlayer = False; ChargeDamage = 0; if( Level.NetMode!=NM_DedicatedServer ) @@ -942,7 +949,6 @@ state Charging if( Level.NetMode!=NM_DedicatedServer ) PostNetReceive(); } - SetGroundSpeed(OriginalGroundSpeed * 1.25); if( LookTarget!=none ) { Acceleration = AccelRate * Normal(LookTarget.Location - Location); @@ -956,16 +962,6 @@ state Charging if( Level.NetMode!=NM_DedicatedServer ) PostNetReceive(); } - - // Zapping slows him down, but doesn't stop him - if( bZapped ) - { - SetGroundSpeed(OriginalGroundSpeed * 1.5); - } - else - { - SetGroundSpeed(OriginalGroundSpeed * 2.5); - } } Global.Tick(Delta); @@ -1071,7 +1067,6 @@ State Escaping extends Charging // Got hurt and running away... if( Level.NetMode!=NM_DedicatedServer ) PostNetReceive(); } - SetGroundSpeed(GetOriginalGroundSpeed()); } else { @@ -1081,23 +1076,20 @@ State Escaping extends Charging // Got hurt and running away... if( Level.NetMode!=NM_DedicatedServer ) PostNetReceive(); } - - // Zapping slows him down, but doesn't stop him - if( bZapped ) - { - SetGroundSpeed(OriginalGroundSpeed * 1.5); - } - else - { - SetGroundSpeed(OriginalGroundSpeed * 2.5); - } } Global.Tick(Delta); } + simulated function UpdateGroundSpeed() { + super.UpdateGroundSpeed(); + if (bShotAnim) { + groundSpeed *= 1.25; + } else { + groundSpeed *= 2.5; + } + } function EndState() { - SetGroundSpeed(GetOriginalGroundSpeed()); bChargingPlayer = False; if( Level.NetMode!=NM_DedicatedServer ) PostNetReceive(); diff --git a/sources/Zeds/Nice/NiceZombieBossBase.uc b/sources/Zeds/Nice/NiceZombieBossBase.uc index aa6cade..cd05c38 100644 --- a/sources/Zeds/Nice/NiceZombieBossBase.uc +++ b/sources/Zeds/Nice/NiceZombieBossBase.uc @@ -98,6 +98,9 @@ defaultproperties HealthMax=8000.000000 Health=8000 HeadScale=1.300000 + stoppingRecoveryRate=0.1 + maxStoppingEffect=0.2 + minStoppingThreshold=0.6 MenuName="Nice Patriarch" MovementAnims(0)="WalkF" MovementAnims(1)="WalkF" diff --git a/sources/Zeds/Nice/NiceZombieBrute.uc b/sources/Zeds/Nice/NiceZombieBrute.uc index 8e6c7f1..26860fc 100644 --- a/sources/Zeds/Nice/NiceZombieBrute.uc +++ b/sources/Zeds/Nice/NiceZombieBrute.uc @@ -182,18 +182,6 @@ function TakeDamageClient(int Damage, Pawn InstigatedBy, Vector HitLocation, Vec if (bDecapitated) Died(InstigatedBy.Controller, damageType, HitLocation); } -function TakeFireDamage(int Damage, Pawn Instigator) -{ - Super.TakeFireDamage(Damage, Instigator); - // Adjust movement speed if not charging - if (!bChargingPlayer) - { - if (bBurnified) - GroundSpeed = GetOriginalGroundSpeed() * BurnGroundSpeedMul; - else - GroundSpeed = GetOriginalGroundSpeed(); - } -} function ClawDamageTarget() { local KFHumanPawn HumanTarget; @@ -311,19 +299,16 @@ Ignores StartCharging; NetUpdateTime = Level.TimeSeconds - 1; } + simulated function UpdateGroundSpeed() { + super.UpdateGroundSpeed(); + groundSpeed = groundSpeed + ((groundSpeed * 0.75 / maxRageCounter * (rageCounter + 1) * rageSpeedTween)); + } function EndState() { bChargingPlayer = false; NiceZombieBruteController(Controller).RageFrustrationTimer = 0; - if (Health > 0) - { - GroundSpeed = GetOriginalGroundSpeed(); - if (bBurnified) - GroundSpeed *= BurnGroundSpeedMul; - } - if( Level.NetMode!=NM_DedicatedServer ) ClientChargingAnims(); @@ -331,12 +316,8 @@ Ignores StartCharging; } function Tick(float Delta) { - if (!bShotAnim) - { + if (!bShotAnim) { RageSpeedTween = FClamp(RageSpeedTween + (Delta * 0.75), 0, 1.0); - GroundSpeed = OriginalGroundSpeed + ((OriginalGroundSpeed * 0.75 / MaxRageCounter * (RageCounter + 1) * RageSpeedTween)); - if (bBurnified) - GroundSpeed *= BurnGroundSpeedMul; } Global.Tick(Delta); diff --git a/sources/Zeds/Nice/NiceZombieBruteBase.uc b/sources/Zeds/Nice/NiceZombieBruteBase.uc index 58af2a0..7bbd5e5 100644 --- a/sources/Zeds/Nice/NiceZombieBruteBase.uc +++ b/sources/Zeds/Nice/NiceZombieBruteBase.uc @@ -33,7 +33,6 @@ var bool bServerBlock; var bool bClientBlock; var float BlockDmgMul; // Multiplier for damage taken from blocked shots var float BlockFireDmgMul; -var float BurnGroundSpeedMul; // Multiplier for ground speed when burning replication { reliable if(Role == ROLE_Authority) @@ -61,7 +60,6 @@ defaultproperties BlockAddScale=2.500000 BlockDmgMul=0.100000 BlockFireDmgMul=1.000000 - BurnGroundSpeedMul=0.700000 StunThreshold=4.000000 flameFuel=0.500000 clientHeadshotScale=1.300000 @@ -110,6 +108,7 @@ defaultproperties Health=1000 HeadHeight=2.500000 HeadScale=1.300000 + minStoppingThreshold=0.1 MenuName="Brute" MovementAnims(0)="BruteWalkC" MovementAnims(1)="BruteWalkC" diff --git a/sources/Zeds/Nice/NiceZombieFleshPound.uc b/sources/Zeds/Nice/NiceZombieFleshPound.uc index 1a7ea05..8d5056d 100644 --- a/sources/Zeds/Nice/NiceZombieFleshPound.uc +++ b/sources/Zeds/Nice/NiceZombieFleshPound.uc @@ -49,7 +49,6 @@ function SetMindControlled(bool bNewMindControlled) if( bNewMindControlled != bZedUnderControl ) { - SetGroundSpeed(OriginalGroundSpeed * 1.25); Health *= 1.25; HealthMax *= 1.25; } @@ -252,21 +251,21 @@ Ignores StartChargingFP; if(fpController == none) fpController.RageFrustrationTimer = 0; - if( Health>0 && !bZapped ) - { - SetGroundSpeed(GetOriginalGroundSpeed()); - } - if( Level.NetMode!=NM_DedicatedServer ) ClientChargingAnims(); NetUpdateTime = Level.TimeSeconds - 1; } + simulated function UpdateGroundSpeed() { + super.UpdateGroundSpeed(); + if (!bShotAnim) { + groundSpeed *= 2.3; + } + } function Tick( float Delta ) { if( !bShotAnim ) { - SetGroundSpeed(OriginalGroundSpeed * 2.3);//2.0; if( !bFrustrated && !bZedUnderControl && Level.TimeSeconds>RageEndTime ) { GoToState(''); @@ -330,11 +329,16 @@ Ignores StartChargingFP; state ChargeToMarker extends RageCharging { Ignores StartChargingFP; + simulated function UpdateGroundSpeed() { + super.UpdateGroundSpeed(); + if (!bShotAnim) { + groundSpeed *= 2.3; + } + } function Tick( float Delta ) { if( !bShotAnim ) { - SetGroundSpeed(OriginalGroundSpeed * 2.3); if( !bFrustrated && !bZedUnderControl && Level.TimeSeconds>RageEndTime ) { GoToState(''); diff --git a/sources/Zeds/Nice/NiceZombieFleshpoundBase.uc b/sources/Zeds/Nice/NiceZombieFleshpoundBase.uc index 6380eb1..54fc8c3 100644 --- a/sources/Zeds/Nice/NiceZombieFleshpoundBase.uc +++ b/sources/Zeds/Nice/NiceZombieFleshpoundBase.uc @@ -80,6 +80,8 @@ defaultproperties Health=1650 HeadHeight=2.500000 HeadScale=1.300000 + maxStoppingEffect=0.05 + minStoppingThreshold=0.68 MenuName="Nice Flesh Pound" MovementAnims(0)="PoundWalk" MovementAnims(1)="WalkB" diff --git a/sources/Zeds/Nice/NiceZombieGorefast.uc b/sources/Zeds/Nice/NiceZombieGorefast.uc index 6b75e97..a696b0e 100644 --- a/sources/Zeds/Nice/NiceZombieGorefast.uc +++ b/sources/Zeds/Nice/NiceZombieGorefast.uc @@ -45,7 +45,6 @@ function SetMindControlled(bool bNewMindControlled) if( bNewMindControlled != bZedUnderControl ) { - SetGroundSpeed(OriginalGroundSpeed * 1.25); Health *= 1.25; HealthMax *= 1.25; } @@ -73,13 +72,6 @@ function RangedAttack(Actor A){ if(!bShotAnim && !bDecapitated && VSize(A.Location - Location) <= 700) GoToState('RunningState'); } -simulated function Tick(float DeltaTime){ - super.Tick(DeltaTime); - if(IsInState('RunningState')) - SetGroundSpeed(GetOriginalGroundSpeed() * 1.875); - else - SetGroundSpeed(GetOriginalGroundSpeed()); -} state RunningState{ // Set the zed to the zapped behavior simulated function SetZappedBehavior(){ @@ -94,7 +86,6 @@ state RunningState{ if(bZapped) GoToState(''); else{ - SetGroundSpeed(OriginalGroundSpeed * 1.875); bRunning = true; if(Level.NetMode != NM_DedicatedServer) PostNetReceive(); @@ -103,7 +94,6 @@ state RunningState{ } } function EndState(){ - SetGroundSpeed(GetOriginalGroundSpeed()); bRunning = false; if(Level.NetMode != NM_DedicatedServer) PostNetReceive(); @@ -112,6 +102,10 @@ state RunningState{ NetUpdateTime = Level.TimeSeconds - 1; } + simulated function UpdateGroundSpeed() { + super.UpdateGroundSpeed(); + groundSpeed *= 1.875; + } function RemoveHead(){ GoToState(''); Global.RemoveHead(); diff --git a/sources/Zeds/Nice/NiceZombieHuskBase.uc b/sources/Zeds/Nice/NiceZombieHuskBase.uc index 7c93117..89b8a58 100644 --- a/sources/Zeds/Nice/NiceZombieHuskBase.uc +++ b/sources/Zeds/Nice/NiceZombieHuskBase.uc @@ -60,6 +60,7 @@ defaultproperties HeadHeight=1.000000 HeadScale=1.350000 AmbientSoundScaling=8.000000 + stoppingRecoveryRate=0.05 MenuName="Nice Husk" MovementAnims(0)="WalkF" MovementAnims(1)="WalkB" diff --git a/sources/Zeds/Nice/NiceZombieJason.uc b/sources/Zeds/Nice/NiceZombieJason.uc index ab0a1f6..c32c255 100644 --- a/sources/Zeds/Nice/NiceZombieJason.uc +++ b/sources/Zeds/Nice/NiceZombieJason.uc @@ -105,15 +105,11 @@ State SawingLoop else GoToState(''); } } -simulated function float GetOriginalGroundSpeed() -{ - local float result; - result = OriginalGroundSpeed; - if ( bWasRaged || bCharging ) - result *= 3.5; - else if( bZedUnderControl ) - result *= 1.25; - return result; +simulated function UpdateGroundSpeed() { + super.UpdateGroundSpeed(); + if (bWasRaged || bCharging) { + groundSpeed *= 3.5; + } } state RunningState { @@ -124,7 +120,6 @@ state RunningState GoToState(''); else { bCharging = true; - SetGroundSpeed(GetOriginalGroundSpeed()); if( Level.NetMode!=NM_DedicatedServer ) PostNetReceive(); NetUpdateTime = Level.TimeSeconds - 1; @@ -133,8 +128,6 @@ state RunningState function EndState() { bCharging = False; - if( !bZapped ) - SetGroundSpeed(GetOriginalGroundSpeed()); if( Level.NetMode!=NM_DedicatedServer ) PostNetReceive(); } @@ -163,6 +156,8 @@ defaultproperties ChallengeSound(2)=None ChallengeSound(3)=None ScoringValue=300 + maxStoppingEffect=0.25 + minStoppingThreshold=0.25 MenuName="Jason" AmbientSound=Sound'ScrnZedPack_S.Jason.Jason_Sound' Mesh=SkeletalMesh'ScrnZedPack_A.JasonMesh' diff --git a/sources/Zeds/Nice/NiceZombieScrake.uc b/sources/Zeds/Nice/NiceZombieScrake.uc index 190e4fb..22f2797 100644 --- a/sources/Zeds/Nice/NiceZombieScrake.uc +++ b/sources/Zeds/Nice/NiceZombieScrake.uc @@ -83,7 +83,6 @@ function SetMindControlled(bool bNewMindControlled) if( bNewMindControlled != bZedUnderControl ) { - SetGroundSpeed(OriginalGroundSpeed * 1.25); Health *= 1.25; HealthMax *= 1.25; } @@ -185,8 +184,9 @@ state RunningState { return false; } - simulated function float GetOriginalGroundSpeed() { - return 3.5 * OriginalGroundSpeed; + simulated function UpdateGroundSpeed() { + super.UpdateGroundSpeed(); + groundSpeed *= 3.5; } function BeginState(){ local NiceHumanPawn rageTarget, rageCause; @@ -214,7 +214,6 @@ state RunningState if(bZapped) GoToState(''); else{ - SetGroundSpeed(OriginalGroundSpeed * 3.5); bCharging = true; if( Level.NetMode!=NM_DedicatedServer ) PostNetReceive(); @@ -224,10 +223,6 @@ state RunningState } function EndState() { - if( !bZapped ) - { - SetGroundSpeed(GetOriginalGroundSpeed()); - } bCharging = False; if( Level.NetMode!=NM_DedicatedServer ) PostNetReceive(); @@ -265,8 +260,9 @@ State SawingLoop { return false; } - simulated function float GetOriginalGroundSpeed() { - return OriginalGroundSpeed * AttackChargeRate; + simulated function UpdateGroundSpeed() { + super.UpdateGroundSpeed(); + groundSpeed *= attackChargeRate; } function bool CanGetOutOfWay() { @@ -279,7 +275,6 @@ State SawingLoop // Randomly have the scrake charge during an attack so it will be less predictable if(Health/HealthMax < 0.5 || FRand() <= 0.95) { - SetGroundSpeed(OriginalGroundSpeed * AttackChargeRate); bCharging = true; if( Level.NetMode!=NM_DedicatedServer ) PostNetReceive(); @@ -327,8 +322,6 @@ State SawingLoop { AmbientSound=default.AmbientSound; MeleeDamage = Max( DifficultyDamageModifer() * default.MeleeDamage, 1 ); - - SetGroundSpeed(GetOriginalGroundSpeed()); bCharging = False; if(Level.NetMode != NM_DedicatedServer) PostNetReceive(); diff --git a/sources/Zeds/Nice/NiceZombieScrakeBase.uc b/sources/Zeds/Nice/NiceZombieScrakeBase.uc index 6ccd9f6..2905831 100644 --- a/sources/Zeds/Nice/NiceZombieScrakeBase.uc +++ b/sources/Zeds/Nice/NiceZombieScrakeBase.uc @@ -63,6 +63,8 @@ defaultproperties HealthMax=1000.000000 Health=1000 HeadHeight=2.200000 + maxStoppingEffect=0.15 + minStoppingThreshold=0.15 MenuName="Nice Scrake" MovementAnims(0)="SawZombieWalk" MovementAnims(1)="SawZombieWalk" diff --git a/sources/Zeds/Nice/NiceZombieShiver.uc b/sources/Zeds/Nice/NiceZombieShiver.uc index fbd612a..72c110e 100644 --- a/sources/Zeds/Nice/NiceZombieShiver.uc +++ b/sources/Zeds/Nice/NiceZombieShiver.uc @@ -179,7 +179,6 @@ state Running Global.Tick(Delta); if (RunUntilTime < Level.TimeSeconds) GotoState(''); - GroundSpeed = GetOriginalGroundSpeed(); } function BeginState() { @@ -190,13 +189,12 @@ state Running function EndState() { bRunning = false; - GroundSpeed = global.GetOriginalGroundSpeed(); RunCooldownEnd = Level.TimeSeconds + PeriodRunCoolBase + FRand() * PeriodRunCoolRan; MovementAnims[0] = WalkAnim; } - function float GetOriginalGroundSpeed() - { - return global.GetOriginalGroundSpeed() * 2.5; + simulated function UpdateGroundSpeed() { + super.UpdateGroundSpeed(); + groundSpeed *= 2.5; } function bool CanSpeedAdjust() { @@ -219,14 +217,6 @@ simulated function bool AnimNeedsWait(name TestAnim) } return ExpectingChannel == 0; } -simulated function float GetOriginalGroundSpeed() -{ - local float result; - result = OriginalGroundSpeed; - if( bZedUnderControl ) - result *= 1.25; - return result; -} simulated function HandleAnimation(float Delta) { // hehehe diff --git a/sources/Zeds/Nice/NiceZombieSiren.uc b/sources/Zeds/Nice/NiceZombieSiren.uc index ad5b69b..1ea867c 100644 --- a/sources/Zeds/Nice/NiceZombieSiren.uc +++ b/sources/Zeds/Nice/NiceZombieSiren.uc @@ -281,6 +281,12 @@ simulated function HurtRadius(float DamageAmount, float DamageRadius, class 0){ currScreamTime = Level.TimeSeconds - screamStartTime; diff --git a/sources/Zeds/Nice/NiceZombieTeslaHusk.uc b/sources/Zeds/Nice/NiceZombieTeslaHusk.uc index 030c45f..ff60b33 100644 --- a/sources/Zeds/Nice/NiceZombieTeslaHusk.uc +++ b/sources/Zeds/Nice/NiceZombieTeslaHusk.uc @@ -709,7 +709,6 @@ defaultproperties HealEnergyDrain=0.200000 ProjectileFireInterval=5.000000 BurnDamageScale=1.000000 - mind=0.000000 bFireImmune=False MoanVoice=SoundGroup'KF_EnemiesFinalSnd_CIRCUS.Husk.Husk_Talk' BleedOutDuration=5.000000 diff --git a/sources/Zeds/NiceMonster.uc b/sources/Zeds/NiceMonster.uc index 85b79d9..0c13d76 100644 --- a/sources/Zeds/NiceMonster.uc +++ b/sources/Zeds/NiceMonster.uc @@ -24,6 +24,7 @@ class NiceMonster extends KFMonster #exec OBJ LOAD FILE=KF_EnemyGlobalSndTwo.uax #exec OBJ LOAD FILE=KFZED_FX_T.utx +var bool initializationComplete; //============================================================================== //============================================================================== // > Affliction system @@ -75,13 +76,15 @@ var float stunLoopStart, stunLoopEnd, idleInsertFrame; var bool bWasIdleStun; // Were we using idleanimation for stun? var float prevStunAnimFrame; // At which tick we were? //============================================================================== -// >> Another default stun system allows tostuns zeds by repeatedly dealing +// >> Another default stun system allows to stun zeds by repeatedly dealing // head damage to them fast enough: // 1. Dealing head damage increases accumulated damage // 2. If head damage was received for a certain time period, - // accumulated damage starts to decrease // 3. If accumulated damage is high enough, passes 'IsStunPossible' check -// and has low enough mind level - normal duration stun activates +// - normal duration stun activates +// How much more time will this zed spend concussed? +var float concussionCountdown; // Accumulated head damage var float accHeadDamage; // Rate (per second) at which accumulated head damage diminishes @@ -91,16 +94,6 @@ var float headRecoveryTime; // Count down variable for above mentioned time var float headRecoveryCountDown; -//============================================================================== -//============================================================================== -// > Mind system -// Largly underdeveloped and currently only exists to decide whether or not -// zed can be stunned by accumulating head damage -// Current mind level (1.0 - default and maximum value) -var float mind; -// Treshold, required for stun by accumulated head damage -var float accStunMindLvl; - //============================================================================== //============================================================================== // > Temperature system @@ -148,16 +141,14 @@ var bool bFrugalFuelUsage; // Is a value from 0.0 to 1.0 and `1 - stoppingEffect` acts as speed multiplier // for the zed var float stoppingEffect; -// (Absolute) Point in time at which recovery would start, updated when zeds -// receives another stopping effect from somewhere -var float stoppingRecoveryStartTime; -// How much stopping effect would be rcovred in a second +// How much stopping effect would be recovred in a second var float stoppingRecoveryRate; -// Maximum stopping effect this zed can tank +// Maximum `stoppingEffect` value zed can accumulate var float maxStoppingEffect; // Minimal stopping threshold for the zed (supposed to be subtracted from // incoming effects' strenght). var float minStoppingThreshold; + //============================================================================== //============================================================================== // > Miscellaneous variables @@ -241,6 +232,7 @@ simulated function PostBeginPlay(){ SavedExtCollision = MyExtCollision.bCollideActors; } } + initializationComplete = true; } //============================================================================== @@ -381,6 +373,15 @@ simulated function FearTick(float deltaTime){ + 0.75 * accelRate * Normal(Location - fearCenter); } //============================================================================== +// >> Decrease active stopping power on the zed as the time goes by +simulated function StoppingPowerTick(float deltaTime) { + if (stoppingEffect <= 0.0 || concussionCountdown > 0.0) { + return; + } + stoppingEffect -= deltaTime * stoppingRecoveryRate; + stoppingEffect = FMax(0, stoppingEffect); +} +//============================================================================== // >> Set of functions to handle animation changes during stun simulated function CalcRemainigStunStructure( name seqName, float oFrame, @@ -470,14 +471,14 @@ simulated function StunTick(float deltaTime){ } //============================================================================== // >> Set of functions to handle stun from head damage accumulation -function AccumulateHeadDamage( float addDamage, +function AccumulateHeadDamage( float addDamage, bool bIsHeadshot, NicePlayerController nicePlayer){ if(bIsHeadshot){ AccHeadDamage += addDamage; HeadRecoveryCountDown = HeadRecoveryTime; if(AccHeadDamage > (default.HeadHealth / 1.5) - && (Mind <= AccStunMindLvl && IsStunPossible())) + && (concussionCountdown > 0.0 && IsStunPossible())) DoStun(nicePlayer.pawn,,,, 1.0); } else if(HeadRecoveryCountDown > 0.0) @@ -485,11 +486,13 @@ function AccumulateHeadDamage( float addDamage, HeadRecoveryTime / 2); } function HeadDamageRecoveryTick(float delta){ - HeadRecoveryCountDown -= delta; - HeadRecoveryCountDown = FMax(0.0, HeadRecoveryCountDown); - if(HeadRecoveryCountDown <= 0.0) - AccHeadDamage -= delta * HeadDamageRecoveryRate; - AccHeadDamage = FMax(AccHeadDamage, 0.0); + concussionCountdown -= delta; + concussionCountdown = FMax(0.0, concussionCountdown); + headRecoveryCountDown -= delta; + headRecoveryCountDown = FMax(0.0, headRecoveryCountDown); + if(headRecoveryCountDown <= 0.0) + accHeadDamage -= delta * HeadDamageRecoveryRate; + accHeadDamage = FMax(accHeadDamage, 0.0); } //============================================================================== // >> Function that calls actual 'HeatTick' when needed @@ -546,15 +549,6 @@ simulated function FakeHeatTick(float deltaTime){ // >> Ticks from TWI's code // Updates zed's speed if it's not relevant; // code, specific to standalone game and listen servers was cut out -simulated function NonRelevantSpeedupTick(float deltaTime){ - if(Level.netMode == NM_Client || !CanSpeedAdjust()) return; - if(Level.TimeSeconds - LastReplicateTime > 0.5) - SetGroundSpeed(default.GroundSpeed * (300.0 / default.GroundSpeed)); - else{ - LastSeenOrRelevantTime = Level.TimeSeconds; - SetGroundSpeed(GetOriginalGroundSpeed()); - } -} // Kill zed if it has been bleeding long enough simulated function BleedOutTick(float deltaTick) @@ -605,7 +599,6 @@ simulated function TWITick(float deltaTime){ // If we've flagged this character to be destroyed next tick, handle that if(bDestroyNextTick && TimeSetDestroyNextTickTime < Level.TimeSeconds) Destroy(); - NonRelevantSpeedupTick(deltaTime); // Reset AnimAction if(bResetAnimAct && ResetAnimActTime < Level.TimeSeconds){ AnimAction = ''; @@ -628,8 +621,10 @@ simulated function Tick(float deltaTime){ DecapTick(deltaTime); FearTick(deltaTime); StunTick(deltaTime); + StoppingPowerTick(deltaTime); HeadDamageRecoveryTick(deltaTime); FakeHeatTick(deltaTime); + UpdateGroundSpeed(); // TWI's tick TWITick(deltaTime); } @@ -1613,7 +1608,7 @@ function UnFreeze(){ GroundSpeed = GetOriginalGroundSpeed(); bFrozenZed = false; } -function TakeDamageClient( int damage, +function TakeDamageClient( int damage, Pawn instigatedBy, Vector hitLocation, Vector momentum, @@ -1632,22 +1627,24 @@ function TakeDamageClient( int damage, KFPRI = KFPlayerReplicationInfo(instigatedBy.PlayerReplicationInfo); if(headHealth <= 0) headshotLevel = 0.0; + // Handle special weapon effects + HandleStoppingPower(damageType, headshotLevel); // Handle elemental damage components - ExtractElementalDamage( regDamage, heatDamage, damage, + ExtractElementalDamage(regDamage, heatDamage, damage, instigatedBy, hitLocation, momentum, damageType, KFPRI, headshotLevel, lockonTime); - FireDamageEffects( HeatDamage, instigatedBy, hitLocation, momentum, + FireDamageEffects( HeatDamage, instigatedBy, hitLocation, momentum, damageType, headshotLevel, KFPRI); - FrostEffects( instigatedBy, hitLocation, momentum, + FrostEffects( instigatedBy, hitLocation, momentum, damageType, headshotLevel, KFPRI); // Handle body parts damage components - ExtractPartsDamage( bodyDamage, headDamage, painDamage, + ExtractPartsDamage( bodyDamage, headDamage, painDamage, RegDamage + HeatDamage, instigatedBy, hitLocation, momentum, damageType, KFPRI, headshotLevel, lockonTime); - DoRightPainReaction( painDamage, instigatedBy, hitLocation, momentum, + DoRightPainReaction( painDamage, instigatedBy, hitLocation, momentum, damageType, headshotLevel, KFPRI); - DealPartsDamage( bodyDamage, headDamage, instigatedBy, + DealPartsDamage( bodyDamage, headDamage, instigatedBy, hitLocation, momentum, damageType, KFPRI, headshotLevel, lockonTime); AddKillAssistant(instigatedBy, bodyDamage); @@ -1658,6 +1655,28 @@ function TakeDamageClient( int damage, // like why the fuck is it being done HERE? Makes no fucking sense bBackstabbed = false; } +function HandleStoppingPower( + class damageType, + float headshotLevel +) { + local float strength; + local float actualMinStoppingThreshold, actualMaxStoppingEffect; + + strength = damageType.default.stoppingPower; + if (headshotLevel > 0.0) { + strength *= 2; + } + if (concussionCountdown > 0) { + actualMinStoppingThreshold = FMax(0.0, minStoppingThreshold - 0.2); + actualMaxStoppingEffect = FMin(0.9, maxStoppingEffect + 0.2); + } + else { + actualMinStoppingThreshold = minStoppingThreshold; + actualMaxStoppingEffect = maxStoppingEffect; + } + strength = FMax(0, strength - actualMinStoppingThreshold); + stoppingEffect = FMin(actualMaxStoppingEffect, stoppingEffect + strength); +} function TakeDamage(int damage, Pawn instigatedBy, Vector hitLocation, @@ -1798,7 +1817,6 @@ simulated function UnSetBurningBehavior(){ if(Role == Role_Authority){ Intelligence = default.Intelligence; if(!bZapped){ - SetGroundSpeed(GetOriginalGroundSpeed()); AirSpeed = default.AirSpeed; WaterSpeed = default.WaterSpeed; } @@ -1810,6 +1828,39 @@ simulated function UnSetBurningBehavior(){ WalkAnims[i] = default.WalkAnims[i]; } } +simulated function SetGroundSpeed(float newGroundSpeed) { + if (initializationComplete) { + UpdateGroundSpeed(); + } else { + // Let `KFMonster`'s code setup original speed for this zed. + // This is a hack to be removed later, when we'll be untangling + // initialization code + super.SetGroundSpeed(newGroundSpeed); + } +} +simulated function UpdateGroundSpeed() { + if (TryNonRelevantSpeedup()) { + return; + } + groundSpeed = GetOriginalGroundSpeed(); + groundSpeed *= (1.0 - stoppingEffect); + if (bDecapitated) { + groundSpeed *= 0.8; + } +} +// If this function returns `true`, then we shouldn't touch speed further, +// because a speed hack was used for the zed +simulated function bool TryNonRelevantSpeedup(){ + if(level.netMode == NM_Client || !CanSpeedAdjust()) { + return false; + } + if(level.timeSeconds - lastReplicateTime > 0.5) { + groundSpeed = default.groundSpeed * (300.0 / default.groundSpeed); + return true; + } + lastSeenOrRelevantTime = level.timeSeconds; + return false; +} simulated function ServerDropFaster(NiceHumanPawn nicePawn){ if(nicePawn == none) return; if(Health > 0) @@ -1827,7 +1878,7 @@ simulated function RemoveHead(){ if(kfDmgType != none && kfDmgType.default.bIsMeleeDamage) bMeleeDecapitated = true; SetAnimAction('HitF'); - SetGroundSpeed(GroundSpeed *= 0.80); + UpdateGroundSpeed(); // No more raspy breathin'...cuz he has no throat or mouth :S AmbientSound = MiscSound; if(Health > 0) @@ -2220,8 +2271,6 @@ defaultproperties lastStunTime=-1.000000 headDamageRecoveryRate=100.000000 headRecoveryTime=1.000000 - mind=1.000000 - accStunMindLvl=0.500000 bCanBurn=True fuelRatio=0.750000 heatDissipationRate=0.666000 @@ -2236,9 +2285,8 @@ defaultproperties RagdollLifeSpan=120.000000 ControllerClass=class'NiceMonsterController' stoppingEffect=0.0 - stoppingRecoveryStartTime=2.0 - stoppingRecoveryRate=0.5 - maxStoppingEffect=0.5 + stoppingRecoveryRate=0.025 + maxStoppingEffect=0.25 minStoppingThreshold=0.0 Begin Object Class=KarmaParamsSkel Name=KarmaParamsSkelN KConvulseSpacing=(Max=2.200000) -- 2.20.1