DayZ 1.29
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
HumanInventory.c
См. документацию.
1
10{
12 //int m_UserReservationToClear = -1;
16 proto native EntityAI GetEntityInHands();
17
21 proto native bool CanAddEntityInHands(EntityAI e);
22
30 proto native bool TestAddEntityInHands(EntityAI e, bool do_resevation_check, bool do_item_check, bool do_lock_check, bool do_occupancy_test, bool do_script_check);
31
35 proto native bool CanRemoveEntityInHands();
36
37 proto native bool CanOpenInventory();
38
44 proto native EntityAI CreateInHands(string typeName);
45
46 proto native int GetUserReservedLocationCount();
47 proto native int FindUserReservedLocationIndex(notnull EntityAI e);
48 proto native int FindCollidingUserReservedLocationIndex(notnull EntityAI e, notnull InventoryLocation dst);
49 proto native void GetUserReservedLocation(int index, out notnull InventoryLocation dst);
51
52 proto native void SetUserReservedLocation(notnull EntityAI eai, notnull InventoryLocation dst);
53 proto native void ClearUserReservedLocation(notnull EntityAI eai);
54 proto native bool ClearUserReservedLocationAtIndex(int index);
55 proto native void ClearUserReservedLocationForContainer(notnull EntityAI eai);
56 proto native bool GetDebugFlag();
57
65 override EntityAI CreateInInventory(string type)
66 {
67 EntityAI newEntity = super.CreateInInventory(type);
68 if (newEntity == null)
69 newEntity = CreateInHands(type);
70 return newEntity;
71 }
72
74 {
75 if (g_Game.IsClient())
77 else if (!g_Game.IsMultiplayer())
78 {
80 eai.GetOnReleaseLock().Invoke(eai);
81 }
82
83 }
84
86 {
87 if (g_Game.IsClient())
89 else if (!g_Game.IsMultiplayer())
90 {
92
94
96 EntityAI item = il.GetItem();
97 item.GetOnReleaseLock().Invoke(item);
98 }
99
100 }
101
103 {
104 return Man.Cast(GetInventoryOwner());
105 }
106
108 {
109 return e == GetEntityInHands();
110 }
111
113
117
119 {
121 cpy.Copy(src);
122 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[inv] OnEntityInHandsCreated src=" + InventoryLocation.DumpToStringNullSafe(cpy));
123 ProcessHandEvent(new HandEventCreated(GetManOwner(), src));
124 }
125
127 {
129 cpy.Copy(src);
130 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[inv] OnEntityInHandsDestroyed src=" + InventoryLocation.DumpToStringNullSafe(cpy));
131 ProcessHandEvent(new HandEventDestroyed(GetManOwner(), cpy));
132 }
133
135 {
136 return true;
137 }
138
139 override bool DropEntity(InventoryMode mode, EntityAI owner, notnull EntityAI item)
140 {
142 if (item)
143 {
144 GameInventory itemInventory = item.GetInventory();
145 if (itemInventory && itemInventory.GetCurrentInventoryLocation(src))
146 {
147 switch (src.GetType())
148 {
149 case InventoryLocationType.HANDS:
150 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[inv] HumanInventory::DropEntity(" + typename.EnumToString(InventoryMode, mode) + ") item=" + item);
151 HandEvent(mode, new HandEventDrop(GetManOwner(), src));
152 return true;
153
154 default:
155 return super.DropEntity(mode, owner, item);
156 }
157 }
158 }
159
160 Error("No inventory location");
161 return false;
162 }
163
164 bool ThrowEntity(EntityAI item, vector dir, float force)
165 {
166 if (g_Game.IsServer() && g_Game.IsMultiplayer())
167 return false;
168
169 DayZPlayer player = DayZPlayer.Cast(item.GetHierarchyRootPlayer());
170 InventoryMode invMode = InventoryMode.PREDICTIVE;
171
172 if (player.NeedInventoryJunctureFromServer(item, item.GetHierarchyParent(), null))
173 invMode = InventoryMode.JUNCTURE;
174
176 if (item)
177 {
178 GameInventory itemInventory = item.GetInventory();
179 if (itemInventory && itemInventory.GetCurrentInventoryLocation(src))
180 {
181 switch (src.GetType())
182 {
183 case InventoryLocationType.HANDS:
184 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[inv] HumanInventory::ThrowEntity item=" + item);
185 HandEventThrow throwEvent = new HandEventThrow(GetManOwner(), src);
186 throwEvent.SetForce(dir * force);
187 HandEvent(invMode, throwEvent);
188 return true;
189
190 default:
191 DropEntity(invMode, player, item);
192 return true;
193 }
194 }
195 }
196 Error("No inventory location");
197 return false;
198 }
199
201 {
202 if (src.GetType() == InventoryLocationType.HANDS)
203 {
204 Man man_src = Man.Cast(src.GetParent());
205 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[inv] HI::RedirectToHandEvent - source location == HANDS, player has to handle this");
206
207 EntityAI item = src.GetItem();
208
209 int r_index = FindUserReservedLocationIndex(item);
210
211 if (r_index >= 0)
212 {
214 GetUserReservedLocation(r_index,r_il);
215
217 int r_type = r_il.GetType();
218 if (r_type == InventoryLocationType.CARGO || r_type == InventoryLocationType.PROXYCARGO)
219 {
220 r_il.GetParent().GetOnReleaseLock().Invoke(item);
221 }
222 else if (r_type == InventoryLocationType.ATTACHMENT)
223 {
224 r_il.GetParent().GetOnAttachmentReleaseLock().Invoke(item, r_il.GetSlot());
225 }
226 }
227
228 man_src.GetHumanInventory().HandEvent(mode, new HandEventMoveTo(man_src, src, dst));
229 return true;
230 }
231
232 if (dst.GetType() == InventoryLocationType.HANDS)
233 {
234 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[inv] HI::RedirectToHandEvent - dst location == HANDS, player has to handle this");
235
236 Man man_dst = Man.Cast(dst.GetParent());
237 man_dst.GetHumanInventory().HandEvent(mode, new HandEventTake(man_dst, src));
238 return true;
239 }
240 return false;
241 }
242
243 override bool TakeToDst(InventoryMode mode, notnull InventoryLocation src, notnull InventoryLocation dst)
244 {
245 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[inv] Take2Dst(" + typename.EnumToString(InventoryMode, mode) + ") src=" + InventoryLocation.DumpToStringNullSafe(src) + " dst=" + InventoryLocation.DumpToStringNullSafe(dst));
246
247 if (GetManOwner().IsAlive() && RedirectToHandEvent(mode, src, dst))
248 return true;
249
250 return super.TakeToDst(mode, src, dst);
251 }
252
254 {
256 if (item.GetInventory().GetCurrentInventoryLocation(src))
257 {
259 if (FindFreeLocationFor(item, flags, dst))
260 {
261 if (RedirectToHandEvent(mode, src, dst))
262 return true;
263
264 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[inv] HumanInventory::Take2Inv(" + typename.EnumToString(InventoryMode, mode) + ") item=" + item);
265 return super.TakeEntityToInventory(mode, flags, item);
266 }
267 else
268 return false; // no room
269 }
270 Error("HumanInventory::TakeEntityToInventory: No inventory location");
271 return false;
272 }
273
277 override bool TakeEntityToCargoEx(InventoryMode mode, notnull EntityAI item, int idx, int row, int col)
278 {
280 GameInventory itemInventory = item.GetInventory();
281 if (itemInventory.GetCurrentInventoryLocation(src))
282 {
283 switch (src.GetType())
284 {
285 case InventoryLocationType.HANDS:
286 EntityAI inventoryOwner = GetInventoryOwner();
287 if (inventoryOwner.IsAlive())
288 {
289 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[inv] HumanInventory::Take2Cgo(" + typename.EnumToString(InventoryMode, mode) + ") item=" + item + " row=" + row + " col=" + col);
291 dst.SetCargo(inventoryOwner, item, idx, row, col, itemInventory.GetFlipCargo());
292
293 HandEvent(mode, new HandEventMoveTo(GetManOwner(), src, dst));
294 return true;
295 }
296
297 return super.TakeEntityToCargoEx(mode, item, idx, row, col);
298
299 default:
300 return super.TakeEntityToCargoEx(mode, item, idx, row, col);
301 }
302 }
303
304 Error("HumanInventory::TakeEntityToCargoEx: No inventory location");
305 return false;
306 }
307
308 override bool TakeEntityAsAttachmentEx(InventoryMode mode, notnull EntityAI item, int slot)
309 {
311 if (item.GetInventory().GetCurrentInventoryLocation(src))
312 {
313 switch (src.GetType())
314 {
315 case InventoryLocationType.HANDS:
316 EntityAI inventoryOwner = GetInventoryOwner();
317 if (inventoryOwner.IsAlive())
318 {
319 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[inv] HumanInventory::Take2Att(" + typename.EnumToString(InventoryMode, mode) + ") item=" + item + " slot=" + slot);
321 dst.SetAttachment(inventoryOwner, item, slot);
322
323 HandEvent(mode, new HandEventMoveTo(GetManOwner(), src, dst));
324 return true;
325 }
326
327 return super.TakeEntityAsAttachmentEx(mode, item, slot);
328
329 default:
330 return super.TakeEntityAsAttachmentEx(mode, item, slot);
331 }
332 }
333
334 Error("HumanInventory::TakeEntityAsAttachmentEx: No inventory location");
335 return false;
336 }
337
338 override bool SwapEntities(InventoryMode mode, notnull EntityAI item1, notnull EntityAI item2)
339 {
340 InventoryLocation src1, src2, dst1, dst2;
341 if (GameInventory.MakeSrcAndDstForSwap(item1, item2, src1, src2, dst1, dst2))
342 {
343 bool handled = false;
344 switch (src1.GetType())
345 {
346 case InventoryLocationType.HANDS:
348 InventoryLocation fswap_dst2 = new InventoryLocation;
349 if ( SwappingToPreviousLocation(item1, item2, fswap_dst2) )
350 {
351 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[inv] HumanInventory::Swap HandEventForceSwap(" + typename.EnumToString(InventoryMode, mode) + ") IH=src1=" + InventoryLocation.DumpToStringNullSafe(src1) + " src2=" + InventoryLocation.DumpToStringNullSafe(src2));
352 HandEvent(mode, new HandEventForceSwap(GetManOwner(), src1, src2, dst1, fswap_dst2));
353 }
354 else
355 {
356 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[inv] HumanInventory::Swap HandEventSwap(" + typename.EnumToString(InventoryMode, mode) + ") src1=" + InventoryLocation.DumpToStringNullSafe(src1) + "src2=" + InventoryLocation.DumpToStringNullSafe(src2));
357 HandEvent(mode, new HandEventSwap(GetManOwner(), src1, src2, dst1, dst2));
358 }
359 handled = true;
360 break;
361 }
362
363 switch (src2.GetType())
364 {
365 case InventoryLocationType.HANDS:
366 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[inv] HumanInventory::Swap HandEventSwap2(" + typename.EnumToString(InventoryMode, mode) + ") src1=" + InventoryLocation.DumpToStringNullSafe(src1) + " IH=src2=" + InventoryLocation.DumpToStringNullSafe(src2));
367 HandEvent(mode, new HandEventSwap(GetManOwner(), src2, src1, dst2, dst1));
368 handled = true;
369 break;
370 }
371
372 if (!handled)
373 return super.SwapEntities(mode, item1, item2);
374
375 return true;
376 }
377
378 Error("HumanInventory::SwapEntities: cannot create src1, src2, dst1, dst2");
379 return false;
380 }
381
382 override bool ForceSwapEntities(InventoryMode mode, notnull EntityAI item1, notnull EntityAI item2, notnull InventoryLocation item2_dst)
383 {
384 InventoryLocation src1, src2, dst1;
385 if (GameInventory.MakeSrcAndDstForForceSwap(item1, item2, src1, src2, dst1, item2_dst))
386 {
387 GameInventory manOwnerInventory = GetManOwner().GetInventory();
388
389 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[inv] HumanInventory::FSwap(" + typename.EnumToString(InventoryMode, mode) + ") dst1=" + InventoryLocation.DumpToStringNullSafe(dst1)+ " dst2=" + InventoryLocation.DumpToStringNullSafe(item2_dst));
390 bool handled = false;
391 switch (src1.GetType())
392 {
393 case InventoryLocationType.HANDS:
394 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[inv] HumanInventory::FSwap-HND@1(" + typename.EnumToString(InventoryMode, mode) + ") src1=" + InventoryLocation.DumpToStringNullSafe(src1) + " src2=" + InventoryLocation.DumpToStringNullSafe(src2) + " dst1=" + InventoryLocation.DumpToStringNullSafe(dst1) + " item2_dst=" + InventoryLocation.DumpToStringNullSafe(item2_dst));
395 HandEventBase e = new HandEventForceSwap(GetManOwner(), src1, src2, dst1, item2_dst);
397 HandEvent(mode, e);
398 handled = true;
399 break;
400
401 }
402
403 switch (src2.GetType())
404 {
405 case InventoryLocationType.HANDS:
407 InventoryLocation fswap_dst2 = new InventoryLocation;
408 if ( SwappingToPreviousLocation(item2, item1, fswap_dst2))
409 {
410 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[inv] HumanInventory::FSwap-PREV(" + typename.EnumToString(InventoryMode, mode) + ") src1=" + InventoryLocation.DumpToStringNullSafe(src1) + " src2=" + InventoryLocation.DumpToStringNullSafe(src2) + " dst1=" + InventoryLocation.DumpToStringNullSafe(dst1) + " fswap_dst2=" + InventoryLocation.DumpToStringNullSafe(fswap_dst2));
411 HandEvent(mode, new HandEventForceSwap(GetManOwner(), src1, src2, dst1, fswap_dst2));
412 }
413 else
414 {
415 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[inv] HumanInventory::FSwap-HND@2(" + typename.EnumToString(InventoryMode, mode) + ") src1=" + InventoryLocation.DumpToStringNullSafe(src1) + " src2=" + InventoryLocation.DumpToStringNullSafe(src2) + " dst1=" + InventoryLocation.DumpToStringNullSafe(dst1) + " item2_dst=" + InventoryLocation.DumpToStringNullSafe(item2_dst));
416 HandEvent(mode, new HandEventForceSwap(GetManOwner(), src1, src2, dst1, item2_dst));
417 }
418
419 handled = true;
420 break;
421 }
422
423 bool returnValue = true;
424
425 if (!handled)
426 returnValue = super.ForceSwapEntities(mode, item1, item2, item2_dst);
427
428 return returnValue;
429 }
430
431 Error("HumanInventory::ForceSwapEntities: No inventory location");
432 return false;
433 }
434
435 override bool LocalDestroyEntity(notnull EntityAI item)
436 {
438 if (item.GetInventory().GetCurrentInventoryLocation(src))
439 {
440 switch (src.GetType())
441 {
442 case InventoryLocationType.HANDS:
443 if (GetInventoryOwner().IsAlive())
444 {
445 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[inv] HumanInventory::LocalDestroy inv item=" + item);
446 HandEvent(InventoryMode.LOCAL, new HandEventDestroy(GetManOwner(), src));
447 return true;
448 }
449
450 return super.LocalDestroyEntity(item);
451
452 default:
453 return super.LocalDestroyEntity(item);
454 }
455 }
456
457 Error("LocalDestroyEntity: No inventory location");
458 return false;
459 }
460
462 {
463 EntityAI itemInHands = GetEntityInHands();
464 if (itemInHands == lambda.m_OldItem)
465 return ReplaceItemInHandsWithNew(mode, lambda);
466
467 return super.ReplaceItemWithNew(mode, lambda);
468 }
469
471 {
472 HandEventBase heb = new HandEventDestroyElsewhereAndReplaceWithNewInHands(GetManOwner(), null, lambda);
474 }
475
477 {
478 if (GetEntityInHands())
479 {
480 Error("[inv] HumanInventory::ReplaceItemInElsewhereWithNewinHandsImpl Item in hands, event=" + e.DumpToString());
481 return false;
482 }
483
484 InventoryLocation dst = e.GetDst();
485 if (dst)
486 {
487 switch (dst.GetType())
488 {
489 case InventoryLocationType.HANDS:
490 if (GetInventoryOwner().IsAlive())
491 {
492 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[inv] HumanInventory::ReplaceItemInElsewhereWithNewinHandsImpl event=" + e);
493 HandEvent(mode, e);
494 return true;
495 }
496
497 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[inv] HumanInventory::ReplaceItemInElsewhereWithNewinHandsImpl DEAD_owner=" + GetInventoryOwner().GetName() +"="+ GetInventoryOwner());
498 Error("HumanInventory::ReplaceItemInElsewhereWithNewinHandsImpl TODO"); // replace-with-new in corpse's hands, not implemented
499 return false;
500
501 default:
502 Error("[inv] HumanInventory::ReplaceItemInElsewhereWithNewinHandsImpl src has to be hands");
503 return false;
504 }
505 }
506
507 Error("[inv] HumanInventory::ReplaceItemInElsewhereWithNewinHandsImpl no dst in event, event=" + e.DumpToString());
508 return false;
509 }
510
512 {
513 EntityAI itemInHands = GetEntityInHands();
515 if (itemInHands && itemInHands.GetInventory().GetCurrentInventoryLocation(src))
516 {
517 switch (src.GetType())
518 {
519 case InventoryLocationType.HANDS:
520 if ((mode != InventoryMode.SERVER) && GetInventoryOwner().IsAlive())
521 {
522 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[inv] HumanInventory::ReplaceItemInHandsWithNewImpl event=" + e);
523 HandEvent(mode, e);
524 return true;
525 }
526
527 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[inv] HumanInventory::ReplaceItemInHandsWithNewImpl DEAD_owner=" + GetInventoryOwner().GetName() +"="+ GetInventoryOwner());
528 HandEvent(mode, e);
529 return true;
530
531 default:
532 Error("[inv] HumanInventory::ReplaceItemInHandsWithNewImpl src has to be hands");
533 return false;
534 }
535 }
536
537 Error("[inv] HumanInventory::ReplaceItemInHandsWithNewImpl No item in hands, event=" + e.DumpToString());
538 return false;
539 }
540
546
548 {
549 HandEventBase heb = new HandEventDestroyAndReplaceWithNewElsewhere(GetManOwner(), null, lambda);
550 return ReplaceItemInHandsWithNewImpl(mode, heb);
551 }
552
554 {
555 bool SwapToPrevious = true;
558 dst = new InventoryLocation();
559 GameInventory item1Inventory = item1.GetInventory();
560 if (item1Inventory.GetCurrentInventoryLocation(src1) && item2.GetInventory().GetCurrentInventoryLocation(src2))
561 {
562 if (item1.m_OldLocation && item1.m_OldLocation.IsValid() && !item1.m_OldLocation.CollidesWith(src2) && item1.m_OldLocation.GetParent() && item1.m_OldLocation.GetParent().GetHierarchyRootPlayer())
563 {
564 dst.Copy(item1.m_OldLocation);
565
566 if (src2.GetType() == InventoryLocationType.ATTACHMENT) //item2 is currently attached somewhere
567 {
568 int count = item1Inventory.GetSlotIdCount();
569 for (int i = 0; i < count; ++i)
570 {
571 int slotID = item1Inventory.GetSlotId(i);
572 if (src2.GetSlot() == slotID) //can be attached into the same slot. And will be.
573 return false;
574 }
575 }
576
577 if (!item1.m_OldLocation.GetParent().GetInventory().LocationCanAddEntity(item1.m_OldLocation))
578 SwapToPrevious = false;
579
580 if (CanSwapEntitiesEx(item1,item2))
581 SwapToPrevious = false;
582
583 if (SwapToPrevious)
584 return true;
585 }
586 }
587
588 return false;
589 }
590
592
593 void Update(float delta_time)
594 {
597 {
600 ctx.Write(InventoryCommandType.USER_RESERVATION_CANCEL);
602 ctx.Send();
603
605
608 EntityAI item = il.GetItem();
609 item.GetOnReleaseLock().Invoke(item);
611 }
612 }
613
615 {
616 validation.m_Result = InventoryValidationResult.SUCCESS;
617
618 int index = -1;
619 if (!ctx.Read(index))
620 {
622 return true;
623 }
624
626 //m_UserReservationToClear = index;
627
628 return true;
629 }
630
632 {
633 return true;
634 }
635
636
637 bool PostDeferredForceSwapEntities(InventoryMode mode, notnull EntityAI item1, notnull EntityAI item2, notnull InventoryLocation dst1, notnull InventoryLocation dst2)
638 {
639 return true;
640 }
641
642 bool OnInventoryCheck(int userDataType, ParamsReadContext ctx)
643 {
644 return false;
645 }
646}
InventoryCommandType
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
InventoryValidationResult
const int INPUT_UDT_INVENTORY
DayZGame g_Game
Определения DayZGame.c:3942
void hndDebugPrint(string s)
Определения HandFSM.c:1
FindInventoryLocationType
flags for searching locations in inventory
Определения InventoryLocation.c:18
InventoryLocationType
types of Inventory Location
Определения InventoryLocation.c:4
Определения DayZPlayerImplement.c:87
proto native bool GetFlipCargo()
proto native bool GetCurrentInventoryLocation(out notnull InventoryLocation loc)
returns information about current item location
static bool MakeSrcAndDstForSwap(notnull EntityAI item1, notnull EntityAI item2, out InventoryLocation src1, out InventoryLocation src2, out InventoryLocation dst1, out InventoryLocation dst2)
helper function for swap
static bool CanSwapEntitiesEx(notnull EntityAI item1, notnull EntityAI item2)
static bool MakeSrcAndDstForForceSwap(notnull EntityAI item1, notnull EntityAI item2, out InventoryLocation src1, out InventoryLocation src2, out InventoryLocation dst1, notnull InventoryLocation dst2)
helper function for ForceSwap
proto native EntityAI GetInventoryOwner()
Engine native functions.
proto native int GetSlotId(int index)
attachments
proto native int GetSlotIdCount()
proto native bool FindFreeLocationFor(notnull EntityAI item, FindInventoryLocationType flags, out notnull InventoryLocation loc)
FindFreeLocationFor.
script counterpart to engine's class Inventory
override InventoryLocation GetDst()
Определения Hand_Events.c:215
override bool ReserveInventory()
Определения Hand_Events.c:699
override string DumpToString()
Определения Hand_Events.c:338
Abstracted event, not to be used, only inherited.
Определения Hand_Events.c:212
Определения Hand_Events.c:726
represent hand state base
Определения HandAnimatedForceSwapping.c:4
override bool ReplaceItemWithNew(InventoryMode mode, ReplaceItemWithNewLambdaBase lambda)
Определения HumanInventory.c:461
proto native void SetUserReservedLocation(notnull EntityAI eai, notnull InventoryLocation dst)
int m_syncClearUserReservationindex
Определения HumanInventory.c:11
void ClearUserReservedLocationAtIndexSynced(int index)
Определения HumanInventory.c:85
Man GetManOwner()
Определения HumanInventory.c:102
override bool TakeEntityAsAttachmentEx(InventoryMode mode, notnull EntityAI item, int slot)
Определения HumanInventory.c:308
proto native bool TestAddEntityInHands(EntityAI e, bool do_resevation_check, bool do_item_check, bool do_lock_check, bool do_occupancy_test, bool do_script_check)
bool ProcessHandEvent(HandEventBase e)
proto native void ClearUserReservedLocationForContainer(notnull EntityAI eai)
proto native int GetUserReservedLocationCount()
bool OnInventoryCheck(int userDataType, ParamsReadContext ctx)
Определения HumanInventory.c:642
proto native int FindCollidingUserReservedLocationIndex(notnull EntityAI e, notnull InventoryLocation dst)
bool HandEvent(InventoryMode mode, HandEventBase e)
Определения HumanInventory.c:134
proto native EntityAI CreateInHands(string typeName)
creates new entity in hands
proto native int FindFirstUserReservedLocationIndexForContainer(notnull EntityAI e)
override EntityAI CreateInInventory(string type)
creates entity somewhere in inventory
Определения HumanInventory.c:65
void ClearUserReservedLocationSynced(notnull EntityAI eai)
Определения HumanInventory.c:73
void OnHandsEnteredStableState(HandStateBase src, HandStateBase dst)
void OnEntityInHandsDestroyed(InventoryLocation src)
Определения HumanInventory.c:126
bool ReplaceItemInHandsWithNewElsewhere(InventoryMode mode, ReplaceItemWithNewLambdaBase lambda)
Определения HumanInventory.c:547
proto native bool CanOpenInventory()
bool PostDeferredForceSwapEntities(InventoryMode mode, notnull EntityAI item1, notnull EntityAI item2, notnull InventoryLocation dst1, notnull InventoryLocation dst2)
Определения HumanInventory.c:637
proto native EntityAI GetEntityInHands()
void OnHandsExitedStableState(HandStateBase src, HandStateBase dst)
bool RedirectToHandEvent(InventoryMode mode, notnull InventoryLocation src, notnull InventoryLocation dst)
Определения HumanInventory.c:200
bool ReplaceItemElsewhereWithNewInHands(InventoryMode mode, ReplaceItemWithNewLambdaBase lambda)
Определения HumanInventory.c:470
bool HasEntityInHands(EntityAI e)
Определения HumanInventory.c:107
proto native void ClearUserReservedLocation(notnull EntityAI eai)
void HandleInventoryManipulation()
override bool TakeEntityToInventory(InventoryMode mode, FindInventoryLocationType flags, notnull EntityAI item)
Определения HumanInventory.c:253
proto native int FindUserReservedLocationIndex(notnull EntityAI e)
void OnHandsStateChanged(HandStateBase src, HandStateBase dst)
override bool LocalDestroyEntity(notnull EntityAI item)
Определения HumanInventory.c:435
override bool DropEntity(InventoryMode mode, EntityAI owner, notnull EntityAI item)
Определения HumanInventory.c:139
proto native bool CanAddEntityInHands(EntityAI e)
alternative for TestAddEntityInHands(e, true, true, true);
bool ValidateUserReservationCancel(inout Serializer ctx, InventoryValidation validation)
Определения HumanInventory.c:614
bool ReplaceItemInHandsWithNewImpl(InventoryMode mode, HandEventBase e)
Определения HumanInventory.c:511
override bool TakeEntityToCargoEx(InventoryMode mode, notnull EntityAI item, int idx, int row, int col)
Put item into into cargo on specific cargo location.
Определения HumanInventory.c:277
proto native void GetUserReservedLocation(int index, out notnull InventoryLocation dst)
bool ReplaceItemInHandsWithNew(InventoryMode mode, ReplaceItemWithNewLambdaBase lambda)
Определения HumanInventory.c:541
override bool TakeToDst(InventoryMode mode, notnull InventoryLocation src, notnull InventoryLocation dst)
Определения HumanInventory.c:243
proto native bool ClearUserReservedLocationAtIndex(int index)
override bool ForceSwapEntities(InventoryMode mode, notnull EntityAI item1, notnull EntityAI item2, notnull InventoryLocation item2_dst)
Определения HumanInventory.c:382
bool SwappingToPreviousLocation(EntityAI item1, EntityAI item2, out InventoryLocation dst)
Определения HumanInventory.c:553
override bool SwapEntities(InventoryMode mode, notnull EntityAI item1, notnull EntityAI item2)
Определения HumanInventory.c:338
bool ReplaceItemInElsewhereWithNewinHandsImpl(InventoryMode mode, HandEventBase e)
Определения HumanInventory.c:476
void OnEntityInHandsCreated(InventoryLocation src)
Определения HumanInventory.c:118
proto native bool GetDebugFlag()
bool ThrowEntity(EntityAI item, vector dir, float force)
Определения HumanInventory.c:164
void Update(float delta_time)
Определения HumanInventory.c:593
proto native bool CanRemoveEntityInHands()
bool PostDeferredEventTakeToDst(InventoryMode mode, notnull InventoryLocation src, notnull InventoryLocation dst)
Определения HumanInventory.c:631
inventory for plain man/human
Определения HumanInventory.c:10
proto native EntityAI GetParent()
returns parent of current inventory location
static string DumpToStringNullSafe(InventoryLocation loc)
Определения InventoryLocation.c:233
proto native void SetAttachment(notnull EntityAI parent, EntityAI e, int slotId)
sets current inventory location type to Attachment with slot id set to <slotId>
proto native int GetSlot()
returns slot id if current type is Attachment
proto native InventoryLocation Copy(notnull InventoryLocation rhs)
copies location data to another location
proto native int GetType()
returns type of InventoryLocation
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native EntityAI GetItem()
returns item of current inventory location
InventoryLocation.
Определения InventoryLocation.c:30
InventoryValidationResult m_Result
static bool IsInventoryHFSMLogEnable()
Определения 3_Game/DayZ/tools/Debug.c:766
base class for transformation operations (creating one item from another)
Определения ReplaceItemWithNewLambdaBase.c:5
proto native void Send()
proto static native bool CanStoreInputUserData()
Returns true when the channel is free, AND the InputBuffer is NOT full (same as '!...
Определения gameplay.c:121
proto bool Write(void value_out)
Serialization general interface. Serializer API works with:
Определения Serializer.c:56
Определения EnConvert.c:119
Serializer ParamsReadContext
Определения gameplay.c:15
void Error(string err)
Messagebox with error message.
Определения EnDebug.c:90
proto native owned string GetName()
Test name getter. Strictly for UI porposes!
Определения SyncedValue.c:119