Dayz Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Loading...
Searching...
No Matches
pperflashbangeffects.c
Go to the documentation of this file.
1class PPERequester_FlashbangEffects extends PPERequester_GameplayBase
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 (g_Game.GetMission() && g_Game.GetMission().GetEffectWidgets())
13 g_Game.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 (g_Game.GetMission() && g_Game.GetMission().GetEffectWidgets())
27 g_Game.GetMission().GetEffectWidgets().RemoveActiveEffects({EffectWidgetsTypes.COVER_FLASHBANG});
28 }
29
30 override protected void OnUpdate(float delta)
31 {
32 super.OnUpdate(delta);
33
34 if (g_Game && g_Game.GetMission() && g_Game.GetMission().GetEffectWidgets())
35 {
36 Param1<float> par = new Param1<float>(1 - m_Intensity);
37 g_Game.GetMission().GetEffectWidgets().UpdateWidgets(EffectWidgetsTypes.COVER_FLASHBANG,0,par,EffectWidgetHandles.FLASHBANG);
38 }
39 }
40
41 void SetFlashbangIntensity(float intensity, float daytime_toggle)
42 {
43 m_Intensity = intensity;
44 array<float> overlay_color = {1.0, 1.0, 1.0, intensity};
45 if (daytime_toggle <= 5.0)
46 {
47 m_Exposure = Math.Clamp(intensity * daytime_toggle,0.0,EXPOSURE_MAX);
48 }
49 else
50 {
51 m_Exposure = Easing.EaseInQuart(intensity);
53 }
54 overlay_color[3] = intensity;
55
56 //blur
58 //overlay
61 //exposure
63 }
64}
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 L_0_FLASHBANG
static const int PARAM_INTENSITY
GaussFilter - PostProcessEffectType.GaussFilter.
static const int L_0_FLASHBANG
static const int PARAM_INTENSITY
Glow - PostProcessEffectType.Glow.
Definition ppeglow.c:8
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
static const int PARAM_OVERLAYCOLOR
Definition ppeglow.c:30
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.
Definition param.c:12
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
DayZGame g_Game
Definition dayzgame.c:3942
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'.
PPOperators
PP operators, specify operation between subsequent layers.
PPEExceptions
/brief IDs of custom PPE classes /note Currently used for various native exceptions that used to be h...
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, array< float > val, int priority_layer, int operator=PPOperators.ADD_RELATIVE)