Vixen
caa30e12
csharp
public sealed class EffectSet

Every effect running on one thing, and the tags and stats they imply.

Read the guide page for this →

Remarks

The one place the eight kinds of timed thing meet. A set owns the target's AttributeSet and GameplayTagSet for the duration of an effect: applying one stamps its modifiers with a source and grants its tags, and removing one takes exactly those back off. Nothing else may add a modifier whose source is an effect, which is what makes "the buff fell off and my power did not come back down" impossible rather than unlikely.

Refusals are reported, not swallowed. An application blocked by None or by an immunity produces an Refused event, because the caller nearly always has something to say about it — a floating "immune", a wasted cooldown, an achievement.

Fields and properties (4)

  • public AttributeSet Attributes

    The stats effects here modify.

  • public GameplayTagSet Tags

    The tags effects here grant.

  • public int Count

    How many effects are running.

  • public ReadOnlySpan<ActiveEffect> Active

    Them, in the order they were applied.

Methods (11)

  • public EffectSet(AttributeSet attributes, GameplayTagSet tags)

    Makes a set over a target's stats and tags.

  • public EffectHandle Apply(EffectTemplate template, ulong instigator = 0, ICollection<EffectEvent>? events = null)

    Applies an effect, honouring its stacking policy and the target's immunities.

  • public bool Remove(EffectHandle handle, ICollection<EffectEvent>? events = null)

    Takes an effect off.

  • public int RemoveByDefinition(DefId definition, ICollection<EffectEvent>? events = null)

    Takes off every instance of one effect, whoever applied it.

  • public void Clear(ICollection<EffectEvent>? events = null)

    Takes everything off.

  • public void Tick(float delta, ICollection<EffectEvent>? events = null)

    Advances every effect by one step, emitting periodic ticks and expiring what is done.

  • public int Notify(GameplayTag gameplayEvent, ICollection<EffectEvent>? events = null)

    Tells the set something happened, and ends whatever said it should end on that.

  • public bool Blocks(GameplayTag action)

    Whether any running effect stops the target doing something.

  • public bool IsImmuneTo(EffectTemplate template)

    Whether any running effect makes the target immune to this one.

  • public bool TryGet(EffectHandle handle, out ActiveEffect effect)

    Finds a running effect.

  • public int StacksOf(DefId definition)

    How many stacks of an effect are running, summed over every instance of it.

Used by (7)

  • AbilityCasterVixen.Gameplay.Combat
  • AbilityCasterTestsVixen.Gameplay.Combat.Tests
  • CombatResolverVixen.Gameplay.Combat
  • CombatResolverTestsVixen.Gameplay.Combat.Tests
  • EffectSetTestsVixen.Gameplay.Tests
  • GameplaySubjectVixen.Gameplay
  • GameplaySubjectTestsVixen.Gameplay.Tests