Class ChainAttackDef

Namespace
TDMaker.Core.Defs
Assembly
TDMaker.Core.dll

One attack whose successive links visit distinct opposing units; state is held in a fixed simulation pool.

public sealed class ChainAttackDef : IAbilityAction
Inheritance
ChainAttackDef
Implements
Inherited Members

Examples

var channel = new AbilityActionDef(new ChainAttackDef("arc", hit, 5, 2, 4), 3);

Constructors

ChainAttackDef(string, DamageDef, float, float, int, float, float, float, MechanicTargetDef, bool, bool, bool)

Creates chain behavior; nearest eligible targets and then smaller Id break ties at every link.

public ChainAttackDef(string id, DamageDef damage, float range, float linkRange, int maxTargets, float linkDelay = 0, float linkScale = 1, float chance = 1, MechanicTargetDef targets = null, bool targetsFlying = true, bool targetsGround = true, bool cancelWithSource = true)

Parameters

id string
damage DamageDef
range float
linkRange float
maxTargets int
linkDelay float
linkScale float
chance float
targets MechanicTargetDef
targetsFlying bool
targetsGround bool
cancelWithSource bool

Properties

CancelWithSource

Cancels remaining links if the source dies, disappears, is stunned, disarmed or ordered to rally.

public bool CancelWithSource { get; }

Property Value

bool

Chance

One probability roll per eligible activation; a failed roll still consumes its cooldown.

public float Chance { get; }

Property Value

float

Damage

Payload at each link, including optional on-hit extensions.

public DamageDef Damage { get; }

Property Value

DamageDef

Id

Neutral author-defined event key.

public string Id { get; }

Property Value

string

LinkDelay

Game seconds between links; even zero yields until the next fixed tick.

public float LinkDelay { get; }

Property Value

float

LinkRange

Horizontal range from the preceding impact position for later links.

public float LinkRange { get; }

Property Value

float

LinkScale

Outgoing multiplier applied after each link; the first uses the source's captured output.

public float LinkScale { get; }

Property Value

float

MaxTargets

Maximum distinct primary recipients, including the first; cannot exceed simulation EntityCapacity.

public int MaxTargets { get; }

Property Value

int

Range

Initial horizontal range; affected by the source's range modifier.

public float Range { get; }

Property Value

float

Targets

Recipient restrictions.

public MechanicTargetDef Targets { get; }

Property Value

MechanicTargetDef

TargetsFlying

Whether links may hit airborne units.

public bool TargetsFlying { get; }

Property Value

bool

TargetsGround

Whether links may hit ground units.

public bool TargetsGround { get; }

Property Value

bool