Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_HealSupportStationAction.c
Go to the documentation of this file.
2{
3 [Attribute("#AR-SupportStation_Heal_ActionInvalid_FullHealth", desc: "Text shown on action if undamaged", uiwidget: UIWidgets.LocaleEditBox)]
5
6 [Attribute("#AR-Inventory_Bleeding", desc: "Text shown on action if character is bleeding and action cannot be performed", uiwidget: UIWidgets.LocaleEditBox)]
8
9 //[Attribute("loc Can not heal more (Disabled)", desc: "Character cannot heal more as max healing is reached", uiwidget: UIWidgets.LocaleEditBox)]
10 //protected LocalizedString m_sInvalidMaxHealingReached;
11
12 //[Attribute("loc Seek medical base (Disabled)", desc: "Character cannot heal more as max healing is reached for healing with field service (Ambulance).", uiwidget: UIWidgets.LocaleEditBox)]
13 //protected LocalizedString m_sInvalidMaxHealingReachedField;
14
15 [Attribute("#AR-SupportStation_Heal_ActionInvalid_Needs_SupportStation_Emergency", desc: "Character cannot heal more as max healing is reached for healing with emergency heal (No medical services in the area)", uiwidget: UIWidgets.LocaleEditBox)]
17
18 [Attribute(ECharacterHitZoneGroup.VIRTUAL.ToString(), UIWidgets.ComboBox, "Which hitzone group will be healed, VIRTUAL means all hitzones are healed", enumType:ECharacterHitZoneGroup)]
20
21 [Attribute("0", desc: "If this heal action will also heal the blood hitzone")]
22 protected bool m_bHealBloodHitzone;
23
25
26 //------------------------------------------------------------------------------------------------
28 {
29 return ESupportStationType.HEAL;
30 }
31
32 //------------------------------------------------------------------------------------------------
37
38 //------------------------------------------------------------------------------------------------
39 protected override bool RequiresGadget()
40 {
41 return true;
42 }
43
44 //------------------------------------------------------------------------------------------------
45 protected override int GetActionDecimalCount()
46 {
47 return 0;
48 }
49
50 //------------------------------------------------------------------------------------------------
52 {
53 //~ Entity is undamaged
54 if (reasonInvalid == ESupportStationReasonInvalid.HEAL_ENTITY_UNDAMAGED)
55 return m_sInvalidDamaged;
56 else if (reasonInvalid == ESupportStationReasonInvalid.HEAL_CHARACTER_IS_BLEEDING)
58 //else if (reasonInvalid == ESupportStationReasonInvalid.HEAL_MAX_HEALABLE_HEALTH_REACHED)
59 // return m_sInvalidMaxHealingReached;
60 //else if (reasonInvalid == ESupportStationReasonInvalid.HEAL_MAX_HEALABLE_HEALTH_REACHED_FIELD)
61 // return m_sInvalidMaxHealingReachedField;
62 else if (reasonInvalid == ESupportStationReasonInvalid.HEAL_MAX_HEALABLE_HEALTH_REACHED_EMERGENCY)
64
65 return super.GetInvalidPerformReasonString(reasonInvalid);
66 }
67
68 //------------------------------------------------------------------------------------------------
69 override bool CanBeShownScript(IEntity user)
70 {
72 return false;
73
74 foreach (HitZone hitzone : m_aHitZonesToHeal)
75 {
76 //~ Has a hitzone that is damaged so show
77 if (hitzone.GetHealthScaled() != 1)
78 return super.CanBeShownScript(user);
79 }
80
81 //~ Not damaged
82 return false;
83 }
84
85 //------------------------------------------------------------------------------------------------
86 override bool CanBePerformedScript(IEntity user)
87 {
89 if (!charDamageManager)
90 return super.CanBePerformedScript(user);
91
92 //~ Can heal blood hitzone but somewhere the character is bleeding. Note: m_BloodHitZone will be null if m_bHealBloodHitzone is false
93 if (m_BloodHitZone && charDamageManager.IsBleeding())
94 {
95 SetCanPerform(false, ESupportStationReasonInvalid.HEAL_CHARACTER_IS_BLEEDING);
96 return false;
97 }
98
99 //~ Check if the character is bleeding at the hitzones this action heals
100 foreach (HitZone hitZone : m_aHitZonesToHeal)
101 {
102 SCR_RegeneratingHitZone regenHitZone = SCR_RegeneratingHitZone.Cast(hitZone);
103 if (!regenHitZone)
104 continue;
105
106 if (regenHitZone.GetHitZoneDamageOverTime(EDamageType.BLEEDING) > 0)
107 {
108 SetCanPerform(false, ESupportStationReasonInvalid.HEAL_CHARACTER_IS_BLEEDING);
109 return false;
110 }
111 }
112
113 return super.CanBePerformedScript(user);
114 }
115
116 //------------------------------------------------------------------------------------------------
122
123 //------------------------------------------------------------------------------------------------
124 override bool IsStabilizedReason()
125 {
126 return m_eCannotPerformReason == ESupportStationReasonInvalid.HEAL_MAX_HEALABLE_HEALTH_REACHED_EMERGENCY;
127 }
128
129 //------------------------------------------------------------------------------------------------
132 {
133 int healthState = m_DamageIntensityHolder.GetValidIntensityType(m_aHitZonesToHeal);
134
135 if (healthState == SCR_EDamageIntensityType.NO_DAMAGE)
137
138 if (IsInProgress())
140
141 if (IsStabilizedReason())
143
144 if (healthState < SCR_EDamageIntensityType.HIGH)
146
148 }
149
150 //------------------------------------------------------------------------------------------------
151 protected override void SetHitZonesToHeal()
152 {
153 m_aHitZonesToHeal.Clear();
154
155 //~ If it should heal the blood hitzone then set reference to it
157 {
159 if (charDamageManager)
160 m_BloodHitZone = charDamageManager.GetBloodHitZone();
161 }
162
163 //~ Virtual gets all hitzones
165 {
166 super.SetHitZonesToHeal();
167 return;
168 }
169
170 //~ Get specific hitzone group
172 }
173}
ESupportStationType
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
proto external bool IsInProgress()
Returns true while continuous or timed action is being used.
void SetCanPerform(bool canPerform, ESupportStationReasonInvalid reasonInvalid)
ESupportStationReasonInvalid m_eCannotPerformReason
bool IsBleeding()
the official and globally used way of checking if bleeding tests for any PERSISTENT damage effects of...
override LocalizedString GetInvalidPerformReasonString(ESupportStationReasonInvalid reasonInvalid)
override bool CanBeShownScript(IEntity user)
HitZone GetBloodHitZoneToHeal()
return Return the Blood hitzone to heal if any is set
override SCR_ENearbyInteractionContextColors GetHealthStatus()
return the Health code color for nearby interactions
override bool CanBePerformedScript(IEntity user)
override ESupportStationType GetSupportStationType()
float GetHitZoneDamageOverTime(EDamageType targetDamageType)
Get current total damage per second of this hitZone.
SCR_FieldOfViewSettings Attribute
EDamageType
Definition EDamageType.c:13