DayZ Scripts
v1.21.156300 ยท Jun 20, 2023
 
Loading...
Searching...
No Matches
ActionTogglePlaceObject.c
Go to the documentation of this file.
2{
3
5 {
6 m_Text = "#toggle_placing";
7 }
8
9 override void CreateConditionComponents()
10 {
13 }
14
15 override bool HasTarget()
16 {
17 return false;
18 }
19
20 override bool IsLocal()
21 {
22 return true;
23 }
24
25 override bool IsInstant()
26 {
27 return true;
28 }
29
30 override bool IsDeploymentAction()
31 {
32 return true;
33 }
34
36 {
37 return false;
38 }
39
40 override bool ActionCondition( PlayerBase player, ActionTarget target, ItemBase item )
41 {
42 // not placeable if liquid is present; exception for barrels, for now
43 if ( !item.IsKindOf("Barrel_ColorBase") && item.IsLiquidPresent() )
44 {
45 return false;
46 }
47
48 return true;
49 }
50
51 override void Start( ActionData action_data ) //Setup on start of action
52 {
53 super.Start( action_data );
54 action_data.m_Player.SetLocalProjectionPosition(action_data.m_Target.GetCursorHitPos());
55 action_data.m_Player.TogglePlacingLocal();
56 }
57};
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56
protected string m_Text
Definition ActionBase.c:49
class ActionTargets ActionTarget
PlayerBase m_Player
Definition ActionBase.c:33
ref ActionTarget m_Target
Definition ActionBase.c:32
override void Start(ActionData action_data)
override void CreateConditionComponents()
override bool RemoveForceTargetAfterUse()
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)