Skip to main content

PlayerHealthVisualEffectsSettings

A class in Root.Township, the global namespace.

Asset with the local player's health effects: hurt vignette, saturation by health, hunger blur and stomach sounds, recent damage, and the nightmare fog effect.

Constructors​

MemberWhat it is
PlayerHealthVisualEffectsSettings()Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets.

Fields​

19 private and internal fields
MemberWhat it is
private float blurryDelayBacking field for BlurryDelay. Shown only when isBlurringOnRepeat is on.
private DurationCurve blurryEffectBacking field for BlurryEffect.
private float chanceOfStomachAudioBacking field for ChanceOfStomachAudio. Shown only when isBlurringOnRepeat is on.
private float deadSaturationBacking field for DeadSaturation.
private AnimationCurve fogDensityOverValueCurve from the nightmare stat's value to fog density.
private HungerStat hungerDefinitionBacking field for HungerDefinition.
private ShellSetting hurtShellBacking field for HurtShell.
private DurationCurve hurtShellCurveBacking field for HurtShellCurve.
private bool isBlurringOnRepeatBacking field for IsBlurringOnRepeat.
private int maxHungerLevelBeforeBlurBacking field for MaxHungerLevelBeforeBlur.
private PlayerHealthVisualEffectsSettings.NightmareEffectController nightmareEffectControllerThe nightmare effect controller, made on the first SetupNightmare call.
private PooledObjectDefinition nightmareEffectDefinitionPooled particle effect spawned at the player's feet during a nightmare.
private StatDefinition nightmareStatDefinitionThe stat that drives the nightmare effect.
private float recentDamageCooldownBacking field for RecentDamageCooldown.
private StatDefinition recentDamageDefinitionBacking field for RecentDamageDefinition.
private int repeatStartsOnLevelBacking field for RepeatStartsOnLevel. Shown only when isBlurringOnRepeat is on.
private AnimationCurve saturationCurveBacking field for SaturationCurve.
private DurationCurve vignetteDurationCurveBacking field for VignetteDurationCurve.
private float visionLerpSpeedBacking field for VisionLerpSpeed.

Properties​

MemberWhat it is
float BlurryDelay { get; }Seconds between repeated hunger blurs.
DurationCurve BlurryEffect { get; }Curve and length of one hunger blur.
float ChanceOfStomachAudio { get; }Chance of a stomach rumble with each blur.
float DeadSaturation { get; }Screen saturation while dead.
HungerStat HungerDefinition { get; }The hunger stat, used to get the hunger level.
ShellSetting HurtShell { get; }Shell setting for the hurt effect.
DurationCurve HurtShellCurve { get; }Curve and length of the hurt shell effect.
bool IsBlurringOnRepeat { get; }Whether the hunger blur repeats at low hunger levels.
int MaxHungerLevelBeforeBlur { get; }Hunger levels at or above this don't blur.
float RecentDamageCooldown { get; }Seconds the recent damage stat stays on after damage.
StatDefinition RecentDamageDefinition { get; }The stat set to 1 while the player was recently damaged.
int RepeatStartsOnLevel { get; }Hunger level at or below which the blur repeats.
AnimationCurve SaturationCurve { get; }Curve from health to screen saturation.
DurationCurve VignetteDurationCurve { get; }Curve and length of the hurt vignette.
float VisionLerpSpeed { get; }How fast saturation changes.

Methods​

MemberWhat it is
void SetupNightmare(StatManager manager)Starts watching the nightmare stat to show its particles and fog.

Used in​

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