Class SpellDef
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
idstringcooldownfloatpointRulePointRuleDefsupportSummonDefstrikesStrikeSequenceDefareaAreaEffectDefunlockWaveint
Properties
Area
Optional residual region.
public AreaEffectDef Area { get; }
Property Value
Cooldown
Cooldown consumed only by an approved cast.
public float Cooldown { get; }
Property Value
Id
Author-defined spell identifier.
public string Id { get; }
Property Value
PointRule
Shared preview and cast point validation.
public PointRuleDef PointRule { get; }
Property Value
Strikes
Optional independently scheduled area strikes.
public StrikeSequenceDef Strikes { get; }
Property Value
Support
Optional temporary support units.
public SummonDef Support { get; }
Property Value
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
UnlockWave
Minimum started wave number; zero enables the spell during preparation.
public int UnlockWave { get; }
Property Value
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
idstringcooldownfloatpointRulePointRuleDeftrapTrapDefunlockWaveint
Returns
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
trapTrapDef