Class MultiTargetAttackDef
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
idstringdamageDamageDefrangefloatmaxTargetsinthealthBudgetfloatchancefloattargetsMechanicTargetDeftargetsFlyingbooltargetsGroundbool
Properties
Chance
One probability roll per eligible activation; failure consumes cooldown.
public float Chance { get; }
Property Value
Damage
Independent hit for every chosen recipient; Execute flags are supported.
public DamageDef Damage { get; }
Property Value
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
Id
Neutral event key.
public string Id { get; }
Property Value
MaxTargets
Maximum distinct primary recipients per activation.
public int MaxTargets { get; }
Property Value
Range
Horizontal targeting radius, affected by source range modifiers.
public float Range { get; }
Property Value
Targets
Recipient restrictions, including health and hero eligibility.
public MechanicTargetDef Targets { get; }
Property Value
TargetsFlying
Allows airborne opponents.
public bool TargetsFlying { get; }
Property Value
TargetsGround
Allows ground opponents.
public bool TargetsGround { get; }