DayZ 1.24
Loading...
Searching...
No Matches
ActionGetInTransport Class Reference
Inheritance diagram for ActionGetInTransport:
[legend]
Collaboration diagram for ActionGetInTransport:
[legend]

Private Member Functions

void ActionGetInTransport ()
 
override void CreateConditionComponents ()
 
override GetInputType ()
 
override bool HasProgress ()
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
override void Start (ActionData action_data)
 
override void OnStartServer (ActionData action_data)
 
override bool CanBeUsedInRestrain ()
 
override void OnUpdate (ActionData action_data)
 
override int GetActionCategory ()
 
override void OnEndClient (ActionData action_data)
 
override void OnEndServer (ActionData action_data)
 

Detailed Description

Definition at line 1 of file ActionGetInTransport.c.

Constructor & Destructor Documentation

◆ ActionGetInTransport()

void ActionGetInTransport::ActionGetInTransport ( )
inlineprivate

Definition at line 3 of file ActionGetInTransport.c.

4 {
5 m_StanceMask = DayZPlayerConstants.STANCEMASK_CROUCH | DayZPlayerConstants.STANCEMASK_ERECT;
6 m_Text = "#get_in_vehicle";
7 }
string m_Text
Definition ActionBase.c:49
int m_StanceMask
Definition ActionBase.c:53
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:597

References m_StanceMask, and m_Text.

Member Function Documentation

◆ ActionCondition()

override bool ActionGetInTransport::ActionCondition ( PlayerBase player,
ActionTarget target,
ItemBase item )
inlineprivate

Definition at line 26 of file ActionGetInTransport.c.

27 {
29
30 if (!target)
31 return false;
32
33 if (!Class.CastTo(trans, target.GetObject()))
34 return false;
35
36 if (player.GetItemInHands() && player.GetItemInHands().IsHeavyBehaviour())
37 return false;
38
39 if (player.GetCommand_Vehicle())
40 return false;
41
42 int componentIndex = target.GetComponentIndex();
43 int crew_index = trans.CrewPositionIndex(componentIndex);
44 if (crew_index < 0)
45 return false;
46
47 Human crew = trans.CrewMember(crew_index);
48 if (crew)
49 return false;
50
51 if (!trans.CrewCanGetThrough(crew_index) || !trans.IsAreaAtDoorFree(crew_index))
52 return false;
53
55 trans.GetActionComponentNameList(componentIndex, selections);
56
57 for (int i = 0; i < selections.Count(); i++)
58 {
59 if (trans.CanReachSeatFromDoors(selections[i], player.GetPosition(), 1.0))
60 return true;
61 }
62
63 return false;
64 }
Super root of all classes in Enforce script.
Definition EnScript.c:11
Base native class for all motorized wheeled vehicles.
Definition Car.c:75
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.

References Class::CastTo().

◆ CanBeUsedInRestrain()

override bool ActionGetInTransport::CanBeUsedInRestrain ( )
inlineprivate

Definition at line 94 of file ActionGetInTransport.c.

95 {
96 return true;
97 }

◆ CreateConditionComponents()

override void ActionGetInTransport::CreateConditionComponents ( )
inlineprivate

Definition at line 10 of file ActionGetInTransport.c.

11 {
14 }
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56

References m_ConditionItem, and m_ConditionTarget.

◆ GetActionCategory()

override int ActionGetInTransport::GetActionCategory ( )
inlineprivate

Definition at line 109 of file ActionGetInTransport.c.

110 {
111 return AC_INTERACT;
112 }
const int AC_INTERACT
Definition _constants.c:4

References AC_INTERACT.

◆ GetInputType()

override ActionGetInTransport::GetInputType ( )
inlineprivate

◆ HasProgress()

override bool ActionGetInTransport::HasProgress ( )
inlineprivate

Definition at line 21 of file ActionGetInTransport.c.

22 {
23 return false;
24 }

◆ OnEndClient()

override void ActionGetInTransport::OnEndClient ( ActionData action_data)
inlineprivate

Definition at line 114 of file ActionGetInTransport.c.

115 {
116 if (action_data.m_Player.GetInventory())
117 action_data.m_Player.GetInventory().UnlockInventory(LOCK_FROM_SCRIPT);
118 }

◆ OnEndServer()

override void ActionGetInTransport::OnEndServer ( ActionData action_data)
inlineprivate

Definition at line 120 of file ActionGetInTransport.c.

121 {
122 if (action_data.m_Player.GetInventory())
123 action_data.m_Player.GetInventory().UnlockInventory(LOCK_FROM_SCRIPT);
124
125 CarScript car = CarScript.Cast(action_data.m_Target.GetObject());
126 if (car)
127 car.ForceUpdateLightsEnd();
128 }

◆ OnStartServer()

override void ActionGetInTransport::OnStartServer ( ActionData action_data)
inlineprivate

Definition at line 87 of file ActionGetInTransport.c.

88 {
89 CarScript car = CarScript.Cast(action_data.m_Target.GetObject());
90 if (car)
91 car.ForceUpdateLightsStart();
92 }

◆ OnUpdate()

override void ActionGetInTransport::OnUpdate ( ActionData action_data)
inlineprivate

Definition at line 99 of file ActionGetInTransport.c.

100 {
101
102 if (action_data.m_State == UA_START)
103 {
104 if (!action_data.m_Player.GetCommand_Vehicle() || !action_data.m_Player.GetCommand_Vehicle().IsGettingIn())
106 }
107 }
void End()
called on surrender end request end
const int UA_START
Definition constants.c:439

References End(), and UA_START.

◆ Start()

override void ActionGetInTransport::Start ( ActionData action_data)
inlineprivate

Definition at line 66 of file ActionGetInTransport.c.

67 {
68 super.Start(action_data);
69
70 Transport trans = Transport.Cast(action_data.m_Target.GetObject());
71 int componentIndex = action_data.m_Target.GetComponentIndex();
72 int crew_index = trans.CrewPositionIndex(componentIndex);
73
74
75 int seat = trans.GetSeatAnimationType(crew_index);
76 HumanCommandVehicle vehCommand = action_data.m_Player.StartCommand_Vehicle(trans, crew_index, seat);
77 if (vehCommand)
78 {
79 vehCommand.SetVehicleType(trans.GetAnimInstance());
80
81 GetDayZGame().GetBacklit().OnEnterCar();
82 if (action_data.m_Player.GetInventory())
83 action_data.m_Player.GetInventory().LockInventory(LOCK_FROM_SCRIPT);
84 }
85 }
DayZGame GetDayZGame()
Definition DayZGame.c:3530

References GetDayZGame().


The documentation for this class was generated from the following file: