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_BaseDamageHealSupportStationAction.c
Go to the documentation of this file.
1
2
class
SCR_BaseDamageHealSupportStationAction
:
SCR_BaseUseSupportStationAction
3
{
4
[
Attribute
(
desc
:
"Used to get the damage state such as Critical, minor ect"
)]
5
protected
ref SCR_DamageIntensityHolder
m_DamageIntensityHolder
;
6
7
SCR_DamageManagerComponent
m_DamageManagerComponent
;
8
9
//~ A list of hitZones to heal
10
protected
ref array<HitZone>
m_aHitZonesToHeal
= {};
11
12
//------------------------------------------------------------------------------------------------
13
protected
override
void
DelayedInit
(
IEntity
owner)
14
{
15
if
(!owner)
16
return
;
17
18
super.DelayedInit(owner);
19
20
m_DamageManagerComponent
= SCR_DamageManagerComponent.GetDamageManager(owner);
21
22
//~ Set hitZones to Repair
23
if
(
m_DamageManagerComponent
)
24
SetHitZonesToHeal
();
25
}
26
27
//------------------------------------------------------------------------------------------------
33
int
GetHitZonesToHeal
(notnull out array<HitZone> hitZones)
34
{
35
hitZones.Copy(
m_aHitZonesToHeal
);
36
return
hitZones.Count();
37
}
38
39
//------------------------------------------------------------------------------------------------
40
protected
void
SetHitZonesToHeal
()
41
{
42
m_aHitZonesToHeal
.Clear();
43
44
if
(!
m_DamageManagerComponent
)
45
return
;
46
47
m_DamageManagerComponent
.GetAllHitZonesInHierarchy(
m_aHitZonesToHeal
);
48
49
if
(
m_aHitZonesToHeal
.Count() > 1)
50
{
51
HitZone
defaultHitZone =
m_DamageManagerComponent
.GetDefaultHitZone();
52
53
// Move default hitZone to the end
54
int
defaultHitZoneIndex =
m_aHitZonesToHeal
.Find(defaultHitZone);
55
if
(
m_aHitZonesToHeal
.IsIndexValid(defaultHitZoneIndex))
56
{
57
m_aHitZonesToHeal
.RemoveOrdered(defaultHitZoneIndex);
58
m_aHitZonesToHeal
.InsertAt(defaultHitZone,
m_aHitZonesToHeal
.Count() -1);
59
}
60
}
61
}
62
63
//------------------------------------------------------------------------------------------------
64
SCR_DamageManagerComponent
GetActionDamageManager
()
65
{
66
return
m_DamageManagerComponent
;
67
}
68
69
//------------------------------------------------------------------------------------------------
70
protected
override
string
GetActionStringParam
()
71
{
72
if
(!
m_DamageIntensityHolder
||
m_aHitZonesToHeal
.IsEmpty() || (!
m_bCanPerform
&&
m_eCannotPerformReason
!=
ESupportStationReasonInvalid
.HEAL_MAX_HEALABLE_HEALTH_REACHED_FIELD &&
m_eCannotPerformReason
!=
ESupportStationReasonInvalid
.HEAL_MAX_HEALABLE_HEALTH_REACHED_EMERGENCY))
73
return
string
.Empty;
74
75
SCR_UIName
uiInfo =
m_DamageIntensityHolder
.GetValidIntensityUIInfo(
m_aHitZonesToHeal
);
76
if
(uiInfo)
77
return
uiInfo.
GetName
();
78
79
return
string
.Empty;
80
}
81
82
//------------------------------------------------------------------------------------------------
84
SCR_ENearbyInteractionContextColors
GetHealthStatus
()
85
{
86
// Hitzones to heal are cached but if the entity owning them
87
// gets deleted we'd get a VME inside GetValidIntensityType
88
// because all hitzones would be null.
89
if
(!
m_DamageManagerComponent
)
90
return
SCR_ENearbyInteractionContextColors
.DEFAULT;
91
92
int
healthState =
m_DamageIntensityHolder
.GetValidIntensityType(
m_aHitZonesToHeal
);
93
94
if
(healthState ==
SCR_EDamageIntensityType
.NO_DAMAGE)
95
return
SCR_ENearbyInteractionContextColors
.DEFAULT;
96
97
if
(
IsInProgress
())
98
return
SCR_ENearbyInteractionContextColors
.HEALING;
99
100
if
(
IsStabilizedReason
())
101
return
SCR_ENearbyInteractionContextColors
.STABLE;
102
103
if
(healthState <
SCR_EDamageIntensityType
.HIGH)
104
return
SCR_ENearbyInteractionContextColors
.MEDIUM;
105
106
return
SCR_ENearbyInteractionContextColors
.SEVERE;
107
}
108
109
//------------------------------------------------------------------------------------------------
110
bool
IsStabilizedReason
()
111
{
112
return
m_eCannotPerformReason
==
ESupportStationReasonInvalid
.HEAL_MAX_HEALABLE_HEALTH_REACHED_FIELD;
113
}
114
}
ESupportStationReasonInvalid
ESupportStationReasonInvalid
Definition
ESupportStationReasonInvalid.c:4
SCR_EDamageIntensityType
SCR_EDamageIntensityType
Definition
SCR_DamageIntensityHolder.c:3
SCR_ENearbyInteractionContextColors
SCR_ENearbyInteractionContextColors
Definition
SCR_NearbyContextColorsComponentInteract.c:2
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition
SCR_RespawnBriefingComponent.c:17
BaseUserAction::IsInProgress
proto external bool IsInProgress()
Returns true while continuous or timed action is being used.
HitZone
Definition
HitZone.c:13
IEntity
Definition
IEntity.c:13
SCR_BaseDamageHealSupportStationAction
Allows healing of action owner (not user).
Definition
SCR_BaseDamageHealSupportStationAction.c:3
SCR_BaseDamageHealSupportStationAction::GetActionDamageManager
SCR_DamageManagerComponent GetActionDamageManager()
Definition
SCR_BaseDamageHealSupportStationAction.c:64
SCR_BaseDamageHealSupportStationAction::DelayedInit
override void DelayedInit(IEntity owner)
Definition
SCR_BaseDamageHealSupportStationAction.c:13
SCR_BaseDamageHealSupportStationAction::GetHealthStatus
SCR_ENearbyInteractionContextColors GetHealthStatus()
return the Health code color for nearby interactions
Definition
SCR_BaseDamageHealSupportStationAction.c:84
SCR_BaseDamageHealSupportStationAction::GetActionStringParam
override string GetActionStringParam()
Definition
SCR_BaseDamageHealSupportStationAction.c:70
SCR_BaseDamageHealSupportStationAction::IsStabilizedReason
bool IsStabilizedReason()
Definition
SCR_BaseDamageHealSupportStationAction.c:110
SCR_BaseDamageHealSupportStationAction::m_DamageIntensityHolder
ref SCR_DamageIntensityHolder m_DamageIntensityHolder
Definition
SCR_BaseDamageHealSupportStationAction.c:5
SCR_BaseDamageHealSupportStationAction::GetHitZonesToHeal
int GetHitZonesToHeal(notnull out array< HitZone > hitZones)
Definition
SCR_BaseDamageHealSupportStationAction.c:33
SCR_BaseDamageHealSupportStationAction::SetHitZonesToHeal
void SetHitZonesToHeal()
Definition
SCR_BaseDamageHealSupportStationAction.c:40
SCR_BaseDamageHealSupportStationAction::m_aHitZonesToHeal
ref array< HitZone > m_aHitZonesToHeal
Definition
SCR_BaseDamageHealSupportStationAction.c:10
SCR_BaseDamageHealSupportStationAction::m_DamageManagerComponent
SCR_DamageManagerComponent m_DamageManagerComponent
Definition
SCR_BaseDamageHealSupportStationAction.c:7
SCR_BaseUseSupportStationAction
Definition
SCR_BaseUseSupportStationAction.c:2
SCR_BaseUseSupportStationAction::m_bCanPerform
bool m_bCanPerform
Definition
SCR_BaseUseSupportStationAction.c:54
SCR_BaseUseSupportStationAction::m_eCannotPerformReason
ESupportStationReasonInvalid m_eCannotPerformReason
Definition
SCR_BaseUseSupportStationAction.c:55
SCR_UIName
Definition
SCR_UIName.c:6
SCR_UIName::GetName
LocalizedString GetName()
Definition
SCR_UIName.c:31
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
scripts
Game
UserActions
SupportStations
SCR_BaseDamageHealSupportStationAction.c
Generated by
1.17.0