4 [
Attribute(
ENotification.SUPPORTSTATION_REPAIRED_BY_OTHER_DONE_NOT_FULL.ToString(),
desc:
"Leave UNKNOWN to not send notification when healing is done but vehicle is not full heal but not done (for players in vehicle that is being repaired)", uiwidget: UIWidgets.SearchComboBox, enums: ParamEnumArray.FromEnum(
ENotification),
category:
"Heal/Repair Support Station")]
5 protected ENotification m_eHealDoneNotFullNotificationInVehicle;
7 [
Attribute(
"SOUND_VEHICLE_EXTINGUISH_PARTIAL",
desc:
"Sound effect played when Extinguish is updated and not done. Broadcast to players. Leave empty if no sfx",
category:
"Heal/Repair Support Station")]
8 protected string m_sOnExtinguishUpdateSoundEffectEventName;
10 [
Attribute(
"SOUND_VEHICLE_EXTINGUISH_DONE",
desc:
"Sound effect played when Extinguish is done. Broadcast to players. Leave empty if no sfx",
category:
"Heal/Repair Support Station")]
11 protected string m_sOnExtinguishDoneSoundEffectEventName;
13 protected ref SCR_AudioSourceConfiguration m_OnExtinguishUpdateAudioSourceConfiguration;
14 protected ref SCR_AudioSourceConfiguration m_OnExtinguishDoneAudioSourceConfiguration;
25 SCR_AudioSourceConfiguration GetOnExtinguishUpdateAudioConfig()
36 SCR_AudioSourceConfiguration GetOnExtinguishDoneAudioConfig()
46 class SCR_RepairSupportStationComponent : SCR_BaseDamageHealSupportStationComponent
48 [
Attribute(
"40",
desc:
"Only valid if m_aDoTTypesHealed includes FIRE, Each Execute the fire rate is reduced with a set amount. If fire rate is 0 it will be extinguished",
category:
"Heal/Repair Support Station")]
49 protected float m_fFireRateReductionEachExecute;
51 [
Attribute(
"1",
desc:
"Only valid if m_aDoTTypesHealed includes FIRE. The supply cost each time fire rate is reduced (no matter the reduction amount as fire rate is not replicated)",
category:
"Heal/Repair Support Station")]
54 [
Attribute(
"0.75",
desc:
"Heavy smoke (which will never lead to fire) is removed when vehicle rough health is this or higher",
category:
"Heal/Repair Support Station")]
57 [
Attribute(
"0.95",
desc:
"Light smoke (which will never lead to fire) is removed when vehicle rough health is this or higher",
category:
"Heal/Repair Support Station")]
70 return super.GetDamageOrStateToHeal(actionOwner, actionUser, action, activeDoT, hitZones);
73 action.GetHitZonesToHeal(hitZones);
75 float fireRateHealAmount;
77 SCR_FlammableHitZone flammableHitZone;
78 foreach (
HitZone hitZone : hitZones)
80 flammableHitZone = SCR_FlammableHitZone.Cast(hitZone);
81 if (!flammableHitZone)
84 if (flammableHitZone.GetFireState() !=
EFireState.BURNING)
89 fireRateHealAmount += flammableHitZone.GetFireRate();
91 if (fireRateHealAmount >= m_fFireRateReductionEachExecute)
92 return m_fFireRateReductionEachExecute;
95 if (activeDoT ==
EDamageType.FIRE && fireRateHealAmount > 0)
96 return fireRateHealAmount;
99 return super.GetDamageOrStateToHeal(actionOwner, actionUser, action, activeDoT, hitZones);
109 return super.GetSupplyCostAction(actionOwner, actionUser, action);
112 array<HitZone> hitZones = {};
121 return super.GetSupplyCostAction(actionOwner, actionUser, action);
128 array<HitZone> hitZones = {};
141 SCR_FlammableHitZone flammableHitZone;
143 float removeFireAmount = m_fFireRateReductionEachExecute;
145 bool stillBurning =
false;
147 foreach (
HitZone hitZone : hitZones)
149 flammableHitZone = SCR_FlammableHitZone.Cast(hitZone);
150 if (!flammableHitZone)
154 fireRate = flammableHitZone.GetFireRate();
159 if (removeFireAmount <= 0)
165 if (fireRate > removeFireAmount)
168 flammableHitZone.SetFireRate(fireRate - removeFireAmount);
173 flammableHitZone.SetFireRate(0);
174 removeFireAmount -= fireRate;
178 if (flammableHitZone.GetFireRate() <= 0 && flammableHitZone.GetFireState() ==
EFireState.SMOKING_IGNITING)
179 flammableHitZone.SetFireState(
EFireState.SMOKING_HEAVY);
193 FindEntityIds(actionOwner, actionUser, ownerId, userId, playerId);
200 super.OnExecutedServer(actionOwner, actionUser, action);
216 bool isFireStateHealed =
false;
226 PlaySoundEffect(classData.GetOnExtinguishUpdateAudioConfig(), actionOwner, action);
227 isFireStateHealed =
true;
232 PlaySoundEffect(classData.GetOnExtinguishDoneAudioConfig(), actionOwner, action);
233 isFireStateHealed =
true;
240 if (!isFireStateHealed)
242 super.OnExecuteDamageSystem(actionOwner, actionUser, healState, action, healthScaled);
261 if (!userEditableEntity)
272 inVehicleNotification =
ENotification.SUPPORTSTATION_REPAIRED_BY_OTHER_UPDATE;
281 inVehicleNotification = classData.GetHealDoneNotFullInVehicleNotification();
286 inVehicleNotification =
ENotification.SUPPORTSTATION_REPAIRED_BY_OTHER_DONE;
291 inVehicleNotification =
ENotification.SUPPORTSTATION_FIRE_EXTINGUISHED_VEHICLE_BY_OTHER_UPDATE;
296 inVehicleNotification =
ENotification.SUPPORTSTATION_FIRE_EXTINGUISHED_VEHICLE_BY_OTHER_DONE;
305 RplId userRplId = Replication.FindId(userEditableEntity);
308 array<int> playersInVehicle = {};
315 if (healState !=
ENotification.SUPPORTSTATION_FIRE_EXTINGUISHED_VEHICLE_BY_OTHER_UPDATE && healState !=
ENotification.SUPPORTSTATION_FIRE_EXTINGUISHED_VEHICLE_BY_OTHER_DONE)
320 array<EVehicleHitZoneGroup> hitZoneGroup = {};
321 repairAction.GetHitZoneGroups(hitZoneGroup);
323 if (!hitZoneGroup.IsEmpty())
324 notificationHitZoneGroup = hitZoneGroup[0];
329 SCR_NotificationsComponent.SendLocal(inVehicleNotification, userRplId, notificationHitZoneGroup, healthScaled * 1000);
336 bool allHitZonesMaxHealth;
337 float healthPercentage;
340 SCR_SupportStationManagerComponent.GetCombinedHitZonesStateForDamageSupportStation(action.GetActionDamageManager(), hitZones, GetMaxHealScaled(), healthPercentage, allHitZonesMaxHealth);
341 SCR_FlammableHitZone flammableHitZone;
344 foreach (
HitZone hitZone : hitZones)
346 flammableHitZone = SCR_FlammableHitZone.Cast(hitZone);
347 if (!flammableHitZone)
350 fireState = flammableHitZone.GetFireState();
353 flammableHitZone.SetFireState(
EFireState.NONE);
355 flammableHitZone.SetFireState(
EFireState.SMOKING_LIGHT);
356 else if (fireState ==
EFireState.SMOKING_IGNITING)
357 flammableHitZone.SetFireState(
EFireState.SMOKING_HEAVY);