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")]
21class 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);
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.GetSupplyAmountAction(actionOwner, actionUser, action);
75 if (!characterDamageManager)
76 return super.GetSupplyAmountAction(actionOwner, actionUser, action);
81 if (hitZones.Count() != 1 || hitZones[0] != bloodHitZone)
82 return super.GetSupplyAmountAction(actionOwner, actionUser, action);
85 float bloodHealCost = (damageToHeal / m_iBloodHealedEachExecute) * m_iSupplyCostBloodHealed;
94 array<HitZone> hitZones = {};
96 float damageToHeal =
GetDamageOrStateToHeal(actionOwner, actionUser, damageHealAction, activeDoT, hitZones);
99 super.OnExecutedServer(actionOwner, actionUser, action);
105 if (!characterDamageManager)
107 super.OnExecutedServer(actionOwner, actionUser, action);
113 if (hitZones.Count() != 1 || hitZones[0] != bloodHitZone)
115 super.OnExecutedServer(actionOwner, actionUser, action);
128 characterDamageManager.HealHitZones(damageToHeal,
true, m_fMaxBloodScaled, hitZones);
132 if (bloodHitZone.GetHealthScaled() < m_fMaxBloodScaled)
134 else if (m_fMaxBloodScaled < 1 && bloodHitZone.GetHealthScaled() == m_fMaxBloodScaled)
142 FindEntityIds(actionOwner, actionUser, ownerId, userId, playerId);
152 if (!actionOwner || !actionUser)
159 bool isBloodHealState =
false;
169 isBloodHealState =
true;
175 isBloodHealState =
true;
181 isBloodHealState =
true;
192 if (!isBloodHealState)
194 super.OnExecuteDamageSystem(actionOwner, actionUser, healState, action, healthScaled);
213 if (!userEditableEntity)
218 SCR_PossessingManagerComponent possesionManager = SCR_PossessingManagerComponent.GetInstance();
219 if (possesionManager)
221 ownerPlayerID = possesionManager.GetPlayerIdFromControlledEntity(actionOwner);
227 if (ownerEditableEntity)
232 if (ownerPlayerID <= 0)
248 SCR_NotificationsComponent.SendLocal(
ENotification.SUPPORTSTATION_HEALED_BY_OTHER_UPDATE, userRplId, notificationHitZoneGroup, healthScaled * 1000);
254 SCR_NotificationsComponent.SendLocal(
ENotification.SUPPORTSTATION_HEALED_BY_OTHER_DONE_NOT_FULL, userRplId, notificationHitZoneGroup, healthScaled * 1000);
260 SCR_NotificationsComponent.SendLocal(
ENotification.SUPPORTSTATION_HEALED_BY_OTHER_DONE, userRplId, notificationHitZoneGroup, 1);
enum EAIGroupCombatMode ComponentEditorProps(category:"GameScripted/AI", description:"Component for utility AI system for groups")
SCR_EDamageSupportStationHealState
override int GetSupplyAmountAction(IEntity actionOwner, IEntity actionUser, SCR_BaseUseSupportStationAction action)
float GetDamageOrStateToHeal(IEntity actionOwner, IEntity actionUser, notnull SCR_BaseDamageHealSupportStationAction action, out EDamageType activeDoT, out notnull array< HitZone > hitZones)
void OnExecuteDamageSystemBroadcast(RplId ownerId, RplId userId, SCR_EDamageSupportStationHealState healState, int actionId, float healthScaled)
void OnExecuteDamageSystem(IEntity actionOwner, IEntity actionUser, SCR_EDamageSupportStationHealState healState, SCR_BaseDamageHealSupportStationAction action, float healthScaled)
void SendDamageSupportStationNotification(IEntity actionOwner, IEntity actionUser, SCR_BaseUseSupportStationAction action, SCR_EDamageSupportStationHealState healState, float healthScaled)
override void OnExecutedServer(notnull IEntity actionOwner, notnull IEntity actionUser, notnull SCR_BaseUseSupportStationAction action)
bool GetSendNotificationOnUse()
bool AreSuppliesEnabled()
void PlayCharacterVoiceEvent(IEntity character)
ESupportStationType GetSupportStationType()
int m_iBaseSupplyCostOnUse
bool OnConsumeSuppliesServer(int amount)
void FindEntityIds(IEntity owner, IEntity user, out RplId ownerId, out RplId userId, out int playerId)
void OnSuccessfullyExecuted(IEntity actionOwner, IEntity actionUser, SCR_BaseUseSupportStationAction action)
void PlaySoundEffect(SCR_AudioSourceConfiguration audioConfig, notnull IEntity soundOwner, SCR_BaseUseSupportStationAction action)
SCR_AudioSourceConfiguration GetOnUseAudioConfig()
SCR_CharacterSoundComponentClass GetComponentData()
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
proto external Managed FindComponent(typename typeName)
Replication item identifier.
Allows healing of action owner (not user).
SCR_DamageManagerComponent GetActionDamageManager()
SCR_AudioSourceConfiguration CreateSoundAudioConfig(string soundEventName)
SCR_CharacterBloodHitZone GetBloodHitZone()
HitZone GetBloodHitZoneToHeal()
return Return the Blood hitzone to heal if any is set
ECharacterHitZoneGroup GetHitZoneGroup()
SCR_AudioSourceConfiguration GetOnHealBloodUpdateAudioConfig()
string m_sOnHealBloodUpdateSoundEffectEventName
ref SCR_AudioSourceConfiguration m_OnHealBloodUpdateAudioSourceConfiguration
static int GetLocalPlayerId()
Returns either a valid ID of local player or 0.
IEntity GetOwner()
Owner entity of the fuel tank.
SCR_FieldOfViewSettings Attribute