Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_SetFireVehicleContextAction.c
Go to the documentation of this file.
1 //------------------------------------------------------------------------------------------------
4 {
5  [Attribute(SCR_Enum.GetDefault(EFireState.BURNING), uiwidget: UIWidgets.ComboBox, enums: ParamEnumArray.FromEnum(EFireState))]
6  private EFireState m_eTargetFireState;
7 
8  [Attribute(defvalue: "-1")]
9  private float m_fTargetFireStateWeight;
10 
11  //------------------------------------------------------------------------------------------------
12  override bool CanBeShown(SCR_EditableEntityComponent selectedEntity, vector cursorWorldPosition, int flags)
13  {
14  return selectedEntity.GetEntityType() == EEditableEntityType.VEHICLE;
15  }
16 
17  //------------------------------------------------------------------------------------------------
18  override bool CanBePerformed(SCR_EditableEntityComponent selectedEntity, vector cursorWorldPosition, int flags)
19  {
20  DamageManagerComponent damageManager = DamageManagerComponent.Cast(selectedEntity.GetOwner().FindComponent(DamageManagerComponent));
21  if (!damageManager)
22  return false;
23 
24  if (damageManager.GetState() == EDamageState.DESTROYED)
25  return false;
26 
27  SCR_FlammableHitZone flammableHitZone = SCR_FlammableHitZone.Cast(damageManager.GetDefaultHitZone());
28  if (!flammableHitZone)
29  return false;
30 
31  if (m_eTargetFireState == EFireState.NONE)
32  return flammableHitZone.GetFireState() != EFireState.NONE;
33  else
34  return flammableHitZone.GetFireState() == EFireState.NONE;
35  }
36 
37  //------------------------------------------------------------------------------------------------
38  override void Perform(SCR_EditableEntityComponent selectedEntity, vector cursorWorldPosition)
39  {
40  DamageManagerComponent damageManager = DamageManagerComponent.Cast(selectedEntity.GetOwner().FindComponent(DamageManagerComponent));
41  if (!damageManager)
42  return;
43 
44  if (damageManager.GetState() == EDamageState.DESTROYED)
45  return;
46 
47  SCR_FlammableHitZone flammableHitZone = SCR_FlammableHitZone.Cast(damageManager.GetDefaultHitZone());
48  if (!flammableHitZone)
49  return;
50 
51  flammableHitZone.SetFireState(m_eTargetFireState, m_fTargetFireStateWeight);
52  flammableHitZone.LockFireRate();
53  }
54 };
SCR_Enum
Definition: SCR_Enum.c:1
EDamageState
EDamageState
Definition: EDamageState.c:12
Attribute
typedef Attribute
Post-process effect of scripted camera.
EEditableEntityType
EEditableEntityType
Defines type of SCR_EditableEntityComponent. Assigned automatically based on IEntity inheritance.
Definition: EEditableEntityType.c:5
SCR_SetFireVehicleContextAction
Definition: SCR_SetFireVehicleContextAction.c:3
SCR_EditableEntityComponent
Definition: SCR_EditableEntityComponent.c:13
EFireState
EFireState
Definition: SCR_FlammableHitZone.c:1
SCR_SelectedEntitiesContextAction
Definition: SCR_SelectedEntitiesContextAction.c:10
SCR_BaseContainerCustomTitleUIInfo
void SCR_BaseContainerCustomTitleUIInfo(string propertyName, string format="%1")
Definition: Attributes.c:788
DamageManagerComponent
Definition: DamageManagerComponent.c:12
BaseContainerProps
SCR_AIGoalReaction_Follow BaseContainerProps
Handles insects that are supposed to be spawned around selected prefabs defined in prefab names array...
Definition: SCR_AIGoalReaction.c:468