Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_FlammableHitZone.c
Go to the documentation of this file.
1//---- REFACTOR NOTE START: This code will need to be refactored as current implementation is not conforming to the standards ----
2// TODO: Move enum to separate file
11//---- REFACTOR NOTE END ----
12
13//---- REFACTOR NOTE START: This code will need to be refactored as current implementation is not conforming to the standards ----
14// TODO: Too specific and bloated to be a hitzone, Replace with damage effects, potentially handle visuals via separate component
15class SCR_FlammableHitZone : SCR_VehicleHitZone
16{
17 protected static const float FIRE_TERRAIN_HEIGHT_TOLERANCE = 2.2; // Prevents spawning of ground fire effect if the vehicle is too high (in meters)
18 protected static const float LIGHT_EMISSIVITY_START = 5;
19
22 protected float m_fFireRate;
26 protected float m_fFireDamageRateMin;
27 protected float m_fFireDamageRateMax;
28 protected float m_fUpdateFireTime;
29 protected bool m_bIsUpdatingFire;
30 protected bool m_bIsFireRateLocked;
31
32 protected ref array<LightEntity> m_aLightEntities;
33
34 [Attribute("", desc: "Data for flame lighting that is visible when vehicle burns", UIWidgets.Object, "", category: "Flammability")]
35 protected ref array<ref SCR_BaseLightData> m_aLightData;
36
37 // Burning configuration - amount of damage, burning rates etc.
38 [Attribute(defvalue: "0", desc: "Fire damage applied to occupants of a burning vehicle each second (hp)", params: "0 100 0.01", category: "Flammability")]
39 protected float m_fIncendiaryReduction;
40
41 [Attribute(defvalue: "0", desc: "Minimum incendiary damage\n[hp]", params: "0 100 0.01", category: "Flammability")]
42 protected float m_fIncendiaryThreshold;
43
44 [Attribute(defvalue: "8", desc: "Fire damage applied to occupants of a burning vehicle each second\n[hp]", params: "0 100 0.01", category: "Flammability")]
45 protected float m_fFireDamageOccupants;
46
47 [Attribute(defvalue: "600", desc: "Maximum time for light smoke to stop\n[s]", params: "0 10000 0.1", category: "Flammability")]
48 protected float m_fLightSmokeStopTime;
49
50 [Attribute(defvalue: "1800", desc: "Maximum time for heavy smoke to become light smoke\n[s]", params: "0 10000 0.1", category: "Flammability")]
51 protected float m_fHeavySmokeStopTime;
52
53 [Attribute(defvalue: "180", desc: "Maximum time for igniting smoke to become fire\n[s]", params: "0 10000 0.1", category: "Flammability")]
54 protected float m_fIgnitingSmokeStokeTime;
55
56 [Attribute(defvalue: "60", desc: "Minimum time for burning hitzone down\nDetermines maximum fire rate\n[s]", params: "0 10000 0.1", category: "Flammability")]
57 protected float m_fMinFireBurningTime;
58
59 [Attribute(defvalue: "240", desc: "Maximum time for burning hitzone down\nDetermines minimum fire rate\n[s]", params: "0 10000 0.1", category: "Flammability")]
60 protected float m_fMaxFireBurningTime;
61
62 [Attribute(defvalue: "120", desc: "Burning time of the object after destruction\n[s]", params: "0 1000 1", category: "Effects")]
63 protected float m_fBurningTime;
64
65 [Attribute(defvalue: "0.1", uiwidget: UIWidgets.Slider, desc: "Light smoke effect threshold\n[x * minimum fire rate]", params: "0 1 0.01", category: "Flammability")]
66 protected float m_fLightSmokeThreshold;
67
68 [Attribute(defvalue: "0.5", uiwidget: UIWidgets.Slider, desc: "Heavy smoke effect threshold\n[x * minimum fire rate]", params: "0 1 0.01", category: "Flammability")]
69 protected float m_fHeavySmokeThreshold;
70
71 [Attribute(defvalue: "0.8", uiwidget: UIWidgets.Slider, desc: "Igniting smoke effect threshold\n[x * minimum fire rate]", params: "0 1 0.01", category: "Flammability")]
72 protected float m_fIgnitingSmokeThreshold;
73
74 // Particle effects
75 [Attribute(desc: "Particle effect for light smoke", params: "ptc", category: "Effects")]
77
78 [Attribute(desc: "Particle effect for heavy smoke", params: "ptc", category: "Effects")]
80
81 [Attribute(desc: "Particle effect for fire", params: "ptc", category: "Effects")]
83
84 [Attribute(desc: "Particle effect for fire on ground under object after the wreck stops moving", params: "ptc", category: "Effects")]
86
87 [Attribute(defvalue: "1", desc: "Minimum water depth to stop the fire\n[m]", params: "0 100 0.1", category: "Flammability")]
88 protected float m_fWaterDepthThreshold;
89
90 [Attribute(defvalue: "FireState", desc: "Fire state signal name", category: "Flammability")]
91 protected string m_sFireStateSignal;
92
93 // Audio features
95 protected int m_iFireStateSignalIdx = -1; // Damage particles
96
97 // Fire particles
98 protected ParticleEffectEntity m_DamagedParticleLight; // Lighter damage particle emitter
99 protected ParticleEffectEntity m_DamagedParticleHeavy; // Darker damage particle emitter
100 protected ParticleEffectEntity m_BurningParticle; // Rapid fire damage particle emitter
101 protected ParticleEffectEntity m_BurningGroundParticle; // Burning fuel on ground particle
102
103 override bool HasDataToReplicate()
104 {
106 return false;
107
108 return true;
109 }
110
111 override bool Save(notnull ScriptBitWriter writer)
112 {
113 writer.WriteInt(GetFireState());
114 return true;
115 }
116
117 override bool Load(notnull ScriptBitReader reader)
118 {
119 int fireState;
120
121 reader.ReadInt(fireState);
122 SetFireState(fireState);
123 return true;
124 }
125
126 //------------------------------------------------------------------------------------------------
127 override void OnInit(IEntity pOwnerEntity, GenericComponent pManagerComponent)
128 {
129 super.OnInit(pOwnerEntity, pManagerComponent);
130
132
134 if (damageManager)
135 damageManager.RegisterFlammableHitZone(this);
136
138 if (m_SignalsManager && !m_sFireStateSignal.IsEmpty())
140 }
141
142 //------------------------------------------------------------------------------------------------
144 {
145 return m_eHitZoneGroup;
146 }
147
148 //------------------------------------------------------------------------------------------------
149 override void OnMaxHealthChanged()
150 {
151 super.OnMaxHealthChanged();
152
154
155 if (GetGame().GetWorld())
156 UpdateFireRate(true);
157 }
158
159 //------------------------------------------------------------------------------------------------
162 {
163 float maxDamage = GetMaxHealth();
164 float fireMultiplier = GetDamageMultiplier(EDamageType.FIRE);
165
166 if (fireMultiplier <= 0)
167 return;
168 if (m_fMinFireBurningTime > 0)
169 m_fFireDamageRateMax = maxDamage / (m_fMinFireBurningTime * fireMultiplier);
170
171 if (m_fMaxFireBurningTime > 0)
172 m_fFireDamageRateMin = maxDamage / (m_fMaxFireBurningTime * fireMultiplier);
173
174 if (m_fLightSmokeStopTime > 0)
175 m_fLightSmokeReductionRate = m_fFireDamageRateMin * (m_fHeavySmokeThreshold - m_fLightSmokeThreshold) / m_fLightSmokeStopTime;
176
177 if (m_fHeavySmokeStopTime > 0)
178 m_fHeavySmokeReductionRate = m_fFireDamageRateMin * (m_fIgnitingSmokeThreshold - m_fHeavySmokeThreshold) / m_fHeavySmokeStopTime;
179
180 if (m_fIgnitingSmokeStokeTime > 0)
181 m_fIgnitingSmokeStokeRate = m_fFireDamageRateMin * (1 - m_fIgnitingSmokeThreshold) / m_fIgnitingSmokeStokeTime;
182 }
183
184 //------------------------------------------------------------------------------------------------
200 override float ComputeEffectiveDamage(notnull BaseDamageContext damageContext, bool isDOT)
201 {
202 // Handled via HandleIncendiaryDamage, does not deal damage directly
203 if (damageContext.damageType == EDamageType.INCENDIARY)
204 return 0;
205
206 return super.ComputeEffectiveDamage(damageContext, isDOT);
207 }
208
209 //------------------------------------------------------------------------------------------------
215 void HandleIncendiaryDamage(notnull BaseDamageContext damageContext)
216 {
217 //apply base multiplier
218 float incendiaryDamage = damageContext.damageValue * GetBaseDamageMultiplier();
219 //apply damage multiplier for this specific damage type
220 incendiaryDamage *= GetDamageMultiplier(EDamageType.INCENDIARY);
221
222 //Extinguishing does not receive reduction or thresholds
223 if (incendiaryDamage > 0)
224 {
225 //apply flat damage reduction
226 incendiaryDamage -= m_fIncendiaryReduction;
227
228 //if its less than the damage threshold we discard the damage.
229 //if the damage to take becomes negative (healing) because of the flat damage reduction, this should reset it back to 0 dmg to take.
230 if (incendiaryDamage < m_fIncendiaryThreshold)
231 incendiaryDamage = 0;
232 }
233
234 // Ignore insignificant incendiary rate change
235 float newFireRate = Math.Clamp(m_fFireRate + incendiaryDamage, 0, m_fFireDamageRateMax);
236 if (float.AlmostEqual(newFireRate, m_fFireRate))
237 return;
238
239 // Last shot that sets the vehicle on fire is going to be remembered as instigator of fire
240 if (m_eFireState == SCR_EBurningState.SMOKING_IGNITING)
241 SetFireInstigator(damageContext.instigator);
242 else if (m_eFireState == SCR_EBurningState.BURNING && (!m_FireInstigator || m_FireInstigator.GetInstigatorType() == InstigatorType.INSTIGATOR_NONE))
243 SetFireInstigator(damageContext.instigator);
244
245 SetFireRate(newFireRate);
246 }
247
248 //------------------------------------------------------------------------------------------------
250 protected void SetFireInstigator(Instigator instigator)
251 {
252 m_FireInstigator = instigator;
253 }
254
255 //------------------------------------------------------------------------------------------------
258 {
260 return m_FireInstigator;
261
262 m_FireInstigator = Instigator.CreateInstigator(null);
263
264 return m_FireInstigator;
265 }
266
267 //------------------------------------------------------------------------------------------------
269 override void OnDamageStateChanged(EDamageState newState, EDamageState previousDamageState, bool isJIP)
270 {
271 super.OnDamageStateChanged(newState, previousDamageState, isJIP);
272
273 if (!GetGame().GetWorld())
274 return;
275
276 if(isJIP)
277 return;
278
279 if (GetDamageState() == EDamageState.DESTROYED)
281 else if (GetPreviousDamageState() == EDamageState.DESTROYED)
283 }
284
285 //------------------------------------------------------------------------------------------------
288 {
289 return m_fFireRate;
290 }
291
292 //------------------------------------------------------------------------------------------------
294 void SetFireRate(float fireRate)
295 {
296 m_fFireRate = fireRate;
297 m_bIsFireRateLocked = false;
298 UpdateFireRate(true);
299 }
300
301 //------------------------------------------------------------------------------------------------
307 float GetFireRateForState(SCR_EBurningState fireState, float weight = -1)
308 {
309 if (weight < 0 || weight > 1)
310 weight = 0.5;
311
312 float top;
313 float bottom;
314 switch (fireState)
315 {
316 case SCR_EBurningState.BURNING:
317 {
319 bottom = m_fFireDamageRateMin;
320 break;
321 }
322 case SCR_EBurningState.SMOKING_IGNITING:
323 {
325 bottom = m_fFireDamageRateMin * m_fIgnitingSmokeThreshold;
326 break;
327 }
328 case SCR_EBurningState.SMOKING_HEAVY:
329 {
330 top = m_fFireDamageRateMin * m_fIgnitingSmokeThreshold;
331 bottom = m_fFireDamageRateMin * m_fHeavySmokeThreshold;
332 break;
333 }
334 case SCR_EBurningState.SMOKING_LIGHT:
335 {
336 top = m_fFireDamageRateMin * m_fHeavySmokeThreshold;
337 bottom = m_fFireDamageRateMin * m_fLightSmokeThreshold;
338 break;
339 }
340 default:
341 {
342 top = m_fFireDamageRateMin * m_fLightSmokeThreshold;
343 bottom = 0;
344 }
345 }
346
347 float fireRate = Math.Lerp(bottom, top, weight);
348 return fireRate;
349 }
350
351 //------------------------------------------------------------------------------------------------
354 {
355 return m_eFireState;
356 }
357
358 //------------------------------------------------------------------------------------------------
365 void SetFireState(SCR_EBurningState fireState, float weight = -1, bool changeRate = true)
366 {
367 // Continue only if weight is defined or fir state is changed
368 bool stateChanged = fireState != m_eFireState;
369 m_eFireState = fireState;
370
371 if (stateChanged)
372 UpdateFireEffects(fireState);
373 else if (weight < 0)
374 return;
375
376 if (IsProxy())
377 return;
378
379 // Update fire rate
380 if (changeRate)
381 SetFireRate(GetFireRateForState(fireState, weight));
382
383 if (!stateChanged)
384 return;
385
386 // Clean the fire instigator if the fire is extinguished
387 if (m_eFireState < SCR_EBurningState.SMOKING_IGNITING)
388 SetFireInstigator(null);
389
390 // Send update to remote clients
391 array<HitZone> hitZones = {};
392 SCR_DamageManagerComponent hitZoneContainer = SCR_DamageManagerComponent.Cast(GetHitZoneContainer());
393
394 if (!hitZoneContainer)
395 return;
396
397 hitZoneContainer.GetAllHitZones(hitZones);
398 int hitZoneIndex = hitZones.Find(this);
399 if (hitZoneIndex >= 0)
400 hitZoneContainer.RpcDo_SetFireState(hitZoneIndex, m_eFireState);
401 }
402
403 //------------------------------------------------------------------------------------------------
410 {
411 SCR_EBurningState fireState;
412 if (fireRate >= m_fFireDamageRateMin)
413 fireState = SCR_EBurningState.BURNING;
414 else if (fireRate >= m_fFireDamageRateMin * m_fIgnitingSmokeThreshold)
415 fireState = SCR_EBurningState.SMOKING_IGNITING;
416 else if (fireRate >= m_fFireDamageRateMin * m_fHeavySmokeThreshold)
417 fireState = SCR_EBurningState.SMOKING_HEAVY;
418 else if (fireRate >= m_fFireDamageRateMin * m_fLightSmokeThreshold)
419 fireState = SCR_EBurningState.SMOKING_LIGHT;
420 else
421 fireState = SCR_EBurningState.NONE;
422
423 return fireState;
424 }
425
426 //------------------------------------------------------------------------------------------------
432 protected float CalculateNewFireRate(float fireRate, float deltaTime)
433 {
434 float depth;
435 if (fireRate > 0 && SCR_WorldTools.IsObjectUnderwater(GetOwner(), m_vParticleOffset, -1, depth) && depth > m_fWaterDepthThreshold)
436 {
437 fireRate = 0;
438 }
439 else if (deltaTime > 0 && fireRate > 0 && fireRate < m_fFireDamageRateMin)
440 {
441 // Update smoking virtual fire rate, that can get
442 if (fireRate < m_fHeavySmokeThreshold * m_fFireDamageRateMin)
443 fireRate -= deltaTime * m_fLightSmokeReductionRate;
444 else if (fireRate < m_fIgnitingSmokeThreshold * m_fFireDamageRateMin)
445 fireRate -= deltaTime * m_fHeavySmokeReductionRate;
446 else
447 fireRate += deltaTime * m_fIgnitingSmokeStokeRate;
448
449 fireRate = Math.Clamp(fireRate, 0, m_fFireDamageRateMin);
450 }
451 else
452 {
453 // On fire
454 fireRate = Math.Clamp(fireRate, 0, m_fFireDamageRateMax);
455 }
456
457 return fireRate;
458 }
459
460 //------------------------------------------------------------------------------------------------
465 protected void ApplyFireDamage(float fireRate, float deltaTime)
466 {
467 if (fireRate < m_fFireDamageRateMin)
468 {
469 SetDamageOverTime(EDamageType.FIRE, 0);
470 return;
471 }
472
473 SetDamageOverTime(EDamageType.FIRE, fireRate);
474
475 Instigator instigator = m_FireInstigator;
476 if (!instigator)
477 instigator = Instigator.CreateInstigator(null);
478
479 // Damage random physical hitzones
480 if (GetHitZoneContainer() == m_RootDamageManager && m_RootDamageManager.GetDefaultHitZone() == this)
481 m_RootDamageManager.DamageRandomHitZones(fireRate, EDamageType.FIRE, instigator);
482
483 // Deal damage to crew depending on how much the fire is stoked
484 // TODO: Deal damage based on distance from fire
486 return;
487
488 float damageOccupants = m_fFireDamageOccupants * deltaTime;
489 if (m_fFireDamageRateMin > 0)
490 damageOccupants *= fireRate / m_fFireDamageRateMin;
491
492 if (damageOccupants > 0)
493 m_CompartmentManager.DamageOccupants(damageOccupants, EDamageType.FIRE, instigator, false, false);
494 }
495
496 //------------------------------------------------------------------------------------------------
500 protected void UpdateFireRate(bool forceUpdate = false)
501 {
502 if (IsProxy())
503 return;
504
505 IEntity owner = GetOwner();
506 if (!owner)
507 {
509 return;
510 }
511
512 ChimeraWorld world = ChimeraWorld.CastFrom(owner.GetWorld());
513 if (!world)
514 return;
515
516 if (!forceUpdate && m_fUpdateFireTime == 0)
517 return;
518
519 // Scale damage by time passed
520 float deltaTime;
521 float currentTime = world.GetWorldTime();
522
523 if (m_fUpdateFireTime > 0)
524 deltaTime = (currentTime - m_fUpdateFireTime) * 0.001; // Convert to seconds
525
526 float previousFireRate = m_fFireRate;
528 m_fFireRate = CalculateNewFireRate(previousFireRate, deltaTime);
529
530 // Extinguishing should also force RPC and removal of queued call so that clients stop updating fire rate
531 if (m_fFireRate == 0 && previousFireRate > 0)
532 forceUpdate = true;
533
534 //HOTFIX until this will be transfered to the proper system
535 if (!world.IsGameTimePaused())
536 ApplyFireDamage(m_fFireRate, deltaTime);
537
538 // Clear any scheduled call in the queue
539 if (forceUpdate)
541
542 // Schedule future update
543 if (m_fFireRate > 0)
544 {
545 m_fUpdateFireTime = currentTime;
546
548 {
549 // Schedule delayed update every second
550 m_bIsUpdatingFire = true;
551 GetGame().GetCallqueue().CallLater(UpdateFireRate, 1000, true, false);
552 }
553 }
554 else
555 {
557 }
558
559 // Update fire state
561 if (newFireState != m_eFireState)
562 SetFireState(newFireState, -1, false);
563 }
564
565 //------------------------------------------------------------------------------------------------
568 {
569 m_bIsUpdatingFire = false;
570 GetGame().GetCallqueue().Remove(UpdateFireRate);
571 }
572
573 //------------------------------------------------------------------------------------------------
575 void LockFireRate(bool locked = true)
576 {
577 m_bIsFireRateLocked = locked;
578 }
579
580 //------------------------------------------------------------------------------------------------
582 {
583 IEntity owner = GetOwner();
584 if (!owner)
585 return;
586
587 float depth;
588 if (SCR_WorldTools.IsObjectUnderwater(owner, m_vParticleOffset, -1, depth) && depth > m_fWaterDepthThreshold)
589 {
591 return;
592 }
593
595
596 ScriptCallQueue queue = GetGame().GetCallqueue();
597 queue.CallLater(StopDestructionFire, m_fBurningTime * 1000);
598 queue.CallLater(StartDestructionGroundFire, 1000, true);
599 }
600
601 //------------------------------------------------------------------------------------------------
604 {
605 IEntity owner = GetOwner();
606 if (!owner)
607 return;
608
609 float depth;
610 if (SCR_WorldTools.IsObjectUnderwater(owner, m_vParticleOffset, -1, depth) && depth > m_fWaterDepthThreshold)
611 {
613 return;
614 }
615 else if (SCR_WorldTools.IsObjectUnderwater(owner))
616 {
617 // Do not create surface fire effect
618 return;
619 }
620
621 // Make sure the wreck is not moving
622 Physics physics = owner.GetPhysics();
623 if (physics && physics.GetVelocity().LengthSq() > 0.01)
624 return;
625
626 // Measure the height difference between owner and the surface
627 vector position = owner.GetOrigin();
628 float surfaceY = GetGame().GetWorld().GetSurfaceY(position[0], position[2]);
629
630 // If the difference is within tolerance then proceed to spawn fire effect and stop the loop
631 if (position[1] - surfaceY > FIRE_TERRAIN_HEIGHT_TOLERANCE)
632 return;
633
634 // Stop the loop
635 GetGame().GetCallqueue().Remove(StartDestructionGroundFire);
636
637 // No need to play particles on headless client
638 if (System.IsConsoleApp())
639 return;
640
641 // Stop existing effect so that it gets removed and does not have to be tracked again
643 {
646 }
647
648 position[1] = surfaceY;
649
650 if (m_sDestructionParticle.IsEmpty())
651 return;
652
654 spawnParams.Transform[3] = position;
655 spawnParams.UseFrameEvent = true;
657 }
658
659 //------------------------------------------------------------------------------------------------
660 // Stops fire on vehicle and on the ground
662 {
664
665 ScriptCallQueue queue = GetGame().GetCallqueue();
666 queue.Remove(StartDestructionGroundFire);
667 queue.Remove(StopDestructionFire);
668
670 {
673 }
674 }
675
676 //------------------------------------------------------------------------------------------------
678 protected void UpdateFireEffects(SCR_EBurningState fireState)
679 {
680 // No need to play particles on headless client
681 if (System.IsConsoleApp())
682 return;
683
684 // Update sound effects
685 IEntity owner = GetOwner();
686 if (!owner)
687 return;
688
690 m_SignalsManager.SetSignalValue(m_iFireStateSignalIdx, fireState);
691
692 // Create particle emitters
694 spawnParams.Transform[3] = m_vParticleOffset;
695 spawnParams.FollowParent = owner;
696 spawnParams.PlayOnSpawn = true;
697 spawnParams.UseFrameEvent = true;
698 spawnParams.DeleteWhenStopped = true;
699
700 // Spawn particles on object
701 if (fireState == SCR_EBurningState.SMOKING_LIGHT)
702 {
704 m_DamagedParticleLight = ParticleEffectEntity.SpawnParticleEffect(m_sDamagedParticle, spawnParams);
705 }
706 else if (m_DamagedParticleLight)
707 {
710 }
711
712 if (fireState == SCR_EBurningState.SMOKING_HEAVY || fireState == SCR_EBurningState.SMOKING_IGNITING)
713 {
715 m_DamagedParticleHeavy = ParticleEffectEntity.SpawnParticleEffect(m_sDamagedParticleHeavy, spawnParams);
716 }
717 else if (m_DamagedParticleHeavy)
718 {
721 }
722
723 if (fireState == SCR_EBurningState.BURNING)
724 {
725 if (!m_BurningParticle && !m_sBurningParticle.IsEmpty())
726 m_BurningParticle = ParticleEffectEntity.SpawnParticleEffect(m_sBurningParticle, spawnParams);
727 }
728 else if (m_BurningParticle)
729 {
731 m_BurningParticle = null;
732 }
733
734 // Fire light
735 if (fireState == SCR_EBurningState.BURNING)
736 FireLightOn();
737 else
738 FireLightOff();
739 }
740
741 //------------------------------------------------------------------------------------------------
742 protected void FireLightOn()
743 {
745 return;
746
747 IEntity owner = GetOwner();
748 if (!owner)
749 return;
750
751 vector ownerOrigin = owner.GetOrigin();
752
753 m_aLightEntities = {};
754
755 foreach (SCR_BaseLightData lightdata : m_aLightData)
756 {
757 LightEntity lightEntity = LightEntity.CreateLight(lightdata.GetLightType(), lightdata.GetLightFlag(), lightdata.GetEffectRadius(), Color.FromVector(lightdata.GetLightColor()), LIGHT_EMISSIVITY_START, ownerOrigin);
758 owner.AddChild(lightEntity, -1, EAddChildFlags.AUTO_TRANSFORM);
759
760 // Calculate desired position
761 lightEntity.SetOrigin(ownerOrigin + lightdata.GetLightOffset());
762 lightEntity.SetLensFlareType(LightLensFlareType.Disabled);
763 lightEntity.SetIntensityEVClip(lightdata.GetIntensityClipEV());
764
765 m_aLightEntities.Insert(lightEntity);
766 }
767 }
768
769 //------------------------------------------------------------------------------------------------
770 protected void FireLightOff()
771 {
772 if (!m_aLightEntities)
773 return;
774
775 foreach (LightEntity lightEntity : m_aLightEntities)
776 {
777 if (lightEntity)
778 delete lightEntity;
779 }
780
781 m_aLightEntities = null;
782 }
783
784 //------------------------------------------------------------------------------------------------
786 {
787 return GetDamageOverTime(EDamageType.FIRE);
788 }
789
804}
805//---- REFACTOR NOTE END ----
EHitZoneGroup
ArmaReforgerScripted GetGame()
Definition game.c:1398
ECharacterHitZoneGroup m_eHitZoneGroup
float GetDamageMultiplier(EDamageType type)
float GetMaxHealth()
vector position
void HandleIncendiaryDamage(notnull BaseDamageContext damageContext)
void StopFireRateUpdate()
Stop fire rate updates until requested again.
ParticleEffectEntity m_DamagedParticleHeavy
ParticleEffectEntity m_DamagedParticleLight
float GetFireRate()
Get rate of fire (dps). If it is below fire damage threshold, no damage will be dealt.
enum SCR_EBurningState FIRE_TERRAIN_HEIGHT_TOLERANCE
float CalculateNewFireRate(float fireRate, float deltaTime)
float m_fIgnitingSmokeStokeRate
void ApplyFireDamage(float fireRate, float deltaTime)
void UpdateFireEffects(SCR_EBurningState fireState)
Logic when vehicle is damaged.
float m_fHeavySmokeReductionRate
SCR_EBurningState
@ SMOKING_HEAVY
@ SMOKING_LIGHT
@ SMOKING_IGNITING
void ~SCR_FlammableHitZone()
void FireLightOn()
float m_fIncendiaryReduction
ResourceName m_sDamagedParticle
ResourceName m_sBurningParticle
float m_fFireRate
float GetFireRateForState(SCR_EBurningState fireState, float weight=-1)
float m_fUpdateFireTime
void SetFireRate(float fireRate)
Set rate of fire (dps). If it is below fire damage threshold, no damage will be dealt.
void LockFireRate(bool locked=true)
Temporarily stop fire rate changes until incendiary damage is received again.
int m_iFireStateSignalIdx
string m_sFireStateSignal
Instigator GetFireInstigator()
Inform damage manager about fire instigator.
void InitFireRates()
Compute smoke and fire damage thresholds and rates.
void StartDestructionGroundFire()
Attempts to spawn fire effect on the ground under the burning wreck.
void SetFireInstigator(Instigator instigator)
Inform damage manager about fire instigator.
SCR_EBurningState GetFireState()
Returns current fire state.
ref array< ref SCR_BaseLightData > m_aLightData
float m_fLightSmokeReductionRate
bool m_bIsFireRateLocked
void StartDestructionFire()
void FireLightOff()
ref array< LightEntity > m_aLightEntities
void UpdateFireRate(bool forceUpdate=false)
void StopDestructionFire()
void SetFireState(SCR_EBurningState fireState, float weight=-1, bool changeRate=true)
bool m_bIsUpdatingFire
SCR_EBurningState GetFireStateForRate(float fireRate)
ResourceName m_sDamagedParticleHeavy
ParticleEffectEntity m_BurningGroundParticle
Instigator m_FireInstigator
SCR_EBurningState m_eFireState
ParticleEffectEntity m_BurningParticle
ResourceName m_sBurningGroundParticle
float m_fFireDamageRateMax
float m_fFireDamageRateMin
void ParticleEffectEntity(IEntitySource src, IEntity parent)
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
SCR_VehicleDamageManagerComponent m_RootDamageManager
SCR_BaseCompartmentManagerComponent m_CompartmentManager
SignalsManagerComponent m_SignalsManager
void SCR_VehicleDamageManagerComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
Definition Color.c:13
bool Save(notnull ScriptBitWriter writer)
void OnMaxHealthChanged()
Called when max damage changes.
bool HasDataToReplicate()
Use it to save bandwidth in some default conditions. Use it if Save and Load are overriden.
proto external Managed FindComponent(typename typeName)
proto external vector GetOrigin()
proto external Physics GetPhysics()
proto external int AddChild(notnull IEntity child, TNodeId pivot, EAddChildFlags flags=EAddChildFlags.AUTO_TRANSFORM)
Add Entity to hierarchy. Pivot is pivot index, or -1 for center of parent.
proto external BaseWorld GetWorld()
Definition Math.c:13
Light parameters.
float GetSecondaryExplosionScale()
Get secondary explosion desired scale. It will determine the prefab retrieved from secondary explosio...
override void OnDamageStateChanged(EDamageState newState, EDamageState previousDamageState, bool isJIP)
Kill occupants and start destruction.
override float ComputeEffectiveDamage(notnull BaseDamageContext damageContext, bool isDOT)
Definition SCR_HitZone.c:67
IEntity GetOwner()
Definition SCR_HitZone.c:42
static void StopParticleEmissionAndLights(notnull ParticleEffectEntity particleEntity, int lightEmitterID=0)
override EHitZoneGroup GetHitZoneGroup()
ScriptCallQueue Class provide "lazy" calls - when we don't want to execute function immediately but l...
Definition tools.c:53
void Load()
Definition gameLib.c:220
IEntity GetOwner()
Owner entity of the fuel tank.
InstigatorType
@ NONE
When Shape is created and not initialized yet.
Definition ShapeType.c:15
SCR_FieldOfViewSettings Attribute
EAddChildFlags
EDamageType
Definition EDamageType.c:13
EDamageState
LightLensFlareType
Type of the light lens flare.