DayZ 1.24
Loading...
Searching...
No Matches
ActionTurnValve.c File Reference

Go to the source code of this file.

Classes

class  ActionTurnValveCB
 

Functions

ActionTurnValveCB ActionContinuousBaseCB ActionTurnValve ()
 
override void CreateActionComponent ()
 
override GetInputType ()
 
override void CreateConditionComponents ()
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
override void OnStart (ActionData action_data)
 
override void OnEnd (ActionData action_data)
 

Function Documentation

◆ ActionCondition()

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

Definition at line 31 of file ActionTurnValve.c.

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 }
bool IsInReach(PlayerBase player, ActionTarget target, float maxDistance=1.0)
Definition ActionBase.c:856
Super root of all classes in Enforce script.
Definition EnScript.c:11
const float DEFAULT
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.

References Class::CastTo(), UAMaxDistances::DEFAULT, and IsInReach().

◆ ActionTurnValve()

Definition at line 1 of file ActionTurnValve.c.

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 }
bool m_FullBody
Definition ActionBase.c:52
string m_Text
Definition ActionBase.c:49
int m_StanceMask
Definition ActionBase.c:53
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:597

Referenced by ActionConstructor::RegisterActions().

◆ CreateActionComponent()

override void ActionTurnValve::CreateActionComponent ( )

Definition at line 12 of file ActionTurnValve.c.

12 {
13 m_CallbackClass = ActionTurnValveCB;
14 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_TURN_VALVE;
15 m_FullBody = true;

References m_FullBody, m_StanceMask, and m_Text.

◆ CreateConditionComponents()

override void CreateConditionComponents ( )

Definition at line 25 of file ActionTurnValve.c.

26 {
29 }
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56

References m_ConditionItem, and m_ConditionTarget.

◆ GetInputType()

override GetInputType ( )

Definition at line 20 of file ActionTurnValve.c.

◆ OnEnd()

override void OnEnd ( ActionData action_data)

Definition at line 60 of file ActionTurnValve.c.

61 {
62 action_data.m_Player.TryHideItemInHands(false);
63
64 super.OnEnd(action_data);
65 }

◆ OnStart()

override void OnStart ( ActionData action_data)

Definition at line 52 of file ActionTurnValve.c.

53 {
54 super.OnStart(action_data);
55
56 action_data.m_Player.TryHideItemInHands(true);
57
58 }