Skip to main content

PlayerEffectManager.StatEffectApplication

A private class in Root.Township, the global namespace. Reach it through att-stubs' publicized assemblies or Harmony's AccessTools.

Private helper in PlayerEffectManager that watches one stat for a buff or a debuff and shows or hides the matching shield shell effect. Two are made per stat effect (buff and debuff).

Constructors​

MemberWhat it is
StatEffectApplication(StatDrivenEffect statDrive, Stat stat, bool isBuff, StatEffectShellAnimator shellAnimator, Action<StatDefinition, bool, bool> activeChanged, Action<StatDefinition, bool, float> sizeChanged)Creates a PlayerEffectManager.StatEffectApplication from statDrive, stat, isBuff, shellAnimator, activeChanged and sizeChanged.

Fields​

MemberWhat it is
Action<StatDefinition, bool, bool> ActiveChangedCallback run when the buff or debuff turns on or off, with the stat definition and whether it is a buff.
Action<StatDefinition, bool, float> SizeChangedCallback run with a new effect size (from the stat drive's value-to-size curve) when the effect starts or its value changes.
7 private and internal fields
MemberWhat it is
private ShellAnimationHandler handlerAnimation handler of the shield shell currently playing, deactivated when the effect ends or restarts.
private bool isActiveWhether the buff or debuff is currently showing.
private bool isBuffTrue to watch for a raised stat, false to watch for a lowered one.
private Func<float, float, float> MagnitudeDefinitionUnused function field.
private StatEffectShellAnimator shellAnimatorThe player's StatEffectShellAnimator that plays the shield effect.
private StatDrivenEffect statDriveThe StatDrivenEffect that gives the shield effect and the value-to-size curve.
private float ValueLast buff amount the shell was sized for. A change over 0.01 restarts the shell animation.

Methods​

1 private and internal method
MemberWhat it is
private void ValueChanged(Stat stat)Handles the stat's Changed event: works out the buff part of the value and turns the shell on, off or resizes it.