Dayz
Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Toggle main menu visibility
Loading...
Searching...
No Matches
pperdrowningeffect.c
Go to the documentation of this file.
1
class
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
33
SetTargetValueFloat
(
PostProcessEffectType
.Glow,
PPEGlow
.
PARAM_VIGNETTE
,
true
,
m_Magnitude
,
PPEGodRays
.
L_0_GLASSES
,
PPOperators
.ADD);
34
SetTargetValueColor
(
PostProcessEffectType
.Glow,
PPEGlow
.
PARAM_VIGNETTECOLOR
,{0.0,0.025,0.04, 0.0},
PPEGlow
.
L_23_GLASSES
,
PPOperators
.ADD);
35
}
36
37
void
SetStamina01
(
float
stamina01)
38
{
39
m_Stamina01
= stamina01;
40
}
41
}
Easing
Input value between 0 and 1, returns value adjusted by easing, no automatic clamping of input(do your...
Definition
easing.c:3
Easing::EaseInExpo
static float EaseInExpo(float t)
Definition
easing.c:103
Math
Definition
enmath.c:7
PPEGlow
Glow - PostProcessEffectType.Glow.
Definition
ppeglow.c:8
PPEGlow::L_23_GLASSES
static const int L_23_GLASSES
Definition
ppeglow.c:52
PPEGlow::PARAM_VIGNETTE
static const int PARAM_VIGNETTE
Definition
ppeglow.c:34
PPEGlow::PARAM_VIGNETTECOLOR
static const int PARAM_VIGNETTECOLOR
Definition
ppeglow.c:35
PPEGodRays
GodRays - PostProcessEffectType.GodRays.
Definition
ppegodrays.c:3
PPEGodRays::L_0_GLASSES
static const int L_0_GLASSES
Definition
ppegodrays.c:11
PPERequester_GameplayBase
base, not to be used directly, would lead to layering collisions!
Definition
pperbloodloss.c:2
PPERequester_GameplayBase::m_MaxMagnitude
float m_MaxMagnitude
Definition
pperdrowningeffect.c:6
PPERequester_GameplayBase::SetStamina01
void SetStamina01(float stamina01)
Definition
pperdrowningeffect.c:37
PPERequester_GameplayBase::m_Magnitude
float m_Magnitude
Definition
pperdrowningeffect.c:4
PPERequester_GameplayBase::m_Stamina01
float m_Stamina01
Definition
pperdrowningeffect.c:8
PPERequester_GameplayBase::m_Frequency
float m_Frequency
Definition
pperdrowningeffect.c:7
PPERequester_GameplayBase::OnStart
void OnStart(Param par=null)
Definition
pperdrowningeffect.c:10
PPERequester_GameplayBase::OnUpdate
void OnUpdate(float delta)
Definition
pperdrowningeffect.c:18
PPERequester_GameplayBase::m_EffectPhase
float m_EffectPhase
Definition
pperdrowningeffect.c:3
PPERequester_GameplayBase::m_MinMagnitude
float m_MinMagnitude
Definition
pperdrowningeffect.c:5
Param
Base Param Class with no parameters.
Definition
param.c:12
PostProcessEffectType
PostProcessEffectType
Post-process effect type.
Definition
enworld.c:72
Math::Lerp
static proto float Lerp(float a, float b, float time)
Linearly interpolates between 'a' and 'b' given 'time'.
Math::Sin
static proto float Sin(float angle)
Returns sinus of angle in radians.
PPOperators
PPOperators
PP operators, specify operation between subsequent layers.
Definition
ppeconstants.c:53
m_IsRunning
bool m_IsRunning
Definition
pperequestplatformsbase.c:437
SetTargetValueFloat
void SetTargetValueFloat(int mat_id, int param_idx, bool relative, float val, int priority_layer, int operator=PPOperators.ADD_RELATIVE)
Definition
pperequestplatformsbase.c:588
SetTargetValueColor
void SetTargetValueColor(int mat_id, int param_idx, array< float > val, int priority_layer, int operator=PPOperators.ADD_RELATIVE)
Definition
pperequestplatformsbase.c:630
Games
Dayz
scripts
3_game
ppemanager
requesters
pperdrowningeffect.c
Generated by
1.17.0