5class SCR_RepairRequestedTaskEntity : SCR_BaseRequestedTaskEntity
54 SCR_NotificationsComponent.SendLocal(
ENotification.GROUP_TASK_REPAIR_ENTERED_AREA);
59 SCR_NotificationsComponent.SendLocal(
ENotification.GROUP_TASK_REPAIR_LEAVED_AREA);
90 bool loaded = super.RplLoad(reader);
101 SCR_ChimeraCharacter character;
102 CharacterControllerComponent charControl;
104 if (!assigneePlayerIDs)
111 foreach (
int playerId : assigneePlayerIDs)
113 character = SCR_ChimeraCharacter.Cast(pManager.GetPlayerControlledEntity(playerId));
117 charControl = character.GetCharacterController();
118 if (!charControl || charControl.IsDead())
148 if (!action || !supportStation)
152 if (!repairedVehicle)
156 int playerId =
GetGame().GetPlayerManager().GetPlayerIdFromControlledEntity(actionUser);
166 Vehicle vehicleWithRepairBox =
Vehicle.Cast(supportStation.GetOwner().GetParent());
167 if (!vehicleWithRepairBox)
169 SCR_NotificationsComponent.SendToPlayer(playerId,
ENotification.GROUP_TASK_REPAIR_TRUCK_IS_NOT_IN_RANGE);
173 SCR_EditableVehicleComponent editableVehicleWithRepairBox = SCR_EditableVehicleComponent.Cast(vehicleWithRepairBox.FindComponent(SCR_EditableVehicleComponent));
174 if (!editableVehicleWithRepairBox)
176 SCR_NotificationsComponent.SendToPlayer(playerId,
ENotification.GROUP_TASK_REPAIR_TRUCK_IS_NOT_IN_RANGE);
184 SCR_NotificationsComponent.SendToPlayer(playerId,
ENotification.GROUP_TASK_REPAIR_TRUCK_IS_NOT_IN_RANGE);
198 SCR_XPHandlerComponent comp = SCR_XPHandlerComponent.Cast(
GetGame().
GetGameMode().FindComponent(SCR_XPHandlerComponent));
204 if (!assigneePlayerIDs)
207 foreach (
int playerID : assigneePlayerIDs)
209 comp.AwardXP(playerID,
SCR_EXPRewards.REPAIR_TASK_COMPLETED, 1.0,
false);
219 super.SetTaskState(state);
225 SCR_DamageManagerComponent damageComponent = SCR_DamageManagerComponent.GetDamageManager(actionTarget);
226 if (!damageComponent)
229 HitZone hitZone = damageComponent.GetDefaultHitZone();
230 return hitZone.GetHealthScaled() == 1;
236 SCR_DamageManagerComponent damageComponent = SCR_DamageManagerComponent.GetDamageManager(vehicle);
237 if (!damageComponent)
241 array<HitZone> hitZones = {};
242 damageComponent.GetAllHitZonesInHierarchy(hitZones);
243 SCR_FlammableHitZone flammableHitZone;
244 foreach (
HitZone hitZone : hitZones)
246 if (hitZone && hitZone.GetDamageState() !=
EDamageState.UNDAMAGED)
250 flammableHitZone = SCR_FlammableHitZone.Cast(hitZone);
251 if (flammableHitZone && damageComponent.IsOnFire(flammableHitZone))
261 super.EOnInit(owner);
268 if (!
System.IsConsoleApp())
283 if (supportStationManager)
297 if (supportStationManager)
ArmaReforgerScripted GetGame()
override bool RplLoad(ScriptBitReader reader)
override void SetTaskState(SCR_ETaskState state)
SCR_AttackTaskEntityClass PERIODICAL_CHECK_INTERVAL
SCR_BaseGameMode GetGameMode()
RplComponent m_RplComponent
void OnTaskAssigneeAdded(SCR_Task task, SCR_TaskExecutor executor, int requesterID)
void OnTaskAssigneeRemoved(SCR_Task task, SCR_TaskExecutor executor, int requesterID)
bool m_bIsAreaCheckRunning
bool m_bWasLocalPlayerInArea
bool IsVehiclePartFullyRepaired(IEntity actionTarget)
void StartCheckingDistanceToArea()
const int DISTANCE_CHECK_INTERVAL
WorldTimestamp m_AutoCancelTimestamp
void CheckDistanceToArea()
void StopCheckingDistanceToArea()
void ~SCR_RepairRequestedTaskEntity()
bool IsVehicleFullyRepaired(IEntity vehicle)
array< int > GetTaskAssigneePlayerIDs()
void SCR_Task(IEntitySource src, IEntity parent)
bool IsTaskAssignedTo(SCR_TaskExecutor executor, out SCR_TaskExecutor match=null)
SCR_TaskSystem m_TaskSystem
void OnVehicleRepaired(SCR_BaseSupportStationComponent supportStation, ESupportStationType supportStationType, IEntity actionTarget, IEntity actionUser, SCR_BaseUseSupportStationAction action)
proto external Managed FindComponent(typename typeName)
proto external vector GetOrigin()
proto external IEntity GetRootParent()
bool HasEntityLabel(EEditableEntityLabel label)
static int GetLocalPlayerId()
Returns either a valid ID of local player or 0.
static IEntity GetLocalControlledEntity()
ScriptInvokerBase< SupportStation_OnSupportStationExecuted > GetOnSupportStationExecutedSuccessfully()
static SCR_SupportStationManagerComponent GetInstance()
enum EPhysicsLayerPresets Vehicle
override void EOnInit(IEntity owner)
SCR_FieldOfViewSettings Attribute