Class GlitchEffect
Corrupts a region intermittently: rows torn sideways, cells replaced with the wrong character, patches of inverted video.
Inherited Members
Namespace: Scylla.TextMode
Assembly: ScyllaTextMode.dll
Syntax
public sealed class GlitchEffect : AmbientEffectBase, ITextEffect, IDisposable
Remarks
A glitch has to be occasional to read as a fault. Corrupting every frame looks like an animation, so the effect spends most of its time showing the region untouched and only breaks it during short bursts.
The three kinds of damage can be mixed freely. Tearing alone reads as a signal problem, wrong characters alone as data corruption, and inversion alone as a failing panel.
Properties
BurstDuration
Gets or sets how long a burst lasts, in seconds.
Declaration
public float BurstDuration { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
ChurnRate
Gets or sets how often damage is re-rolled during a burst, in times per second.
Declaration
public float ChurnRate { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
Remarks
A high rate makes a burst boil; a low one makes it stutter in visible steps. Every other effect that re-rolls on a timer exposes this, and a preset cannot carry a value the runtime type does not surface.
CorruptionSet
Gets or sets the characters corrupted cells are replaced with.
Declaration
public string CorruptionSet { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Intensity
Gets or sets how severe the damage is during a burst, from 0 for none to 1 for as much as the effect will do.
Declaration
public float Intensity { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
Interval
Gets or sets the average gap between bursts, in seconds.
Declaration
public float Interval { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
IsGlitching
Gets whether the effect is currently in a burst.
Declaration
public bool IsGlitching { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Methods
OnAmbientStart()
Called when the effect starts, after the region has been captured.
Declaration
protected override void OnAmbientStart()
Overrides
OnEffectRelease()
Called when the effect is disposed. Return anything rented from the context here.
Declaration
protected override void OnEffectRelease()
Overrides
OnEffectTick(float, float)
Called once per tick to draw the effect at the given progress.
Declaration
protected override void OnEffectTick(float progress, float easedProgress)
Parameters
| Type | Name | Description |
|---|---|---|
| float | progress | Linear progress from 0 to 1. |
| float | easedProgress | Progress with the easing curve applied. |
Overrides
SetChurnRate(float)
Sets how often damage is re-rolled during a burst.
Declaration
public GlitchEffect SetChurnRate(float churnRate)
Parameters
| Type | Name | Description |
|---|---|---|
| float | churnRate | Re-rolls per second. |
Returns
| Type | Description |
|---|---|
| GlitchEffect | This effect, for chaining. |
SetCorruptionSet(string)
Sets the characters corrupted cells are replaced with.
Declaration
public GlitchEffect SetCorruptionSet(string corruptionSet)
Parameters
| Type | Name | Description |
|---|---|---|
| string | corruptionSet | The characters to draw from. |
Returns
| Type | Description |
|---|---|
| GlitchEffect | This effect, for chaining. |
SetDamage(bool, bool, bool)
Chooses which kinds of damage the effect does.
Declaration
public GlitchEffect SetDamage(bool tearRows, bool corruptCells, bool invertPatches)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | tearRows | Whether rows are torn sideways. |
| bool | corruptCells | Whether cells are replaced with the wrong character. |
| bool | invertPatches | Whether patches of the region are inverted. |
Returns
| Type | Description |
|---|---|
| GlitchEffect | This effect, for chaining. |
SetSeverity(float, float, float)
Sets how bad the damage gets and how often it happens.
Declaration
public GlitchEffect SetSeverity(float intensity, float interval, float burstDuration)
Parameters
| Type | Name | Description |
|---|---|---|
| float | intensity | Severity during a burst, from 0 to 1. |
| float | interval | Average seconds between bursts. |
| float | burstDuration | How long a burst lasts. |
Returns
| Type | Description |
|---|---|
| GlitchEffect | This effect, for chaining. |