Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_BloodOnClothesSystem.c
Go to the documentation of this file.
1/*
2System to update the bleeding mask on clothing items covering bleeding hitZones
3*/
4
6{
7 override static void InitInfo(WorldSystemInfo outInfo)
8 {
9 outInfo
10 .SetAbstract(false)
11 .AddPoint(ESystemPoint.Frame);
12 }
13
14 protected ref array<SCR_BleedingDamageEffect> m_aEffects = {};
15
16 protected float m_fUpdateClothesTimer;
17 protected const float UPDATE_CLOTHES_DELAY = 0.5;
18
20 SCR_CharacterHitZone m_HitZone;
21
22 //------------------------------------------------------------------------------------------------
23 protected override void OnInit()
24 {
25 Enable(false);
26 }
27
28 //------------------------------------------------------------------------------------------------
30 {
31 bool nullValuePresent;
32 m_fUpdateClothesTimer += args.GetTimeSliceSeconds();
34 return;
35
36 foreach (SCR_BleedingDamageEffect effect : m_aEffects)
37 {
38 if (!effect)
39 {
40 nullValuePresent = true;
41 continue;
42 }
43
44 m_HitZone = SCR_CharacterHitZone.Cast(effect.GetAffectedHitZone());
47 m_CharacterDamageManager.AddBloodToClothes(m_HitZone, effect.GetDPS() * m_fUpdateClothesTimer);
48 }
49
50 if (nullValuePresent)
51 {
52 for (int i = m_aEffects.Count() - 1; i >= 0; i--)
53 {
54 if (!m_aEffects[i])
55 m_aEffects.Remove(i);
56 }
57 }
58
60 }
61
62 //------------------------------------------------------------------------------------------------
64 {
65 if (!bleedingEffect)
66 return;
67
68 if (!m_aEffects.Contains(bleedingEffect))
69 m_aEffects.Insert(bleedingEffect);
70
71 if (!IsEnabled())
72 Enable(true);
73 }
74
75 //------------------------------------------------------------------------------------------------
77 {
78 m_aEffects.RemoveItem(bleedingEffect);
79 if (m_aEffects.IsEmpty())
80 Enable(false);
81 }
82}
override void OnUpdatePoint(WorldUpdatePointArgs args)
void Unregister(SCR_BleedingDamageEffect bleedingEffect)
void Register(SCR_BleedingDamageEffect bleedingEffect)
SCR_CharacterDamageManagerComponent m_CharacterDamageManager
ref array< SCR_BleedingDamageEffect > m_aEffects
Structure holding world system meta-information required by the engine.
Structure holding extra data of WorldSystem update point.
WorldSystemPoint ESystemPoint
Definition gameLib.c:7
int IsEnabled()
Returns true if the light is enabled.