Class MineFieldData
- Namespace
- TDMaker.Unity.Authoring
- Assembly
- TDMaker.Unity.dll
Automatic mine laying, baked into a DeploymentPlanDef with a TrapDef payload. Each activation picks one lane node of a level path inside the distance band around the producer (seeded, deterministic), reserves it, throws the mine (flight, landing, then the arm delay) and leaves a trap that bursts under the first eligible unit. The lifetime counts from the throw. Use it as an ability action (useMines); it fails, without a fallback spot, when no node fits.
public sealed class MineFieldData
- Inheritance
-
MineFieldData
- Inherited Members
Constructors
MineFieldData()
public MineFieldData()
Fields
area
Optional region left where the mine bursts.
[Tooltip("Optional region (effect and/or pulse) left at the mine on every trigger.")]
public AreaEffectData area
Field Value
armDelay
Delay after landing before the mine can trigger.
[Tooltip("Arming delay after the landing preparation.")]
[Min(0)]
public float armDelay
Field Value
color
Marker, detection ring and blast colour.
[Header("Look")]
public Color color
Field Value
- Color
damage
Hit on trigger: an area packet is centred on the mine, a single-target packet hits the triggering unit.
[Tooltip("Hit on trigger: an area packet (radius > 0) is centred on the mine and re-searches its victims; radius 0 hits only the triggering unit.")]
public DamageData damage
Field Value
id
Event key: selects the marker colour and the keyed audio cue, and counts toward the mine limit.
[Tooltip("Event key: selects the marker colour and the keyed audio cue, and counts toward the mine limit.")]
public string id
Field Value
keepWhenSourceLost
Mines stay when their producer is sold or dies (off = they are removed with it).
[Tooltip("Mines already laid stay when the producer is sold, dies or disappears (their kill credit is kept).")]
public bool keepWhenSourceLost
Field Value
lifetime
Total lifetime from the throw, including flight, landing and arming.
[Tooltip("Lifetime in game seconds from the throw (flight, landing and arming count). An unused mine fades out without exploding.")]
[Min(0.05)]
public float lifetime
Field Value
maxMines
Maximum live and in-flight mines of this producer; a full field rejects the throw.
[Tooltip("Maximum mines of this id alive or in flight per producer. A full field rejects the throw (old mines are never replaced). 0 = no limit.")]
[Min(0)]
public int maxMines
Field Value
maxTriggers
Activations before the mine is used up.
[Tooltip("Activations before the mine is used up (1 = a single blast).")]
[Min(1)]
public int maxTriggers
Field Value
maximumDistance
Outer radius of the placement band (range ellipse).
[Tooltip("Outer radius of the placement band (range ellipse); usually a little less than the producer's attack range.")]
[Min(0)]
public float maximumDistance
Field Value
minimumDistance
Inner radius of the placement band around the producer (range ellipse).
[Header("Placement")]
[Tooltip("Inner radius of the placement band around the producer (range ellipse). Lane nodes closer than this are skipped.")]
[Min(0)]
public float minimumDistance
Field Value
minimumSpacing
Minimum distance between mines, including mines still in flight.
[Tooltip("Minimum distance between mines, including those still in flight. About half to one detection diameter spreads them out.")]
[Min(0)]
public float minimumSpacing
Field Value
pointRule
Terrain check for candidate nodes; a node the rule moves is rejected.
[Tooltip("Terrain check for every candidate lane node (for example bounds). A node the rule would move is skipped.")]
public PointRuleData pointRule
Field Value
settleDuration
Landing preparation before the arming delay.
[Tooltip("Landing preparation after the flight, before the arming delay.")]
[Min(0)]
public float settleDuration
Field Value
sideClearance
Minimum horizontal offset from the producer (keeps mines off the spot right under it).
[Tooltip("Minimum horizontal (X) offset of a site from the producer; 0 accepts sites straight above or below it.")]
[Min(0)]
public float sideClearance
Field Value
spacingScope
Spacing counts only this producer's mines, or every deployment.
[Tooltip("Owner: spacing only against this producer's mines. Global: against every deployment (other producers and spell traps).")]
public DeploymentSpacingScope spacingScope
Field Value
targets
Extra trigger eligibility (blast victims use normal damage eligibility).
public MechanicTargetData targets
Field Value
targetsEnemies
Triggered by enemies (otherwise by friendly soldiers and heroes).
[Tooltip("Triggered by enemies (off = by friendly soldiers and heroes, for mines laid by enemies).")]
public bool targetsEnemies
Field Value
targetsFlying
Flying units can trigger it.
public bool targetsFlying
Field Value
targetsGround
Ground units can trigger it.
public bool targetsGround
Field Value
transitDuration
Flight time before the landing.
[Tooltip("Flight time of the throw (drawn as an arc).")]
[Min(0)]
public float transitDuration
Field Value
triggerRadius
Detection radius (range ellipse), usually a fraction of the blast radius.
[Tooltip("Detection radius (range ellipse). Usually about a quarter to a third of the blast radius.")]
[Min(0)]
public float triggerRadius
Field Value
useCustomPointRule
Uses pointRule to check every candidate node (default: any node on a lane).
public bool useCustomPointRule
Field Value
vfx
Optional pooled VFX spawned on each blast.
public GameObject vfx
Field Value
- GameObject
Properties
Id
The resolved event key.
public string Id { get; }
Property Value
PreparationTime
Seconds from the throw until the mine is armed.
public float PreparationTime { get; }
Property Value
Methods
ToDef()
Bakes the deployment plan.
public DeploymentPlanDef ToDef()