Class StatusEffectAsset

Namespace
TDMaker.Unity.Authoring
Assembly
TDMaker.Unity.dll

An attached status effect (slow, stun, armor shift, damage over time ...). Bakes to StatusEffectDef. Reference it from attack damage (effects), area effects, abilities or spells.

[CreateAssetMenu(menuName = "2D Tower Defense Maker/Status Effect", fileName = "StatusEffect", order = 15)]
public sealed class StatusEffectAsset : ScriptableObject
Inheritance
Object
ScriptableObject
StatusEffectAsset
Inherited Members
ScriptableObject.SetDirty()
ScriptableObject.CreateInstance<T>()
Object.GetEntityId()
Object.GetInstanceID()
Object.GetHashCode()
Object.InstantiateAsync<T>(T)
Object.InstantiateAsync<T>(T, Transform)
Object.InstantiateAsync<T>(T, Vector3, Quaternion)
Object.InstantiateAsync<T>(T, Transform, Vector3, Quaternion)
Object.Instantiate(Object, Vector3, Quaternion)
Object.Instantiate(Object, Vector3, Quaternion, Transform)
Object.Instantiate(Object)
Object.Instantiate(Object, Scene)
Object.Instantiate<T>(T, InstantiateParameters)
Object.Instantiate<T>(T, Vector3, Quaternion, InstantiateParameters)
Object.Instantiate(Object, Transform)
Object.Instantiate<T>(T)
Object.Instantiate<T>(T, Vector3, Quaternion)
Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
Object.Instantiate<T>(T, Transform)
Object.Destroy(Object)
Object.DestroyImmediate(Object)
Object.DontDestroyOnLoad(Object)
Object.DestroyObject(Object)
Object.FindObjectsOfType<T>()
Object.FindObjectsByType<T>(FindObjectsSortMode)
Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)
Object.FindObjectOfType<T>()
Object.FindFirstObjectByType<T>()
Object.FindAnyObjectByType<T>()
Object.FindFirstObjectByType<T>(FindObjectsInactive)
Object.FindAnyObjectByType<T>(FindObjectsInactive)
Object.FindObjectsByType<T>()
Object.FindObjectsByType<T>(FindObjectsInactive)
Object.ToString()
Object.name
Object.hideFlags

Constructors

StatusEffectAsset()

public StatusEffectAsset()

Fields

displayName

Name shown in UI; blank uses the asset name.

public string displayName

Field Value

string

duration

Lifetime in game seconds.

[Min(0.01)]
public float duration

Field Value

float

effectId

Definition id used for duplicate checks; blank uses the asset name.

public string effectId

Field Value

string

family

Optional family used by immunities and suppression (for example "slow" or "poison").

public string family

Field Value

string

forbiddenFamilies

Effect families that cannot be attached while this effect is present.

public List<string> forbiddenFamilies

Field Value

List<string>

forbiddenIds

Effect ids that cannot be attached while this effect is present.

public List<string> forbiddenIds

Field Value

List<string>

healing

Optional healing over time (independent of damage over time).

public PeriodicHealingData healing

Field Value

PeriodicHealingData

icon

Optional icon drawn above affected units; a coloured pip is used when empty.

public Sprite icon

Field Value

Sprite

modifier

Reversible stat changes while attached.

[Header("Payload")]
public StatModifierData modifier

Field Value

StatModifierData

periodic

Optional damage over time.

public PeriodicDamageData periodic

Field Value

PeriodicDamageData

rank

Relative strength; a higher rank can replace a lower rank of the same id.

[Min(0)]
public int rank

Field Value

int

refreshEqualRank

Re-applying at equal rank refreshes the lifetime (without re-applying modifiers).

public bool refreshEqualRank

Field Value

bool

rejectedTags

No such eligibility bit may be present on the target (bit mask).

public int rejectedTags

Field Value

int

removeForbidden

Also removes existing forbidden effects when this one attaches.

public bool removeForbidden

Field Value

bool

replaceLowerRank

Replaces lower-ranked instances of the same id.

public bool replaceLowerRank

Field Value

bool

requiredTags

All these eligibility bits must be present on the target (bit mask).

[Header("Eligibility")]
public int requiredTags

Field Value

int

shield

Optional damage-absorbing shield, stored separately for each attachment.

public ShieldData shield

Field Value

ShieldData

stackEqualRank

Allows separate instances at equal rank.

[Header("Stacking")]
public bool stackEqualRank

Field Value

bool

tint

Body tint applied to affected units.

[Header("View")]
public Color tint

Field Value

Color

tintStrength

Strength of the body tint (0 disables tinting).

[Range(0, 1)]
public float tintStrength

Field Value

float

Properties

DisplayName

The resolved display name.

public string DisplayName { get; }

Property Value

string

EffectId

The resolved effect id.

public string EffectId { get; }

Property Value

string

Methods

ToDef()

Bakes the immutable definition. Inside a level bake the same instance is reused for this asset.

public StatusEffectDef ToDef()

Returns

StatusEffectDef