Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_VehicleDamageStateCondition.c
Go to the documentation of this file.
1 //------------------------------------------------------------------------------------------------
2 
5 {
6  [Attribute("1", UIWidgets.ComboBox, "Compared value of vehicle damage state", "", ParamEnumArray.FromEnum(EDamageState) )]
7  private EDamageState m_eValue;
8 
9  //------------------------------------------------------------------------------------------------
10  override bool IsAvailable(SCR_AvailableActionsConditionData data)
11  {
12  if (!data)
13  return false;
14 
15  IEntity vehicle = data.GetCurrentVehicle();
16  if (!vehicle)
17  return false;
18 
19  DamageManagerComponent damageManager = DamageManagerComponent.Cast(vehicle.FindComponent(DamageManagerComponent));
20  if (!damageManager)
21  return false;
22 
23  auto result = (damageManager.GetState() == m_eValue);
24 
25  return GetReturnResult(result);
26  }
27 };
SCR_AvailableActionsConditionData
Definition: SCR_AvailableActionsConditionData.c:5
EDamageState
EDamageState
Definition: EDamageState.c:12
SCR_AvailableActionCondition
A single available action condition representation.
Definition: SCR_AvailableActionsCondition.c:3
Attribute
typedef Attribute
Post-process effect of scripted camera.
data
Get all prefabs that have the spawner data
Definition: SCR_EntityCatalogManagerComponent.c:305
DamageManagerComponent
Definition: DamageManagerComponent.c:12
BaseContainerProps
SCR_VehicleDamageStateCondition BaseContainerProps
SCR_VehicleDamageStateCondition
Definition: SCR_VehicleDamageStateCondition.c:4