DayZ 1.24
Loading...
Searching...
No Matches
PPERFlashbangEffects.c
Go to the documentation of this file.
2{
3 const float VAL_FACTOR = 0.85;
4 const float EXPOSURE_MAX = 50;
5 protected float m_Exposure;
6 protected float m_Intensity;
7
8 override protected void OnStart(Param par = null)
9 {
10 if (!m_IsRunning)
11 {
12 if (GetGame().GetMission() && GetGame().GetMission().GetEffectWidgets())
13 GetGame().GetMission().GetEffectWidgets().AddActiveEffects({EffectWidgetsTypes.COVER_FLASHBANG});
14 }
15
16 super.OnStart();
17 }
18
19 override protected void OnStop(Param par = null)
20 {
21 super.OnStop();
22
23 m_Intensity = 0.0;
24 m_Exposure = 0.0;
25
26 if (GetGame().GetMission() && GetGame().GetMission().GetEffectWidgets())
27 GetGame().GetMission().GetEffectWidgets().RemoveActiveEffects({EffectWidgetsTypes.COVER_FLASHBANG});
28 }
29
30 override protected void OnUpdate(float delta)
31 {
32 super.OnUpdate(delta);
33
34 if (GetGame() && GetGame().GetMission() && GetGame().GetMission().GetEffectWidgets())
35 {
36 Param1<float> par = new Param1<float>(1 - m_Intensity);
37 GetGame().GetMission().GetEffectWidgets().UpdateWidgets(EffectWidgetsTypes.COVER_FLASHBANG, 0, par, EffectWidgetHandles.FLASHBANG);
38 }
39 }
40
42 {
43 m_Intensity = intensity;
44 array<float> overlay_color = {1.0, 1.0, 1.0, intensity};
45 if (daytime_toggle <= 5.0)
46 m_Exposure = Math.Clamp(intensity * daytime_toggle, 0.0, EXPOSURE_MAX);
47 else
48 {
49 m_Exposure = Easing.EaseInQuart(intensity);
50 m_Exposure = Math.Clamp(EXPOSURE_MAX * m_Exposure, 0.0, EXPOSURE_MAX);
51 }
53
54 //blur
56 //overlay
59 //exposure
61 }
62}
PPOperators
PP operators, specify operation between subsequent layers.
PPEExceptions
bool m_IsRunning
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, ref array< float > val, int priority_layer, int operator=PPOperators.ADD_RELATIVE)
Input value between 0 and 1, returns value adjusted by easing, no automatic clamping of input(do your...
Definition Easing.c:3
static float EaseInQuart(float t)
Definition Easing.c:56
Definition EnMath.c:7
EV postprocess, does not directly use materials.
static const int PARAM_INTENSITY
static const int L_0_FLASHBANG
GaussFilter - PostProcessEffectType.GaussFilter.
static const int L_0_FLASHBANG
static const int PARAM_INTENSITY
Glow - PostProcessEffectType.Glow.
Definition PPEGlow.c:8
static const int PARAM_OVERLAYCOLOR
Definition PPEGlow.c:30
static const int L_20_FLASHBANG
Definition PPEGlow.c:43
static const int L_21_FLASHBANG
Definition PPEGlow.c:48
static const int PARAM_OVERLAYFACTOR
Definition PPEGlow.c:29
base, not to be used directly, would lead to layering collisions!
void OnStart(Param par=null)
void SetFlashbangIntensity(float intensity, float daytime_toggle)
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
Definition param.c:12
proto native CGame GetGame()
PostProcessEffectType
Post-process effect type.
Definition EnWorld.c:72
static proto float Clamp(float value, float min, float max)
Clamps 'value' to 'min' if it is lower than 'min', or to 'max' if it is higher than 'max'.