DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
PPERDrowningEffect.c
См. документацию.
1class PPERequester_Drowning extends PPERequester_GameplayBase
2{
3 private float m_EffectPhase = 0;
4 private float m_Magnitude = 0;
5 private float m_MinMagnitude = 0.3;
6 private float m_MaxMagnitude = 0.3; // Actual Maximum is Min+Max
7 private float m_Frequency = 5;
8 private float m_Stamina01;
9
10 override protected void OnStart(Param par = null)
11 {
12 super.OnStart(par);
13
14 m_EffectPhase = 0;
15 m_Magnitude = 0;
16 }
17
18 override protected void OnUpdate(float delta)
19 {
20 super.OnUpdate(delta);
21
22 if (!m_IsRunning)
23 return;
24
25 m_EffectPhase += delta * m_Frequency / (m_Stamina01 + 1); // Start with lower frequency and increase it as it gets closer to danger
26
27 float currentVal = (Math.Sin(m_EffectPhase) +1)/2; // Makes current val oscillate between 0 and 1 (normlization)
28 currentVal = Easing.EaseInExpo(currentVal); // Ease it to tweak the effect
29 currentVal *= currentVal * m_MaxMagnitude; // Scale the normalized value to make it proportional to the Max Magnitude
30 currentVal += m_MinMagnitude;
31 m_Magnitude = Math.Lerp(m_Magnitude, currentVal, delta * m_Frequency); // Learp to smooth the changes
32
35 }
36
37 void SetStamina01(float stamina01)
38 {
39 m_Stamina01 = stamina01;
40 }
41}
PPOperators
PP operators, specify operation between subsequent layers.
Определения PPEConstants.c:53
bool m_IsRunning
Определения PPERequestPlatformsBase.c:437
void SetTargetValueFloat(int mat_id, int param_idx, bool relative, float val, int priority_layer, int operator=PPOperators.ADD_RELATIVE)
Определения PPERequestPlatformsBase.c:588
void SetTargetValueColor(int mat_id, int param_idx, array< float > val, int priority_layer, int operator=PPOperators.ADD_RELATIVE)
Определения PPERequestPlatformsBase.c:630
static float EaseInExpo(float t)
Определения Easing.c:103
Input value between 0 and 1, returns value adjusted by easing, no automatic clamping of input(do your...
Определения Easing.c:3
Определения EnMath.c:7
static const int PARAM_VIGNETTECOLOR
Определения PPEGlow.c:35
static const int L_23_GLASSES
Определения PPEGlow.c:52
static const int PARAM_VIGNETTE
Определения PPEGlow.c:34
Glow - PostProcessEffectType.Glow.
Определения PPEGlow.c:8
static const int L_0_GLASSES
Определения PPEGodRays.c:11
GodRays - PostProcessEffectType.GodRays.
Определения PPEGodRays.c:3
void OnStart(Param par=null)
Определения PPERDrowningEffect.c:10
void SetStamina01(float stamina01)
Определения PPERDrowningEffect.c:37
void OnUpdate(float delta)
Определения PPERDrowningEffect.c:18
float m_MinMagnitude
Определения PPERDrowningEffect.c:5
float m_Stamina01
Определения PPERDrowningEffect.c:8
float m_EffectPhase
Определения PPERDrowningEffect.c:3
float m_MaxMagnitude
Определения PPERDrowningEffect.c:6
float m_Frequency
Определения PPERDrowningEffect.c:7
float m_Magnitude
Определения PPERDrowningEffect.c:4
base, not to be used directly, would lead to layering collisions!
Определения PPERBloodLoss.c:2
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
Определения param.c:12
PostProcessEffectType
Post-process effect type.
Определения EnWorld.c:72
static proto float Lerp(float a, float b, float time)
Linearly interpolates between 'a' and 'b' given 'time'.
static proto float Sin(float angle)
Returns sinus of angle in radians.