Dayz Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Loading...
Searching...
No Matches
pperspooky.c
Go to the documentation of this file.
1// PPE when player is in spooky area trigger
2class 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
20
21 m_FadeIn = true;
22 m_FadeOut = false;
23
26 }
27
28 override protected void OnUpdate( float delta )
29 {
30 super.OnUpdate( delta );
31
33 {
34 m_AccumulatedTime += delta;
35
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 {
46 {
47 m_AccumulatedTime += delta;
48
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
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}
Super root of all classes in Enforce script.
Definition enscript.c:11
Input value between 0 and 1, returns value adjusted by easing, no automatic clamping of input(do your...
Definition easing.c:3
static float EaseInOutSine(float t)
Definition easing.c:14
Definition enmath.c:7
FilmGrain - PostProcessEffectType.FilmGrain.
Definition ppefilmgrain.c:7
static const int L_2_TOXIC_TINT
static const int PARAM_SHARPNESS
Definition ppefilmgrain.c:9
static const int PARAM_GRAINSIZE
static const int L_1_TOXIC_TINT
Glow - PostProcessEffectType.Glow.
Definition ppeglow.c:8
static const int PARAM_COLORIZATIONCOLOR
Definition ppeglow.c:32
static const int L_23_TOXIC_TINT
Definition ppeglow.c:53
base, not to be used directly, would lead to layering collisions!
void OnStart(Param par=null)
Definition pperspooky.c:15
void OnUpdate(float delta)
Definition pperspooky.c:28
override void OnStop(Param par=null)
Definition pperspooky.c:62
float FadeColourMult(float x, float y, float deltaT)
Base Param Class with no parameters.
Definition param.c:12
PostProcessEffectType
Post-process effect type.
Definition enworld.c:72
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
static proto float Lerp(float a, float b, float time)
Linearly interpolates between 'a' and 'b' given 'time'.
void Stop()
Stops all elements this effect consists of.
Definition effect.c:183
Icon x
Icon y
PPOperators
PP operators, specify operation between subsequent layers.
void SetTargetValueFloat(int mat_id, int param_idx, bool relative, float val, int priority_layer, int operator=PPOperators.ADD_RELATIVE)
void SetTargetValueColor(int mat_id, int param_idx, array< float > val, int priority_layer, int operator=PPOperators.ADD_RELATIVE)