Dayz
Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Toggle main menu visibility
Loading...
Searching...
No Matches
pperflashbangeffects.c
Go to the documentation of this file.
1
class
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);
52
m_Exposure
=
Math
.
Clamp
(
EXPOSURE_MAX
*
m_Exposure
,0.0,
EXPOSURE_MAX
);
53
}
54
overlay_color[3] = intensity;
55
56
//blur
57
SetTargetValueFloat
(
PostProcessEffectType
.GaussFilter,
PPEGaussFilter
.
PARAM_INTENSITY
,
true
,intensity,
PPEGaussFilter
.
L_0_FLASHBANG
,
PPOperators
.ADD_RELATIVE);
58
//overlay
59
SetTargetValueFloat
(
PostProcessEffectType
.Glow,
PPEGlow
.
PARAM_OVERLAYFACTOR
,
true
,intensity,
PPEGlow
.
L_20_FLASHBANG
,
PPOperators
.HIGHEST);
60
SetTargetValueColor
(
PostProcessEffectType
.Glow,
PPEGlow
.
PARAM_OVERLAYCOLOR
,overlay_color,
PPEGlow
.
L_21_FLASHBANG
,
PPOperators
.SET);
61
//exposure
62
SetTargetValueFloat
(
PPEExceptions
.EXPOSURE,
PPEExposureNative
.
PARAM_INTENSITY
,
false
,
m_Exposure
,
PPEExposureNative
.
L_0_FLASHBANG
,
PPOperators
.ADD);
63
}
64
}
Easing
Input value between 0 and 1, returns value adjusted by easing, no automatic clamping of input(do your...
Definition
easing.c:3
Easing::EaseInQuart
static float EaseInQuart(float t)
Definition
easing.c:56
Math
Definition
enmath.c:7
PPEExposureNative
EV postprocess, does not directly use materials.
Definition
ppeexposurenative.c:6
PPEExposureNative::L_0_FLASHBANG
static const int L_0_FLASHBANG
Definition
ppeexposurenative.c:13
PPEExposureNative::PARAM_INTENSITY
static const int PARAM_INTENSITY
Definition
ppeexposurenative.c:8
PPEGaussFilter
GaussFilter - PostProcessEffectType.GaussFilter.
Definition
ppegaussfilter.c:3
PPEGaussFilter::L_0_FLASHBANG
static const int L_0_FLASHBANG
Definition
ppegaussfilter.c:9
PPEGaussFilter::PARAM_INTENSITY
static const int PARAM_INTENSITY
Definition
ppegaussfilter.c:4
PPEGlow
Glow - PostProcessEffectType.Glow.
Definition
ppeglow.c:8
PPEGlow::L_20_FLASHBANG
static const int L_20_FLASHBANG
Definition
ppeglow.c:43
PPEGlow::L_21_FLASHBANG
static const int L_21_FLASHBANG
Definition
ppeglow.c:48
PPEGlow::PARAM_OVERLAYFACTOR
static const int PARAM_OVERLAYFACTOR
Definition
ppeglow.c:29
PPEGlow::PARAM_OVERLAYCOLOR
static const int PARAM_OVERLAYCOLOR
Definition
ppeglow.c:30
PPERequester_GameplayBase
base, not to be used directly, would lead to layering collisions!
Definition
pperbloodloss.c:2
PPERequester_GameplayBase::OnStop
void OnStop(Param par=null)
Definition
pperflashbangeffects.c:19
PPERequester_GameplayBase::VAL_FACTOR
const float VAL_FACTOR
Definition
pperflashbangeffects.c:3
PPERequester_GameplayBase::m_Exposure
float m_Exposure
Definition
pperflashbangeffects.c:5
PPERequester_GameplayBase::OnStart
void OnStart(Param par=null)
Definition
pperflashbangeffects.c:8
PPERequester_GameplayBase::m_Intensity
float m_Intensity
Definition
pperflashbangeffects.c:6
PPERequester_GameplayBase::SetFlashbangIntensity
void SetFlashbangIntensity(float intensity, float daytime_toggle)
Definition
pperflashbangeffects.c:41
PPERequester_GameplayBase::EXPOSURE_MAX
const float EXPOSURE_MAX
Definition
pperflashbangeffects.c:4
PPERequester_GameplayBase::OnUpdate
void OnUpdate(float delta)
Definition
pperflashbangeffects.c:30
Param
Base Param Class with no parameters.
Definition
param.c:12
array
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
Definition
isboxcollidinggeometryproxyclasses.c:28
g_Game
DayZGame g_Game
Definition
dayzgame.c:3942
PostProcessEffectType
PostProcessEffectType
Post-process effect type.
Definition
enworld.c:72
Math::Clamp
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
PPOperators
PP operators, specify operation between subsequent layers.
Definition
ppeconstants.c:53
PPEExceptions
PPEExceptions
/brief IDs of custom PPE classes /note Currently used for various native exceptions that used to be h...
Definition
ppeconstants.c:43
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
pperflashbangeffects.c
Generated by
1.17.0