DayZ 1.24
Loading...
Searching...
No Matches
ActionRepackTent.c
Go to the documentation of this file.
41
43{
46
48 {
51 m_CommandUID = 0;
52 m_FullBody = true;
53 m_StanceMask = DayZPlayerConstants.STANCEMASK_CROUCH | DayZPlayerConstants.STANCEMASK_ERECT;
54 m_Text = "#repack_tent";
55 }
56
58 {
61 }
62
63 override bool HasTarget()
64 {
65 return false;
66 }
67
68 override bool HasProgress()
69 {
70 return true;
71 }
72
74 {
75 return true;
76 }
77
79 {
80 return true;
81 }
82
83 override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
84 {
85 if (!player.IsPlacingLocal())
86 return true;
87 return false;
88 }
89
91 {
93
94 if (super.SetupAction(player, target, item, action_data, extra_data))
95 return true;
96 return false;
97 }
98
100 {
102 m_IsFinished = false;
103 }
104
106 {
107 Param1<bool> play = new Param1<bool>(false);
108 GetGame().RPCSingleParam(action_data.m_MainItem, SoundTypeTent.REPACK, play, true);
109
110 m_IsFinished = true;
111 }
112
114 {
115 if (m_IsFinished)
116 {
117 if (action_data.m_MainItem.IsInherited(TentBase))
118 {
119 RepackLambda lambda_back_pack = new RepackLambda(action_data.m_MainItem, "LargeTentBackPack", action_data.m_Player);
120 action_data.m_Player.ServerReplaceItemElsewhereWithNewInHands(lambda_back_pack);
121 }
122
123 if (action_data.m_MainItem.IsInherited(Clothing))
124 {
125 RepackLambda lambda_tent = new RepackLambda(action_data.m_MainItem, "LargeTent", action_data.m_Player);
126 action_data.m_Player.ServerReplaceItemElsewhereWithNewInHands(lambda_tent);
127 }
128 }
129 else
130 {
131 if (GetGame().IsMultiplayer())
132 {
133 if (action_data.m_MainItem)
134 action_data.m_Player.ServerTakeEntityToHands(action_data.m_MainItem);
135 }
136 else
137 {
138 if (action_data.m_MainItem)
139 action_data.m_Player.LocalTakeEntityToHands(action_data.m_MainItem);
140 }
141 }
142 }
143
145 {
146 if (item.IsHeavyBehaviour())
147 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_DEPLOY_HEAVY;
148 else if (item.IsOneHandedBehaviour())
149 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_DEPLOY_1HD;
150 else if (item.IsTwoHandedBehaviour())
151 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_DEPLOY_2HD;
152 else
153 Print("Error: check " + item + " behaviour");
154 }
155
157 {
158 if (action_data.m_Player.GetItemInHands())
160 }
161
163 {
164 Param1<bool> play = new Param1<bool>(false);
165 if (!GetGame().IsMultiplayer())
166 {
167 if (action_data.m_Player.GetItemInHands())
169 }
170
171 if (action_data.m_Player.GetItemInHands())
172 {
173 play = new Param1<bool>(true);
174 GetGame().RPCSingleParam(action_data.m_MainItem, SoundTypeTent.REPACK, play, true);
175 }
176 }
177
179 {
180 if (!GetGame().IsMultiplayer() || GetGame().IsServer())
181 {
182 Param1<bool> play = new Param1<bool>(false);
183 GetGame().RPCSingleParam(action_data.m_MainItem, SoundTypeTent.REPACK, play, true);
184 }
185 }
186
188 {
189 return " re-packed " + action_data.m_Target.GetObject().GetDisplayName() + " with Hands ";
190 }
191};
192
bool m_FullBody
Definition ActionBase.c:52
string m_Text
Definition ActionBase.c:49
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
float m_SpecialtyWeight
Definition ActionBase.c:68
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56
int m_StanceMask
Definition ActionBase.c:53
SoundTypeTent
Definition LargeTent.c:2
ActionData m_ActionData
PlayerBase m_Player
Definition ActionBase.c:33
ref CABase m_ActionComponent
Definition ActionBase.c:30
ItemBase m_MainItem
Definition ActionBase.c:28
override void CreateActionComponent()
override string GetAdminLogMessage(ActionData action_data)
override bool SetupAction(PlayerBase player, ActionTarget target, ItemBase item, out ActionData action_data, Param extra_data=NULL)
override void OnFinishProgressServer(ActionData action_data)
override void OnStartAnimationLoopClient(ActionData action_data)
override void OnStartAnimationLoopServer(ActionData action_data)
override void CreateConditionComponents()
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
override void OnStartServer(ActionData action_data)
void SetupAnimation(ItemBase item)
override bool HasTarget()
override bool ActionConditionContinue(ActionData action_data)
override bool HasAlternativeInterrupt()
override void OnEndServer(ActionData action_data)
override void OnEndAnimationLoop(ActionData action_data)
override bool HasProgress()
InventoryLocation.
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
Definition param.c:12
EntityAI m_RepackedNewEntity
void RepackLambda(EntityAI old_item, string new_item_type, PlayerBase player)
const float DEFAULT
const float UNPACK
static proto native float DistanceSq(vector v1, vector v2)
Returns the square distance between tips of two 3D vectors.
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:597
proto native CGame GetGame()
proto void Print(void var)
Prints content of variable to console/log.
static proto void MatrixToQuat(vector mat[3], out float d[4])
Converts rotation matrix to quaternion.
static proto void YawPitchRollMatrix(vector ang, out vector mat[3])
Creates rotation matrix from angles.