DIFF

class ShockHandlerSource

Constructors 1

Constants 12

protected const float UPDATE_THRESHOLD = 3

NOTE : The lower, the more precise but the more synchronization

Referenced by CheckValue(), and ShockHitEffect()
const float VALUE_CHECK_INTERVAL = 0.95

in seconds

Referenced by Update()
private const int INTENSITY_FACTOR = 1

How intense the vignette effect will be, the higher the value, the stronger the effect

Referenced by NormalizeShockVal()
private const int VIGNETTE_INTENSITY_MAX = 1

Max BASE intensity of the vignette effect (w/o. bobbing). 0..2, where 2 is full screen coverage

private const int VIGNETTE_INTENSITY_MAX_TOTAL = 2

Max TOTAL intensity of the vignette effect (w. bobbing). 0..2, where 2 is full screen coverage

Referenced by AddEffectBobbing()
private const float SMOOTHING_MAX_INCR = 0.05

max smoothing change INCREASE per update

private const float SMOOTHING_MAX_DECR = 0.01

max smoothing change DECREASE per update

private const float PULSE_PERIOD = 0.5

The time it takes for pulse to do a full cycle

Referenced by AddEffectBobbing()
private const float PULSE_AMPLITUDE = 0.05

This is a multiplier, keep below 1 or expect the unexpected

Referenced by AddEffectBobbing()
private const int LIGHT_SHOCK_HIT = 33

Deprecated

Referenced by ShockHitEffect()
private const int MID_SHOCK_HIT = 67

Deprecated

Referenced by ShockHitEffect()
private const int HEAVY_SHOCK_HIT = 100

Deprecated

Referenced by ShockHitEffect()

Members 13

protected float m_Shock
Referenced by CheckValue(), GetShock(), and SetShock()
protected float m_LastEffectIntensityValue

for interpolation only

protected float m_ShockValueMax
Referenced by AddEffectBobbing(), NormalizeShockVal(), ShockHandler()
Show 1 more, Update()
protected float m_CumulatedShock

works ok on server, but does nothing for client. See deprecated stuff.

private float m_TimeSinceLastTick = VALUE_CHECK_INTERVAL + 1
Referenced by Update()
private float m_ShockMultiplier = 1
Referenced by CheckValue(), and SetMultiplier()
private float m_PrevVignette

Previous shock-adjecent value (some normalization required). Client sets it only on regular ShockHandler update!

private float m_PulseTimer
Referenced by AddEffectBobbing(), and Update()
protected ref Param1<float> m_Param
Referenced by ShockHandler(), and Update()
protected float m_ShockValueThreshold

Deprecated

Referenced by ShockHandler()
private float m_LerpRes

Deprecated

Methods 13

float GetCurrentShock()
float GetShock()
References m_Shock
private void DealShock()
Referenced by CheckValue()
protected void Synchronize()
Referenced by CheckValue()
protected float AddEffectBobbing(float baseVal)

adds bobbing, also clamps to valid range

Referenced by Update()
private float NormalizeShockVal(float shock)
private float LerpVignette(float x, float y, float deltaT)
References Math.Lerp()