1
0
KF2-Dev-Scripts/KFGameContent/Classes/KFSeqAct_DamageDestructibleActor.uc

48 lines
1.4 KiB
Ucode
Raw Permalink Normal View History

2020-12-13 15:01:13 +00:00
//=============================================================================
// KFSeqAct_DamageDestructibleActor
//=============================================================================
// Deals damage to a destructible actor
//=============================================================================
// Killing Floor 2
// Copyright (C) 2019 Tripwire Interactive LLC
//=============================================================================
class KFSeqAct_DamageDestructibleActor extends SequenceAction;
var() class<DamageType> Type<AllowAbstract>;
var() int Amount;
Var() bool bInstaKillDamage;
event Activated()
{
local int DamageAmount;
local KFDestructibleActor DestructibleInput;
local SeqVar_Object ObjectInput;
foreach LinkedVariables(class'SeqVar_Object', ObjectInput, "Destructible Actor")
{
DestructibleInput = KFDestructibleActor(ObjectInput.GetObjectValue());
if (DestructibleInput != none)
{
if (bInstaKillDamage)
{
DamageAmount = DestructibleInput.GetInstaKillDamage();
}
else
{
DamageAmount = Amount;
}
DestructibleInput.TakeDamage(DamageAmount, none, vect(0, 0, 0), vect(0, 0, 0), Type);
}
}
}
DefaultProperties
{
ObjCategory="Killing Floor"
ObjName="Damage Destructible Actor"
VariableLinks.Empty()
VariableLinks(0)=(ExpectedType=class'SeqVar_Object', LinkDesc="Destructible Actor")
}