Class AreaEffectDef
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
effectStatusEffectDefradiusfloatdurationfloatintervalfloatmaxTargetsinttargetsEnemiesboolfollowSourceboolremoveOnEndbooltargetsFlyingbooltargetsGroundboolincludeTowersbool
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
Effect
Effect applied to each eligible occupant.
public StatusEffectDef Effect { get; }
Property Value
FollowSource
Follows its source while that source exists.
public bool FollowSource { get; }
Property Value
IncludeTowers
Also considers friendly structures when targeting friendly recipients.
public bool IncludeTowers { get; }
Property Value
Interval
Seconds between occupancy scans.
public float Interval { get; }
Property Value
MaxTargets
Maximum recipients per scan; zero means no limit.
public int MaxTargets { get; }
Property Value
Pulse
Optional direct pulse, evaluated independently from attached-effect lifetime.
public AreaPulseDef Pulse { get; }
Property Value
Radius
Ellipse horizontal radius.
public float Radius { get; }
Property Value
RemoveOnEnd
Removes bindings originating in this region when the region or source is removed.
public bool RemoveOnEnd { get; }
Property Value
TargetsEnemies
Targets hostile units instead of friendly units.
public bool TargetsEnemies { get; }
Property Value
TargetsFlying
Allows airborne recipients.
public bool TargetsFlying { get; }
Property Value
TargetsGround
Allows ground recipients.
public bool TargetsGround { get; }
Property Value
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
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
effectStatusEffectDefradiusfloatintervalfloatmaxTargetsinttargetsEnemiesboolfollowSourcebooltargetsFlyingbooltargetsGroundboolincludeTowersbool
Returns
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
pulseAreaPulseDefradiusfloatdurationfloatintervalfloatmaxTargetsinttargetsEnemiesboolfollowSourcebooltargetsFlyingbooltargetsGroundbool
Returns
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
followSourcebool
Returns
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
pulseAreaPulseDef