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")]
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")]
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")]
13 [
Attribute(defvalue:
"0",
desc:
"Amount of unflipping force that this support station provides when a player tries to unflip a vehicle near it",
params:
"0 inf 0.01")]
55class SCR_RepairSupportStationComponent : SCR_BaseDamageHealSupportStationComponent
57 [
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")]
58 protected float m_fFireRateReductionEachExecute;
60 [
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")]
76 return data.GetUnflippingPower();
85 return super.GetDamageOrStateToHeal(actionOwner, actionUser, action, activeDoT, hitZones);
88 action.GetHitZonesToHeal(hitZones);
89 SCR_DamageManagerComponent dmgManager = action.GetActionDamageManager();
93 float fireRateHealAmount;
95 SCR_FlammableHitZone flammableHitZone;
96 foreach (
HitZone hitZone : hitZones)
98 flammableHitZone = SCR_FlammableHitZone.Cast(hitZone);
99 if (!flammableHitZone)
102 if (!dmgManager.IsOnFire(flammableHitZone))
107 fireRateHealAmount +=
Math.Max(1, flammableHitZone.GetFireRate());
109 if (fireRateHealAmount >= m_fFireRateReductionEachExecute)
110 return m_fFireRateReductionEachExecute;
113 if (activeDoT ==
EDamageType.FIRE && fireRateHealAmount > 0)
114 return fireRateHealAmount;
117 return super.GetDamageOrStateToHeal(actionOwner, actionUser, action, activeDoT, hitZones);
127 return super.GetSupplyAmountAction(actionOwner, actionUser, action);
130 array<HitZone> hitZones = {};
139 return super.GetSupplyAmountAction(actionOwner, actionUser, action);
146 array<HitZone> hitZones = {};
159 SCR_FlammableHitZone flammableHitZone;
161 float removeFireAmount = m_fFireRateReductionEachExecute;
163 bool stillBurning =
false;
165 foreach (
HitZone hitZone : hitZones)
167 flammableHitZone = SCR_FlammableHitZone.Cast(hitZone);
168 if (!flammableHitZone)
172 fireRate = flammableHitZone.GetFireRate();
177 if (removeFireAmount <= 0)
183 if (fireRate > removeFireAmount)
186 flammableHitZone.SetFireRate(fireRate - removeFireAmount);
191 flammableHitZone.SetFireRate(0);
192 removeFireAmount -= fireRate;
196 if (flammableHitZone.GetFireRate() <= 0 && flammableHitZone.GetFireState() ==
SCR_EBurningState.SMOKING_IGNITING)
211 FindEntityIds(actionOwner, actionUser, ownerId, userId, playerId);
218 super.OnExecutedServer(actionOwner, actionUser, action);
231 bool isFireStateHealed =
false;
242 isFireStateHealed =
true;
248 isFireStateHealed =
true;
249 if (s_OnFireExtinguished)
250 s_OnFireExtinguished.Invoke(actionUser);
257 if (!isFireStateHealed)
259 super.OnExecuteDamageSystem(actionOwner, actionUser, healState, action, healthScaled);
278 if (!userEditableEntity)
288 inVehicleNotification =
ENotification.SUPPORTSTATION_REPAIRED_BY_OTHER_UPDATE;
302 inVehicleNotification =
ENotification.SUPPORTSTATION_REPAIRED_BY_OTHER_DONE;
307 inVehicleNotification =
ENotification.SUPPORTSTATION_FIRE_EXTINGUISHED_VEHICLE_BY_OTHER_UPDATE;
312 inVehicleNotification =
ENotification.SUPPORTSTATION_FIRE_EXTINGUISHED_VEHICLE_BY_OTHER_DONE;
324 array<int> playersInVehicle = {};
331 if (healState !=
ENotification.SUPPORTSTATION_FIRE_EXTINGUISHED_VEHICLE_BY_OTHER_UPDATE && healState !=
ENotification.SUPPORTSTATION_FIRE_EXTINGUISHED_VEHICLE_BY_OTHER_DONE)
336 array<EVehicleHitZoneGroup> hitZoneGroup = {};
339 if (!hitZoneGroup.IsEmpty())
340 notificationHitZoneGroup = hitZoneGroup[0];
345 SCR_NotificationsComponent.SendLocal(inVehicleNotification, userRplId, notificationHitZoneGroup, healthScaled * 1000);
354 if (!s_OnFireExtinguished)
357 return s_OnFireExtinguished;
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 GetPlayerIdsInVehicle(IEntity vehicle, out notnull array< int > playerIds)
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_CharacterSoundComponentClass GetComponentData()
Get all prefabs that have the spawner data
ref SCR_AudioSourceConfiguration m_OnExtinguishDoneAudioSourceConfiguration
float m_iSupplyCostPerFireRateReduction
float GetUnflippingPower()
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
ScriptInvokerBase< ScriptInvokerEntityMethod > ScriptInvokerEntity
proto external Managed FindComponent(typename typeName)
Replication item identifier.
Allows healing of action owner (not user).
SCR_AudioSourceConfiguration CreateSoundAudioConfig(string soundEventName)
static int GetLocalPlayerId()
Returns either a valid ID of local player or 0.
int GetHitZoneGroups(out notnull array< EVehicleHitZoneGroup > hitZoneGroup)
SCR_AudioSourceConfiguration GetOnExtinguishDoneAudioConfig()
ref SCR_AudioSourceConfiguration m_OnExtinguishDoneAudioSourceConfiguration
ENotification GetHealDoneNotFullInVehicleNotification()
SCR_AudioSourceConfiguration GetOnExtinguishUpdateAudioConfig()
float GetUnflippingPower()
ref SCR_AudioSourceConfiguration m_OnExtinguishUpdateAudioSourceConfiguration
ENotification m_eHealDoneNotFullNotificationInVehicle
string m_sOnExtinguishDoneSoundEffectEventName
string m_sOnExtinguishUpdateSoundEffectEventName
IEntity GetOwner()
Owner entity of the fuel tank.
SCR_FieldOfViewSettings Attribute