DayZ 1.24
Loading...
Searching...
No Matches
Bonfire.c
Go to the documentation of this file.
1class Bonfire extends BuildingSuper
2{
4 const float PARAM_HEAT_RADIUS = 15;
5 const float PARAM_FULL_HEAT_RADIUS = 5;
7 const float CONST_FIRE_TEMP = 1000;
8
9 protected BonfireLight m_Light;
13
14 //Heating related variables
16
17 // UniversalTemperatureSource
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 m_ParticleSmoke = ParticleManager.GetInstance().PlayOnObject(ParticleList.BONFIRE_SMOKE, this, GetMemoryPointPos("bonfire_smoke"), Vector(0, 0, 0), true);
41
42 if (!m_ParticleFire)
43 m_ParticleFire = ParticleManager.GetInstance().PlayOnObject(ParticleList.BONFIRE_FIRE, this, GetMemoryPointPos("bonfire_fire"), Vector(0, 0, 0), true);
44
45 // sounds
46 if (!m_SoundFireLoop)
47 PlaySoundSetLoop(m_SoundFireLoop, "HeavyFire_SoundSet", 1.0, 2.0);
48#endif
49
50 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
51 {
54 m_UTSSettings.m_Updateable = true;
55 m_UTSSettings.m_TemperatureMin = 0;
56 m_UTSSettings.m_TemperatureMax = CONST_FIRE_TEMP;
60
61 m_UTSLBonfire = new UniversalTemperatureSourceLambdaConstant();
62 m_UTSource = new UniversalTemperatureSource(this, m_UTSSettings, m_UTSLBonfire);
63 m_UTSource.SetActive(true);
64 }
65 }
66
67 override void EEDelete(EntityAI parent)
68 {
69 super.EEDelete(parent);
70
71#ifndef SERVER
72 // outside of bubble - do effects cleanup (light, particles, sound)
73
74 // light
75 if (m_Light)
76 m_Light.FadeOut();
77
78 // particles
81
82 if (m_ParticleFire)
83 m_ParticleFire.Stop();
84
85 // sounds
88#endif
89
90 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
91 m_UTSource.SetActive(false);
92 }
93
95 protected void BonfireHeating() {};
96}
ExplosiveLight m_Light
light
ref UniversalTemperatureSourceSettings m_UTSSettings
const int TIMER_HEATING_UPDATE_INTERVAL
EffectSound m_SoundFireLoop
const float PARAM_MAX_TRANSFERED_TEMPERATURE
DEPRECATED value for calculation of heat transfered from fireplace through air to player (environment...
const float PARAM_HEAT_RADIUS
radius in which objects are fully heated by fire
ref UniversalTemperatureSource m_UTSource
const float PARAM_FULL_HEAT_RADIUS
maximum value of temperature of items in fireplace when heating (degree Celsius)
void ParticleManager(ParticleManagerSettings settings)
Constructor (ctor)
Particle m_ParticleSmoke
particle
void BonfireHeating()
DEPRECATED.
Definition Bonfire.c:95
ref Timer m_BonfireHeatingTimer
Definition Bonfire.c:15
Particle m_ParticleSmoke
Definition Bonfire.c:11
BonfireLight m_Light
Definition Bonfire.c:9
override void EEInit()
Definition Bonfire.c:22
ref UniversalTemperatureSource m_UTSource
DEPRECATED.
Definition Bonfire.c:18
ref UniversalTemperatureSourceLambdaConstant m_UTSLBonfire
Definition Bonfire.c:20
Particle m_ParticleFire
Definition Bonfire.c:10
EffectSound m_SoundFireLoop
Definition Bonfire.c:12
override void EEDelete(EntityAI parent)
Definition Bonfire.c:67
ref UniversalTemperatureSourceSettings m_UTSSettings
Definition Bonfire.c:19
Wrapper class for managing sound through SEffectManager.
Definition EffectSound.c:5
void SoundStop()
Stops sound.
Legacy way of using particles in the game.
Definition Particle.c:7
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
Definition Particle.c:262
static const int BONFIRE_SMOKE
static const int BONFIRE_FIRE
static float m_FireBrightness
Definition BonfireLight.c:4
static float m_FireRadius
Definition BonfireLight.c:3
static string m_MemoryPoint
Definition BonfireLight.c:5
original Timer deletes m_params which is unwanted
proto native CGame GetGame()
proto native vector Vector(float x, float y, float z)
Vector constructor from components.