4 [
Attribute(
"SOUND_HEAL_SELF",
desc:
"Sound effect played when heal is updated and not done. Broadcast to players. Leave empty if no sfx",
category:
"Heal/Repair Support Station")]
5 protected string m_sOnHealBloodUpdateSoundEffectEventName;
7 protected ref SCR_AudioSourceConfiguration m_OnHealBloodUpdateAudioSourceConfiguration;
11 SCR_AudioSourceConfiguration GetOnHealBloodUpdateAudioConfig()
21 class SCR_HealSupportStationComponent : SCR_BaseDamageHealSupportStationComponent
23 [
Attribute(
"1000",
desc:
"Max blood amount healed each execute. If you hold the action it will heal each time the action ends",
category:
"Heal/Repair Support Station")]
24 protected float m_iBloodHealedEachExecute;
26 [
Attribute(
"100",
desc:
"Supply cost for ever 'm_iBloodHealedEachExecute' damage healed. If the left over blood amount is less then it will of course be cheaper with a min value of 1",
category:
"Heal/Repair Support Station")]
27 protected int m_iSupplyCostBloodHealed;
29 [
Attribute(
"1",
desc:
"The max blood scaled that this support station can heal. 1 == 100%",
params:
"0.01 1",
category:
"Heal/Repair Support Station")]
30 protected float m_fMaxBloodScaled;
41 float damageToHeal = super.GetDamageOrStateToHeal(actionOwner, actionUser, action, activeDoT, hitZones);
49 HitZone bloodHitZone = healAction.GetBloodHitZoneToHeal();
54 hitZones.Insert(bloodHitZone);
56 return Math.Clamp(action.GetActionDamageManager().GetHitZonesDamage(m_fMaxBloodScaled, hitZones), 0, m_iBloodHealedEachExecute);
67 array<HitZone> hitZones = {};
69 float damageToHeal =
GetDamageOrStateToHeal(actionOwner, actionUser, damageHealAction, activeDoT, hitZones);
71 return super.GetSupplyCostAction(actionOwner, actionUser, action);
75 if (!characterDamageManager)
76 return super.GetSupplyCostAction(actionOwner, actionUser, action);
78 HitZone bloodHitZone = characterDamageManager.GetBloodHitZone();
81 if (hitZones.Count() != 1 || hitZones[0] != bloodHitZone)
82 return super.GetSupplyCostAction(actionOwner, actionUser, action);
85 float bloodHealCost = (damageToHeal / m_iBloodHealedEachExecute) * m_iSupplyCostBloodHealed;
98 array<HitZone> hitZones = {};
100 float damageToHeal =
GetDamageOrStateToHeal(actionOwner, actionUser, damageHealAction, activeDoT, hitZones);
103 super.OnExecutedServer(actionOwner, actionUser, action);
109 if (!characterDamageManager)
111 super.OnExecutedServer(actionOwner, actionUser, action);
114 HitZone bloodHitZone = characterDamageManager.GetBloodHitZone();
117 if (hitZones.Count() != 1 || hitZones[0] != bloodHitZone)
119 super.OnExecutedServer(actionOwner, actionUser, action);
132 characterDamageManager.HealHitZones(damageToHeal,
true, m_fMaxBloodScaled, hitZones);
136 if (bloodHitZone.GetHealthScaled() < m_fMaxBloodScaled)
138 else if (m_fMaxBloodScaled < 1 && bloodHitZone.GetHealthScaled() == m_fMaxBloodScaled)
146 FindEntityIds(actionOwner, actionUser, ownerId, userId, playerId);
156 if (!actionOwner || !actionUser)
163 bool isBloodHealState =
false;
173 isBloodHealState =
true;
174 PlaySoundEffect(classData.GetOnHealBloodUpdateAudioConfig(), actionOwner, action);
179 isBloodHealState =
true;
185 isBloodHealState =
true;
196 if (!isBloodHealState)
198 super.OnExecuteDamageSystem(actionOwner, actionUser, healState, action, healthScaled);
217 if (!userEditableEntity)
222 SCR_PossessingManagerComponent possesionManager = SCR_PossessingManagerComponent.GetInstance();
223 if (possesionManager)
225 ownerPlayerID = possesionManager.GetPlayerIdFromControlledEntity(actionOwner);
231 if (ownerEditableEntity)
232 ownerPlayerID = ownerEditableEntity.GetPlayerID();
236 if (ownerPlayerID <= 0)
239 RplId userRplId = Replication.FindId(userEditableEntity);
244 notificationHitZoneGroup = healAction.GetHitZoneGroup();
252 SCR_NotificationsComponent.SendLocal(
ENotification.SUPPORTSTATION_HEALED_BY_OTHER_UPDATE, userRplId, notificationHitZoneGroup, healthScaled * 1000);
258 SCR_NotificationsComponent.SendLocal(
ENotification.SUPPORTSTATION_HEALED_BY_OTHER_DONE_NOT_FULL, userRplId, notificationHitZoneGroup, healthScaled * 1000);
264 SCR_NotificationsComponent.SendLocal(
ENotification.SUPPORTSTATION_HEALED_BY_OTHER_DONE, userRplId, notificationHitZoneGroup, 1);