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

61 lines
1.6 KiB
Ucode
Raw Normal View History

2020-12-13 15:01:13 +00:00
//=============================================================================
// KFAfflictionAdvanced
//=============================================================================
// An affliction base class for custom (non special move) handling
//=============================================================================
// Killing Floor 2
// Copyright (C) 2015 Tripwire Interactive LLC
//=============================================================================
class KFAfflictionAdvanced extends KFAfflictionBase
abstract;
/** Duration copied from owner's incap settings */
var float Duration;
/** true once activated until duration has expired */
var bool bIsActive;
/** Default Effect Socket */
2022-11-27 21:49:25 +00:00
var name EffectSocketName;
2020-12-13 15:01:13 +00:00
/** Copy incap settings we're going to need */
function Init(KFPawn P, EAfflictionType Type, KFPerk InstigatorPerk)
{
Super.Init(P, Type, InstigatorPerk);
Duration = P.IncapSettings[Type].Duration;
}
/** */
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;
}
}
function DeActivate()
{
bIsActive = false;
`log(self@"was deactivaed", bDebug);
}
/** flush active timers */
function Shutdown()
{
// flush active timers
if ( bIsActive )
{
DeActivate();
PawnOwner.ClearTimer(nameof(DeActivate), self);
`log(self@"shutdown on owner death", bDebug);
}
}
defaultproperties
{
EffectSocketName=Hips
}