Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
actionstartengine.c
Go to the documentation of this file.
2 {
3  override void CreateActionComponent()
4  {
5  m_ActionData.m_ActionComponent = new CAContinuousTime(UATimeSpent.START_ENGINE);
6  }
7 }
8 
10 {
11  private const float ROUGH_SPECIALTY_WEIGHT = 0.5;
12  static const float MINIMUM_BATTERY_ENERGY = 5.0;
13 
14  bool m_BatteryCon = false;
15  bool m_SparkCon = false;
16  bool m_BeltCon = false;
17  bool m_FuelCon = false;
18 
20  {
21  m_CallbackClass = ActionStartCarCB;
22  m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_STARTENGINE;
23  m_StanceMask = DayZPlayerConstants.STANCEMASK_ALL;
25  m_LockTargetOnUse = false;
26  m_Text = "#start_the_car";
27  }
28 
29  override void CreateConditionComponents()
30  {
31  m_ConditionTarget = new CCTNone();
32  m_ConditionItem = new CCINone();
33  }
34 
35  override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
36  {
37  HumanCommandVehicle vehCommand = player.GetCommand_Vehicle();
38  if (vehCommand)
39  {
40  Transport trans = vehCommand.GetTransport();
41  if (trans)
42  {
43  Car car;
44  if (Class.CastTo(car, trans) && !car.EngineIsOn())
45  {
46  if (car.GetHealthLevel("Engine") >= GameConstants.STATE_RUINED)
47  {
48  return false;
49  }
50 
51  return car.CrewMemberIndex(player) == DayZPlayerConstants.VEHICLESEAT_DRIVER);
52  }
53  }
54  }
55 
56  return false;
57  }
58 
59  override void OnFinishProgressServer(ActionData action_data)
60  {
61  HumanCommandVehicle vehCommand = action_data.m_Player.GetCommand_Vehicle();
62  if (vehCommand)
63  {
64  Transport trans = vehCommand.GetTransport();
65  if (trans)
66  {
67  CarScript car;
68  if (Class.CastTo(car, trans))
69  {
70  car.EngineStart();
71  }
72  }
73  }
74  }
75 
76  override void OnExecuteServer(ActionData action_data)
77  {
78  HumanCommandVehicle vehCommand = action_data.m_Player.GetCommand_Vehicle();
79  if (vehCommand)
80  {
81  Transport trans = vehCommand.GetTransport();
82  if (trans)
83  {
84  CarScript car;
85  if (Class.CastTo(car, trans))
86  {
87  car.OnBeforeEngineStart();
88  }
89  }
90  }
91  }
92 
93  override bool CanBeUsedInVehicle()
94  {
95  return true;
96  }
97 }
ItemBase
Definition: inventoryitem.c:730
CAContinuousTime
Definition: cacontinuoustime.c:1
CreateConditionComponents
override void CreateConditionComponents()
Definition: actionstartengine.c:29
CanBeUsedInVehicle
override bool CanBeUsedInVehicle()
Definition: actionstartengine.c:93
m_FuelCon
bool m_FuelCon
DEPRECATED.
Definition: actionstartengine.c:17
CCINone
Definition: ccinone.c:1
CarScript
Definition: civiliansedan.c:1
CCTNone
Definition: cctnone.c:1
m_BeltCon
bool m_BeltCon
DEPRECATED.
Definition: actionstartengine.c:16
ROUGH_SPECIALTY_WEIGHT
ActionStartCarCB ROUGH_SPECIALTY_WEIGHT
ActionStartCarCB
Definition: actionstartengine.c:1
OnFinishProgressServer
override void OnFinishProgressServer(ActionData action_data)
Definition: actionstartengine.c:59
PlayerBase
Definition: playerbaseclient.c:1
ActionTarget
class ActionTargets ActionTarget
ActionData
Definition: actionbase.c:20
m_BatteryCon
bool m_BatteryCon
DEPRECATED.
Definition: actionstartengine.c:14
DayZPlayerConstants
DayZPlayerConstants
defined in C++
Definition: dayzplayer.c:601
Transport
Base native class for all motorized wheeled vehicles.
Definition: car.c:79
ActionCondition
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Definition: actionstartengine.c:35
UATimeSpent
Definition: actionconstants.c:26
ActionContinuousBaseCB
Definition: actioncontinuousbase.c:1
HumanCommandVehicle
Definition: human.c:689
m_LockTargetOnUse
protected bool m_LockTargetOnUse
Definition: actionbase.c:51
m_SparkCon
bool m_SparkCon
DEPRECATED.
Definition: actionstartengine.c:15
ActionStartEngine
void ActionStartEngine()
DEPRECATED.
Definition: actionstartengine.c:19
m_Text
protected string m_Text
Definition: actionbase.c:49
OnExecuteServer
override void OnExecuteServer(ActionData action_data)
Definition: actionstartengine.c:76
GameConstants
Definition: constants.c:612
m_ConditionItem
ref CCIBase m_ConditionItem
Definition: actionbase.c:55
ActionContinuousBase
Definition: actioncontinuousbase.c:132
m_ConditionTarget
ref CCTBase m_ConditionTarget
Definition: actionbase.c:56
Class
Super root of all classes in Enforce script.
Definition: enscript.c:10
m_SpecialtyWeight
protected float m_SpecialtyWeight
Definition: actionbase.c:68
m_StanceMask
protected int m_StanceMask
Definition: actionbase.c:53