DayZ 1.27
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 (GetGame().IsClient())
77 else if (!GetGame().IsMultiplayer())
78 {
80 eai.GetOnReleaseLock().Invoke(eai);
81 }
82
83 }
84
86 {
87 if (GetGame().IsClient())
89 else if (!GetGame().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 && item.GetInventory() && item.GetInventory().GetCurrentInventoryLocation(src))
143 {
144 switch (src.GetType())
145 {
146 case InventoryLocationType.HANDS:
147 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[inv] HumanInventory::DropEntity(" + typename.EnumToString(InventoryMode, mode) + ") item=" + item);
148 HandEvent(mode, new HandEventDrop(GetManOwner(), src));
149 return true;
150
151 default:
152 return super.DropEntity(mode, owner, item);
153 }
154 }
155
156 Error("No inventory location");
157 return false;
158 }
159
160 bool ThrowEntity(EntityAI item, vector dir, float force)
161 {
162 if (GetGame().IsServer() && GetGame().IsMultiplayer())
163 return false;
164
165 DayZPlayer player = DayZPlayer.Cast(item.GetHierarchyRootPlayer());
166 InventoryMode invMode = InventoryMode.PREDICTIVE;
167
168 if (player.NeedInventoryJunctureFromServer(item, item.GetHierarchyParent(), null))
169 invMode = InventoryMode.JUNCTURE;
170
172 if (item && item.GetInventory() && item.GetInventory().GetCurrentInventoryLocation(src))
173 {
174 switch (src.GetType())
175 {
176 case InventoryLocationType.HANDS:
177 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[inv] HumanInventory::ThrowEntity item=" + item);
178 HandEventThrow throwEvent = new HandEventThrow(GetManOwner(), src);
179 throwEvent.SetForce(dir * force);
180 HandEvent(invMode, throwEvent);
181 return true;
182
183 default:
184 DropEntity(invMode, player, item);
185 return true;
186 }
187 }
188 Error("No inventory location");
189 return false;
190 }
191
193 {
194 if (src.GetType() == InventoryLocationType.HANDS)
195 {
196 Man man_src = Man.Cast(src.GetParent());
197 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[inv] HI::RedirectToHandEvent - source location == HANDS, player has to handle this");
198
199 EntityAI item = src.GetItem();
200
201 int r_index = FindUserReservedLocationIndex(item);
202
203 if (r_index >= 0)
204 {
206 GetUserReservedLocation(r_index,r_il);
207
209 int r_type = r_il.GetType();
210 if (r_type == InventoryLocationType.CARGO || r_type == InventoryLocationType.PROXYCARGO)
211 {
212 r_il.GetParent().GetOnReleaseLock().Invoke(item);
213 }
214 else if (r_type == InventoryLocationType.ATTACHMENT)
215 {
216 r_il.GetParent().GetOnAttachmentReleaseLock().Invoke(item, r_il.GetSlot());
217 }
218 }
219
220 man_src.GetHumanInventory().HandEvent(mode, new HandEventMoveTo(man_src, src, dst));
221 return true;
222 }
223
224 if (dst.GetType() == InventoryLocationType.HANDS)
225 {
226 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[inv] HI::RedirectToHandEvent - dst location == HANDS, player has to handle this");
227
228 Man man_dst = Man.Cast(dst.GetParent());
229 man_dst.GetHumanInventory().HandEvent(mode, new HandEventTake(man_dst, src));
230 return true;
231 }
232 return false;
233 }
234
235 override bool TakeToDst(InventoryMode mode, notnull InventoryLocation src, notnull InventoryLocation dst)
236 {
237 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[inv] Take2Dst(" + typename.EnumToString(InventoryMode, mode) + ") src=" + InventoryLocation.DumpToStringNullSafe(src) + " dst=" + InventoryLocation.DumpToStringNullSafe(dst));
238
239 if (GetManOwner().IsAlive() && RedirectToHandEvent(mode, src, dst))
240 return true;
241
242 return super.TakeToDst(mode, src, dst);
243 }
244
246 {
248 if (item.GetInventory().GetCurrentInventoryLocation(src))
249 {
251 if (FindFreeLocationFor(item, flags, dst))
252 {
253 if (RedirectToHandEvent(mode, src, dst))
254 return true;
255
256 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[inv] HumanInventory::Take2Inv(" + typename.EnumToString(InventoryMode, mode) + ") item=" + item);
257 return super.TakeEntityToInventory(mode, flags, item);
258 }
259 else
260 return false; // no room
261 }
262 Error("HumanInventory::TakeEntityToInventory: No inventory location");
263 return false;
264 }
265
269 override bool TakeEntityToCargoEx(InventoryMode mode, notnull EntityAI item, int idx, int row, int col)
270 {
272 if (item.GetInventory().GetCurrentInventoryLocation(src))
273 {
274 switch (src.GetType())
275 {
276 case InventoryLocationType.HANDS:
277 if (GetInventoryOwner().IsAlive())
278 {
279 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[inv] HumanInventory::Take2Cgo(" + typename.EnumToString(InventoryMode, mode) + ") item=" + item + " row=" + row + " col=" + col);
281 dst.SetCargo(GetInventoryOwner(), item, idx, row, col, item.GetInventory().GetFlipCargo());
282
283 HandEvent(mode, new HandEventMoveTo(GetManOwner(), src, dst));
284 return true;
285 }
286
287 return super.TakeEntityToCargoEx(mode, item, idx, row, col);
288
289 default:
290 return super.TakeEntityToCargoEx(mode, item, idx, row, col);
291 }
292 }
293
294 Error("HumanInventory::TakeEntityToCargoEx: No inventory location");
295 return false;
296 }
297
298 override bool TakeEntityAsAttachmentEx(InventoryMode mode, notnull EntityAI item, int slot)
299 {
301 if (item.GetInventory().GetCurrentInventoryLocation(src))
302 {
303 switch (src.GetType())
304 {
305 case InventoryLocationType.HANDS:
306 if (GetInventoryOwner().IsAlive())
307 {
308 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[inv] HumanInventory::Take2Att(" + typename.EnumToString(InventoryMode, mode) + ") item=" + item + " slot=" + slot);
310 EntityAI src_entity = GetInventoryOwner();
311 dst.SetAttachment(src_entity, item, slot);
312
313 HandEvent(mode, new HandEventMoveTo(GetManOwner(), src, dst));
314 return true;
315 }
316
317 return super.TakeEntityAsAttachmentEx(mode, item, slot);
318
319 default:
320 return super.TakeEntityAsAttachmentEx(mode, item, slot);
321 }
322 }
323
324 Error("HumanInventory::TakeEntityAsAttachmentEx: No inventory location");
325 return false;
326 }
327
328 override bool SwapEntities(InventoryMode mode, notnull EntityAI item1, notnull EntityAI item2)
329 {
330 InventoryLocation src1, src2, dst1, dst2;
331 if (GameInventory.MakeSrcAndDstForSwap(item1, item2, src1, src2, dst1, dst2))
332 {
333 bool handled = false;
334 switch (src1.GetType())
335 {
336 case InventoryLocationType.HANDS:
338 InventoryLocation fswap_dst2 = new InventoryLocation;
339 if ( SwappingToPreviousLocation(item1, item2, fswap_dst2) )
340 {
341 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[inv] HumanInventory::Swap HandEventForceSwap(" + typename.EnumToString(InventoryMode, mode) + ") IH=src1=" + InventoryLocation.DumpToStringNullSafe(src1) + " src2=" + InventoryLocation.DumpToStringNullSafe(src2));
342 HandEvent(mode, new HandEventForceSwap(GetManOwner(), src1, src2, dst1, fswap_dst2));
343 }
344 else
345 {
346 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[inv] HumanInventory::Swap HandEventSwap(" + typename.EnumToString(InventoryMode, mode) + ") src1=" + InventoryLocation.DumpToStringNullSafe(src1) + "src2=" + InventoryLocation.DumpToStringNullSafe(src2));
347 HandEvent(mode, new HandEventSwap(GetManOwner(), src1, src2, dst1, dst2));
348 }
349 handled = true;
350 break;
351 }
352
353 switch (src2.GetType())
354 {
355 case InventoryLocationType.HANDS:
356 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[inv] HumanInventory::Swap HandEventSwap2(" + typename.EnumToString(InventoryMode, mode) + ") src1=" + InventoryLocation.DumpToStringNullSafe(src1) + " IH=src2=" + InventoryLocation.DumpToStringNullSafe(src2));
357 HandEvent(mode, new HandEventSwap(GetManOwner(), src2, src1, dst2, dst1));
358 handled = true;
359 break;
360 }
361
362 if (!handled)
363 return super.SwapEntities(mode, item1, item2);
364
365 return true;
366 }
367
368 Error("HumanInventory::SwapEntities: cannot create src1, src2, dst1, dst2");
369 return false;
370 }
371
372 override bool ForceSwapEntities(InventoryMode mode, notnull EntityAI item1, notnull EntityAI item2, notnull InventoryLocation item2_dst)
373 {
374 InventoryLocation src1, src2, dst1;
375 if (GameInventory.MakeSrcAndDstForForceSwap(item1, item2, src1, src2, dst1, item2_dst))
376 {
377 GameInventory manOwnerInventory = GetManOwner().GetInventory();
378
379 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[inv] HumanInventory::FSwap(" + typename.EnumToString(InventoryMode, mode) + ") dst1=" + InventoryLocation.DumpToStringNullSafe(dst1)+ " dst2=" + InventoryLocation.DumpToStringNullSafe(item2_dst));
380 bool handled = false;
381 switch (src1.GetType())
382 {
383 case InventoryLocationType.HANDS:
384 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));
385 HandEventBase e = new HandEventForceSwap(GetManOwner(), src1, src2, dst1, item2_dst);
387 HandEvent(mode, e);
388 handled = true;
389 break;
390
391 }
392
393 switch (src2.GetType())
394 {
395 case InventoryLocationType.HANDS:
397 InventoryLocation fswap_dst2 = new InventoryLocation;
398 if ( SwappingToPreviousLocation(item2, item1, fswap_dst2))
399 {
400 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));
401 HandEvent(mode, new HandEventForceSwap(GetManOwner(), src1, src2, dst1, fswap_dst2));
402 }
403 else
404 {
405 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));
406 HandEvent(mode, new HandEventForceSwap(GetManOwner(), src1, src2, dst1, item2_dst));
407 }
408
409 handled = true;
410 break;
411 }
412
413 bool returnValue = true;
414
415 if (!handled)
416 returnValue = super.ForceSwapEntities(mode, item1, item2, item2_dst);
417
418 return returnValue;
419 }
420
421 Error("HumanInventory::ForceSwapEntities: No inventory location");
422 return false;
423 }
424
425 override bool LocalDestroyEntity(notnull EntityAI item)
426 {
428 if (item.GetInventory().GetCurrentInventoryLocation(src))
429 {
430 switch (src.GetType())
431 {
432 case InventoryLocationType.HANDS:
433 if (GetInventoryOwner().IsAlive())
434 {
435 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[inv] HumanInventory::LocalDestroy inv item=" + item);
436 HandEvent(InventoryMode.LOCAL, new HandEventDestroy(GetManOwner(), src));
437 return true;
438 }
439
440 return super.LocalDestroyEntity(item);
441
442 default:
443 return super.LocalDestroyEntity(item);
444 }
445 }
446
447 Error("LocalDestroyEntity: No inventory location");
448 return false;
449 }
450
452 {
453 EntityAI itemInHands = GetEntityInHands();
454 if (itemInHands == lambda.m_OldItem)
455 return ReplaceItemInHandsWithNew(mode, lambda);
456
457 return super.ReplaceItemWithNew(mode, lambda);
458 }
459
461 {
462 return ReplaceItemInElsewhereWithNewinHandsImpl(mode, new HandEventDestroyElsewhereAndReplaceWithNewInHands(GetManOwner(), null, lambda));
463 }
464
466 {
467 if (GetEntityInHands())
468 {
469 Error("[inv] HumanInventory::ReplaceItemInElsewhereWithNewinHandsImpl Item in hands, event=" + e.DumpToString());
470 return false;
471 }
472
473 InventoryLocation dst = e.GetDst();
474 if (dst)
475 {
476 switch (dst.GetType())
477 {
478 case InventoryLocationType.HANDS:
479 if (GetInventoryOwner().IsAlive())
480 {
481 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[inv] HumanInventory::ReplaceItemInElsewhereWithNewinHandsImpl event=" + e);
482 HandEvent(mode, e);
483 return true;
484 }
485
486 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[inv] HumanInventory::ReplaceItemInElsewhereWithNewinHandsImpl DEAD_owner=" + GetInventoryOwner().GetName() +"="+ GetInventoryOwner());
487 Error("HumanInventory::ReplaceItemInElsewhereWithNewinHandsImpl TODO"); // replace-with-new in corpse's hands, not implemented
488 return false;
489
490 default:
491 Error("[inv] HumanInventory::ReplaceItemInElsewhereWithNewinHandsImpl src has to be hands");
492 return false;
493 }
494 }
495
496 Error("[inv] HumanInventory::ReplaceItemInElsewhereWithNewinHandsImpl no dst in event, event=" + e.DumpToString());
497 return false;
498 }
499
501 {
502 EntityAI itemInHands = GetEntityInHands();
504 if (itemInHands && itemInHands.GetInventory().GetCurrentInventoryLocation(src))
505 {
506 switch (src.GetType())
507 {
508 case InventoryLocationType.HANDS:
509 if ((mode != InventoryMode.SERVER) && GetInventoryOwner().IsAlive())
510 {
511 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[inv] HumanInventory::ReplaceItemInHandsWithNewImpl event=" + e);
512 HandEvent(mode, e);
513 return true;
514 }
515
516 if (LogManager.IsInventoryHFSMLogEnable()) hndDebugPrint("[inv] HumanInventory::ReplaceItemInHandsWithNewImpl DEAD_owner=" + GetInventoryOwner().GetName() +"="+ GetInventoryOwner());
517 HandEvent(mode, e);
518 return true;
519
520 default:
521 Error("[inv] HumanInventory::ReplaceItemInHandsWithNewImpl src has to be hands");
522 return false;
523 }
524 }
525
526 Error("[inv] HumanInventory::ReplaceItemInHandsWithNewImpl No item in hands, event=" + e.DumpToString());
527 return false;
528 }
529
534
536 {
537 return ReplaceItemInHandsWithNewImpl(mode, new HandEventDestroyAndReplaceWithNewElsewhere(GetManOwner(), null, lambda));
538 }
539
541 {
542 bool SwapToPrevious = true;
545 dst = new InventoryLocation();
546 if (item1.GetInventory().GetCurrentInventoryLocation(src1) && item2.GetInventory().GetCurrentInventoryLocation(src2))
547 {
548 if (item1.m_OldLocation && item1.m_OldLocation.IsValid() && !item1.m_OldLocation.CollidesWith(src2) && item1.m_OldLocation.GetParent() && item1.m_OldLocation.GetParent().GetHierarchyRootPlayer())
549 {
550 dst.Copy(item1.m_OldLocation);
551
552 int count = item1.GetInventory().GetSlotIdCount();
553 if (count > 0 && src2.GetType() == InventoryLocationType.ATTACHMENT) //item2 is currently attached somewhere
554 {
555 for (int i = 0; i < count; i++)
556 {
557 int slotID = item1.GetInventory().GetSlotId(i);
558 if (src2.GetSlot() == slotID) //can be attached into the same slot. And will be.
559 return false;
560 }
561 }
562
563 if (!item1.m_OldLocation.GetParent().GetInventory().LocationCanAddEntity(item1.m_OldLocation))
564 SwapToPrevious = false;
565
566 if (CanSwapEntitiesEx(item1,item2))
567 SwapToPrevious = false;
568
569 if (SwapToPrevious)
570 return true;
571 }
572 }
573
574 return false;
575 }
576
578
579 void Update(float delta_time)
580 {
583 {
586 ctx.Write(InventoryCommandType.USER_RESERVATION_CANCEL);
588 ctx.Send();
589
591
594 EntityAI item = il.GetItem();
595 item.GetOnReleaseLock().Invoke(item);
597 }
598 }
599
601 {
602 validation.m_Result = InventoryValidationResult.SUCCESS;
603
604 int index = -1;
605 if (!ctx.Read(index))
606 {
608 return true;
609 }
610
612 //m_UserReservationToClear = index;
613
614 return true;
615 }
616
618 {
619 return true;
620 }
621
622
623 bool PostDeferredForceSwapEntities(InventoryMode mode, notnull EntityAI item1, notnull EntityAI item2, notnull InventoryLocation dst1, notnull InventoryLocation dst2)
624 {
625 return true;
626 }
627}
InventoryCommandType
Определения Inventory.c:3
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
Определения Inventory.c:22
InventoryValidationResult
Определения Inventory.c:30
const int INPUT_UDT_INVENTORY
Определения _constants.c:9
void hndDebugPrint(string s)
Определения HandFSM.c:1
FindInventoryLocationType
flags for searching locations in inventory
Определения InventoryLocation.c:17
InventoryLocationType
types of Inventory Location
Определения InventoryLocation.c:4
Определения Building.c:6
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
Определения Inventory.c:1209
static bool CanSwapEntitiesEx(notnull EntityAI item1, notnull EntityAI item2)
Определения Inventory.c:628
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
Определения Inventory.c:1221
proto native EntityAI GetInventoryOwner()
Engine native functions.
proto native bool FindFreeLocationFor(notnull EntityAI item, FindInventoryLocationType flags, out notnull InventoryLocation loc)
FindFreeLocationFor.
script counterpart to engine's class Inventory
Определения Inventory.c:79
override InventoryLocation GetDst()
Определения Hand_Events.c:212
override bool ReserveInventory()
Определения Hand_Events.c:652
override string DumpToString()
Определения Hand_Events.c:332
Abstracted event, not to be used, only inherited.
Определения Hand_Events.c:209
Определения Hand_Events.c:679
represent hand state base
Определения HandAnimatedForceSwapping.c:4
override bool ReplaceItemWithNew(InventoryMode mode, ReplaceItemWithNewLambdaBase lambda)
Определения HumanInventory.c:451
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:298
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()
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:535
proto native bool CanOpenInventory()
bool PostDeferredForceSwapEntities(InventoryMode mode, notnull EntityAI item1, notnull EntityAI item2, notnull InventoryLocation dst1, notnull InventoryLocation dst2)
Определения HumanInventory.c:623
proto native EntityAI GetEntityInHands()
void OnHandsExitedStableState(HandStateBase src, HandStateBase dst)
bool RedirectToHandEvent(InventoryMode mode, notnull InventoryLocation src, notnull InventoryLocation dst)
Определения HumanInventory.c:192
bool ReplaceItemElsewhereWithNewInHands(InventoryMode mode, ReplaceItemWithNewLambdaBase lambda)
Определения HumanInventory.c:460
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:245
proto native int FindUserReservedLocationIndex(notnull EntityAI e)
void OnHandsStateChanged(HandStateBase src, HandStateBase dst)
override bool LocalDestroyEntity(notnull EntityAI item)
Определения HumanInventory.c:425
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:600
bool ReplaceItemInHandsWithNewImpl(InventoryMode mode, HandEventBase e)
Определения HumanInventory.c:500
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:269
proto native void GetUserReservedLocation(int index, out notnull InventoryLocation dst)
bool ReplaceItemInHandsWithNew(InventoryMode mode, ReplaceItemWithNewLambdaBase lambda)
Определения HumanInventory.c:530
override bool TakeToDst(InventoryMode mode, notnull InventoryLocation src, notnull InventoryLocation dst)
Определения HumanInventory.c:235
proto native bool ClearUserReservedLocationAtIndex(int index)
override bool ForceSwapEntities(InventoryMode mode, notnull EntityAI item1, notnull EntityAI item2, notnull InventoryLocation item2_dst)
Определения HumanInventory.c:372
bool SwappingToPreviousLocation(EntityAI item1, EntityAI item2, out InventoryLocation dst)
Определения HumanInventory.c:540
override bool SwapEntities(InventoryMode mode, notnull EntityAI item1, notnull EntityAI item2)
Определения HumanInventory.c:328
bool ReplaceItemInElsewhereWithNewinHandsImpl(InventoryMode mode, HandEventBase e)
Определения HumanInventory.c:465
void OnEntityInHandsCreated(InventoryLocation src)
Определения HumanInventory.c:118
proto native bool GetDebugFlag()
bool ThrowEntity(EntityAI item, vector dir, float force)
Определения HumanInventory.c:160
void Update(float delta_time)
Определения HumanInventory.c:579
proto native bool CanRemoveEntityInHands()
bool PostDeferredEventTakeToDst(InventoryMode mode, notnull InventoryLocation src, notnull InventoryLocation dst)
Определения HumanInventory.c:617
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:226
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:29
InventoryValidationResult m_Result
Определения Inventory.c:48
Определения Inventory.c:44
static bool IsInventoryHFSMLogEnable()
Определения Debug.c:668
Определения Debug.c:594
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:106
proto native CGame GetGame()
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