Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_BaseDamageHealSupportStationAction.c
Go to the documentation of this file.
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.GetAllHitZones(m_aHitZonesToHeal);
48 
49  if (m_aHitZonesToHeal.Count() > 1)
50  {
51  HitZone defaultHitZone = m_DamageManagerComponent.GetDefaultHitZone();
52 
53  //~ Move default hitZone to end
54  if (defaultHitZone)
55  {
56  int defaultHitZoneIndex = m_aHitZonesToHeal.Find(defaultHitZone);
57  if (m_aHitZonesToHeal.IsIndexValid(defaultHitZoneIndex))
58  {
59  m_aHitZonesToHeal.RemoveOrdered(defaultHitZoneIndex);
60  m_aHitZonesToHeal.InsertAt(defaultHitZone, m_aHitZonesToHeal.Count() -1);
61  }
62  }
63  }
64  }
65 
66  //------------------------------------------------------------------------------------------------
67  SCR_DamageManagerComponent GetActionDamageManager()
68  {
70  }
71 
72  //------------------------------------------------------------------------------------------------
73  protected override string GetActionStringParam()
74  {
75  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))
76  return string.Empty;
77 
78  SCR_UIName uiInfo = m_DamageIntensityHolder.GetValidIntensityUIInfo(m_aHitZonesToHeal);
79  if (uiInfo)
80  return uiInfo.GetName();
81 
82  return string.Empty;
83  }
84 }
HitZone
Definition: HitZone.c:12
SCR_UIName
Definition: SCR_UIName.c:5
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition: SCR_RespawnBriefingComponent.c:17
ESupportStationReasonInvalid
ESupportStationReasonInvalid
Definition: ESupportStationReasonInvalid.c:3
Attribute
typedef Attribute
Post-process effect of scripted camera.
m_DamageManagerComponent
private DamageManagerComponent m_DamageManagerComponent
Definition: SpectateTargetComponent.c:11
SCR_BaseDamageHealSupportStationAction
Allows healing of action owner (not user)
Definition: SCR_BaseDamageHealSupportStationAction.c:2
SCR_BaseUseSupportStationAction
Definition: SCR_BaseUseSupportStationAction.c:1