Class UpgradeEffectDef
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
targetUpgradeTargetDeffieldUpgradeFieldoperationUpgradeOperationvaluefloat
Properties
Field
Numeric destination; ignored by nonnumeric effects.
public UpgradeField Field { get; }
Property Value
FromTemplateId
Nested reference replaced by SwapTemplate, or null.
public string FromTemplateId { get; }
Property Value
Mechanic
Additional always-active behavior action, or null.
public AbilityActionDef Mechanic { get; }
Property Value
Operation
Numeric operation.
public UpgradeOperation Operation { get; }
Property Value
Target
Recipient filter.
public UpgradeTargetDef Target { get; }
Property Value
ToTemplateId
Replacement nested reference, or null.
public string ToTemplateId { get; }
Property Value
Value
Finite numeric operand.
public float Value { get; }
Property Value
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
targetUpgradeTargetDefmechanicAbilityActionDef
Returns
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
targetUpgradeTargetDeffromTemplateIdstringtoTemplateIdstring