Class UnitPresets

Namespace
TDMaker.Editor
Assembly
TDMaker.Editor.dll

Fills enemy, hero and soldier assets from ratios to a baseline (the project's median enemy and soldier, or built-in defaults). The ratios stay inside the bands of the balance notes: bounty density ×0.5–1.8 of the baseline, defenses in the low (0–0.2), medium (0.2–0.5) and strong (0.5–0.7) bands, hero experience steps ×1.1–1.6 after a first jump of ×2.5–3.5. They are a starting point; tune the result against your own towers.

public static class UnitPresets
Inheritance
UnitPresets
Inherited Members

Fields

Names

Display names in enum order.

public static readonly string[] Names

Field Value

string[]

Methods

Apply(EntityAssetBase, UnitPreset, Baseline, EnemyAsset)

Fills asset (an enemy, hero or soldier matching AssetType(UnitPreset)) from the preset. A splitter also needs its smaller enemy: pass it as companion (it is filled too), otherwise the split stays empty.

public static void Apply(EntityAssetBase asset, UnitPreset preset, UnitPresets.Baseline b, EnemyAsset companion = null)

Parameters

asset EntityAssetBase
preset UnitPreset
b UnitPresets.Baseline
companion EnemyAsset

AssetType(UnitPreset)

The asset type a preset creates.

public static Type AssetType(UnitPreset preset)

Parameters

preset UnitPreset

Returns

Type

Create(UnitPreset, string, string)

Creates and saves a new asset from a preset in folder (unique name, template id from the name). A splitter also creates its smaller enemy. Returns every created asset, the main one first.

public static List<EntityAssetBase> Create(UnitPreset preset, string folder, string name)

Parameters

preset UnitPreset
folder string
name string

Returns

List<EntityAssetBase>

FromProject()

Medians of the project's enemies and soldiers (defaults where the project has none).

public static UnitPresets.Baseline FromProject()

Returns

UnitPresets.Baseline

GrowthCurve(int, float)

Growth rows: experience steps ×3 after the first level then ×1.35 (inside the ×2.5–3.5 and ×1.1–1.6 bands), health +12%, damage +10% and one skill point per level, a little armor every other level.

public static List<HeroLevelData> GrowthCurve(int levels, float firstStep)

Parameters

levels int
firstStep float

Returns

List<HeroLevelData>

HasCompanion(UnitPreset)

Whether a preset also creates a second enemy (the splitter's split-off, the necromancer's raised unit).

public static bool HasCompanion(UnitPreset preset)

Parameters

preset UnitPreset

Returns

bool

Id(string)

Lower-case template id from an asset name ("Enemy_Big Orc" → "big_orc").

public static string Id(string name)

Parameters

name string

Returns

string