Arma Reforger Explorer
1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Toggle main menu visibility
Loading...
Searching...
No Matches
SCR_BloodOnClothesSystem.c
Go to the documentation of this file.
1
/*
2
System to update the bleeding mask on clothing items covering bleeding hitZones
3
*/
4
5
class
SCR_BloodOnClothesSystem
:
GameSystem
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
19
SCR_CharacterDamageManagerComponent
m_CharacterDamageManager
;
20
SCR_CharacterHitZone
m_HitZone
;
21
22
//------------------------------------------------------------------------------------------------
23
protected
override
void
OnInit
()
24
{
25
Enable(
false
);
26
}
27
28
//------------------------------------------------------------------------------------------------
29
override
void
OnUpdatePoint
(
WorldUpdatePointArgs
args)
30
{
31
bool
nullValuePresent;
32
m_fUpdateClothesTimer
+= args.GetTimeSliceSeconds();
33
if
(
m_fUpdateClothesTimer
<
UPDATE_CLOTHES_DELAY
)
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());
45
m_CharacterDamageManager
=
SCR_CharacterDamageManagerComponent
.Cast(
m_HitZone
.GetHitZoneContainer());
46
if
(
m_CharacterDamageManager
)
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
59
m_fUpdateClothesTimer
= 0;
60
}
61
62
//------------------------------------------------------------------------------------------------
63
void
Register
(
SCR_BleedingDamageEffect
bleedingEffect)
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
//------------------------------------------------------------------------------------------------
76
void
Unregister
(
SCR_BleedingDamageEffect
bleedingEffect)
77
{
78
m_aEffects
.RemoveItem(bleedingEffect);
79
if
(
m_aEffects
.IsEmpty())
80
Enable(
false
);
81
}
82
}
GameSystem
Definition
GameSystem.c:16
SCR_BleedingDamageEffect
Definition
SCR_BleedingDamageEffect.c:2
SCR_BloodOnClothesSystem
Definition
SCR_BloodOnClothesSystem.c:6
SCR_BloodOnClothesSystem::OnUpdatePoint
override void OnUpdatePoint(WorldUpdatePointArgs args)
Definition
SCR_BloodOnClothesSystem.c:29
SCR_BloodOnClothesSystem::Unregister
void Unregister(SCR_BleedingDamageEffect bleedingEffect)
Definition
SCR_BloodOnClothesSystem.c:76
SCR_BloodOnClothesSystem::Register
void Register(SCR_BleedingDamageEffect bleedingEffect)
Definition
SCR_BloodOnClothesSystem.c:63
SCR_BloodOnClothesSystem::m_CharacterDamageManager
SCR_CharacterDamageManagerComponent m_CharacterDamageManager
Definition
SCR_BloodOnClothesSystem.c:19
SCR_BloodOnClothesSystem::UPDATE_CLOTHES_DELAY
const float UPDATE_CLOTHES_DELAY
Definition
SCR_BloodOnClothesSystem.c:17
SCR_BloodOnClothesSystem::m_aEffects
ref array< SCR_BleedingDamageEffect > m_aEffects
Definition
SCR_BloodOnClothesSystem.c:14
SCR_BloodOnClothesSystem::m_fUpdateClothesTimer
float m_fUpdateClothesTimer
Definition
SCR_BloodOnClothesSystem.c:16
SCR_BloodOnClothesSystem::m_HitZone
SCR_CharacterHitZone m_HitZone
Definition
SCR_BloodOnClothesSystem.c:20
SCR_BloodOnClothesSystem::OnInit
override void OnInit()
Definition
SCR_BloodOnClothesSystem.c:23
SCR_CharacterDamageManagerComponent
Definition
SCR_CharacterDamageManagerComponent.c:19
WorldSystemInfo
Structure holding world system meta-information required by the engine.
Definition
WorldSystemInfo.c:14
WorldUpdatePointArgs
Structure holding extra data of WorldSystem update point.
Definition
WorldUpdatePointArgs.c:14
ESystemPoint
WorldSystemPoint ESystemPoint
Definition
gameLib.c:7
IsEnabled
int IsEnabled()
Returns true if the light is enabled.
Definition
SCR_BaseManualCameraComponent.c:239
scripts
Game
Systems
SCR_BloodOnClothesSystem.c
Generated by
1.17.0