Table of Contents

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

TTarget

The 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

name string
description string
duration int
isStackable bool
modifierType AovDataStructures.ModifierType
amount float

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

float

Description

A description of what this effect does.

public string Description { get; protected set; }

Property Value

string

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

int

EffectToSpread

Store a effect status that can be spread

public IStatusEffect? EffectToSpread { get; protected init; }

Property Value

IStatusEffect

IsStackable

Whether this effect can be stacked.

public bool IsStackable { get; }

Property Value

bool

ModifierType

The modifier type (flat/percent)

public AovDataStructures.ModifierType ModifierType { get; }

Property Value

AovDataStructures.ModifierType

Name

The display name of the effect.

public string Name { get; protected set; }

Property Value

string

StackCount

The number of times this effect has been stacked.

public int StackCount { get; }

Property Value

int

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

target IEffectTarget<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

target IEffectTarget<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

target IEffectTarget<TTarget>

The target affected by this effect.

ResetDuration(int)

public virtual void ResetDuration(int duration)

Parameters

duration int