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_GetOutUserAction.c
Go to the documentation of this file.
1
class
SCR_GetOutAction
:
SCR_CompartmentUserAction
2
{
3
protected
const
float
MAX_GETOUT_SPEED_METER_PER_SEC_SQ
= 17.36138889;
4
protected
const
float
MAX_GETOUT_ALTITUDE_AGL_METERS
= 3;
5
6
//------------------------------------------------------------------------------------------------
7
override
void
PerformAction
(
IEntity
pOwnerEntity,
IEntity
pUserEntity)
8
{
9
if
(!pOwnerEntity)
10
return
;
11
12
ChimeraCharacter
character =
ChimeraCharacter
.Cast(pUserEntity);
13
if
(!character)
14
return
;
15
16
CharacterControllerComponent controller = character.GetCharacterController();
17
if
(controller && controller.IsUnconscious())
18
return
;
19
20
BaseCompartmentSlot
targetCompartment = GetCompartmentSlot();
21
if
(!targetCompartment)
22
return
;
23
24
CompartmentAccessComponent compartmentAccess = character.GetCompartmentAccessComponent();
25
if
(!compartmentAccess)
26
return
;
27
28
if
(!compartmentAccess.GetOutVehicle(
EGetOutType
.ANIMATED,
GetRelevantDoorIndex
(pUserEntity),
ECloseDoorAfterActions
.RETURN_TO_PREVIOUS_STATE,
false
))
29
return
;
30
31
super.PerformAction(pOwnerEntity, pUserEntity);
32
}
33
34
//------------------------------------------------------------------------------------------------
35
override
bool
CanBePerformedScript
(
IEntity
user)
36
{
37
ChimeraCharacter
character =
ChimeraCharacter
.Cast(user);
38
if
(!character)
39
return
false
;
40
41
CharacterControllerComponent controller = character.GetCharacterController();
42
if
(controller && controller.IsUnconscious())
43
return
false
;
44
45
CompartmentAccessComponent compartmentAccess = character.GetCompartmentAccessComponent();
46
if
(!compartmentAccess)
47
return
false
;
48
49
if
(!compartmentAccess.IsInCompartment())
50
return
false
;
51
52
if
(compartmentAccess.IsGettingIn() || compartmentAccess.IsGettingOut())
53
return
false
;
54
55
BaseCompartmentSlot
compartment = compartmentAccess.GetCompartment();
56
if
(!compartment)
57
return
false
;
58
59
// Do not allow plain GetOut with speeds higher than 15 km/phys
60
Vehicle
vehicle =
Vehicle
.Cast(
GetOwner
().GetRootParent());
61
62
if
(vehicle)
63
{
64
Physics
phys = vehicle.GetPhysics();
65
66
if
(phys)
67
{
68
vector
velocity = phys.GetVelocity();
69
70
if
((velocity.LengthSq()) >
MAX_GETOUT_SPEED_METER_PER_SEC_SQ
)
71
return
false
;
72
}
73
74
// Disallow GetOut when flying is above 3 meters
75
HelicopterControllerComponent
helicopterController =
HelicopterControllerComponent
.Cast(vehicle.GetVehicleController());
76
if
(helicopterController)
77
{
78
VehicleHelicopterSimulation
simulation =
VehicleHelicopterSimulation
.Cast(helicopterController.GetBaseSimulation());
79
if
(simulation && simulation.GetAltitudeAGL() >
MAX_GETOUT_ALTITUDE_AGL_METERS
)
80
return
false
;
81
}
82
}
83
84
BaseCompartmentSlot
thisCompartment = GetCompartmentSlot();
85
return
thisCompartment == compartment;
86
}
87
88
//------------------------------------------------------------------------------------------------
89
override
bool
CanBeShownScript
(
IEntity
user)
90
{
91
return
CanBePerformed
(user);
92
}
93
94
//------------------------------------------------------------------------------------------------
95
override
bool
GetActionNameScript
(out
string
outName)
96
{
97
BaseCompartmentSlot
compartment = GetCompartmentSlot();
98
if
(!compartment)
99
return
false
;
100
101
UIInfo
actionInfo =
GetUIInfo
();
102
if
(!actionInfo)
103
return
false
;
104
105
outName = actionInfo.GetName();
106
107
return
true
;
108
}
109
};
GetUIInfo
SCR_UIInfo GetUIInfo()
Definition
SCR_EditableEntityCampaignBuildingModeLabelSetting.c:27
CanBePerformed
override bool CanBePerformed(SCR_EditableEntityComponent hoveredEntity, notnull set< SCR_EditableEntityComponent > selectedEntities, vector cursorWorldPosition, int flags)
Definition
SCR_NewSessionToolbarAction.c:48
BaseCompartmentSlot
Definition
BaseCompartmentSlot.c:2
ChimeraCharacter
Definition
ChimeraCharacter.c:13
HelicopterControllerComponent
Definition
HelicopterControllerComponent.c:13
IEntity
Definition
IEntity.c:13
Physics
Definition
Physics.c:22
SCR_CompartmentUserAction
Definition
SCR_CompartmentUserAction.c:2
SCR_CompartmentUserAction::GetRelevantDoorIndex
int GetRelevantDoorIndex(IEntity caller)
Definition
SCR_CompartmentUserAction.c:46
SCR_GetOutAction
Definition
SCR_GetOutUserAction.c:2
SCR_GetOutAction::PerformAction
override void PerformAction(IEntity pOwnerEntity, IEntity pUserEntity)
Definition
SCR_GetOutUserAction.c:7
SCR_GetOutAction::CanBeShownScript
override bool CanBeShownScript(IEntity user)
Definition
SCR_GetOutUserAction.c:89
SCR_GetOutAction::CanBePerformedScript
override bool CanBePerformedScript(IEntity user)
Definition
SCR_GetOutUserAction.c:35
SCR_GetOutAction::MAX_GETOUT_SPEED_METER_PER_SEC_SQ
const float MAX_GETOUT_SPEED_METER_PER_SEC_SQ
Definition
SCR_GetOutUserAction.c:3
SCR_GetOutAction::MAX_GETOUT_ALTITUDE_AGL_METERS
const float MAX_GETOUT_ALTITUDE_AGL_METERS
Definition
SCR_GetOutUserAction.c:4
SCR_GetOutAction::GetActionNameScript
override bool GetActionNameScript(out string outName)
Definition
SCR_GetOutUserAction.c:95
UIInfo
UIInfo - allows to define UI elements.
Definition
UIInfo.c:14
VehicleHelicopterSimulation
Definition
VehicleHelicopterSimulation.c:13
vector
Definition
vector.c:13
Vehicle
enum EPhysicsLayerPresets Vehicle
Definition
gameLib.c:24
GetOwner
IEntity GetOwner()
Owner entity of the fuel tank.
Definition
SCR_FuelNode.c:128
ECloseDoorAfterActions
ECloseDoorAfterActions
Definition
ECloseDoorAfterActions.c:13
EGetOutType
EGetOutType
Definition
EGetOutType.c:13
scripts
Game
UserActions
SCR_GetOutUserAction.c
Generated by
1.17.0