DayZ 1.29
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
Hand_Actions.c
См. документацию.
1
2
7{
11 void Action (HandEventBase e) { }
12};
13
14
15class HandActionCreated extends HandActionBase
16{
17 override void Action (HandEventBase e)
18 {
19 #ifdef ENABLE_LOGGING
21 {
22 Debug.InventoryHFSMLog("Action - STS = " + e.m_Player.GetSimulationTimeStamp(), e.ToString() , "n/a", "HandActionCreated", e.m_Player.ToString() );
23 }
24 #endif
25
26 e.m_Player.OnItemInHandsChanged();
27 }
28};
29
30class HandActionTake extends HandActionBase
31{
32 override void Action (HandEventBase e)
33 {
34 #ifdef ENABLE_LOGGING
36 {
37 Debug.InventoryHFSMLog("Action - STS = " + e.m_Player.GetSimulationTimeStamp(), e.ToString() , "n/a", "HandActionTake", e.m_Player.ToString() );
38 }
39 #endif
40
42 e.m_Player.OnItemInHandsChanged();
43 }
44};
45
46class HandActionDrop extends HandActionBase
47{
48 override void Action (HandEventBase e)
49 {
50 #ifdef ENABLE_LOGGING
52 {
53 Debug.InventoryHFSMLog("Action - STS = " + e.m_Player.GetSimulationTimeStamp(), e.ToString() , "n/a", "HandActionDrop", e.m_Player.ToString() );
54 }
55 #endif
56
58 e.m_Player.OnItemInHandsChanged();
59 }
60};
61
62class HandActionThrow extends HandActionBase
63{
64 override void Action (HandEventBase e)
65 {
66 #ifdef ENABLE_LOGGING
68 {
69 Debug.InventoryHFSMLog("Action - STS = " + e.m_Player.GetSimulationTimeStamp(), e.ToString() , "n/a", "HandActionThrow", e.m_Player.ToString() );
70 }
71 #endif
72 HandEventThrow throwEvent = HandEventThrow.Cast(e);
73
75
76 DayZPlayer player = DayZPlayer.Cast(e.m_Player);
77 if ( player.GetInstanceType() != DayZPlayerInstanceType.INSTANCETYPE_REMOTE )
78 {
79 InventoryItem item = InventoryItem.Cast(e.GetSrcEntity());
80 if( item )
81 item.ThrowPhysically(player, throwEvent.GetForce());
82 else
83 Error("[hndfsm] HandActionThrow - src entity null!");
84 }
85
86 player.OnItemInHandsChanged();
87 }
88};
89
90class HandActionMoveTo extends HandActionBase
91{
92 override void Action (HandEventBase e)
93 {
94 #ifdef ENABLE_LOGGING
96 {
97 Debug.InventoryHFSMLog("Action - STS = " + e.m_Player.GetSimulationTimeStamp(), e.ToString() , "n/a", "HandActionMoveTo", e.m_Player.ToString() );
98 }
99 #endif
100
101 HandEventMoveTo es = HandEventMoveTo.Cast(e);
102 if (es)
103 {
105 e.m_Player.OnItemInHandsChanged();
106 }
107 else
108 Error("[hndfsm] HandActionMoveTo - this is no HandEventMoveTo");
109 }
110};
111
112class HandActionDestroy extends HandActionBase
113{
114 override void Action (HandEventBase e)
115 {
116 if (e.m_Player.GetEntityInHands() != e.GetSrcEntity())
117 {
118 #ifdef ENABLE_LOGGING
120 {
121 Error("[hndfsm] HandActionDestroy - item is not in player hands");
122 }
123 #endif
124
125 return;
126 }
127
128 #ifdef ENABLE_LOGGING
130 {
131 Debug.InventoryHFSMLog("Action - STS = " + e.m_Player.GetSimulationTimeStamp(), e.ToString() , "n/a", "HandActionDestroy", e.m_Player.ToString() );
132 }
133 #endif
134
135 g_Game.ObjectDelete(e.GetSrcEntity());
136 e.m_Player.OnItemInHandsChanged();
137 }
138};
139
140class HandActionDestroyed extends HandActionBase
141{
142 override void Action (HandEventBase e)
143 {
144 #ifdef ENABLE_LOGGING
146 {
147 Debug.InventoryHFSMLog("Action - STS = " + e.m_Player.GetSimulationTimeStamp(), e.ToString() , "n/a", "HandActionDestroyed", e.m_Player.ToString() );
148 }
149 #endif
150 e.m_Player.OnItemInHandsChanged();
151 }
152};
153
155{
156 override void Action (HandEventBase e)
157 {
158 #ifdef ENABLE_LOGGING
160 {
161 Debug.InventoryHFSMLog("Action - STS = " + e.m_Player.GetSimulationTimeStamp(), e.ToString() , "n/a", "HandActionDestroyAndReplaceWithNew", e.m_Player.ToString() );
162 }
163 #endif
164 Man player = e.m_Player;
165 EntityAI itemInHands = player.GetEntityInHands();
166
168 if (itemInHands.GetInventory().GetCurrentInventoryLocation(src))
169 {
171 if (edr)
172 {
173 edr.m_Lambda.Execute();
174 return;
175 }
176 else
177 Error("[hndfsm] HandActionDestroyAndReplaceWithNew - not a HandEventDestroyAndReplaceWithNew event");
178 }
179 else
180 Error("[hndfsm] HandActionDestroyAndReplaceWithNew - itemInHands has no InventoryLocation");
181 }
182};
183
184class HandActionDestroyAndReplaceWithNewElsewhere extends HandActionDestroyAndReplaceWithNew
185{
186 override void Action (HandEventBase e)
187 {
188 super.Action(e);
189 }
190};
191
192class HandActionReplaced extends HandActionBase
193{
194 override void Action (HandEventBase e)
195 {
196 #ifdef ENABLE_LOGGING
198 {
199 Debug.InventoryHFSMLog("Action - STS = " + e.m_Player.GetSimulationTimeStamp(), e.ToString() , "n/a", "HandActionReplaced", e.m_Player.ToString() );
200 }
201 #endif
202 Man player = e.m_Player;
203
204 player.OnItemInHandsChanged();
205 }
206};
207
208class HandActionSwap extends HandActionBase
209{
210 override void Action (HandEventBase e)
211 {
212 #ifdef ENABLE_LOGGING
214 {
215 Debug.InventoryHFSMLog("Action - STS = " + e.m_Player.GetSimulationTimeStamp(), e.ToString() , "n/a", "HandActionSwap", e.m_Player.ToString() );
216 }
217 #endif
218 HandEventSwap es = HandEventSwap.Cast(e);
219 if (es)
220 {
221 GameInventory.LocationSwap(es.GetSrc(), es.m_Src2, es.GetDst(), es.m_Dst2);
222 e.m_Player.OnItemInHandsChanged();
223 }
224 else
225 Error("[hndfsm] HandActionSwap - this is no HandEventSwap");
226 }
227};
228
229class HandActionForceSwap extends HandActionBase
230{
231 override void Action (HandEventBase e)
232 {
233 #ifdef ENABLE_LOGGING
235 {
236 Debug.InventoryHFSMLog("Action - STS = " + e.m_Player.GetSimulationTimeStamp(), e.ToString() , "n/a", "HandActionForceSwap", e.m_Player.ToString() );
237 }
238 #endif
239 HandEventForceSwap es = HandEventForceSwap.Cast(e);
240 if (es)
241 {
242 GameInventory.LocationSwap(es.GetSrc(), es.m_Src2, es.GetDst(), es.m_Dst2);
243 e.m_Player.OnItemInHandsChanged();
244 }
245 else
246 Error("[hndfsm] HandActionForceSwap - this is no HandEventForceSwap");
247 }
248};
249
251
DayZGame g_Game
Определения DayZGame.c:3942
override void OnItemInHandsChanged()
Определения DayZPlayerImplement.c:988
Определения DayZPlayerImplement.c:87
static void InventoryHFSMLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Определения 3_Game/DayZ/tools/Debug.c:207
Определения 3_Game/DayZ/tools/Debug.c:2
static proto native bool LocationSyncMoveEntity(notnull InventoryLocation src_loc, notnull InventoryLocation dst_loc)
synchronously removes item from current inventory location and adds it to destination no anims involv...
static proto native bool LocationSwap(notnull InventoryLocation src1, notnull InventoryLocation src2, notnull InventoryLocation dst1, notnull InventoryLocation dst2)
swaps two entities
script counterpart to engine's class Inventory
override void Action(HandEventBase e)
Определения Hand_Actions.c:17
void Action(HandEventBase e)
Определения Hand_Actions.c:11
actions
Определения Hand_Actions.c:7
override void Action(HandEventBase e)
Определения Hand_Actions.c:186
override InventoryLocation GetDst()
Определения Hand_Events.c:215
ref InventoryLocation m_Dst
Определения Hand_Events.c:275
Abstracted event, not to be used, only inherited.
Определения Hand_Events.c:212
Определения Hand_Events.c:726
Определения ItemBase.c:21
InventoryLocation.
Определения InventoryLocation.c:30
static bool IsInventoryHFSMLogEnable()
Определения 3_Game/DayZ/tools/Debug.c:766
DayZPlayerInstanceType
defined in C++
Определения dayzplayer.c:1071
void Error(string err)
Messagebox with error message.
Определения EnDebug.c:90