3 [
Attribute(
"#AR-SupportStation_Repair_ActionInvalid_NoDamage",
desc:
"Text shown on action if undamaged", uiwidget: UIWidgets.LocaleEditBox)]
6 [
Attribute(
"#AR-SupportStation_Repair_ActionInvalid_Needs_SupportStation_Field",
desc:
"Vehicle cannot be repaired any more as max healing is reached", uiwidget: UIWidgets.LocaleEditBox)]
9 [
Attribute(
"#AR-SupportStation_Repair_ActionInvalid_Needs_SupportStation_Emergency",
desc:
"Vehicle cannot be repaired any more as max healing is reached", uiwidget: UIWidgets.LocaleEditBox)]
12 [
Attribute(
"#AR-ActionInvalid_OnFire",
desc:
"Text shown on action if entity is on fire", uiwidget: UIWidgets.LocaleEditBox)]
15 [
Attribute(
"#AR-Editor_ContextAction_Extinguish_Name",
desc:
"Action name when entity is on fire. Only when hitzones are FlammableHitZones", uiwidget: UIWidgets.LocaleEditBox,
category:
"Heal/Repair Support Station")]
18 [
Attribute(uiwidget: UIWidgets.SearchComboBox,
desc:
"Which hitzone groups will be healed, Leave empty if all need to be healed. (VIRTUAL is invalid and will be skipped). The first entry will be used for notifications", enums: ParamEnumArray.FromEnum(
EVehicleHitZoneGroup))]
19 protected ref array<EVehicleHitZoneGroup> m_aHitZoneGroups;
21 [
Attribute(
desc:
"Used to get the group name of which is going to be repaired")]
24 [
Attribute(
desc:
"Any addition Hitzone ID. This is generic and used for example to get the correct fuel tank using it as an ID")]
25 protected ref array<int> m_aHitZoneAdditionalIDs;
27 [
Attribute(
"0",
desc:
"For some repair actions you want the system to know what it will be repairing, eg: Wheels, but the wheels have no hitzones with wheel hitzone group so just get all the hitzones on the entity. But the action and notifications still know they system is repairing the wheels")]
28 protected bool m_bAlwaysRepairAllHitZones;
30 [
Attribute(
"1",
desc:
"if true then the action will not be shown if the entity (or root parent entity) is on fire")]
31 protected bool m_bHideIfEntityOnFire;
33 protected SCR_DamageManagerComponent m_OnFireCheckDamageManager;
46 return m_sInvalidDamaged;
48 return m_sInvalidOnFire;
50 return m_sInvalidMaxHealingReached_Field;
52 return m_sInvalidMaxHealingReached_Emergency;
54 return super.GetInvalidPerformReasonString(reasonInvalid);
58 int GetHitZoneGroups(out notnull array<EVehicleHitZoneGroup> hitZoneGroup)
60 hitZoneGroup.Copy(m_aHitZoneGroups);
61 return hitZoneGroup.Count();
65 protected override bool RequiresGadget()
71 override bool CanBeShownScript(IEntity user)
76 return super.CanBeShownScript(user);
80 protected override bool CanShowDestroyed()
87 return super.CanShowDestroyed();
91 override bool CanBePerformedScript(IEntity user)
94 if (m_OnFireCheckDamageManager && !IsHitZoneOnFire() && m_OnFireCheckDamageManager.IsDamagedOverTime(
EDamageType.FIRE))
112 return super.CanBePerformedScript(user);
116 protected override void SetHitZonesToHeal()
119 if (m_aHitZoneGroups.IsEmpty() || m_bAlwaysRepairAllHitZones)
121 super.SetHitZonesToHeal();
125 m_aHitZonesToHeal.Clear();
128 if (!m_aHitZoneAdditionalIDs.IsEmpty() && m_aHitZoneGroups.Contains(
EVehicleHitZoneGroup.FUEL_TANKS))
133 array<HitZone> allHitZones = {};
137 foreach (
HitZone hitZone : allHitZones)
147 m_aHitZonesToHeal.Insert(hitZone);
149 if (!m_aHitZoneAdditionalIDs.Contains(fuelHitZone.GetFuelTankID()))
153 m_aHitZonesToHeal.Insert(hitZone);
169 protected bool IsHitZoneOnFire()
171 SCR_FlammableHitZone flammableHitZone;
172 array<HitZone> hitZones = {};
173 GetHitZonesToHeal(hitZones);
175 foreach (
HitZone hitZone : hitZones)
177 flammableHitZone = SCR_FlammableHitZone.Cast(hitZone);
178 if (!flammableHitZone)
181 if (flammableHitZone.GetFireState() ==
EFireState.BURNING)
189 protected override string GetActionStringParam()
192 if (IsHitZoneOnFire())
195 return super.GetActionStringParam();
199 override bool GetActionNameScript(out
string outName)
201 if (!m_HitZoneGroupNames)
202 return super.GetActionNameScript(outName);
205 if (IsHitZoneOnFire())
206 outName = m_sOnFireOverrideActionName;
212 if (outName.IsEmpty())
216 return super.GetActionNameScript(outName);
218 outName = uiInfo.GetName();
221 outName = WidgetManager.Translate(outName, m_HitZoneGroupNames.GetHitZoneGroupName(m_aHitZoneGroups[0]));
222 return super.GetActionNameScript(outName);
226 protected override void DelayedInit(IEntity owner)
231 super.DelayedInit(owner);
234 if (m_bHideIfEntityOnFire)
236 IEntity root = owner.GetRootParent();
239 if (root && Vehicle.Cast(root))
240 m_OnFireCheckDamageManager = SCR_DamageManagerComponent.GetDamageManager(root);