Class UpgradeEffectDef

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

An immutable numeric patch, behavior attachment, or nested template-reference substitution.

public sealed class UpgradeEffectDef
Inheritance
UpgradeEffectDef
Inherited Members

Constructors

UpgradeEffectDef(UpgradeTargetDef, UpgradeField, UpgradeOperation, float)

Creates a numeric patch.

public UpgradeEffectDef(UpgradeTargetDef target, UpgradeField field, UpgradeOperation operation, float value)

Parameters

target UpgradeTargetDef
field UpgradeField
operation UpgradeOperation
value float

Properties

Field

Numeric destination; ignored by nonnumeric effects.

public UpgradeField Field { get; }

Property Value

UpgradeField

FromTemplateId

Nested reference replaced by SwapTemplate, or null.

public string FromTemplateId { get; }

Property Value

string

Mechanic

Additional always-active behavior action, or null.

public AbilityActionDef Mechanic { get; }

Property Value

AbilityActionDef

Operation

Numeric operation.

public UpgradeOperation Operation { get; }

Property Value

UpgradeOperation

Target

Recipient filter.

public UpgradeTargetDef Target { get; }

Property Value

UpgradeTargetDef

ToTemplateId

Replacement nested reference, or null.

public string ToTemplateId { get; }

Property Value

string

Value

Finite numeric operand.

public float Value { get; }

Property Value

float

Methods

AddMechanic(UpgradeTargetDef, AbilityActionDef)

Adds a native or custom action to the selected entity's existing behavior; spell recipients are rejected.

public static UpgradeEffectDef AddMechanic(UpgradeTargetDef target, AbilityActionDef mechanic)

Parameters

target UpgradeTargetDef
mechanic AbilityActionDef

Returns

UpgradeEffectDef

SwapTemplate(UpgradeTargetDef, string, string)

Replaces summon/barracks/ability soldier references inside selected recipients, preserving recipient identifiers.

public static UpgradeEffectDef SwapTemplate(UpgradeTargetDef target, string fromTemplateId, string toTemplateId)

Parameters

target UpgradeTargetDef
fromTemplateId string
toTemplateId string

Returns

UpgradeEffectDef