Arma Reforger Explorer
1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Toggle main menu visibility
Loading...
Searching...
No Matches
SCR_AIGroupVehicle.c
Go to the documentation of this file.
1
2
class
SCR_AIGroupVehicle
: Managed
3
{
4
protected
IEntity
m_Vehicle
;
5
protected
SCR_AIVehicleUsageComponent
m_VehicleUsageComp
;
6
7
protected
TurretCompartmentSlot
m_TurretSlot
;
8
protected
PilotCompartmentSlot
m_DriverSlot
;
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;
16
m_iSubgroupHandleId
= -1;
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
//------------------------------------------------------------------------------------------------
41
IEntity
GetEntity
()
42
{
43
return
m_Vehicle
;
44
}
45
46
//------------------------------------------------------------------------------------------------
47
SCR_AIVehicleUsageComponent
GetVehicleUsageComponent
()
48
{
49
return
m_VehicleUsageComp
;
50
}
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
//------------------------------------------------------------------------------------------------
77
bool
DriverIsConscious
()
78
{
79
if
(!
m_DriverSlot
)
80
return
false
;
81
82
IEntity
driver =
m_DriverSlot
.GetOccupant();
83
return
SCR_AIDamageHandling.IsConscious(driver);
84
}
85
86
//------------------------------------------------------------------------------------------------
87
IEntity
GetDriver
()
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
//------------------------------------------------------------------------------------------------
101
int
GetSubgroupHandleId
()
102
{
103
return
m_iSubgroupHandleId
;
104
}
105
};
BaseCompartmentSlot
Definition
BaseCompartmentSlot.c:2
IEntity
Definition
IEntity.c:13
PilotCompartmentSlot
Definition
PilotCompartmentSlot.c:13
SCR_AIGroupVehicle::m_Vehicle
IEntity m_Vehicle
Definition
SCR_AIGroupVehicle.c:4
SCR_AIGroupVehicle::m_TurretSlot
TurretCompartmentSlot m_TurretSlot
Definition
SCR_AIGroupVehicle.c:7
SCR_AIGroupVehicle::m_iSubgroupHandleId
int m_iSubgroupHandleId
Definition
SCR_AIGroupVehicle.c:9
SCR_AIGroupVehicle::DriverIsConscious
bool DriverIsConscious()
Definition
SCR_AIGroupVehicle.c:77
SCR_AIGroupVehicle::CanMove
bool CanMove()
Definition
SCR_AIGroupVehicle.c:59
SCR_AIGroupVehicle::GetDriver
IEntity GetDriver()
Definition
SCR_AIGroupVehicle.c:87
SCR_AIGroupVehicle::HasWeapon
bool HasWeapon()
Definition
SCR_AIGroupVehicle.c:53
SCR_AIGroupVehicle::m_VehicleUsageComp
SCR_AIVehicleUsageComponent m_VehicleUsageComp
Definition
SCR_AIGroupVehicle.c:5
SCR_AIGroupVehicle::SCR_AIGroupVehicle
void SCR_AIGroupVehicle(notnull SCR_AIVehicleUsageComponent vehicleUsageComp)
Definition
SCR_AIGroupVehicle.c:12
SCR_AIGroupVehicle::GetEntity
IEntity GetEntity()
Definition
SCR_AIGroupVehicle.c:41
SCR_AIGroupVehicle::SetSubgroupHandleId
void SetSubgroupHandleId(int handleId=-1)
Definition
SCR_AIGroupVehicle.c:95
SCR_AIGroupVehicle::GetSubgroupHandleId
int GetSubgroupHandleId()
Definition
SCR_AIGroupVehicle.c:101
SCR_AIGroupVehicle::GetVehicleUsageComponent
SCR_AIVehicleUsageComponent GetVehicleUsageComponent()
Definition
SCR_AIGroupVehicle.c:47
SCR_AIGroupVehicle::m_DriverSlot
PilotCompartmentSlot m_DriverSlot
Definition
SCR_AIGroupVehicle.c:8
SCR_AIGroupVehicle::IsStatic
bool IsStatic()
Definition
SCR_AIGroupVehicle.c:71
SCR_AIVehicleUsageComponent
Definition
SCR_AIVehicleUsageComponent.c:30
TurretCompartmentSlot
Definition
TurretCompartmentSlot.c:13
scripts
Game
AI
Group
SCR_AIGroupVehicle.c
Generated by
1.17.0