Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_VehicleGearCondition.c
Go to the documentation of this file.
9
12class SCR_VehicleGearCondition : SCR_AvailableActionCondition
13{
14 [Attribute(defvalue: SCR_Enum.GetDefault(EVehicleGearboxGear.FORWARD), uiwidget: UIWidgets.ComboBox, enums: ParamEnumArray.FromEnum(EVehicleGearboxGear))]
15 protected EVehicleGearboxGear m_eVehicleGearboxGear;
16
17 //------------------------------------------------------------------------------------------------
20 override bool IsAvailable(notnull SCR_AvailableActionsConditionData data)
21 {
22 CarControllerComponent controller = CarControllerComponent.Cast(data.GetCurrentVehicleController());
23 if (!controller)
24 return false;
25
26 VehicleWheeledSimulation simulation = controller.GetSimulation();
27 if (!simulation)
28 return false;
29
30 int currentGear = simulation.GetGear();
31 int gearsCount = simulation.GearboxGearsCount();
32 int neutralGear = gearsCount - simulation.GearboxForwardGearsCount() - 1;
33
34 bool result;
35 if (m_eVehicleGearboxGear == EVehicleGearboxGear.REVERSE)
36 result = currentGear < neutralGear;
37 else if (m_eVehicleGearboxGear == EVehicleGearboxGear.NEUTRAL)
38 result = currentGear == neutralGear;
39 else if (m_eVehicleGearboxGear == EVehicleGearboxGear.FORWARD)
40 result = currentGear > neutralGear;
41 else if (m_eVehicleGearboxGear == EVehicleGearboxGear.FIRST)
42 result = currentGear == neutralGear + 1;
43 else if (m_eVehicleGearboxGear == EVehicleGearboxGear.LAST)
44 result = currentGear == gearsCount - 1;
45
46 return GetReturnResult(result);
47 }
48}
@ NEUTRAL
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
enum SCR_EAICombatMoveRequestType FORWARD
SCR_AIGroupInfoComponentClass LAST
Get all prefabs that have the spawner data
A single available action condition representation.
bool IsAvailable(notnull SCR_AvailableActionsConditionData data)
SCR_FieldOfViewSettings Attribute