Class SpellDef

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

An authored spell combining support units, strikes, traps, and optional residual fields.

public sealed class SpellDef
Inheritance
SpellDef
Inherited Members

Constructors

SpellDef(string, float, PointRuleDef, SummonDef, StrikeSequenceDef, AreaEffectDef, int)

Creates a spell definition.

public SpellDef(string id, float cooldown, PointRuleDef pointRule, SummonDef support = null, StrikeSequenceDef strikes = null, AreaEffectDef area = null, int unlockWave = 0)

Parameters

id string
cooldown float
pointRule PointRuleDef
support SummonDef
strikes StrikeSequenceDef
area AreaEffectDef
unlockWave int

Properties

Area

Optional residual region.

public AreaEffectDef Area { get; }

Property Value

AreaEffectDef

Cooldown

Cooldown consumed only by an approved cast.

public float Cooldown { get; }

Property Value

float

Id

Author-defined spell identifier.

public string Id { get; }

Property Value

string

PointRule

Shared preview and cast point validation.

public PointRuleDef PointRule { get; }

Property Value

PointRuleDef

Strikes

Optional independently scheduled area strikes.

public StrikeSequenceDef Strikes { get; }

Property Value

StrikeSequenceDef

Support

Optional temporary support units.

public SummonDef Support { get; }

Property Value

SummonDef

Trap

Optional deployment placed exactly at the spell-approved point with no entity owner. The spell's point rule replaces automatic trap placement and its point rule.

public TrapDef Trap { get; }

Property Value

TrapDef

UnlockWave

Minimum started wave number; zero enables the spell during preparation.

public int UnlockWave { get; }

Property Value

int

Methods

CreateTrap(string, float, PointRuleDef, TrapDef, int)

Creates a trap-only spell while preserving the existing constructor and its overload resolution.

public static SpellDef CreateTrap(string id, float cooldown, PointRuleDef pointRule, TrapDef trap, int unlockWave = 0)

Parameters

id string
cooldown float
pointRule PointRuleDef
trap TrapDef
unlockWave int

Returns

SpellDef

Examples

SpellDef.CreateTrap("deploy", 4, pointRule, trap);

WithTrap(TrapDef)

Copies every spell payload and replaces or adds the deployment. Trap capacity and its source-zero population limit are checked before any cast side effects.

public SpellDef WithTrap(TrapDef trap)

Parameters

trap TrapDef

Returns

SpellDef