Dayz
Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Toggle main menu visibility
Loading...
Searching...
No Matches
pperspooky.c
Go to the documentation of this file.
1
// PPE when player is in spooky area trigger
2
class
PPERequester_SpookyAreaTint
extends
PPERequester_GameplayBase
3
{
4
protected
vector m_StartRGB = vector.Zero;
5
protected
float
m_AccumulatedTime = 0;
6
protected
bool
m_FadeIn =
false
;
7
protected
bool
m_FadeOut =
false
;
8
9
const
float
FADE_TIME = 3;
10
// the end result is 1 - the value set here
11
const
float
R_TARGET = 0.60;
// 0.31 79 129 0.50
12
const
float
G_TARGET = 0.28;
// 0.80 204 184 0.72
13
const
float
B_TARGET = 0.07;
// 0.95 242 239 0.93
14
15
override
protected
void
OnStart
(
Param
par = null )
16
{
17
super.OnStart( par );
18
19
m_AccumulatedTime
= 0;
20
21
m_FadeIn
=
true
;
22
m_FadeOut
=
false
;
23
24
SetTargetValueFloat
(
PostProcessEffectType
.FilmGrain,
PPEFilmGrain
.
PARAM_SHARPNESS
,
false
,10.0,
PPEFilmGrain
.
L_1_TOXIC_TINT
,
PPOperators
.HIGHEST);
25
SetTargetValueFloat
(
PostProcessEffectType
.FilmGrain,
PPEFilmGrain
.
PARAM_GRAINSIZE
,
false
,1.0,
PPEFilmGrain
.
L_2_TOXIC_TINT
,
PPOperators
.LOWEST);
26
}
27
28
override
protected
void
OnUpdate
(
float
delta )
29
{
30
super.OnUpdate( delta );
31
32
if
(
m_FadeIn
&&
m_AccumulatedTime
<=
FADE_TIME
)
33
{
34
m_AccumulatedTime
+= delta;
35
36
m_StartRGB
[0] = 1 -
FadeColourMult
( 0, 1,
m_AccumulatedTime
/
FADE_TIME
) *
R_TARGET
;
37
m_StartRGB
[1] = 1 -
FadeColourMult
( 0, 1,
m_AccumulatedTime
/
FADE_TIME
) *
G_TARGET
;
38
m_StartRGB
[2] = 1 -
FadeColourMult
( 0, 1,
m_AccumulatedTime
/
FADE_TIME
) *
B_TARGET
;
39
40
SetTargetValueColor
(
PostProcessEffectType
.Glow,
PPEGlow
.
PARAM_COLORIZATIONCOLOR
,{m_StartRGB[0], m_StartRGB[1], m_StartRGB[2], 0.0},
PPEGlow
.
L_23_TOXIC_TINT
,
PPOperators
.MULTIPLICATIVE);
41
}
42
43
if
(
m_FadeOut
)
44
{
45
if
(
m_AccumulatedTime
<=
FADE_TIME
)
46
{
47
m_AccumulatedTime
+= delta;
48
49
m_StartRGB
[0] = ( 1 -
R_TARGET
) +
FadeColourMult
( 0,
R_TARGET
,
m_AccumulatedTime
/
FADE_TIME
);
50
m_StartRGB
[1] = ( 1 -
G_TARGET
) +
FadeColourMult
( 0,
G_TARGET
,
m_AccumulatedTime
/
FADE_TIME
);
51
m_StartRGB
[2] = ( 1 -
B_TARGET
) +
FadeColourMult
( 0,
B_TARGET
,
m_AccumulatedTime
/
FADE_TIME
);
52
53
SetTargetValueColor
(
PostProcessEffectType
.Glow,
PPEGlow
.
PARAM_COLORIZATIONCOLOR
,{m_StartRGB[0], m_StartRGB[1], m_StartRGB[2], 0.0},
PPEGlow
.
L_23_TOXIC_TINT
,
PPOperators
.MULTIPLICATIVE);
54
}
55
else
56
{
57
Stop
();
//proper termination after a fadeout
58
}
59
}
60
}
61
62
override
void
OnStop
(
Param
par = null)
63
{
64
m_FadeIn
=
false
;
65
m_FadeOut
=
false
;
66
Param1<bool> p;
67
68
if
(par &&
Class
.
CastTo
(p,par))
69
m_FadeOut
= p.param1;
70
71
m_AccumulatedTime
= 0;
72
73
super.OnStop(par);
74
}
75
76
// Lerped multiplier for RGBA values
77
protected
float
FadeColourMult
(
float
x
,
float
y
,
float
deltaT )
78
{
79
float
output;
80
output =
Math
.
Lerp
(
x
,
y
, deltaT );
81
Easing
.
EaseInOutSine
( output );
82
return
output;
83
}
84
}
Class
Super root of all classes in Enforce script.
Definition
enscript.c:11
Easing
Input value between 0 and 1, returns value adjusted by easing, no automatic clamping of input(do your...
Definition
easing.c:3
Easing::EaseInOutSine
static float EaseInOutSine(float t)
Definition
easing.c:14
Math
Definition
enmath.c:7
PPEFilmGrain
FilmGrain - PostProcessEffectType.FilmGrain.
Definition
ppefilmgrain.c:7
PPEFilmGrain::L_2_TOXIC_TINT
static const int L_2_TOXIC_TINT
Definition
ppefilmgrain.c:22
PPEFilmGrain::PARAM_SHARPNESS
static const int PARAM_SHARPNESS
Definition
ppefilmgrain.c:9
PPEFilmGrain::PARAM_GRAINSIZE
static const int PARAM_GRAINSIZE
Definition
ppefilmgrain.c:10
PPEFilmGrain::L_1_TOXIC_TINT
static const int L_1_TOXIC_TINT
Definition
ppefilmgrain.c:20
PPEGlow
Glow - PostProcessEffectType.Glow.
Definition
ppeglow.c:8
PPEGlow::PARAM_COLORIZATIONCOLOR
static const int PARAM_COLORIZATIONCOLOR
Definition
ppeglow.c:32
PPEGlow::L_23_TOXIC_TINT
static const int L_23_TOXIC_TINT
Definition
ppeglow.c:53
PPERequester_GameplayBase
base, not to be used directly, would lead to layering collisions!
Definition
pperbloodloss.c:2
PPERequester_GameplayBase::G_TARGET
const float G_TARGET
Definition
ppercontaminated.c:12
PPERequester_GameplayBase::m_FadeOut
bool m_FadeOut
Definition
ppercontaminated.c:7
PPERequester_GameplayBase::OnStart
void OnStart(Param par=null)
Definition
pperspooky.c:15
PPERequester_GameplayBase::m_AccumulatedTime
float m_AccumulatedTime
Definition
ppercontaminated.c:5
PPERequester_GameplayBase::m_FadeIn
bool m_FadeIn
Definition
ppercontaminated.c:6
PPERequester_GameplayBase::OnUpdate
void OnUpdate(float delta)
Definition
pperspooky.c:28
PPERequester_GameplayBase::OnStop
override void OnStop(Param par=null)
Definition
pperspooky.c:62
PPERequester_GameplayBase::B_TARGET
const float B_TARGET
Definition
ppercontaminated.c:13
PPERequester_GameplayBase::FADE_TIME
const float FADE_TIME
Definition
ppercontaminated.c:9
PPERequester_GameplayBase::m_StartRGB
vector m_StartRGB
Definition
ppercontaminated.c:4
PPERequester_GameplayBase::FadeColourMult
float FadeColourMult(float x, float y, float deltaT)
Definition
ppercontaminated.c:77
PPERequester_GameplayBase::R_TARGET
const float R_TARGET
Definition
ppercontaminated.c:11
Param
Base Param Class with no parameters.
Definition
param.c:12
PostProcessEffectType
PostProcessEffectType
Post-process effect type.
Definition
enworld.c:72
Class::CastTo
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
Math::Lerp
static proto float Lerp(float a, float b, float time)
Linearly interpolates between 'a' and 'b' given 'time'.
Stop
void Stop()
Stops all elements this effect consists of.
Definition
effect.c:183
x
Icon x
y
Icon y
PPOperators
PPOperators
PP operators, specify operation between subsequent layers.
Definition
ppeconstants.c:53
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
pperspooky.c
Generated by
1.17.0