Skip to main content

PlayerHealthVisualEffectsSettings.NightmareEffectController

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

Client: drives the nightmare status effect for the local player, a particle effect at their feet and extra fog, from the nightmare stat.

Constructors​

MemberWhat it is
NightmareEffectController(StatDefinition nightmareStatDefinition, AnimationCurve fogDensityOverValue, PooledObjectDefinition nightmareEffectDefinition)Creates a PlayerHealthVisualEffectsSettings.NightmareEffectController from nightmareStatDefinition, fogDensityOverValue and nightmareEffectDefinition.

Fields​

8 private and internal fields
MemberWhat it is
private PooledObject activeNightMareEffectThe spawned nightmare effect, or null.
private AnimationCurve fogDensityOverValueCurve from stat value to fog density.
private PooledObjectDefinition nightmareEffectDefinitionPooled effect spawned for the nightmare.
private Stat nightmareStatThe local player's nightmare stat.
private StatDefinition nightmareStatDefinitionWhich stat is the nightmare stat.
private IUnityUpdateMethod updateEffectHandle for the per frame UpdateEffect registration.
private ValueOperatedParticleSystem valueOperatorParticle system on the effect that is fed the stat value.
private bool wasNightmareActiveUnused flag.

Methods​

MemberWhat it is
void SetupNightmare(StatManager manager)Finds the nightmare stat in a stat manager and listens for it changing.
2 private and internal methods
MemberWhat it is
private void UpdateEffect()Each frame, keeps the effect at the player's feet, or releases it once the stat drops to 0.11 or the player dies.
private void UpdateFog(Stat stat)Spawns the effect when the stat goes above 0.11 and sets or releases fog density from the stat's value.

Used in​

Members of other types that take, return or hold a NightmareEffectController: