Dayz Explorer
1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
bonfire.c
Go to the documentation of this file.
1
class
Bonfire
extends
BuildingSuper
2
{
3
const
float
TIMER_HEATING_UPDATE_INTERVAL
= 2;
4
const
float
PARAM_HEAT_RADIUS
= 15;
5
const
float
PARAM_FULL_HEAT_RADIUS
= 5;
6
const
float
PARAM_MAX_TRANSFERED_TEMPERATURE
= 25;
7
const
float
CONST_FIRE_TEMP = 1000;
8
9
protected
BonfireLight
m_Light
;
10
protected
Particle
m_ParticleFire;
11
protected
Particle
m_ParticleSmoke
;
12
protected
EffectSound
m_SoundFireLoop
;
13
14
//Heating related variables
15
protected
ref
Timer
m_BonfireHeatingTimer;
16
17
// UniversalTemperatureSource
18
protected
ref
UniversalTemperatureSource
m_UTSource
;
19
protected
ref
UniversalTemperatureSourceSettings
m_UTSSettings
;
20
protected
ref UniversalTemperatureSourceLambdaConstant m_UTSLBonfire;
21
22
override
void
EEInit
()
23
{
24
super.EEInit();
25
26
#ifndef SERVER
27
// object creation - create effects (light, particles, sound)
28
29
// light
30
if
(!
m_Light
)
31
{
32
m_Light
= BonfireLight.Cast(
ScriptedLightBase
.CreateLight(BonfireLight,
Vector
(0,0,0), 1));
33
m_Light
.AttachOnMemoryPoint(
this
,
m_Light
.m_MemoryPoint);
34
m_Light
.FadeBrightnessTo(
m_Light
.m_FireBrightness, 0);
35
m_Light
.FadeRadiusTo(
m_Light
.m_FireRadius, 0);
36
}
37
38
// particles
39
if
(!
m_ParticleSmoke
)
40
{
41
m_ParticleSmoke
=
ParticleManager
.GetInstance().PlayOnObject(
ParticleList
.BONFIRE_SMOKE,
this
, GetMemoryPointPos(
"bonfire_smoke"
),
Vector
(0,0,0),
true
);
42
}
43
44
if
(!m_ParticleFire)
45
{
46
m_ParticleFire =
ParticleManager
.GetInstance().PlayOnObject(
ParticleList
.BONFIRE_FIRE,
this
, GetMemoryPointPos(
"bonfire_fire"
),
Vector
(0,0,0),
true
);
47
}
48
49
// sounds
50
if
(!
m_SoundFireLoop
)
51
{
52
PlaySoundSetLoop(
m_SoundFireLoop
,
"HeavyFire_SoundSet"
, 1.0, 2.0);
53
}
54
#endif
55
56
if
(
GetGame
().IsServer() || !
GetGame
().IsMultiplayer())
57
{
58
m_UTSSettings
=
new
UniversalTemperatureSourceSettings
();
59
m_UTSSettings
.m_UpdateInterval =
TIMER_HEATING_UPDATE_INTERVAL
;
60
m_UTSSettings
.m_Updateable =
true
;
61
m_UTSSettings
.m_TemperatureMin = 0;
62
m_UTSSettings
.m_TemperatureMax = CONST_FIRE_TEMP;
63
m_UTSSettings
.m_TemperatureCap =
PARAM_MAX_TRANSFERED_TEMPERATURE
;
64
m_UTSSettings
.m_RangeFull =
PARAM_FULL_HEAT_RADIUS
;
65
m_UTSSettings
.m_RangeMax =
PARAM_HEAT_RADIUS
;
66
67
m_UTSLBonfire =
new
UniversalTemperatureSourceLambdaConstant();
68
m_UTSource
=
new
UniversalTemperatureSource
(
this
,
m_UTSSettings
, m_UTSLBonfire);
69
m_UTSource
.SetActive(
true
);
70
}
71
}
72
73
override
void
EEDelete
(
EntityAI
parent)
74
{
75
super.EEDelete(parent);
76
77
#ifndef SERVER
78
// outside of bubble - do effects cleanup (light, particles, sound)
79
80
// light
81
if
(
m_Light
)
82
{
83
m_Light
.FadeOut();
84
}
85
86
// particles
87
if
(
m_ParticleSmoke
)
88
{
89
m_ParticleSmoke
.Stop();
90
}
91
92
if
(m_ParticleFire)
93
{
94
m_ParticleFire.Stop();
95
}
96
97
// sounds
98
if
(
m_SoundFireLoop
)
99
{
100
m_SoundFireLoop
.SoundStop();
101
}
102
#endif
103
104
if
(
GetGame
().IsServer() || !
GetGame
().IsMultiplayer())
105
{
106
m_UTSource
.SetActive(
false
);
107
}
108
}
109
111
protected
void
BonfireHeating() {};
112
}
GetGame
proto native CGame GetGame()
m_UTSource
protected ref UniversalTemperatureSource m_UTSource
Definition:
fireplacebase.c:224
BuildingSuper
Definition:
buildingwithfireplace.c:1
Particle
Legacy way of using particles in the game.
Definition:
particle.c:6
m_Light
protected ExplosiveLight m_Light
light
Definition:
explosivesbase.c:31
UniversalTemperatureSource
original Timer deletes m_params which is unwanted
Definition:
universaltemperaturesource.c:25
m_UTSSettings
protected ref UniversalTemperatureSourceSettings m_UTSSettings
Definition:
fireplacebase.c:225
EEDelete
override void EEDelete(EntityAI parent)
Definition:
contaminatedarea.c:69
PARAM_MAX_TRANSFERED_TEMPERATURE
const float PARAM_MAX_TRANSFERED_TEMPERATURE
DEPRECATED value for calculation of heat transfered from fireplace through air to player (environment...
Definition:
fireplacebase.c:63
EffectSound
Wrapper class for managing sound through SEffectManager.
Definition:
effectsound.c:4
ParticleList
Definition:
particlelist.c:11
UniversalTemperatureSourceSettings
Definition:
universaltemperaturesource.c:1
m_SoundFireLoop
protected EffectSound m_SoundFireLoop
Definition:
fireplacebase.c:142
ScriptedLightBase
Definition:
pointlightbase.c:1
PARAM_FULL_HEAT_RADIUS
const float PARAM_FULL_HEAT_RADIUS
maximum value of temperature of items in fireplace when heating (degree Celsius)
Definition:
fireplacebase.c:60
TIMER_HEATING_UPDATE_INTERVAL
const int TIMER_HEATING_UPDATE_INTERVAL
Definition:
fireplacebase.c:83
EEInit
override void EEInit()
Definition:
contaminatedarea.c:27
Timer
Definition:
dayzplayerimplement.c:62
ParticleManager
void ParticleManager(ParticleManagerSettings settings)
Constructor (ctor)
Definition:
particlemanager.c:84
Vector
proto native vector Vector(float x, float y, float z)
Vector constructor from components.
EntityAI
Definition:
building.c:5
m_ParticleSmoke
protected Particle m_ParticleSmoke
particle
Definition:
smokegrenadebase.c:23
PARAM_HEAT_RADIUS
const float PARAM_HEAT_RADIUS
radius in which objects are fully heated by fire
Definition:
fireplacebase.c:61
DAYZ
scripts_v1.24.157551
scripts
world
entities
building
specific
bonfire.c
Generated by
1.8.17