Dayz Explorer 1.28.160049
Loading...
Searching...
No Matches
misc_tirepile_burning.c
Go to the documentation of this file.
2{
3 private const float TIMER_HEATING_UPDATE_INTERVAL = 2;
4 private const float PARAM_HEAT_RADIUS = 6;
5 private const float PARAM_FULL_HEAT_RADIUS = 4;
6 private const float PARAM_MAX_TRANSFERED_TEMPERATURE = 25;
7
8 protected TirePileLight m_Light;
11
12 // UniversalTemperatureSource
15 protected ref UniversalTemperatureSourceLambdaConstant m_UTSLTirePile;
16
17 protected ref AreaDamageManager m_AreaDamage;
18
19 override void EEInit()
20 {
21 super.EEInit();
22
23 #ifndef SERVER
24 // object creation - create effects (light, particles, sound)
25 if (!m_Light)
26 {
27 m_Light = TirePileLight.Cast(ScriptedLightBase.CreateLight(TirePileLight, Vector(0,0,0), 1));
28 m_Light.AttachOnMemoryPoint(this, m_Light.m_MemoryPoint);
29 m_Light.FadeBrightnessTo(m_Light.m_FireBrightness, 0);
30 m_Light.FadeRadiusTo(m_Light.m_FireRadius, 0);
31 }
32
33 if (!m_ParticleFire)
34 m_ParticleFire = ParticleManager.GetInstance().PlayOnObject(ParticleList.TIREPILE_FIRE, this, GetMemoryPointPos("tirepile_fire"), Vector(0,0,0), true);
35
36 if (!m_SoundFireLoop)
37 PlaySoundSetLoop(m_SoundFireLoop, "HeavyFire_SoundSet", 1.0, 2.0);
38 #endif
39
40 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
41 {
44 m_UTSSettings.m_Updateable = true;
45 m_UTSSettings.m_TemperatureItemCap = GameConstants.ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE;
49
50 m_UTSLTirePile = new UniversalTemperatureSourceLambdaConstant();
52 m_UTSource.SetActive(true);
53 }
54 }
55
56 override void EEDelete(EntityAI parent)
57 {
58 super.EEDelete(parent);
59
60 #ifndef SERVER
61 // outside of bubble - do effects cleanup (light, particles, sound)
62
63 if (m_Light)
64 m_Light.FadeOut();
65
68
71 #endif
72
73 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
74 {
75 m_UTSource.SetActive(false);
77 }
78 }
79
80 override void DeferredInit()
81 {
82 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
83 {
84 if (!m_AreaDamage)
86 }
87 }
88
89 protected void CreateAreaDamage()
90 {
91 //destroy area damage if some already exists
93
94 //create new area damage
96 m_AreaDamage.SetDamageComponentType(AreaDamageComponentTypes.HITZONE);
97 m_AreaDamage.SetExtents("-2.0 0 -2.0", "2.0 2.0 2.0");
98 m_AreaDamage.SetLoopInterval(0.5);
99 m_AreaDamage.SetDeferDuration(0.5);
100 m_AreaDamage.SetHitZones({ "Head","Torso","LeftHand","LeftLeg","LeftFoot","RightHand","RightLeg","RightFoot" });
101 m_AreaDamage.SetAmmoName("FireDamage");
102 m_AreaDamage.Spawn();
103 }
104
105 protected void DestroyAreaDamage()
106 {
107 if (m_AreaDamage)
108 m_AreaDamage.Destroy();
109 }
110}
Deferred version of AreaDamageLooped.
Wrapper class for managing sound through SEffectManager.
Definition effectsound.c:5
void SoundStop()
Stops sound.
ref AreaDamageManager m_AreaDamage
ref UniversalTemperatureSource m_UTSource
override void EEDelete(EntityAI parent)
ref UniversalTemperatureSourceLambdaConstant m_UTSLTirePile
ref UniversalTemperatureSourceSettings m_UTSSettings
TirePileLight m_Light
maximum value for temperature that will be transfered to player (environment)
Legacy way of using particles in the game.
Definition particle.c:7
static Particle PlayOnObject(int particle_id, Object parent_obj, vector local_pos="0 0 0", vector local_ori="0 0 0", bool force_world_rotation=false)
Creates a particle emitter, attaches it on the given object and activates it.
Definition particle.c:152
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
Definition particle.c:266
original Timer deletes m_params which is unwanted
const int TIMER_HEATING_UPDATE_INTERVAL
timer constants
const float PARAM_MAX_TRANSFERED_TEMPERATURE
radius in which objects are heated by fire
const float PARAM_HEAT_RADIUS
radius in which objects are fully heated by fire
const float PARAM_FULL_HEAT_RADIUS
value for calculating damage on items located in fireplace cargo
proto native CGame GetGame()
proto native vector Vector(float x, float y, float z)
Vector constructor from components.
void ParticleManager(ParticleManagerSettings settings)
Constructor (ctor)