DayZ 1.24
Loading...
Searching...
No Matches
ActionPackTent.c
Go to the documentation of this file.
2{
3 override void CreateActionComponent()
4 {
6 }
7}
8
10{
11 void ActionPackTent()
12 {
13 m_CallbackClass = ActionPackTentCB;
15 m_CommandUID = 0;
16 m_FullBody = true;
17 m_StanceMask = DayZPlayerConstants.STANCEMASK_CROUCH | DayZPlayerConstants.STANCEMASK_ERECT;
18 m_Text = "#pack_tent";
19 }
20
26
27 override typename GetInputType()
28 {
30 }
31
32 override bool IsUsingProxies()
33 {
34 return true;
35 }
36
37 override bool HasProgress()
38 {
39 return true;
40 }
41
43 {
44 return true;
45 }
46
48 {
49 Object targetParent = action_data.m_Target.GetParent();
51 return tent.CanBePacked();
52 }
53
59
61 {
62 if (super.SetupAction(player, target, item, action_data, extra_data))
63 {
66 poActionData.m_AlreadyPlaced = false;
67 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_DEPLOY_2HD; //Call the animation
68 return true;
69 }
70 return false;
71 }
72
73 override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
74 {
75 Object targetObject = target.GetObject();
76 Object targetParent = target.GetParent();
77
79 if (inventory_tent && inventory_tent.GetHierarchyRootPlayer())
80 {
81 return false; //tent is somewhere in player's inventory
82 }
83
85 {
87 if (tent.CanBePacked())
88 {
90 targetObject.GetActionComponentNameList(target.GetComponentIndex(), selections);
91
92 for (int s = 0; s < selections.Count(); s++)
93 {
94 if (selections[s] == "pack")
95 return true;
96 }
97 }
98 }
99 return false;
100 }
101
102 override void Start(ActionData action_data) //Setup on start of action
103 {
104 super.Start(action_data);
105
106 if (action_data.m_Player) action_data.m_Player.TryHideItemInHands(true);
107 }
108
110 {
111 Object targetParent = action_data.m_Target.GetParent();
113 tent.SetIsBeingPacked(true);
114 }
115
117 {
118 Object targetParent = action_data.m_Target.GetParent();
120 tent.SetIsBeingPacked(false);
121 if (action_data.m_Player) action_data.m_Player.TryHideItemInHands(false);
122 }
123
125 {
126 //vector offset = Vector(1, 0, 0);
127 Object targetParent = action_data.m_Target.GetParent();
129 if (tent.CanBePacked())
130 {
131 tent.Pack(true);
132 tent.SetPosition(action_data.m_Player.GetPosition() /*+ offset*/); //Add offset to allign tent with player
133 tent.SetOrientation(action_data.m_Player.GetOrientation());
134 tent.PlaceOnSurface();
135 }
136 }
137
139 {
140 return " packed " + action_data.m_Target.GetParent().GetDisplayName() + " with Hands ";
141 }
142};
ActionData CreateActionData()
Definition ActionBase.c:191
bool m_FullBody
Definition ActionBase.c:52
string m_Text
Definition ActionBase.c:49
void CreateConditionComponents()
Definition ActionBase.c:196
bool IsUsingProxies()
not using plane object - it's using multiple proxies
Definition ActionBase.c:234
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
float m_SpecialtyWeight
Definition ActionBase.c:68
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56
bool SetupAction(PlayerBase player, ActionTarget target, ItemBase item, out ActionData action_data, Param extra_data=NULL)
Definition ActionBase.c:126
string GetAdminLogMessage(ActionData action_data)
int m_StanceMask
Definition ActionBase.c:53
bool HasProgress()
For UI: hiding of progress bar.
Definition ActionBase.c:216
ActionPackTentCB ActionContinuousBaseCB ActionPackTent()
void Start()
Plays all elements this effects consists of.
Definition Effect.c:149
override void OnEnd()
Definition JumpEvents.c:53
ActionData m_ActionData
void OnFinishProgressServer(ActionData action_data)
ref CABase m_ActionComponent
Definition ActionBase.c:30
override void CreateActionComponent()
override bool ActionConditionContinue(ActionData action_data)
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
void OnExecute(ActionData action_data)
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
Definition param.c:12
const float DEFAULT
const float DEFAULT_DEPLOY
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:597