Class StatusEffect<TTarget>
- Namespace
- AshesOfVelsingrad.Systems
- Assembly
- Ashes of Velsingrad.dll
Base class for all status effects that can be applied to an IEffectTarget<TTarget>.
public abstract class StatusEffect<TTarget> : IStatusEffect
Type Parameters
TTargetThe type of target this status effect can be applied to, such as UnitSystem or MapSystem.
- Inheritance
-
StatusEffect<TTarget>
- Implements
- Derived
- Inherited Members
Remarks
This class provides core properties and methods for a status effect, including stacking behavior, duration management, and hooks for when the effect is applied, removed, or updated each turn.
Constructors
StatusEffect(string, string, int, bool, ModifierType, float)
Base class for all status effects that can be applied to an IEffectTarget<TTarget>.
protected StatusEffect(string name, string description, int duration, bool isStackable, AovDataStructures.ModifierType modifierType = ModifierType.Flat, float amount = 0)
Parameters
namestringdescriptionstringdurationintisStackableboolmodifierTypeAovDataStructures.ModifierTypeamountfloat
Remarks
This class provides core properties and methods for a status effect, including stacking behavior, duration management, and hooks for when the effect is applied, removed, or updated each turn.
Properties
Amount
The amount to apply
public float Amount { get; }
Property Value
Description
A description of what this effect does.
public string Description { get; protected set; }
Property Value
Duration
The number of turns the effect will last.
A value of -1 means the effect is permanent.
public int Duration { get; protected set; }
Property Value
EffectToSpread
Store a effect status that can be spread
public IStatusEffect? EffectToSpread { get; protected init; }
Property Value
IsStackable
Whether this effect can be stacked.
public bool IsStackable { get; }
Property Value
ModifierType
The modifier type (flat/percent)
public AovDataStructures.ModifierType ModifierType { get; }
Property Value
Name
The display name of the effect.
public string Name { get; protected set; }
Property Value
StackCount
The number of times this effect has been stacked.
public int StackCount { get; }
Property Value
Methods
AddStack()
Increases the stack count of the effect if it is stackable.
public virtual void AddStack()
OnApply(IEffectTarget<TTarget>)
Called when this effect is applied to a target. Override this to implement custom logic (e.g., visual/audio feedback, stat changes).
public virtual void OnApply(IEffectTarget<TTarget> target)
Parameters
targetIEffectTarget<TTarget>The target receiving the effect.
OnRemove(IEffectTarget<TTarget>)
Called when this effect is removed from a target. Override this to implement cleanup logic (e.g., removing buffs, stopping visual/audio feedback).
public virtual void OnRemove(IEffectTarget<TTarget> target)
Parameters
targetIEffectTarget<TTarget>The target losing the effect.
OnTurnPassed(IEffectTarget<TTarget>)
Called at the end of each turn to update the effect’s duration or apply ongoing logic.
public virtual void OnTurnPassed(IEffectTarget<TTarget> target)
Parameters
targetIEffectTarget<TTarget>The target affected by this effect.
ResetDuration(int)
public virtual void ResetDuration(int duration)
Parameters
durationint