From 35e01600713371440a130ef09aa2212c41e50a47 Mon Sep 17 00:00:00 2001 From: inklesspen1scripter Date: Mon, 6 Jul 2020 20:45:02 +0300 Subject: [PATCH] Sharpshooter and perkstat changes + small fix Medic Pistol is default weapon in hands for MedicPerk now Added Head Damage for Sharpshooter by default Removed Rack'em Up for Sharpshooter by default Now perk-stat menu shows maxvalue of stats --- ServerExt/Classes/Ext_PerkBase.uc | 11 ++++++++++- ServerExt/Classes/Ext_PerkFieldMedic.uc | 6 ++++-- ServerExt/Classes/Ext_PerkSharpshooter.uc | 3 ++- ServerExt/Classes/UIR_PerkStat.uc | 20 ++++++++++++++++---- 4 files changed, 32 insertions(+), 8 deletions(-) diff --git a/ServerExt/Classes/Ext_PerkBase.uc b/ServerExt/Classes/Ext_PerkBase.uc index ebdfdfd..d979b8a 100644 --- a/ServerExt/Classes/Ext_PerkBase.uc +++ b/ServerExt/Classes/Ext_PerkBase.uc @@ -1143,6 +1143,9 @@ simulated function float ApplyEffect( name Type, float Value, float Progress ) case 'AllDmg': Modifiers[18] = 1.f / (1.f+Value*Progress); break; + case 'HeadDamage': + Modifiers[19] = Value*Progress; + break; } return (Value*Progress); } @@ -1150,7 +1153,12 @@ simulated function float ApplyEffect( name Type, float Value, float Progress ) simulated function ModifyDamageGiven( out int InDamage, optional Actor DamageCauser, optional KFPawn_Monster MyKFPM, optional KFPlayerController DamageInstigator, optional class DamageType, optional int HitZoneIdx ) { if( BasePerk==None || (DamageType!=None && DamageType.Default.ModifierPerkList.Find(BasePerk)>=0) || (KFWeapon(DamageCauser)!=None && IsWeaponOnPerk(KFWeapon(DamageCauser))) ) - InDamage *= Modifiers[1]; + { + if(HitZoneIdx == 0) + InDamage *= (Modifiers[1] + Modifiers[19]); + else + InDamage *= Modifiers[1]; + } else if( DamageType==None || DamageType.Name!='KFDT_SuicideExplosive' ) InDamage *= Modifiers[12]; } @@ -1430,6 +1438,7 @@ defaultproperties DefPerkStats(16)=(MaxValue=1000,CostPerValue=1,StatType="SonicDmg",UIName="Sonic Resistance (+&%)",Progress=1.5,bHiddenConfig=true) DefPerkStats(17)=(MaxValue=1000,CostPerValue=1,StatType="FireDmg",UIName="Fire Resistance (+&%)",Progress=1.5,bHiddenConfig=true) DefPerkStats(18)=(MaxValue=500,CostPerValue=1,StatType="AllDmg",UIName="Zed Damage Reduction (+&%)",Progress=0.25) + DefPerkStats(19)=(MaxValue=500,CostPerValue=1,StatType="HeadDamage",UIName="Perk Head Damage (+&%)",Progress=1,bHiddenConfig=true) Modifiers.Add(1.f) Modifiers.Add(1.f) diff --git a/ServerExt/Classes/Ext_PerkFieldMedic.uc b/ServerExt/Classes/Ext_PerkFieldMedic.uc index 582d0dc..c3c448a 100644 --- a/ServerExt/Classes/Ext_PerkFieldMedic.uc +++ b/ServerExt/Classes/Ext_PerkFieldMedic.uc @@ -114,8 +114,10 @@ simulated function float GetSnarePower( optional class DamageType, o function AddDefaultInventory( KFPawn P ) { - P.DefaultInventory.RemoveItem(class'ExtWeap_Pistol_9mm'); - P.DefaultInventory.AddItem(class'ExtWeap_Pistol_MedicS'); + local int i; + i = P.DefaultInventory.Find(class'ExtWeap_Pistol_9mm'); + if(i != -1) + P.DefaultInventory[i] = class'ExtWeap_Pistol_MedicS'; super.AddDefaultInventory(P); } diff --git a/ServerExt/Classes/Ext_PerkSharpshooter.uc b/ServerExt/Classes/Ext_PerkSharpshooter.uc index 21f91ff..bd8eca0 100644 --- a/ServerExt/Classes/Ext_PerkSharpshooter.uc +++ b/ServerExt/Classes/Ext_PerkSharpshooter.uc @@ -28,11 +28,12 @@ defaultproperties PerkName="Sharpshooter" PerkIcon=Texture2D'UI_PerkIcons_TEX.UI_PerkIcon_Sharpshooter' DefTraitList.Add(class'Ext_TraitWPSharp') - DefTraitList.Add(class'Ext_TraitRackEmUp') DefTraitList.Add(class'Ext_TraitRanger') DefTraitList.Add(class'Ext_TraitDireReload') DefTraitList.Add(class'Ext_TraitEliteReload') BasePerk=class'KFPerk_Sharpshooter' + DefPerkStats(1)=(Progress=0.25) + DefPerkStats(19)=(bHiddenConfig=false) PrimaryMelee=class'KFWeap_Knife_Sharpshooter' PrimaryWeapon=class'KFWeap_Rifle_Winchester1894' diff --git a/ServerExt/Classes/UIR_PerkStat.uc b/ServerExt/Classes/UIR_PerkStat.uc index 6cd12e7..6ae594e 100644 --- a/ServerExt/Classes/UIR_PerkStat.uc +++ b/ServerExt/Classes/UIR_PerkStat.uc @@ -5,7 +5,7 @@ var KFGUI_NumericBox StatCountBox; var KFGUI_Button AddButton; var Ext_PerkBase MyPerk; -var int StatIndex,OldValue,CurrentCost; +var int StatIndex,OldValue,CurrentCost,MaxStatValue; var string ProgressStr; var bool bCostDirty; @@ -42,7 +42,10 @@ function Timer() { bCostDirty = false; OldValue = MyPerk.PerkStats[StatIndex].CurrentValue; - InfoText.SetText(MyPerk.GetStatUIStr(StatIndex)$" ["$OldValue$", Cost "$CurrentCost$", "$ProgressStr$"%]:"); + if(CurrentCost != 0) + InfoText.SetText(MyPerk.GetStatUIStr(StatIndex)$" ["$OldValue$"/"$MaxStatValue$", Cost "$CurrentCost$", "$ProgressStr$"%]:"); + else + InfoText.SetText(MyPerk.GetStatUIStr(StatIndex)$" ["$OldValue$"/"$MaxStatValue$", "$ProgressStr$"%]:"); } } function BuyStatPoint( KFGUI_Button Sender ) @@ -51,8 +54,13 @@ function BuyStatPoint( KFGUI_Button Sender ) } function EditBoxChange( KFGUI_EditBox Sender ) { - CurrentCost = StatCountBox.GetValueInt()*MyPerk.PerkStats[StatIndex].CostPerValue; + if(MyPerk.PerkStats[StatIndex].CostPerValue > 1) + CurrentCost = StatCountBox.GetValueInt()*MyPerk.PerkStats[StatIndex].CostPerValue; + else + CurrentCost = 0; + MaxStatValue = MyPerk.PerkStats[StatIndex].MaxValue; ProgressStr = ChopExtraDigits(MyPerk.PerkStats[StatIndex].Progress * StatCountBox.GetValueInt()); + MaxStatValue = MyPerk.PerkStats[StatIndex].MaxValue; bCostDirty = true; Timer(); } @@ -68,8 +76,12 @@ final function CheckBuyLimit() // Make the value clamped. StatCountBox.ChangeValue(StatCountBox.Value); - CurrentCost = StatCountBox.GetValueInt()*MyPerk.PerkStats[StatIndex].CostPerValue; + if(MyPerk.PerkStats[StatIndex].CostPerValue > 1) + CurrentCost = StatCountBox.GetValueInt()*MyPerk.PerkStats[StatIndex].CostPerValue; + else + CurrentCost = 0; ProgressStr = ChopExtraDigits(MyPerk.PerkStats[StatIndex].Progress * StatCountBox.GetValueInt()); + MaxStatValue = MyPerk.PerkStats[StatIndex].MaxValue; // Disable button if can not buy anymore. AddButton.SetDisabled(i==0);