From d6662b1bc60e4c64a2a3793cdfccad75403afef1 Mon Sep 17 00:00:00 2001 From: Shtoyan Date: Sat, 8 Apr 2023 22:21:30 +0400 Subject: [PATCH 1/3] Add NiceSyringe And make heal distance 80 -> 120 --- sources/NiceHumanPawn.uc | 22 +++++++++--------- sources/Weapons/Playable/Tools/NiceSyringe.uc | 8 +++++++ .../Playable/Tools/NiceSyringeAltFire.uc | 1 + .../Weapons/Playable/Tools/NiceSyringeFire.uc | 23 +++++++++++++++++++ .../Playable/Tools/NiceSyringePickup.uc | 6 +++++ 5 files changed, 49 insertions(+), 11 deletions(-) create mode 100644 sources/Weapons/Playable/Tools/NiceSyringe.uc create mode 100644 sources/Weapons/Playable/Tools/NiceSyringeAltFire.uc create mode 100644 sources/Weapons/Playable/Tools/NiceSyringeFire.uc create mode 100644 sources/Weapons/Playable/Tools/NiceSyringePickup.uc diff --git a/sources/NiceHumanPawn.uc b/sources/NiceHumanPawn.uc index b6f1ece..18205da 100644 --- a/sources/NiceHumanPawn.uc +++ b/sources/NiceHumanPawn.uc @@ -69,7 +69,7 @@ function ReplaceRequiredEquipment() RequiredEquipment[0] = string(class'NiceMachete'); RequiredEquipment[1] = string(class'Nice9mmPlus'); RequiredEquipment[2] = string(class'ScrnFrag'); - RequiredEquipment[3] = string(class'ScrnSyringe'); + RequiredEquipment[3] = string(class'NiceSyringe'); RequiredEquipment[4] = string(class'KFMod.Welder'); } @@ -420,10 +420,10 @@ function ServerBuyWeapon(class WClass, float ItemWeight){ Price = WP.Default.Cost; if(KFPlayerReplicationInfo(PlayerReplicationInfo).ClientVeteranSkill != none){ Price *= KFPlayerReplicationInfo(PlayerReplicationInfo).ClientVeteranSkill.static.GetCostScaling(KFPlayerReplicationInfo(PlayerReplicationInfo), WP); - if(class'ScrnBalance'.default.Mut.bBuyPerkedWeaponsOnly - && WP.default.CorrespondingPerkIndex != 7 + if(class'ScrnBalance'.default.Mut.bBuyPerkedWeaponsOnly + && WP.default.CorrespondingPerkIndex != 7 && WP.default.CorrespondingPerkIndex != KFPlayerReplicationInfo(PlayerReplicationInfo).ClientVeteranSkill.default.PerkIndex ) - return; + return; } SellValue = Price * 0.75; Price = int(Price); @@ -507,11 +507,11 @@ function bool AddInventory(inventory NewItem){ if(weap != none){ if(Dualies(weap) != none){ if((DualDeagle(weap) != none || Dual44Magnum(weap) != none || DualMK23Pistol(weap) != none) - && weap.InventoryGroup != 4 ) { + && weap.InventoryGroup != 4 ) { if(KFPRI != none && ClassIsChildOf(KFPRI.ClientVeteranSkill, class'ScrnVetGunslinger')) weap.InventoryGroup = 3; - else + else weap.InventoryGroup = 2; GroupChanged = true; } @@ -521,7 +521,7 @@ function bool AddInventory(inventory NewItem){ } weap.bIsTier3Weapon = true; } - if(GroupChanged) + if(GroupChanged) ClientSetInventoryGroup(NewItem.class, NewItem.InventoryGroup); if(super(SRHumanPawn).AddInventory(NewItem)){ if(weap != none && weap.bTorchEnabled) @@ -568,7 +568,7 @@ simulated function ThrowGrenade() super.ThrowGrenade(); return; } - + if(playerGrenade == none) playerGrenade = FindPlayerGrenade(); if(playerGrenade != none && playerGrenade.HasAmmo()){ @@ -650,7 +650,7 @@ simulated function ApplyWeaponStats(Weapon NewWeapon){ InventorySpeedModifier += default.GroundSpeed * (8 - weaponWeight) * 0.025; // ScrN Armor can slow down players (or even boost) -- PooSH InventorySpeedModifier -= default.GroundSpeed * GetCurrentVestClass().default.SpeedModifier; - } + } } simulated function ModifyVelocity(float DeltaTime, vector OldVelocity){ local NicePack NicePackMutator; @@ -699,7 +699,7 @@ simulated function ModifyVelocity(float DeltaTime, vector OldVelocity){ GroundSpeed = StoryInv.ForcedGroundSpeed; return; } - } + } if(bTraderSpeedBoost && !KFGameReplicationInfo(Level.GRI).bWaveInProgress) MovementMod *= TraderSpeedBoost; if(Health < HealthMax && medicAdrenaliteTime > 0){ @@ -846,7 +846,7 @@ function VeterancyChanged(){ nicePlayer.TriggerSelectEventOnPerkChange(nicePrevPerkClass, class(KFPRI.ClientVeteranSkill)); } - + super.VeterancyChanged(); } simulated function AltFire(optional float F){ diff --git a/sources/Weapons/Playable/Tools/NiceSyringe.uc b/sources/Weapons/Playable/Tools/NiceSyringe.uc new file mode 100644 index 0000000..48116c4 --- /dev/null +++ b/sources/Weapons/Playable/Tools/NiceSyringe.uc @@ -0,0 +1,8 @@ +class NiceSyringe extends ScrnSyringe; + +defaultproperties { + ItemName="Nice Med-Syringe" + FireModeClass(0)=class'NiceSyringeFire' + FireModeClass(1)=class'NiceSyringeAltFire' + PickupClass=class'NiceSyringePickup' +} \ No newline at end of file diff --git a/sources/Weapons/Playable/Tools/NiceSyringeAltFire.uc b/sources/Weapons/Playable/Tools/NiceSyringeAltFire.uc new file mode 100644 index 0000000..c6b2f4a --- /dev/null +++ b/sources/Weapons/Playable/Tools/NiceSyringeAltFire.uc @@ -0,0 +1 @@ +class NiceSyringeAltFire extends ScrnSyringeAltFire; \ No newline at end of file diff --git a/sources/Weapons/Playable/Tools/NiceSyringeFire.uc b/sources/Weapons/Playable/Tools/NiceSyringeFire.uc new file mode 100644 index 0000000..a632d12 --- /dev/null +++ b/sources/Weapons/Playable/Tools/NiceSyringeFire.uc @@ -0,0 +1,23 @@ +class NiceSyringeFire extends ScrnSyringeFire; + +// default == 80 +const SEARCH_RADIUS=120.0; + +function KFHumanPawn GetHealee() { + local KFHumanPawn KFHP, BestKFHP; + local vector Dir; + local float TempDot, BestDot; + + Dir = vector(Instigator.GetViewRotation()); + + foreach Instigator.VisibleCollidingActors(class'KFHumanPawn', KFHP, SEARCH_RADIUS) { + if (KFHP.Health < KFHP.HealthMax && KFHP.Health > 0) { + TempDot = Dir dot (KFHP.Location - Instigator.Location); + if (TempDot > 0.7 && TempDot > BestDot) { + BestKFHP = KFHP; + BestDot = TempDot; + } + } + } + return BestKFHP; +} \ No newline at end of file diff --git a/sources/Weapons/Playable/Tools/NiceSyringePickup.uc b/sources/Weapons/Playable/Tools/NiceSyringePickup.uc new file mode 100644 index 0000000..a9673b6 --- /dev/null +++ b/sources/Weapons/Playable/Tools/NiceSyringePickup.uc @@ -0,0 +1,6 @@ +class NiceSyringePickup extends ScrnSyringePickup; + +defaultproperties { + ItemName="Nice Med-Syringe" + InventoryType=class'NiceSyringe' +} \ No newline at end of file From f331df23c523ae47ae1affed1a14bd4332745097 Mon Sep 17 00:00:00 2001 From: Shtoyan Date: Mon, 22 May 2023 01:14:18 +0400 Subject: [PATCH 2/3] Add missing variables for playercontroller reset --- sources/NicePlayerController.uc | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/sources/NicePlayerController.uc b/sources/NicePlayerController.uc index dabd3d0..ccd38a9 100644 --- a/sources/NicePlayerController.uc +++ b/sources/NicePlayerController.uc @@ -212,6 +212,20 @@ simulated function ClientPostLogin(){ // Change HUD parameters class'ScrnHUD'.default.EnemyHealthBarHeight = 4.0; } + +// fix crooked camera after you die with active `ViewShake` +function StopViewShaking() { + ShakeRotMax = vect(0, 0, 0); + ShakeRotRate = vect(0, 0, 0); + ShakeRotTime = vect(0, 0, 0); + ShakeOffsetMax = vect(0, 0, 0); + ShakeOffsetRate = vect(0, 0, 0); + ShakeOffsetTime = vect(0, 0, 0); + // add missing variables + ShakeOffset = vect(0, 0, 0); + ShakeRot = Rot(0, 0, 0); +} + function ShowLobbyMenu(){ Super.ShowLobbyMenu(); } @@ -1225,7 +1239,7 @@ function LoadDualWieldables(){ local class WP; local class W; local int i; - + CPRL = class'ClientPerkRepLink'.Static.FindStats(self); if(CPRL == none || CPRL.ShopInventory.Length == 0) return; From 989bfc779274321c6b85109cecc5555303816ea6 Mon Sep 17 00:00:00 2001 From: Shtoyan Date: Mon, 22 May 2023 02:00:56 +0400 Subject: [PATCH 3/3] New NiceBloatVomit Limit how many times single projectile can damage zeds --- sources/Zeds/Nice/NiceBloatVomit.uc | 30 ++++++++++++++++++++++++++++ sources/Zeds/Nice/NiceZombieBloat.uc | 9 +++++---- 2 files changed, 35 insertions(+), 4 deletions(-) create mode 100644 sources/Zeds/Nice/NiceBloatVomit.uc diff --git a/sources/Zeds/Nice/NiceBloatVomit.uc b/sources/Zeds/Nice/NiceBloatVomit.uc new file mode 100644 index 0000000..7f3d37c --- /dev/null +++ b/sources/Zeds/Nice/NiceBloatVomit.uc @@ -0,0 +1,30 @@ +class NiceBloatVomit extends KFBloatVomit; + +// limit how much you can damage zeds +const DAMAGECOUNT=10; +var private transient int DamageTicked; + +auto state Flying { + simulated function ProcessTouch(Actor Other, Vector HitLocation) { + // add damage limit + if (DamageTicked >= DAMAGECOUNT) { + BlowUp(HitLocation); + return; + } + if (ExtendedZCollision(Other) != none) { + return; + } + if ( + Other != Instigator && + (Other.IsA('Pawn') || Other.IsA('DestroyableObjective') || Other.bProjTarget) + ) { + DamageTicked += 1; + // warn("DamageTicked: " $ DamageTicked); + // use server DelayedHurtRadius() instead? + HurtRadius(Damage, DamageRadius, MyDamageType, MomentumTransfer, HitLocation); + } + else if (Other != Instigator && Other.bBlockActors) { + HitWall(Normal(HitLocation - Location), Other); + } + } +} \ No newline at end of file diff --git a/sources/Zeds/Nice/NiceZombieBloat.uc b/sources/Zeds/Nice/NiceZombieBloat.uc index c3ab99b..459e04e 100644 --- a/sources/Zeds/Nice/NiceZombieBloat.uc +++ b/sources/Zeds/Nice/NiceZombieBloat.uc @@ -173,7 +173,8 @@ function SpawnTwoShots() if ( !SavedFireProperties.bInitialized ) { SavedFireProperties.AmmoClass = Class'SkaarjAmmo'; - SavedFireProperties.ProjectileClass = Class'KFBloatVomit'; + // use fixed bile class, to prevent super high damage to zeds + SavedFireProperties.ProjectileClass = Class'NiceBloatVomit'; SavedFireProperties.WarnTargetPct = 1; SavedFireProperties.MaxRange = 500; SavedFireProperties.bTossed = False; @@ -185,13 +186,13 @@ function SpawnTwoShots() // Turn off extra collision before spawning vomit, otherwise spawn fails ToggleAuxCollision(false); FireRotation = Controller.AdjustAim(SavedFireProperties,FireStart,600); - Spawn(Class'KFBloatVomit',,,FireStart,FireRotation); + Spawn(SavedFireProperties.ProjectileClass,,,FireStart,FireRotation); FireStart-=(0.5*CollisionRadius*Y); FireRotation.Yaw -= 1200; - spawn(Class'KFBloatVomit',,,FireStart, FireRotation); + spawn(SavedFireProperties.ProjectileClass,,,FireStart, FireRotation); FireStart+=(CollisionRadius*Y); FireRotation.Yaw += 2400; - spawn(Class'KFBloatVomit',,,FireStart, FireRotation); + spawn(SavedFireProperties.ProjectileClass,,,FireStart, FireRotation); // Turn extra collision back on ToggleAuxCollision(true); }