DayZ 1.24
Loading...
Searching...
No Matches
ActionTurnValve.c
Go to the documentation of this file.
2{
7}
8
10{
11 void ActionTurnValve()
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
26 {
29 }
30
31 override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
32 {
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 {
42 return false;
43
44 return targetEntity.IsValveTurnable(valveIndex);
45 }
46 }
47 }
48
49 return false;
50 }
51
53 {
54 super.OnStart(action_data);
55
56 action_data.m_Player.TryHideItemInHands(true);
57
58 }
59
61 {
62 action_data.m_Player.TryHideItemInHands(false);
63
64 super.OnEnd(action_data);
65 }
66}
bool m_FullBody
Definition ActionBase.c:52
string m_Text
Definition ActionBase.c:49
bool IsInReach(PlayerBase player, ActionTarget target, float maxDistance=1.0)
Definition ActionBase.c:856
void CreateConditionComponents()
Definition ActionBase.c:196
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56
int m_StanceMask
Definition ActionBase.c:53
ActionTurnValveCB ActionContinuousBaseCB ActionTurnValve()
override void OnEnd()
Definition JumpEvents.c:53
void OnStart(Param par=null)
ActionData m_ActionData
ref CABase m_ActionComponent
Definition ActionBase.c:30
override void CreateActionComponent()
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Super root of all classes in Enforce script.
Definition EnScript.c:11
const float DEFAULT
const float DEFAULT
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:597
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.