Class ChainAttackDef
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
idstringdamageDamageDefrangefloatlinkRangefloatmaxTargetsintlinkDelayfloatlinkScalefloatchancefloattargetsMechanicTargetDeftargetsFlyingbooltargetsGroundboolcancelWithSourcebool
Properties
CancelWithSource
Cancels remaining links if the source dies, disappears, is stunned, disarmed or ordered to rally.
public bool CancelWithSource { get; }
Property Value
Chance
One probability roll per eligible activation; a failed roll still consumes its cooldown.
public float Chance { get; }
Property Value
Damage
Payload at each link, including optional on-hit extensions.
public DamageDef Damage { get; }
Property Value
Id
Neutral author-defined event key.
public string Id { get; }
Property Value
LinkDelay
Game seconds between links; even zero yields until the next fixed tick.
public float LinkDelay { get; }
Property Value
LinkRange
Horizontal range from the preceding impact position for later links.
public float LinkRange { get; }
Property Value
LinkScale
Outgoing multiplier applied after each link; the first uses the source's captured output.
public float LinkScale { get; }
Property Value
MaxTargets
Maximum distinct primary recipients, including the first; cannot exceed simulation EntityCapacity.
public int MaxTargets { get; }
Property Value
Range
Initial horizontal range; affected by the source's range modifier.
public float Range { get; }
Property Value
Targets
Recipient restrictions.
public MechanicTargetDef Targets { get; }
Property Value
TargetsFlying
Whether links may hit airborne units.
public bool TargetsFlying { get; }
Property Value
TargetsGround
Whether links may hit ground units.
public bool TargetsGround { get; }