DayZ
1.24
Loading...
Searching...
No Matches
HeadtorchLight.c
Go to the documentation of this file.
1
class
HeadtorchLight
extends
SpotLightBase
2
{
3
private
static
float
m_DefaultBrightness
= 3;
4
private
static
float
m_DefaultRadius
= 20;
5
6
void
HeadtorchLight
()
7
{
8
SetVisibleDuringDaylight(
true
);
9
SetRadiusTo(
m_DefaultRadius
);
10
SetSpotLightAngle(95);
11
SetCastShadow(
true
);
12
FadeIn(0.06);
13
SetBrightnessTo(
m_DefaultBrightness
);
14
SetAmbientColor(0.92, 0.85, 0.58);
15
SetDiffuseColor(0.92, 0.85, 0.58);
16
SetFadeOutTime(0.1);
17
//SetDisableShadowsWithinRadius(0.25); // Idea for optimization: Uncomment this to disable shadows from Headtorch while it's on player's head during 1P view.
18
}
19
20
void
SetColorToWhite
()
21
{
22
SetAmbientColor(0.92, 0.85, 0.86);
23
SetDiffuseColor(0.92, 0.85, 0.86);
24
}
25
26
void
SetColorToRed
()
27
{
28
SetAmbientColor(1.0, 0.2, 0.2);
29
SetDiffuseColor(1.0, 0.2, 0.2);
30
}
31
32
void
SetIntensity
(
float
coef,
float
time
)
33
{
34
FadeBrightnessTo(
m_DefaultBrightness
* coef,
time
);
35
FadeRadiusTo(
m_DefaultRadius
* coef,
time
);
36
}
37
38
void
PerformVisibilityCheck
(
EntityAI
owner
)
39
{
40
if
(!
owner
.IsFlagSet(
EntityFlags
.VISIBLE) && IsEnabled())
41
SetEnabled
(
false
);
42
else
if
(
owner
.IsFlagSet(
EntityFlags
.VISIBLE) && !IsEnabled())
43
SetEnabled
(
true
);
44
}
45
}
m_DefaultRadius
float m_DefaultRadius
Definition
ContaminatedArea_Dynamic.c:14
m_DefaultBrightness
enum eAreaDecayStage m_DefaultBrightness
SetEnabled
void SetEnabled()
prevents insider adding in the wrong position, HOTFIX
Definition
TrapTrigger.c:107
EntityAI
Definition
Building.c:6
Param3
Definition
EntityAI.c:95
SpotLightBase
Definition
CarLightBase.c:2
SpotLightBase::SetIntensity
void SetIntensity(float coef, float time)
Definition
HeadtorchLight.c:32
SpotLightBase::SetColorToRed
void SetColorToRed()
Definition
HeadtorchLight.c:26
SpotLightBase::PerformVisibilityCheck
void PerformVisibilityCheck(EntityAI owner)
Definition
HeadtorchLight.c:38
SpotLightBase::HeadtorchLight
void HeadtorchLight()
Definition
HeadtorchLight.c:6
SpotLightBase::SetColorToWhite
void SetColorToWhite()
Definition
HeadtorchLight.c:20
EntityFlags
EntityFlags
Entity flags.
Definition
EnEntity.c:114
scripts
4_World
Entities
ScriptedLightBase
SpotLightBase
HeadtorchLight.c
Generated by
1.10.0