18 protected static const float LIGHT_EMISSIVITY_START = 5;
38 [
Attribute(defvalue:
"0",
desc:
"Fire damage applied to occupants of a burning vehicle each second (hp)",
params:
"0 100 0.01",
category:
"Flammability")]
42 protected float m_fIncendiaryThreshold;
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;
48 protected float m_fLightSmokeStopTime;
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;
54 protected float m_fIgnitingSmokeStokeTime;
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;
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;
63 protected float m_fBurningTime;
66 protected float m_fLightSmokeThreshold;
69 protected float m_fHeavySmokeThreshold;
72 protected float m_fIgnitingSmokeThreshold;
84 [
Attribute(
desc:
"Particle effect for fire on ground under object after the wreck stops moving",
params:
"ptc",
category:
"Effects")]
88 protected float m_fWaterDepthThreshold;
111 override bool Save(notnull ScriptBitWriter writer)
121 reader.ReadInt(fireState);
129 super.OnInit(pOwnerEntity, pManagerComponent);
135 damageManager.RegisterFlammableHitZone(
this);
151 super.OnMaxHealthChanged();
166 if (fireMultiplier <= 0)
168 if (m_fMinFireBurningTime > 0)
171 if (m_fMaxFireBurningTime > 0)
174 if (m_fLightSmokeStopTime > 0)
177 if (m_fHeavySmokeStopTime > 0)
180 if (m_fIgnitingSmokeStokeTime > 0)
203 if (damageContext.damageType ==
EDamageType.INCENDIARY)
206 return super.ComputeEffectiveDamage(damageContext, isDOT);
218 float incendiaryDamage = damageContext.damageValue * GetBaseDamageMultiplier();
223 if (incendiaryDamage > 0)
230 if (incendiaryDamage < m_fIncendiaryThreshold)
231 incendiaryDamage = 0;
271 super.OnDamageStateChanged(newState, previousDamageState, isJIP);
281 else if (GetPreviousDamageState() ==
EDamageState.DESTROYED)
309 if (weight < 0 || weight > 1)
347 float fireRate =
Math.Lerp(bottom, top, weight);
391 array<HitZone> hitZones = {};
392 SCR_DamageManagerComponent hitZoneContainer = SCR_DamageManagerComponent.Cast(GetHitZoneContainer());
394 if (!hitZoneContainer)
397 hitZoneContainer.GetAllHitZones(hitZones);
398 int hitZoneIndex = hitZones.Find(
this);
399 if (hitZoneIndex >= 0)
400 hitZoneContainer.RpcDo_SetFireState(hitZoneIndex,
m_eFireState);
435 if (fireRate > 0 &&
SCR_WorldTools.IsObjectUnderwater(
GetOwner(), m_vParticleOffset, -1, depth) && depth > m_fWaterDepthThreshold)
477 instigator =
Instigator.CreateInstigator(null);
488 float damageOccupants = m_fFireDamageOccupants * deltaTime;
492 if (damageOccupants > 0)
521 float currentTime = world.GetWorldTime();
535 if (!world.IsGameTimePaused())
588 if (
SCR_WorldTools.IsObjectUnderwater(owner, m_vParticleOffset, -1, depth) && depth > m_fWaterDepthThreshold)
610 if (
SCR_WorldTools.IsObjectUnderwater(owner, m_vParticleOffset, -1, depth) && depth > m_fWaterDepthThreshold)
623 if (physics && physics.GetVelocity().LengthSq() > 0.01)
638 if (
System.IsConsoleApp())
650 if (m_sDestructionParticle.IsEmpty())
654 spawnParams.Transform[3] =
position;
655 spawnParams.UseFrameEvent =
true;
681 if (
System.IsConsoleApp())
694 spawnParams.Transform[3] = m_vParticleOffset;
695 spawnParams.FollowParent = owner;
696 spawnParams.PlayOnSpawn =
true;
697 spawnParams.UseFrameEvent =
true;
698 spawnParams.DeleteWhenStopped =
true;
757 LightEntity lightEntity = LightEntity.CreateLight(lightdata.GetLightType(), lightdata.GetLightFlag(), lightdata.GetEffectRadius(),
Color.FromVector(lightdata.GetLightColor()), LIGHT_EMISSIVITY_START, ownerOrigin);
761 lightEntity.SetOrigin(ownerOrigin + lightdata.GetLightOffset());
763 lightEntity.SetIntensityEVClip(lightdata.GetIntensityClipEV());
ArmaReforgerScripted GetGame()
ECharacterHitZoneGroup m_eHitZoneGroup
float GetDamageMultiplier(EDamageType type)
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
void ~SCR_FlammableHitZone()
float m_fIncendiaryReduction
ResourceName m_sDamagedParticle
ResourceName m_sBurningParticle
float GetFireRateForState(SCR_EBurningState fireState, float weight=-1)
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
void StartDestructionFire()
ref array< LightEntity > m_aLightEntities
void UpdateFireRate(bool forceUpdate=false)
void StopDestructionFire()
void SetFireState(SCR_EBurningState fireState, float weight=-1, bool changeRate=true)
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)
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()
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)
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...
IEntity GetOwner()
Owner entity of the fuel tank.
@ NONE
When Shape is created and not initialized yet.
SCR_FieldOfViewSettings Attribute
LightLensFlareType
Type of the light lens flare.