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
This commit is contained in:
inklesspen1scripter 2020-07-06 20:45:02 +03:00
parent dfb0122263
commit 35e0160071
4 changed files with 32 additions and 8 deletions

View File

@ -1143,6 +1143,9 @@ simulated function float ApplyEffect( name Type, float Value, float Progress )
case 'AllDmg': case 'AllDmg':
Modifiers[18] = 1.f / (1.f+Value*Progress); Modifiers[18] = 1.f / (1.f+Value*Progress);
break; break;
case 'HeadDamage':
Modifiers[19] = Value*Progress;
break;
} }
return (Value*Progress); 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<KFDamageType> DamageType, optional int HitZoneIdx ) simulated function ModifyDamageGiven( out int InDamage, optional Actor DamageCauser, optional KFPawn_Monster MyKFPM, optional KFPlayerController DamageInstigator, optional class<KFDamageType> DamageType, optional int HitZoneIdx )
{ {
if( BasePerk==None || (DamageType!=None && DamageType.Default.ModifierPerkList.Find(BasePerk)>=0) || (KFWeapon(DamageCauser)!=None && IsWeaponOnPerk(KFWeapon(DamageCauser))) ) if( BasePerk==None || (DamageType!=None && DamageType.Default.ModifierPerkList.Find(BasePerk)>=0) || (KFWeapon(DamageCauser)!=None && IsWeaponOnPerk(KFWeapon(DamageCauser))) )
{
if(HitZoneIdx == 0)
InDamage *= (Modifiers[1] + Modifiers[19]);
else
InDamage *= Modifiers[1]; InDamage *= Modifiers[1];
}
else if( DamageType==None || DamageType.Name!='KFDT_SuicideExplosive' ) else if( DamageType==None || DamageType.Name!='KFDT_SuicideExplosive' )
InDamage *= Modifiers[12]; 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(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(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(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)
Modifiers.Add(1.f) Modifiers.Add(1.f)

View File

@ -114,8 +114,10 @@ simulated function float GetSnarePower( optional class<DamageType> DamageType, o
function AddDefaultInventory( KFPawn P ) function AddDefaultInventory( KFPawn P )
{ {
P.DefaultInventory.RemoveItem(class'ExtWeap_Pistol_9mm'); local int i;
P.DefaultInventory.AddItem(class'ExtWeap_Pistol_MedicS'); i = P.DefaultInventory.Find(class'ExtWeap_Pistol_9mm');
if(i != -1)
P.DefaultInventory[i] = class'ExtWeap_Pistol_MedicS';
super.AddDefaultInventory(P); super.AddDefaultInventory(P);
} }

View File

@ -28,11 +28,12 @@ defaultproperties
PerkName="Sharpshooter" PerkName="Sharpshooter"
PerkIcon=Texture2D'UI_PerkIcons_TEX.UI_PerkIcon_Sharpshooter' PerkIcon=Texture2D'UI_PerkIcons_TEX.UI_PerkIcon_Sharpshooter'
DefTraitList.Add(class'Ext_TraitWPSharp') DefTraitList.Add(class'Ext_TraitWPSharp')
DefTraitList.Add(class'Ext_TraitRackEmUp')
DefTraitList.Add(class'Ext_TraitRanger') DefTraitList.Add(class'Ext_TraitRanger')
DefTraitList.Add(class'Ext_TraitDireReload') DefTraitList.Add(class'Ext_TraitDireReload')
DefTraitList.Add(class'Ext_TraitEliteReload') DefTraitList.Add(class'Ext_TraitEliteReload')
BasePerk=class'KFPerk_Sharpshooter' BasePerk=class'KFPerk_Sharpshooter'
DefPerkStats(1)=(Progress=0.25)
DefPerkStats(19)=(bHiddenConfig=false)
PrimaryMelee=class'KFWeap_Knife_Sharpshooter' PrimaryMelee=class'KFWeap_Knife_Sharpshooter'
PrimaryWeapon=class'KFWeap_Rifle_Winchester1894' PrimaryWeapon=class'KFWeap_Rifle_Winchester1894'

View File

@ -5,7 +5,7 @@ var KFGUI_NumericBox StatCountBox;
var KFGUI_Button AddButton; var KFGUI_Button AddButton;
var Ext_PerkBase MyPerk; var Ext_PerkBase MyPerk;
var int StatIndex,OldValue,CurrentCost; var int StatIndex,OldValue,CurrentCost,MaxStatValue;
var string ProgressStr; var string ProgressStr;
var bool bCostDirty; var bool bCostDirty;
@ -42,7 +42,10 @@ function Timer()
{ {
bCostDirty = false; bCostDirty = false;
OldValue = MyPerk.PerkStats[StatIndex].CurrentValue; 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 ) function BuyStatPoint( KFGUI_Button Sender )
@ -51,8 +54,13 @@ function BuyStatPoint( KFGUI_Button Sender )
} }
function EditBoxChange( KFGUI_EditBox Sender ) function EditBoxChange( KFGUI_EditBox Sender )
{ {
if(MyPerk.PerkStats[StatIndex].CostPerValue > 1)
CurrentCost = StatCountBox.GetValueInt()*MyPerk.PerkStats[StatIndex].CostPerValue; CurrentCost = StatCountBox.GetValueInt()*MyPerk.PerkStats[StatIndex].CostPerValue;
else
CurrentCost = 0;
MaxStatValue = MyPerk.PerkStats[StatIndex].MaxValue;
ProgressStr = ChopExtraDigits(MyPerk.PerkStats[StatIndex].Progress * StatCountBox.GetValueInt()); ProgressStr = ChopExtraDigits(MyPerk.PerkStats[StatIndex].Progress * StatCountBox.GetValueInt());
MaxStatValue = MyPerk.PerkStats[StatIndex].MaxValue;
bCostDirty = true; bCostDirty = true;
Timer(); Timer();
} }
@ -68,8 +76,12 @@ final function CheckBuyLimit()
// Make the value clamped. // Make the value clamped.
StatCountBox.ChangeValue(StatCountBox.Value); StatCountBox.ChangeValue(StatCountBox.Value);
if(MyPerk.PerkStats[StatIndex].CostPerValue > 1)
CurrentCost = StatCountBox.GetValueInt()*MyPerk.PerkStats[StatIndex].CostPerValue; CurrentCost = StatCountBox.GetValueInt()*MyPerk.PerkStats[StatIndex].CostPerValue;
else
CurrentCost = 0;
ProgressStr = ChopExtraDigits(MyPerk.PerkStats[StatIndex].Progress * StatCountBox.GetValueInt()); ProgressStr = ChopExtraDigits(MyPerk.PerkStats[StatIndex].Progress * StatCountBox.GetValueInt());
MaxStatValue = MyPerk.PerkStats[StatIndex].MaxValue;
// Disable button if can not buy anymore. // Disable button if can not buy anymore.
AddButton.SetDisabled(i==0); AddButton.SetDisabled(i==0);