1
0
KF2-Dev-Scripts/KFGame/Classes/KFAffliction_Poison.uc
2022-11-28 00:49:25 +03:00

56 lines
1.4 KiB
Ucode

//=============================================================================
// KFAfflication_Poison
//=============================================================================
//
//=============================================================================
// Killing Floor 2
// Copyright (C) 2015 Tripwire Interactive LLC
//=============================================================================
class KFAffliction_Poison extends KFAfflictionAdvanced;
function Activate(KFPerk InstigatorPerk, optional class<KFDamageType> DamageType = none)
{
Super.Activate(InstigatorPerk, DamageType);
SetPoisoned(true);
}
function DeActivate()
{
Super.DeActivate();
SetPoisoned(false);
}
/** Set the EMP disrupt functionality */
function SetPoisoned(bool bEnabled)
{
if( MonsterOwner.Role == ROLE_Authority )
{
if( MonsterOwner.bIsPoisoned == bEnabled )
{
return;
}
MonsterOwner.bIsPoisoned = bEnabled;
MonsterOwner.OnStackingAfflictionChanged(AF_Poison);
}
ToggleEffects(bEnabled);
}
function ToggleEffects( bool bEnabled, optional bool bDummy )
{
local MaterialInstanceConstant MIC;
if ( PawnOwner.WorldInfo.NetMode != NM_DedicatedServer )
{
foreach PawnOwner.CharacterMICs(MIC)
{
MIC.SetScalarParameterValue('Scalar_Poison', (bEnabled) ? 1.f : 0.f);
}
}
}
defaultproperties
{
DissipationRate=10
}