From d6662b1bc60e4c64a2a3793cdfccad75403afef1 Mon Sep 17 00:00:00 2001 From: Shtoyan Date: Sat, 8 Apr 2023 22:21:30 +0400 Subject: [PATCH] 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