Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
actionturnvalve.c
Go to the documentation of this file.
2 {
3  override void CreateActionComponent()
4  {
5  m_ActionData.m_ActionComponent = new CAContinuousTime(UATimeSpent.DEFAULT);
6  }
7 }
8 
10 {
12  {
13  m_CallbackClass = ActionTurnValveCB;
14  m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_TURN_VALVE;
15  m_FullBody = true;
16  m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT;
17  m_Text = "#STR_USRACT_TURN";
18  }
19 
20  override typename GetInputType()
21  {
23  }
24 
25  override void CreateConditionComponents()
26  {
27  m_ConditionItem = new CCINone();
29  }
30 
31  override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
32  {
33  EntityAI targetEntity;
34  if (Class.CastTo(targetEntity, target.GetObject()))
35  {
36  if (targetEntity.HasTurnableValveBehavior())
37  {
38  int valveIndex = targetEntity.GetTurnableValveIndex(target.GetComponentIndex());
39  if (valveIndex != -1)
40  {
41  if (!IsInReach(player, target, UAMaxDistances.DEFAULT))
42  {
43  return false;
44  }
45 
46  return targetEntity.IsValveTurnable(valveIndex);
47  }
48  }
49  }
50 
51  return false;
52  }
53 
54  override void OnStart(ActionData action_data)
55  {
56  super.OnStart(action_data);
57 
58  action_data.m_Player.TryHideItemInHands(true);
59 
60  }
61 
62  override void OnEnd(ActionData action_data)
63  {
64  action_data.m_Player.TryHideItemInHands(false);
65 
66  super.OnEnd(action_data);
67  }
68 }
ItemBase
Definition: inventoryitem.c:730
CAContinuousTime
Definition: cacontinuoustime.c:1
ContinuousInteractActionInput
Definition: actioninput.c:521
CCINone
Definition: ccinone.c:1
ActionCondition
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Definition: actionturnvalve.c:31
CreateConditionComponents
override void CreateConditionComponents()
Definition: actionturnvalve.c:25
OnEnd
override void OnEnd(ActionData action_data)
Definition: actionturnvalve.c:62
UAMaxDistances
Definition: actionconstants.c:104
ActionTurnValve
ActionTurnValveCB ActionContinuousBaseCB ActionTurnValve()
Definition: actionturnvalve.c:11
m_FullBody
protected bool m_FullBody
Definition: actionbase.c:52
PlayerBase
Definition: playerbaseclient.c:1
ActionTarget
class ActionTargets ActionTarget
ActionData
Definition: actionbase.c:20
DayZPlayerConstants
DayZPlayerConstants
defined in C++
Definition: dayzplayer.c:601
CCTCursor
Definition: cctcursor.c:1
UATimeSpent
Definition: actionconstants.c:26
ActionContinuousBaseCB
Definition: actioncontinuousbase.c:1
ActionTurnValveCB
Definition: actionturnvalve.c:1
IsInReach
protected bool IsInReach(PlayerBase player, ActionTarget target, float maxDistance=1.0)
Definition: actionbase.c:928
m_Text
protected string m_Text
Definition: actionbase.c:49
m_ConditionItem
ref CCIBase m_ConditionItem
Definition: actionbase.c:55
ActionContinuousBase
Definition: actioncontinuousbase.c:132
GetInputType
override GetInputType()
Definition: actionturnvalve.c:20
m_ConditionTarget
ref CCTBase m_ConditionTarget
Definition: actionbase.c:56
Class
Super root of all classes in Enforce script.
Definition: enscript.c:10
m_StanceMask
protected int m_StanceMask
Definition: actionbase.c:53
EntityAI
Definition: building.c:5
OnStart
override void OnStart(ActionData action_data)
Definition: actionturnvalve.c:54