Class UpgradeTargetData

Namespace
TDMaker.Unity.Campaign
Assembly
TDMaker.Unity.dll

Which templates or spells an effect changes. Filters combine with AND; inside the asset list and inside the kind mask they are alternatives. Empty filters do not restrict (an effect with no filter at all changes everything of the field's kind).

public sealed class UpgradeTargetData
Inheritance
UpgradeTargetData
Inherited Members

Constructors

UpgradeTargetData()

public UpgradeTargetData()

Fields

assets

Towers, soldiers, heroes or enemies whose template ids are selected.

[Tooltip("Towers, soldiers, heroes or enemies to change (their template ids). Leave empty to select by tags or kind only.")]
public List<EntityAssetBase> assets

Field Value

List<EntityAssetBase>

kinds

Optional role filter (towers, soldiers, heroes, spells, projectiles, enemies).

[Tooltip("Optional role filter. Nothing selected: any role.")]
public UpgradeTargetKind kinds

Field Value

UpgradeTargetKind

requiredTags

Tag bits every selected template must have (the Tags field of units). Spells have no tags.

[Tooltip("Tag bits every selected template must carry (the Tags field of units). Spells have no tags.")]
public int requiredTags

Field Value

int

spells

Player spells selected by spell id.

[Tooltip("Player spells to change (their spell ids).")]
public List<SpellAsset> spells

Field Value

List<SpellAsset>

templateIds

Further template or spell ids (for templates registered by code, for example projectile templates).

[Tooltip("Further template or spell ids, for templates registered by code.")]
public List<string> templateIds

Field Value

List<string>

Properties

IsUnfiltered

Whether no filter is set (the effect would change every template that has the field).

public bool IsUnfiltered { get; }

Property Value

bool

Methods

Ids()

Template and spell ids of the asset lists and the id list, without blanks and duplicates.

public string[] Ids()

Returns

string[]

Matches(UpgradeTargetDef, EntityTemplate)

Whether the selector picks template (the same rule the core applies when the battle starts).

public static bool Matches(UpgradeTargetDef target, EntityTemplate template)

Parameters

target UpgradeTargetDef
template EntityTemplate

Returns

bool

MatchesSpell(UpgradeTargetDef, string)

Whether the selector picks the spell spellId.

public static bool MatchesSpell(UpgradeTargetDef target, string spellId)

Parameters

target UpgradeTargetDef
spellId string

Returns

bool

ToDef()

Bakes the core selector.

public UpgradeTargetDef ToDef()

Returns

UpgradeTargetDef