Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_AIGroupVehicle.c
Go to the documentation of this file.
1
2class SCR_AIGroupVehicle : Managed
3{
4 protected IEntity m_Vehicle;
6
9 protected int m_iSubgroupHandleId;
10
11 //------------------------------------------------------------------------------------------------
12 void SCR_AIGroupVehicle(notnull SCR_AIVehicleUsageComponent vehicleUsageComp)
13 {
14 m_Vehicle = vehicleUsageComp.GetOwner();
15 m_VehicleUsageComp = vehicleUsageComp;
17
18 // find pilot & turret slots
19 SCR_BaseCompartmentManagerComponent compartmentMan = SCR_BaseCompartmentManagerComponent.Cast(m_Vehicle.FindComponent(SCR_BaseCompartmentManagerComponent));
20 if (!compartmentMan)
21 return;
22
23 array<BaseCompartmentSlot> compartmentSlots = {};
24 compartmentMan.GetCompartments(compartmentSlots);
25 foreach (BaseCompartmentSlot slot : compartmentSlots)
26 {
27 TurretCompartmentSlot turretComp = TurretCompartmentSlot.Cast(slot);
28 PilotCompartmentSlot pilotComp = PilotCompartmentSlot.Cast(slot);
29 if (turretComp)
30 {
31 m_TurretSlot = turretComp;
32 }
33 if (pilotComp)
34 {
35 m_DriverSlot = pilotComp;
36 }
37 }
38 }
39
40 //------------------------------------------------------------------------------------------------
42 {
43 return m_Vehicle;
44 }
45
46 //------------------------------------------------------------------------------------------------
51
52 //------------------------------------------------------------------------------------------------
53 bool HasWeapon()
54 {
55 return m_TurretSlot;
56 }
57
58 //------------------------------------------------------------------------------------------------
59 bool CanMove()
60 {
61 if (IsStatic())
62 return false;
63
64 if(SCR_AIVehicleUsability.VehicleCanMove(m_Vehicle) && !SCR_AIVehicleUsability.VehicleIsOnFire(m_Vehicle))
65 return true;
66
67 return false;
68 }
69
70 //------------------------------------------------------------------------------------------------
71 bool IsStatic()
72 {
73 return m_TurretSlot && !m_DriverSlot;
74 }
75
76 //------------------------------------------------------------------------------------------------
78 {
79 if (!m_DriverSlot)
80 return false;
81
82 IEntity driver = m_DriverSlot.GetOccupant();
83 return SCR_AIDamageHandling.IsConscious(driver);
84 }
85
86 //------------------------------------------------------------------------------------------------
88 {
89 if (!m_DriverSlot)
90 return null;
91 return m_DriverSlot.GetOccupant();
92 }
93
94 //------------------------------------------------------------------------------------------------
95 void SetSubgroupHandleId(int handleId = -1)
96 {
97 m_iSubgroupHandleId = handleId
98 }
99
100 //------------------------------------------------------------------------------------------------
102 {
103 return m_iSubgroupHandleId;
104 }
105};
TurretCompartmentSlot m_TurretSlot
SCR_AIVehicleUsageComponent m_VehicleUsageComp
void SCR_AIGroupVehicle(notnull SCR_AIVehicleUsageComponent vehicleUsageComp)
void SetSubgroupHandleId(int handleId=-1)
SCR_AIVehicleUsageComponent GetVehicleUsageComponent()
PilotCompartmentSlot m_DriverSlot