Class MultiTargetAttackDef

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

One activation hits multiple distinct opponents in priority order, optionally reserving a total victim-health budget.

public sealed class MultiTargetAttackDef : IAbilityAction
Inheritance
MultiTargetAttackDef
Implements
Inherited Members

Examples

var channel = new AbilityActionDef(new MultiTargetAttackDef("volley", hit, 5, 3), 2);

Constructors

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

Creates an immediate multiple-recipient attack. Towers use their runtime priority; other actors choose nearest first.

public MultiTargetAttackDef(string id, DamageDef damage, float range, int maxTargets, float healthBudget = 0, float chance = 1, MechanicTargetDef targets = null, bool targetsFlying = true, bool targetsGround = true)

Parameters

id string
damage DamageDef
range float
maxTargets int
healthBudget float
chance float
targets MechanicTargetDef
targetsFlying bool
targetsGround bool

Properties

Chance

One probability roll per eligible activation; failure consumes cooldown.

public float Chance { get; }

Property Value

float

Damage

Independent hit for every chosen recipient; Execute flags are supported.

public DamageDef Damage { get; }

Property Value

DamageDef

HealthBudget

Sum of primary current health cannot exceed this value; zero disables the budget. Requires single-target Damage. Secondary payloads are independent.

public float HealthBudget { get; }

Property Value

float

Id

Neutral event key.

public string Id { get; }

Property Value

string

MaxTargets

Maximum distinct primary recipients per activation.

public int MaxTargets { get; }

Property Value

int

Range

Horizontal targeting radius, affected by source range modifiers.

public float Range { get; }

Property Value

float

Targets

Recipient restrictions, including health and hero eligibility.

public MechanicTargetDef Targets { get; }

Property Value

MechanicTargetDef

TargetsFlying

Allows airborne opponents.

public bool TargetsFlying { get; }

Property Value

bool

TargetsGround

Allows ground opponents.

public bool TargetsGround { get; }

Property Value

bool