Class AreaEffectDef

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

A timed region repeatedly requesting attached effects from current occupants.

public sealed class AreaEffectDef
Inheritance
AreaEffectDef
Inherited Members

Constructors

AreaEffectDef(StatusEffectDef, float, float, float, int, bool, bool, bool, bool, bool, bool)

Creates an area emitter.

public AreaEffectDef(StatusEffectDef effect, float radius, float duration, float interval, int maxTargets = 0, bool targetsEnemies = true, bool followSource = false, bool removeOnEnd = false, bool targetsFlying = true, bool targetsGround = true, bool includeTowers = false)

Parameters

effect StatusEffectDef
radius float
duration float
interval float
maxTargets int
targetsEnemies bool
followSource bool
removeOnEnd bool
targetsFlying bool
targetsGround bool
includeTowers bool

Properties

Duration

Region lifetime, independent of attached effect lifetimes. Zero is reported by an UntilSourceLost copy and is not a timed expiry.

public float Duration { get; }

Property Value

float

Effect

Effect applied to each eligible occupant.

public StatusEffectDef Effect { get; }

Property Value

StatusEffectDef

FollowSource

Follows its source while that source exists.

public bool FollowSource { get; }

Property Value

bool

IncludeTowers

Also considers friendly structures when targeting friendly recipients.

public bool IncludeTowers { get; }

Property Value

bool

Interval

Seconds between occupancy scans.

public float Interval { get; }

Property Value

float

MaxTargets

Maximum recipients per scan; zero means no limit.

public int MaxTargets { get; }

Property Value

int

Pulse

Optional direct pulse, evaluated independently from attached-effect lifetime.

public AreaPulseDef Pulse { get; }

Property Value

AreaPulseDef

Radius

Ellipse horizontal radius.

public float Radius { get; }

Property Value

float

RemoveOnEnd

Removes bindings originating in this region when the region or source is removed.

public bool RemoveOnEnd { get; }

Property Value

bool

TargetsEnemies

Targets hostile units instead of friendly units.

public bool TargetsEnemies { get; }

Property Value

bool

TargetsFlying

Allows airborne recipients.

public bool TargetsFlying { get; }

Property Value

bool

TargetsGround

Allows ground recipients.

public bool TargetsGround { get; }

Property Value

bool

UntilSourceLost

Ignores Duration and remains until its required source dies or is removed. Owned attachments are removed with the region.

public bool UntilSourceLost { get; }

Property Value

bool

Methods

CreateOwned(StatusEffectDef, float, float, int, bool, bool, bool, bool, bool)

Creates a source-owned attachment emitter without a duration. The source must exist and remain alive; attached effects retain their own lifetime.

public static AreaEffectDef CreateOwned(StatusEffectDef effect, float radius, float interval, int maxTargets = 0, bool targetsEnemies = true, bool followSource = true, bool targetsFlying = true, bool targetsGround = true, bool includeTowers = false)

Parameters

effect StatusEffectDef
radius float
interval float
maxTargets int
targetsEnemies bool
followSource bool
targetsFlying bool
targetsGround bool
includeTowers bool

Returns

AreaEffectDef

CreatePulse(AreaPulseDef, float, float, float, int, bool, bool, bool, bool)

Creates a pulse-only region without a dummy attached effect. TargetsEnemies selects the global enemy faction, including enemy support auras.

public static AreaEffectDef CreatePulse(AreaPulseDef pulse, float radius, float duration, float interval, int maxTargets = 0, bool targetsEnemies = true, bool followSource = false, bool targetsFlying = true, bool targetsGround = true)

Parameters

pulse AreaPulseDef
radius float
duration float
interval float
maxTargets int
targetsEnemies bool
followSource bool
targetsFlying bool
targetsGround bool

Returns

AreaEffectDef

WithOwnerLifetime(bool)

Copies this region with no timed expiry. Emission requires a living source; fixed-position ownership is allowed by passing false.

public AreaEffectDef WithOwnerLifetime(bool followSource = true)

Parameters

followSource bool

Returns

AreaEffectDef

Examples

new AuraDef(area.WithOwnerLifetime());

Remarks

Attached-effect durations still control occupancy refresh and exit linger. This changes the emitter lifetime only.

WithPulse(AreaPulseDef)

Copies a region and adds direct pulses while retaining its attachment payload.

public AreaEffectDef WithPulse(AreaPulseDef pulse)

Parameters

pulse AreaPulseDef

Returns

AreaEffectDef