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

Go to the source code of this file.

Classes

class  ActionPackTentCB
 

Functions

ActionPackTentCB ActionContinuousBaseCB ActionPackTent ()
 
override void CreateActionComponent ()
 
override void CreateConditionComponents ()
 
override GetInputType ()
 
override bool IsUsingProxies ()
 
override bool HasProgress ()
 
override bool HasAlternativeInterrupt ()
 
override bool ActionConditionContinue (ActionData action_data)
 
override ActionData CreateActionData ()
 
override bool SetupAction (PlayerBase player, ActionTarget target, ItemBase item, out ActionData action_data, Param extra_data=NULL)
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
override void Start (ActionData action_data)
 
override void OnExecute (ActionData action_data)
 
override void OnEnd (ActionData action_data)
 
override void OnFinishProgressServer (ActionData action_data)
 
override string GetAdminLogMessage (ActionData action_data)
 

Function Documentation

◆ ActionCondition()

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

Definition at line 73 of file ActionPackTent.c.

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 }

◆ ActionConditionContinue()

override bool ActionConditionContinue ( ActionData action_data)

Definition at line 47 of file ActionPackTent.c.

48 {
49 Object targetParent = action_data.m_Target.GetParent();
51 return tent.CanBePacked();
52 }

◆ ActionPackTent()

Definition at line 1 of file ActionPackTent.c.

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

Referenced by ActionConstructor::RegisterActions(), ItemBase::SetActions(), and TentBase::SetActions().

◆ CreateActionComponent()

override void ActionPackTent::CreateActionComponent ( )

Definition at line 12 of file ActionPackTent.c.

12 {
13 m_CallbackClass = ActionPackTentCB;
15 m_CommandUID = 0;

References m_FullBody, m_SpecialtyWeight, m_StanceMask, m_Text, and UASoftSkillsWeight::PRECISE_LOW.

◆ CreateActionData()

override ActionData CreateActionData ( )

◆ CreateConditionComponents()

override void CreateConditionComponents ( )

Definition at line 21 of file ActionPackTent.c.

22 {
25 }
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56
const float DEFAULT

References UAMaxDistances::DEFAULT, m_ConditionItem, and m_ConditionTarget.

◆ GetAdminLogMessage()

override string GetAdminLogMessage ( ActionData action_data)

Definition at line 138 of file ActionPackTent.c.

139 {
140 return " packed " + action_data.m_Target.GetParent().GetDisplayName() + " with Hands ";
141 }

◆ GetInputType()

override GetInputType ( )

Definition at line 27 of file ActionPackTent.c.

◆ HasAlternativeInterrupt()

override bool HasAlternativeInterrupt ( )

Definition at line 42 of file ActionPackTent.c.

43 {
44 return true;
45 }

◆ HasProgress()

override bool HasProgress ( )

Definition at line 37 of file ActionPackTent.c.

38 {
39 return true;
40 }

◆ IsUsingProxies()

override bool IsUsingProxies ( )

Definition at line 32 of file ActionPackTent.c.

33 {
34 return true;
35 }

◆ OnEnd()

override void OnEnd ( ActionData action_data)

Definition at line 116 of file ActionPackTent.c.

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 }

◆ OnExecute()

override void OnExecute ( ActionData action_data)

Definition at line 109 of file ActionPackTent.c.

110 {
111 Object targetParent = action_data.m_Target.GetParent();
113 tent.SetIsBeingPacked(true);
114 }

◆ OnFinishProgressServer()

override void OnFinishProgressServer ( ActionData action_data)

Definition at line 124 of file ActionPackTent.c.

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 }

◆ SetupAction()

override bool SetupAction ( PlayerBase player,
ActionTarget target,
ItemBase item,
out ActionData action_data,
Param extra_data = NULL )

Definition at line 60 of file ActionPackTent.c.

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 }

◆ Start()

override void Start ( ActionData action_data)

Definition at line 102 of file ActionPackTent.c.

103 {
104 super.Start(action_data);
105
106 if (action_data.m_Player) action_data.m_Player.TryHideItemInHands(true);
107 }