Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_DoTDamageArea.c
Go to the documentation of this file.
2{
3 [Attribute(desc: "How much damage should be dealt over time of being in the area.")]
4 protected float m_fDotDamage;
5
6 [Attribute(defvalue: "0", desc: "For how long should the effect last.\n0 means infinte, unless entity leaves the area and RemoveEffectWhenLeavingTheArea is true.", params: "0 inf 0.01")]
7 protected float m_fEffectDuration;
8
9 [Attribute(defvalue: "1", desc: "If m_bRemoveEffectWhenLeavingTheArea is false and this is true then effect will last as long as the character is in the area, and when he exits the area, then the effect will linger for the amount of time specified in m_fEffectDuration.\nNOTE: Same limitation as with m_bRemoveEffectWhenLeavingTheArea apply here as well.")]
10 protected bool m_bAddDurationOnExit;
11
12 [Attribute(defvalue: "0", desc: "Dot Damage Type", uiwidget: UIWidgets.ComboBox, enumType: EDamageType)]
14
15 //------------------------------------------------------------------------------------------------
16 override protected BaseDamageEffect GetDamageEffect(SCR_DamageManagerComponent dmgMgr = null, HitZone affectedHitZone = null)
17 {
18 if (!dmgMgr && !affectedHitZone)
19 return m_DamageEffect;
20
22 output.SetDPS(m_fDotDamage);
23 output.SetDamageType(m_eDotDamageType);
24 output.SetAffectedHitZone(affectedHitZone);
25 output.SetInstigator(Instigator.CreateInstigator(GetParent()));
27 output.SetMaxDuration(m_fEffectDuration);
28
29 return output;
30 }
31
32 //------------------------------------------------------------------------------------------------
33 override void OnAreaExit(IEntity entity)
34 {
35 if (!entity)
36 return;
37
39 {
40 super.OnAreaExit(entity);
41 return;
42 }
43
45 return;
46
47 RemoveEffect(entity);
48 }
49
50 //------------------------------------------------------------------------------------------------
51 override void RemoveEffect(notnull IEntity entity)
52 {
53 const SCR_ExtendedDamageManagerComponent dmgMgr = SCR_ExtendedDamageManagerComponent.Cast(SCR_DamageManagerComponent.GetDamageManager(entity));
54 if (!dmgMgr)
55 return;
56
57 array<ref SCR_PersistentDamageEffect> damageEffects = {};
58 if (dmgMgr.FindAllDamageEffectsOfType(GetDamageEffect().Type(), damageEffects) < 1)
59 return;
60
61 const IEntity owner = GetParent();
62 SCR_DotDamageEffect dotEffect;
63 foreach (SCR_PersistentDamageEffect effect : damageEffects)
64 {
65 dotEffect = SCR_DotDamageEffect.Cast(effect);
66 if (!dotEffect)
67 continue;
68
69 if (dotEffect.GetInstigator().GetInstigatorEntity() == owner)
70 dotEffect.SetMaxDuration(dotEffect.GetCurrentDuration() + m_fEffectDuration);
71 }
72 }
73}
Faction GetParent()
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
int Type
ref BaseDamageEffect m_DamageEffect
bool m_bRemoveEffectWhenLeavingTheArea
BaseDamageEffect GetDamageEffect(SCR_DamageManagerComponent dmgMgr=null, HitZone affectedHitZone=null)
override void RemoveEffect(notnull IEntity entity)
EDamageType m_eDotDamageType
override void OnAreaExit(IEntity entity)
SCR_FieldOfViewSettings Attribute
EDamageType
Definition EDamageType.c:13