1
0
KF2-Dev-Scripts/KFGame/Classes/KFAffliction_Snare.uc

53 lines
1.4 KiB
Ucode
Raw Normal View History

2020-12-13 15:01:13 +00:00
//=============================================================================
// KFAffliction_Snare
//=============================================================================
// The snare (slowing down) affliction
//=============================================================================
// Killing Floor 2
// Copyright (C) 2016 Tripwire Interactive LLC
// - Christian "schneidzekk" Schneider
//=============================================================================
class KFAffliction_Snare extends KFAfflictionAdvanced;
var float SnareSpeedModifier;
function Init(KFPawn P, EAfflictionType Type, KFPerk InstigatorPerk)
{
Super.Init(P, Type, InstigatorPerk);
SnareSpeedModifier = 1.f;
if (InstigatorPerk != none)
{
SnareSpeedModifier = InstigatorPerk.GetSnareSpeedModifier();
}
}
/** */
2022-05-11 15:13:25 +00:00
function Activate(optional class<KFDamageType> DamageType = none)
2020-12-13 15:01:13 +00:00
{
if( !bIsActive )
{
super.Activate();
PawnOwner.SetTimer(Duration, false, nameof(DeActivate), self);
bIsActive = true;
PawnOwner.SetAfflictionSpeedModifier();
}
}
function DeActivate()
{
bIsActive = false;
`log(self@"was deactivaed", bDebug);
PawnOwner.SetAfflictionSpeedModifier();
}
/** Accessor to get known affliction speed modifier */
function float GetSpeedModifier()
{
return bIsActive ? SnareSpeedModifier : 1.f;
}
defaultproperties
{
}