KF2-Server-Extension/ServerExt/Classes/Ext_PerkDemolition.uc

107 lines
3.4 KiB
Ucode
Raw Normal View History

2017-10-20 02:00:49 +00:00
Class Ext_PerkDemolition extends Ext_PerkBase;
var bool bSirenResistance,bCanUseSacrifice,bDirectHit,bCriticalHit,bProfessionalActive;
var bool bUsedSacrifice;
var float AOEMult, NukeDamageMult;
replication
{
// Things the server should send to the client.
2020-11-28 20:04:55 +00:00
if (true)
2017-10-22 13:59:20 +00:00
NukeDamageMult,bDirectHit,bCriticalHit,bProfessionalActive,AOEMult;
}
2017-10-22 13:59:20 +00:00
simulated function float GetAoERadiusModifier()
{
return AOEMult;
}
2020-11-28 20:04:55 +00:00
simulated function bool GetUsingTactialReload(KFWeapon KFW)
{
return (IsWeaponOnPerk(KFW) ? Modifiers[5]<0.85 : false);
}
2020-11-28 20:04:55 +00:00
simulated function float ApplyEffect(name Type, float Value, float Progress)
{
local KFPlayerReplicationInfo MyPRI;
local float DefValue;
2023-05-14 02:49:12 +00:00
DefValue = Super.ApplyEffect(Type, Value, Progress);
MyPRI = KFPlayerReplicationInfo(PlayerOwner.PlayerReplicationInfo);
2023-05-14 02:49:12 +00:00
2020-11-28 20:12:58 +00:00
if (MyPRI != None && Type == 'KnockDown')
MyPRI.bConcussiveActive = Modifiers[7] > 1.5;
2023-05-14 02:49:12 +00:00
return DefValue;
}
function OnWaveEnded()
{
bUsedSacrifice = false;
}
2020-11-28 20:04:55 +00:00
simulated function ModifyDamageGiven(out int InDamage, optional Actor DamageCauser, optional KFPawn_Monster MyKFPM, optional KFPlayerController DamageInstigator, optional class<KFDamageType> DamageType, optional int HitZoneIdx)
{
2020-11-28 20:12:58 +00:00
if (BasePerk==None || (DamageType!=None && DamageType.Default.ModifierPerkList.Find(BasePerk)>=0) || (KFWeapon(DamageCauser)!=None && IsWeaponOnPerk(KFWeapon(DamageCauser))))
{
2020-11-28 20:12:58 +00:00
if (bDirectHit && class<KFDT_Ballistic_Shell>(DamageType) != none)
InDamage *= 1.25;
2020-11-28 20:12:58 +00:00
if (bCriticalHit && MyKFPM != none && IsCriticalHitZone(MyKFPM, HitZoneIdx))
InDamage *= 1.5f;
}
2023-05-14 02:49:12 +00:00
2020-11-28 20:12:58 +00:00
if (class<KFDT_DemoNuke_Toxic_Lingering>(DamageType) != None)
InDamage *= NukeDamageMult;
2023-05-14 02:49:12 +00:00
Super.ModifyDamageGiven(InDamage, DamageCauser, MyKFPM, DamageInstigator, DamageType, HitZoneIdx);
}
2020-11-28 20:04:55 +00:00
function bool IsCriticalHitZone(KFPawn TestPawn, int HitZoneIndex)
{
2020-11-28 20:12:58 +00:00
if (TestPawn != none && HitzoneIndex >= 0 && HitzoneIndex < TestPawn.HitZones.length)
return TestPawn.HitZones[HitZoneIndex].DmgScale > 1.f;
return false;
}
2020-11-28 20:04:55 +00:00
simulated function ModifySpareAmmoAmount(KFWeapon KFW, out int PrimarySpareAmmo, optional const out STraderItem TraderItem, optional bool bSecondary)
{
2020-11-28 20:12:58 +00:00
if (KFW != None && KFWeap_Thrown_C4(KFW) != None)
PrimarySpareAmmo += (1 + Modifiers[11]);
2023-05-14 02:49:12 +00:00
2020-11-28 20:04:55 +00:00
Super.ModifySpareAmmoAmount(KFW, PrimarySpareAmmo, TraderItem, bSecondary);
}
2017-10-20 02:00:49 +00:00
defaultproperties
{
PerkIcon=Texture2D'UI_PerkIcons_TEX.UI_PerkIcon_Demolition'
DefTraitList.Add(class'Ext_TraitWPDemo')
DefTraitList.Add(class'Ext_TraitBoomWeld')
DefTraitList.Add(class'Ext_TraitContactNade')
DefTraitList.Add(class'Ext_TraitSupplyGren')
DefTraitList.Add(class'Ext_TraitSirenResistance')
DefTraitList.Add(class'Ext_TraitDemoDirectHit')
DefTraitList.Add(class'Ext_TraitDemoCriticalHit')
DefTraitList.Add(class'Ext_TraitDemoAOE')
DefTraitList.Add(class'Ext_TraitDemoReactiveArmor')
DefTraitList.Add(class'Ext_TraitDemoNuke')
DefTraitList.Add(class'Ext_TraitDemoProfessional')
2017-10-20 02:00:49 +00:00
BasePerk=class'KFPerk_Demolitionist'
2023-05-14 02:49:12 +00:00
AOEMult=1.0f
NukeDamageMult=1.0f
2017-10-20 02:00:49 +00:00
PrimaryMelee=class'KFWeap_Knife_Demolitionist'
PrimaryWeapon=class'KFWeap_GrenadeLauncher_HX25'
PerkGrenade=class'KFProj_DynamiteGrenade'
2023-05-14 02:49:12 +00:00
2017-10-20 02:00:49 +00:00
PrimaryWeaponDef=class'KFWeapDef_HX25'
KnifeWeaponDef=class'KFWeapDef_Knife_Demo'
GrenadeWeaponDef=class'KFWeapDef_Grenade_Demo'
2023-05-14 02:49:12 +00:00
2017-10-20 02:00:49 +00:00
AutoBuyLoadOutPath=(class'KFWeapDef_HX25', class'KFWeapDef_M79', class'KFWeapDef_M16M203', class'KFWeapDef_RPG7')
2023-05-14 02:49:12 +00:00
2017-10-20 02:00:49 +00:00
DefPerkStats(10)=(bHiddenConfig=true) // No support for mag size on demo.
DefPerkStats(13)=(bHiddenConfig=false) // Self damage.
}