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

76 lines
2.3 KiB
Ucode
Raw Normal View History

2017-10-20 02:00:49 +00:00
Class Ext_PerkCommando extends Ext_PerkBase;
var bool bUseProfessional,bUseMachineGunner;
var float ZTExtCount;
replication
{
// Things the server should send to the client.
2020-11-28 20:04:55 +00:00
if (true)
bUseProfessional,bUseMachineGunner;
}
2020-11-28 20:04:55 +00:00
simulated function bool GetUsingTactialReload(KFWeapon KFW)
2017-10-20 02:00:49 +00:00
{
return (IsWeaponOnPerk(KFW) ? Modifiers[5]<0.65 : 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 ((DamageType!=None && DamageType.Default.ModifierPerkList.Find(BasePerk)>=0) || (KFWeapon(DamageCauser)!=None && IsWeaponOnPerk(KFWeapon(DamageCauser))))
{
2020-11-28 20:12:58 +00:00
if (bUseMachineGunner && WorldInfo.TimeDilation < 1.f)
InDamage += InDamage * 0.03;
}
Super.ModifyDamageGiven(InDamage, DamageCauser, MyKFPM, DamageInstigator, DamageType, HitZoneIdx);
}
2020-11-28 20:04:55 +00:00
simulated function float GetZedTimeModifier(KFWeapon W)
{
local name StateName;
StateName = W.GetStateName();
2020-11-28 20:12:58 +00:00
if (bUseProfessional && IsWeaponOnPerk(W))
{
2020-11-28 20:12:58 +00:00
if (StateName == 'Reloading' || StateName == 'AltReloading')
return 1.f;
2020-11-28 20:12:58 +00:00
else if (StateName == 'WeaponPuttingDown' || StateName == 'WeaponEquipping')
return 0.3f;
}
2020-11-28 20:12:58 +00:00
if (bUseMachineGunner && IsWeaponOnPerk(W) && BasePerk.Default.ZedTimeModifyingStates.Find(StateName) != INDEX_NONE)
return 0.5f;
return 0.f;
}
2020-11-28 20:04:55 +00:00
simulated function float GetZedTimeExtensions(byte Level)
{
return ZTExtCount;
}
2017-10-20 02:00:49 +00:00
defaultproperties
{
PerkIcon=Texture2D'UI_PerkIcons_TEX.UI_PerkIcon_Commando'
DefTraitList.Add(class'Ext_TraitWPComm')
DefTraitList.Add(class'Ext_TraitUnCloak')
DefTraitList.Add(class'Ext_TraitZedTExt')
2017-10-20 02:00:49 +00:00
DefTraitList.Add(class'Ext_TraitEnemyHP')
DefTraitList.Add(class'Ext_TraitEliteReload')
DefTraitList.Add(class'Ext_TraitTactician')
DefTraitList.Add(class'Ext_TraitMachineGunner')
2017-10-20 02:00:49 +00:00
BasePerk=class'KFPerk_Commando'
ZTExtCount=1.f;
2017-10-20 02:00:49 +00:00
PrimaryMelee=class'KFWeap_Knife_Commando'
PrimaryWeapon=class'KFWeap_AssaultRifle_AR15'
PerkGrenade=class'KFProj_HEGrenade'
PrimaryWeaponDef=class'KFWeapDef_AR15'
KnifeWeaponDef=class'KFweapDef_Knife_Commando'
GrenadeWeaponDef=class'KFWeapDef_Grenade_Commando'
AutoBuyLoadOutPath=(class'KFWeapDef_AR15', class'KFWeapDef_Bullpup', class'KFWeapDef_AK12', class'KFWeapDef_SCAR')
}