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-11-27 21:49:25 +00:00
|
|
|
function Activate(KFPerk InstigatorPerk, optional class<KFDamageType> DamageType = none)
|
2020-12-13 15:01:13 +00:00
|
|
|
{
|
|
|
|
if( !bIsActive )
|
|
|
|
{
|
2022-11-27 21:49:25 +00:00
|
|
|
super.Activate(InstigatorPerk, DamageType);
|
2020-12-13 15:01:13 +00:00
|
|
|
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
|
|
|
|
{
|
|
|
|
}
|