DayZ Scripts
v1.21.156300 ยท Jun 20, 2023
 
Loading...
Searching...
No Matches
Man.c
Go to the documentation of this file.
1class Man extends EntityAI
2{
6 proto native PlayerIdentity GetIdentity();
8 proto native EntityAI GetDrivingVehicle();
9
10 proto native owned string GetCurrentWeaponMode();
11
13 proto native void SetSpeechRestricted(bool state);
15 proto native bool IsSpeechRestricted();
16
18 proto native void SetFaceTexture(string texture_name);
20 proto native void SetFaceMaterial(string material_name);
21
22 proto native bool IsSoundInsideBuilding();
23 proto native bool IsCameraInsideVehicle();
24
25 proto native owned string GetMasterAttenuation();
26 proto native void SetMasterAttenuation(string masterAttenuation);
27
28 void Man()
29 {
30 SetFlags(EntityFlags.TOUCHTRIGGERS, false);
31 }
32
33 override bool IsMan() { return true; }
34 override bool IsHealthVisible() { return false; }
36
38 {
39 if( IsAlive() ) return EPlayerStates.ALIVE;
40 else return EPlayerStates.DEAD;
41 }
42
44
47 {
48 HumanInventory i = HumanInventory.Cast(GetInventory());
49 return i;
50 }
51
52 //Called when an item is removed from the cargo of this item
54 //Called when an item is moved around in the cargo of this item
56
58 {
59 if (!m_OnItemAddedToHands)
60 m_OnItemAddedToHands = new ScriptInvoker();
61
63 }
64
65
67 {
68 if( !m_OnItemRemovedFromHands )
69 m_OnItemRemovedFromHands = new ScriptInvoker;
70
72 }
73
75 {
76 SetWeightDirty();
77 if( m_OnItemAddedToHands )
78 m_OnItemAddedToHands.Invoke( item, this );
79 }
80
82 {
83 SetWeightDirty();
84 if( m_OnItemRemovedFromHands )
85 m_OnItemRemovedFromHands.Invoke( item, this );
86 }
87
89 bool JunctureDropEntity (notnull EntityAI item)
90 {
91 return DropEntityImpl(InventoryMode.JUNCTURE, this, item);
92 }
93
94 override bool PredictiveDropEntity (notnull EntityAI item)
95 {
97 {
98 Print("[inv] " + GetSimulationTimeStamp() + " Man@" + this + " ::PredictiveDropEntity input data not sent yet, cannot allow another input action");
99 return false;
100 }
101
102 if (NeedInventoryJunctureFromServer(item, item.GetHierarchyParent(), this))
103 return JunctureDropEntity(item);
104 else
105 return DropEntityImpl(InventoryMode.PREDICTIVE, this, item);
106 }
107
108 override bool LocalDropEntity (notnull EntityAI item)
109 {
110 return DropEntityImpl(InventoryMode.LOCAL, this, item);
111 }
112
113 override bool ServerDropEntity (notnull EntityAI item)
114 {
115 return DropEntityImpl(InventoryMode.SERVER, this, item);
116 }
117
118 protected bool DropEntityImpl (InventoryMode mode, notnull EntityAI owner, notnull EntityAI item)
119 {
120 syncDebugPrint("[inv] " + GetDebugName(this) + " STS = " + GetSimulationTimeStamp() + " ::DropEntity(" + typename.EnumToString(InventoryMode, mode) + ") item=" + Object.GetDebugName(item));
121 bool code = GetHumanInventory().DropEntity(mode, owner, item);
123 return code;
124 }
126
127 override bool CanDropEntity (notnull EntityAI item) { return true; }
128
130
131 bool NeedInventoryJunctureFromServer (notnull EntityAI item, EntityAI currParent, EntityAI newParent) { return false; }
132
135 {
136 TakeEntityToHandsImpl(InventoryMode.JUNCTURE, item);
137 }
138
140 {
142 {
143 Print("[inv] " + GetSimulationTimeStamp() + " Man@" + this + " ::PredictiveTakeEntityToHands input data not sent yet, cannot allow another input action");
144 return;
145 }
146
147 if (NeedInventoryJunctureFromServer(item, item.GetHierarchyParent(), this))
149 else
150 TakeEntityToHandsImpl(InventoryMode.PREDICTIVE, item);
151 }
152
154 {
156 }
157
159 {
161 }
162
164 {
165 if (!GetGame().IsDedicatedServer() )
166 {
168 il.SetHands(this, item);
169 //GetInventory().AddInventoryReservationEx(item, il ,GameInventory.c_InventoryReservationTimeoutShortMS);
170 }
171
172 syncDebugPrint("[inv] " + GetDebugName(this) + " STS = " + GetSimulationTimeStamp() + " ::Take2Hands(" + typename.EnumToString(InventoryMode, mode) + ") item=" + Object.GetDebugName(item));
174
176 if (item.GetInventory().GetCurrentInventoryLocation(src_item))
177 {
178 if (itemInHands == null)
179 {
181 hand_dst.SetHands(this, item);
182 GetHumanInventory().TakeToDst(mode, src_item, hand_dst);
183 }
184 else if (GetHumanInventory().CanSwapEntitiesEx(itemInHands, item))
185 GetInventory().SwapEntities(mode, itemInHands, item);
187 }
188 }
190
192 {
193 syncDebugPrint("[inv] " + GetDebugName(this) + " STS = " + GetSimulationTimeStamp() + " Destroy IH=" + GetHumanInventory().GetEntityInHands());
196 }
197
199 {
200 syncDebugPrint("[inv] " + GetDebugName(this) + " STS = " + GetSimulationTimeStamp() + " Stash IH=" + GetHumanInventory().GetEntityInHands());
202 {
203 Print("[inv] PredictiveMoveItemFromHandsToInventory input data not sent yet, cannot allow another input action");
204 return;
205 }
206
207 InventoryMode invMode = InventoryMode.PREDICTIVE;
208
209 if (NeedInventoryJunctureFromServer( GetHumanInventory().GetEntityInHands(), this, this))
210 invMode = InventoryMode.JUNCTURE;
211
213 if (GetHumanInventory().GetEntityInHands().m_OldLocation && GetHumanInventory().GetEntityInHands().m_OldLocation.IsValid())
214 {
216 GetHumanInventory().GetEntityInHands().GetInventory().GetCurrentInventoryLocation(invLoc);
217 //old location is somewhere on player
218 if (GetHumanInventory().GetEntityInHands().m_OldLocation.GetParent() && GetHumanInventory().GetEntityInHands().m_OldLocation.GetParent().GetHierarchyRootPlayer())
219 {
220 if (GetHumanInventory().LocationCanMoveEntity(invLoc, GetHumanInventory().GetEntityInHands().m_OldLocation))
221 {
222 if (GetHumanInventory().TakeToDst(invMode, invLoc,GetHumanInventory().GetEntityInHands().m_OldLocation))
223 {
225 return;
226 }
227 }
228 }
229 }
230
231 GetHumanInventory().TakeEntityToInventory(invMode, FindInventoryLocationType.ATTACHMENT | FindInventoryLocationType.CARGO, GetHumanInventory().GetEntityInHands());
233 }
234
237 {
238 syncDebugPrint("[inv] " + GetDebugName(this) + " STS = " + GetSimulationTimeStamp() + " Replace !HND lambda=" + lambda.DumpToString());
239 bool code = GetHumanInventory().ReplaceItemWithNew(mode, lambda);
241 return code;
242 }
243
245 {
246 return ReplaceItemWithNewImpl(InventoryMode.LOCAL, lambda);
247 }
248
250 {
251 return ReplaceItemWithNewImpl(InventoryMode.SERVER, lambda);
252 }
254
257 {
258 syncDebugPrint("[inv] " + GetDebugName(this) + " STS = " + GetSimulationTimeStamp() + " Replace !HND->HND lambda=" + lambda.DumpToString());
259 bool code = GetHumanInventory().ReplaceItemElsewhereWithNewInHands(mode, lambda);
261 return code;
262 }
263
265 {
267 }
268
270 {
272 }
274
277 {
278 syncDebugPrint("[inv] " + GetDebugName(this) + " STS = " + GetSimulationTimeStamp() + " Replace HND->HND lambda=" + lambda.DumpToString());
279 bool code = GetHumanInventory().ReplaceItemInHandsWithNew(mode, lambda);
281 return code;
282 }
283
285 {
286 return ReplaceItemInHandsWithNewImpl(InventoryMode.LOCAL, lambda);
287 }
288
290 {
291 return ReplaceItemInHandsWithNewImpl(InventoryMode.SERVER, lambda);
292 }
294
297 {
298 syncDebugPrint("[inv] " + GetDebugName(this) + " STS = " + GetSimulationTimeStamp() + " Replace HND->elsewhere lambda=" + lambda.DumpToString());
299 bool code = GetHumanInventory().ReplaceItemInHandsWithNewElsewhere(mode, lambda);
301 return code;
302 }
303
305 {
307 }
308
310 {
312 }
314
317 {
318 return TakeEntityToInventoryImpl(InventoryMode.JUNCTURE, flags, item);
319 }
320
322 {
324 {
325 Print("[inv] " + GetSimulationTimeStamp() + " Man@" + this + " ::PredictiveTakeEntityToInventory input data not sent yet, cannot allow another input action");
326 return false;
327 }
328
329 if (NeedInventoryJunctureFromServer(item, item.GetHierarchyParent(), this))
330 return JunctureTakeEntityToInventory(flags, item);
331 else
332 return TakeEntityToInventoryImpl(InventoryMode.PREDICTIVE, flags, item);
333 }
334
336 {
337 return TakeEntityToInventoryImpl(InventoryMode.LOCAL, flags, item);
338 }
339
341 {
342 return TakeEntityToInventoryImpl(InventoryMode.SERVER, flags, item);
343 }
344
346 {
347 syncDebugPrint("[inv] " + GetDebugName(this) + " STS = " + GetSimulationTimeStamp() + " ::Take2Inv(" + typename.EnumToString(InventoryMode, mode) + ") item=" + Object.GetDebugName(item));
348 bool code = GetHumanInventory().TakeEntityToInventory(mode, flags, item);
350 return code;
351 }
353
356 {
357 return TakeEntityToCargoImpl(InventoryMode.JUNCTURE, item);
358 }
359
360 override bool PredictiveTakeEntityToCargo (notnull EntityAI item)
361 {
363 {
364 Print("[inv] " + GetSimulationTimeStamp() + " Man@" + this + " ::PredictiveTakeEntityToCargo input data not sent yet, cannot allow another input action");
365 return false;
366 }
367
368 if (NeedInventoryJunctureFromServer(item, item.GetHierarchyParent(), this))
369 return JunctureTakeEntityToCargo(item);
370 else
371 return TakeEntityToCargoImpl(InventoryMode.PREDICTIVE, item);
372 }
373
374 override bool LocalTakeEntityToCargo (notnull EntityAI item)
375 {
376 return TakeEntityToCargoImpl(InventoryMode.LOCAL, item);
377 }
378
379 override bool ServerTakeEntityToCargo (notnull EntityAI item)
380 {
381 return TakeEntityToCargoImpl(InventoryMode.SERVER, item);
382 }
383
384 protected bool TakeEntityToCargoImpl (InventoryMode mode, notnull EntityAI item)
385 {
386 syncDebugPrint("[inv] " + GetDebugName(this) + " STS = " + GetSimulationTimeStamp() + " ::Take2Cgo(" + typename.EnumToString(InventoryMode, mode) + ") item=" + Object.GetDebugName(item));
387 bool code = GetHumanInventory().TakeEntityToCargo(mode, item);
389 return code;
390 }
392
395 {
396 return TakeEntityAsAttachmentImpl(InventoryMode.JUNCTURE, item);
397 }
398
399 override bool PredictiveTakeEntityAsAttachment (notnull EntityAI item)
400 {
402 {
403 Print("[inv] " + GetSimulationTimeStamp() + " Man@" + this + " ::PredictiveTakeEntityAsAttachment input data not sent yet, cannot allow another input action");
404 return false;
405 }
406
407 if (NeedInventoryJunctureFromServer(item, item.GetHierarchyParent(), this))
409 else
410 return TakeEntityAsAttachmentImpl(InventoryMode.PREDICTIVE, item);
411 }
412
413 override bool LocalTakeEntityAsAttachment (notnull EntityAI item)
414 {
415 return TakeEntityAsAttachmentImpl(InventoryMode.LOCAL, item);
416 }
417
418 override bool ServerTakeEntityAsAttachment (notnull EntityAI item)
419 {
420 return TakeEntityAsAttachmentImpl(InventoryMode.SERVER, item);
421 }
422
423 protected bool TakeEntityAsAttachmentImpl (InventoryMode mode, notnull EntityAI item)
424 {
425 syncDebugPrint("[inv] " + GetDebugName(this) + " STS = " + GetSimulationTimeStamp() + " ::Take2Att(" + typename.EnumToString(InventoryMode, mode) + ") item=" + Object.GetDebugName(item));
426 bool code = GetHumanInventory().TakeEntityAsAttachment(mode, item);
428 return code;
429 }
431
433 bool JunctureTakeEntityAsAttachmentEx (notnull EntityAI item, int slot)
434 {
435 return TakeEntityAsAttachmentExImpl(InventoryMode.JUNCTURE, item, slot);
436 }
437
438 override bool PredictiveTakeEntityAsAttachmentEx (notnull EntityAI item, int slot)
439 {
441 {
442 Print("[inv] " + GetSimulationTimeStamp() + " Man@" + this + " ::PredictiveTakeEntityAsAttachmentEx input data not sent yet, cannot allow another input action");
443 return false;
444 }
445
446 if (NeedInventoryJunctureFromServer(item, item.GetHierarchyParent(), this))
447 return JunctureTakeEntityAsAttachmentEx(item, slot);
448 else
449 return TakeEntityAsAttachmentExImpl(InventoryMode.PREDICTIVE, item, slot);
450 }
451
452 override bool LocalTakeEntityAsAttachmentEx (notnull EntityAI item, int slot)
453 {
454 return TakeEntityAsAttachmentExImpl(InventoryMode.LOCAL, item, slot);
455 }
456
457 override bool ServerTakeEntityAsAttachmentEx (notnull EntityAI item, int slot)
458 {
459 return TakeEntityAsAttachmentExImpl(InventoryMode.SERVER, item, slot);
460 }
461
462 protected bool TakeEntityAsAttachmentExImpl (InventoryMode mode, notnull EntityAI item, int slot)
463 {
464 syncDebugPrint("[inv] " + GetDebugName(this) + " STS = " + GetSimulationTimeStamp() + " ::Take2AttEx(" + typename.EnumToString(InventoryMode, mode) + ") item=" + Object.GetDebugName(item));
465 bool code = GetHumanInventory().TakeEntityAsAttachmentEx(mode, item, slot);
467 return code;
468 }
470
472 bool JunctureSwapEntities (notnull EntityAI item1, notnull EntityAI item2)
473 {
474 return SwapEntitiesImpl(InventoryMode.JUNCTURE, item1, item2);
475 }
476
477 bool PredictiveSwapEntities (notnull EntityAI item1, notnull EntityAI item2)
478 {
480 {
481 Print("[inv] " + GetSimulationTimeStamp() + " Man@" + this + " ::PredictiveSwapEntities input data not sent yet, cannot allow another input action");
482 return false;
483 }
484
485 bool need_j1 = NeedInventoryJunctureFromServer(item1, item1.GetHierarchyParent(), item2.GetHierarchyParent());
486 bool need_j2 = NeedInventoryJunctureFromServer(item2, item2.GetHierarchyParent(), item1.GetHierarchyParent());
487 if (need_j1 || need_j2)
488 return SwapEntitiesImpl(InventoryMode.JUNCTURE, item1, item2);
489 else
490 return SwapEntitiesImpl(InventoryMode.PREDICTIVE, item1, item2);
491 }
492
493 bool LocalSwapEntities (notnull EntityAI item1, notnull EntityAI item2)
494 {
495 return SwapEntitiesImpl(InventoryMode.LOCAL, item1, item2);
496 }
497
498 bool ServerSwapEntities (notnull EntityAI item1, notnull EntityAI item2)
499 {
500 return SwapEntitiesImpl(InventoryMode.SERVER, item1, item2);
501 }
502
503 protected bool SwapEntitiesImpl (InventoryMode mode, notnull EntityAI item1, notnull EntityAI item2)
504 {
505 bool code;
506 syncDebugPrint("[inv] " + GetDebugName(this) + " STS = " + GetSimulationTimeStamp() + " ::SwapImpl(" + typename.EnumToString(InventoryMode, mode) + ") item1=" + Object.GetDebugName(item1) + " item2=" + item2.GetDebugName(this));
507 if (!GameInventory.CanSwapEntitiesEx(item1, item2))
508 Error("[inv] (Man@" + this + ") SwapEntitiesImpl - cannot swap items!");
509
510 code = GetHumanInventory().SwapEntities(mode, item1, item2);
511
513 if (!code)
514 syncDebugPrint("[inv] " + GetDebugName(this) + " STS = " + GetSimulationTimeStamp() + " SwapEntitiesImpl - cannot swap or forceswap");
515 return code;
516 }
518
520 bool JunctureForceSwapEntities (notnull EntityAI item1, notnull EntityAI item2, notnull InventoryLocation item2_dst)
521 {
522 return ForceSwapEntitiesImpl(InventoryMode.JUNCTURE, item1, item2, item2_dst);
523 }
524
525 bool PredictiveForceSwapEntities (notnull EntityAI item1, notnull EntityAI item2, notnull InventoryLocation item2_dst)
526 {
528 {
529 Print("[inv] " + GetSimulationTimeStamp() + " Man@" + this + " ::PredictiveForceSwapEntities input data not sent yet, cannot allow another input action");
530 return false;
531 }
532
533 bool need_j1 = NeedInventoryJunctureFromServer(item1, item1.GetHierarchyParent(), item2.GetHierarchyParent());
534 bool need_j2 = NeedInventoryJunctureFromServer(item2, item2.GetHierarchyParent(), item1.GetHierarchyParent());
535 if (need_j1 || need_j2)
536 return ForceSwapEntitiesImpl(InventoryMode.JUNCTURE, item1, item2, item2_dst);
537 else
538 return ForceSwapEntitiesImpl(InventoryMode.PREDICTIVE, item1, item2, item2_dst);
539 }
540
541 bool LocalForceSwapEntities (notnull EntityAI item1, notnull EntityAI item2, notnull InventoryLocation item2_dst)
542 {
543 return ForceSwapEntitiesImpl(InventoryMode.LOCAL, item1, item2, item2_dst);
544 }
545
546 bool ServerForceSwapEntities (notnull EntityAI item1, notnull EntityAI item2, notnull InventoryLocation item2_dst)
547 {
548 return ForceSwapEntitiesImpl(InventoryMode.SERVER, item1, item2, item2_dst);
549 }
550
551 protected bool ForceSwapEntitiesImpl (InventoryMode mode, notnull EntityAI item1, notnull EntityAI item2, notnull InventoryLocation item2_dst)
552 {
553 bool code = false;
554 syncDebugPrint("[inv] " + GetDebugName(this) + " STS = " + GetSimulationTimeStamp() + " ForceSwapImpl(" + typename.EnumToString(InventoryMode, mode) + ") item1=" + Object.GetDebugName(item1) + " item2=" + item2.GetDebugName(this));
555 code = GetHumanInventory().ForceSwapEntities(mode, item1, item2, item2_dst);
556
558 if (!code)
559 syncDebugPrint("[inv] " + GetDebugName(this) + " STS = " + GetSimulationTimeStamp() + " ForceSwapEntitiesImpl - cannot Forceswap");
560 return code;
561 }
563
566 {
567 return TakeEntityToTargetInventoryImpl(InventoryMode.JUNCTURE, target, flags, item);
568 }
569
570 override bool PredictiveTakeEntityToTargetInventory (notnull EntityAI target, FindInventoryLocationType flags, notnull EntityAI item)
571 {
573 {
574 Print("[inv] " + GetSimulationTimeStamp() + " ::PredictiveTakeEntityToTargetInventory input data not sent yet, cannot allow another input action");
575 return false;
576 }
577
578 if (NeedInventoryJunctureFromServer(item, item.GetHierarchyParent(), target))
579 return JunctureTakeEntityToTargetInventory(target, flags, item);
580 else
581 return TakeEntityToTargetInventoryImpl(InventoryMode.PREDICTIVE, target, flags, item);
582 }
583
585 {
586 if( GetInventory().CanAddAttachment( item ) )
587 {
589 }
590 else
591 {
592 for( int i = 0; i < item.GetInventory().GetSlotIdCount(); i++ )
593 {
594 int slot_id = item.GetInventory().GetSlotId(i);
595 EntityAI slot_item = GetInventory().FindAttachment( slot_id );
596 if( slot_item && GetInventory().CanSwapEntitiesEx( item, slot_item ) )
597 {
598 return PredictiveSwapEntities(item, slot_item);
599 }
600 }
601 }
602 return false;
603 }
604
605 override bool LocalTakeEntityToTargetInventory (notnull EntityAI target, FindInventoryLocationType flags, notnull EntityAI item)
606 {
607 return TakeEntityToTargetInventoryImpl(InventoryMode.LOCAL, target, flags, item);
608 }
609
610 protected bool TakeEntityToTargetInventoryImpl (InventoryMode mode, notnull EntityAI target, FindInventoryLocationType flags, notnull EntityAI item)
611 {
612 syncDebugPrint("[inv] " + GetDebugName(this) + " STS = " + GetSimulationTimeStamp() + " ::Take2TargetInv(" + typename.EnumToString(InventoryMode, mode) + ") item=" + Object.GetDebugName(item));
613 bool code = GetInventory().TakeEntityToTargetInventory(mode, target, flags, item);
615 return code;
616 }
618
620 bool JunctureTakeEntityToTargetCargoEx (notnull CargoBase cargo, notnull EntityAI item, int row, int col)
621 {
622 return TakeEntityToTargetCargoExImpl(InventoryMode.JUNCTURE, cargo, item, row, col);
623 }
624
625 override bool PredictiveTakeEntityToTargetCargoEx (notnull CargoBase cargo, notnull EntityAI item, int row, int col)
626 {
628 {
629 Print("[inv] " + GetDebugName(this) + " STS = " + GetSimulationTimeStamp() + " ::PredictiveTakeEntityToTargetCargoEx input data not sent yet, cannot allow another input action");
630 return false;
631 }
632
633 if (NeedInventoryJunctureFromServer(item, item.GetHierarchyParent(), cargo.GetCargoOwner()))
634 return JunctureTakeEntityToTargetCargoEx(cargo, item, row, col);
635 else
636 return TakeEntityToTargetCargoExImpl(InventoryMode.PREDICTIVE, cargo, item, row, col);
637 }
638
639 override bool LocalTakeEntityToTargetCargoEx (notnull CargoBase cargo, notnull EntityAI item, int row, int col)
640 {
641 return TakeEntityToTargetCargoExImpl(InventoryMode.LOCAL, cargo, item, row, col);
642 }
643
644 override bool ServerTakeEntityToTargetCargoEx (notnull CargoBase cargo, notnull EntityAI item, int row, int col)
645 {
646 return TakeEntityToTargetCargoExImpl(InventoryMode.SERVER, cargo, item, row, col);
647 }
648
649 protected bool TakeEntityToTargetCargoExImpl (InventoryMode mode, notnull CargoBase cargo, notnull EntityAI item, int row, int col)
650 {
651 syncDebugPrint("[inv] " + GetDebugName(this) + " STS = " + GetSimulationTimeStamp() + " ::Take2TargetCgoEx(" + typename.EnumToString(InventoryMode, mode) + ") item=" + Object.GetDebugName(item));
652 bool code = GetInventory().TakeEntityToTargetCargoEx(mode, cargo, item, row, col);
654 return code;
655 }
657
659 bool JunctureTakeEntityToTargetCargo (notnull EntityAI target, notnull EntityAI item)
660 {
661 return TakeEntityToTargetCargoImpl(InventoryMode.JUNCTURE, target, item);
662 }
663
664 override bool PredictiveTakeEntityToTargetCargo (notnull EntityAI target, notnull EntityAI item)
665 {
667 {
668 Print("[inv] " + GetDebugName(this) + " STS = " + GetSimulationTimeStamp() + " ::PredictiveTakeEntityToTargetCargo input data not sent yet, cannot allow another input action");
669 return false;
670 }
671
672 if (NeedInventoryJunctureFromServer(item, item.GetHierarchyParent(), target))
673 return JunctureTakeEntityToTargetCargo(target, item);
674 else
675 return TakeEntityToTargetCargoImpl(InventoryMode.PREDICTIVE, target, item);
676 }
677
678 override bool LocalTakeEntityToTargetCargo (notnull EntityAI target, notnull EntityAI item)
679 {
680 return TakeEntityToTargetCargoImpl(InventoryMode.LOCAL, target, item);
681 }
682
683 override bool ServerTakeEntityToTargetCargo (notnull EntityAI target, notnull EntityAI item)
684 {
685 if (IsAlive())
686 return TakeEntityToTargetCargoImpl(InventoryMode.SERVER, target, item);
687 else
688 return TakeEntityToTargetCargoImpl(InventoryMode.SERVER, target, item);
689 }
690
691 protected bool TakeEntityToTargetCargoImpl (InventoryMode mode, notnull EntityAI target, notnull EntityAI item)
692 {
693 syncDebugPrint("[inv] " + GetDebugName(this) + " STS = " + GetSimulationTimeStamp() + " Take2TargetCgo(" + typename.EnumToString(InventoryMode, mode) + ") item=" + Object.GetDebugName(item));
694
695 bool code = GetInventory().TakeEntityToTargetInventory(mode, target, FindInventoryLocationType.CARGO, item);
697 return code;
698 }
700
702 bool JunctureTakeEntityToTargetAttachmentEx (notnull EntityAI target, notnull EntityAI item, int slot)
703 {
704 return TakeEntityToTargetAttachmentExImpl(InventoryMode.JUNCTURE, target, item, slot);
705 }
706
707 override bool PredictiveTakeEntityToTargetAttachmentEx (notnull EntityAI target, notnull EntityAI item, int slot)
708 {
710 {
711 Print("[inv] " + GetDebugName(this) + " STS = " + GetSimulationTimeStamp() + " ::PredictiveTakeEntityToTargetAttachmentEx input data not sent yet, cannot allow another input action");
712 return false;
713 }
714
715 if (NeedInventoryJunctureFromServer(item, item.GetHierarchyParent(), target))
716 return JunctureTakeEntityToTargetAttachmentEx(target, item, slot);
717 else
718 return TakeEntityToTargetAttachmentExImpl(InventoryMode.PREDICTIVE, target, item, slot);
719 }
720
721 override bool LocalTakeEntityToTargetAttachmentEx (notnull EntityAI target, notnull EntityAI item, int slot)
722 {
723 return TakeEntityToTargetAttachmentExImpl(InventoryMode.LOCAL, target, item, slot);
724 }
725
726 override bool ServerTakeEntityToTargetAttachmentEx (notnull EntityAI target, notnull EntityAI item, int slot)
727 {
728 return TakeEntityToTargetAttachmentExImpl(InventoryMode.SERVER, target, item, slot);
729 }
730
731 protected bool TakeEntityToTargetAttachmentExImpl (InventoryMode mode, notnull EntityAI target, notnull EntityAI item, int slot)
732 {
733 syncDebugPrint("[inv] " + GetDebugName(this) + " STS = " + GetSimulationTimeStamp() + " ::Take2TargetAtt(" + typename.EnumToString(InventoryMode, mode) + ") item=" + Object.GetDebugName(item));
734 bool code = GetInventory().TakeEntityAsTargetAttachmentEx(mode, target, item, slot);
736 return code;
737 }
739
741 bool JunctureTakeEntityToTargetAttachment (notnull EntityAI target, notnull EntityAI item)
742 {
743 return TakeEntityToTargetAttachmentImpl(InventoryMode.JUNCTURE, target, item);
744 }
745
746 override bool PredictiveTakeEntityToTargetAttachment (notnull EntityAI target, notnull EntityAI item)
747 {
749 {
750 Print("[inv] " + GetSimulationTimeStamp() + " Man@" + this + " ::PredictiveTakeEntityToTargetAttachment input data not sent yet, cannot allow another input action");
751 return false;
752 }
753
754 if (NeedInventoryJunctureFromServer(item, item.GetHierarchyParent(), target))
755 return JunctureTakeEntityToTargetAttachment(target, item);
756 else
757 return TakeEntityToTargetAttachmentImpl(InventoryMode.PREDICTIVE, target, item);
758 }
759
760 override bool LocalTakeEntityToTargetAttachment (notnull EntityAI target, notnull EntityAI item)
761 {
762 return TakeEntityToTargetAttachmentImpl(InventoryMode.LOCAL, target, item);
763 }
764
765 override bool ServerTakeEntityToTargetAttachment (notnull EntityAI target, notnull EntityAI item)
766 {
767 return TakeEntityToTargetAttachmentImpl(InventoryMode.SERVER, target, item);
768 }
769
770 protected bool TakeEntityToTargetAttachmentImpl (InventoryMode mode, notnull EntityAI target, notnull EntityAI item)
771 {
773 if( target.GetInventory().FindFreeLocationFor( item, FindInventoryLocationType.ATTACHMENT, il) )
774 {
775 return TakeEntityToTargetAttachmentExImpl(mode, target, item, il.GetSlot());
776 }
777 return false;
778 }
780
783 {
784 return TakeToDstImpl(InventoryMode.JUNCTURE, src, dst);
785 }
786
787 override bool PredictiveTakeToDst (notnull InventoryLocation src, notnull InventoryLocation dst)
788 {
790 {
791 Print("[inv] " + GetSimulationTimeStamp() + " Man@" + this + " ::PredictiveTakeToDst input data not sent yet, cannot allow another input action");
792 return false;
793 }
794
795 if (NeedInventoryJunctureFromServer(src.GetItem(), src.GetParent(), dst.GetParent()))
796 return JunctureTakeToDst(src, dst);
797 else
798 return TakeToDstImpl(InventoryMode.PREDICTIVE, src, dst);
799 }
800
801 override bool LocalTakeToDst (notnull InventoryLocation src, notnull InventoryLocation dst)
802 {
803 return TakeToDstImpl(InventoryMode.LOCAL, src, dst);
804 }
805
806 override bool ServerTakeToDst (notnull InventoryLocation src, notnull InventoryLocation dst)
807 {
808 return TakeToDstImpl(InventoryMode.SERVER, src, dst);
809 }
810
811 protected bool TakeToDstImpl (InventoryMode mode, notnull InventoryLocation src, notnull InventoryLocation dst)
812 {
813 syncDebugPrint("[inv] " + GetDebugName(this) + " STS = " + GetSimulationTimeStamp() + " ::Take2Dst(" + typename.EnumToString(InventoryMode, mode) + ") src=" + InventoryLocation.DumpToStringNullSafe(src) + " dst=" + InventoryLocation.DumpToStringNullSafe(dst));
814 bool code = GetHumanInventory().TakeToDst(mode, src, dst);
816 return code;
817 }
820
822 {
823
824 }
825
826 override bool CanBeSkinned()
827 {
828 return true;
829 }
830
832 {
833 if( GetGame().IsClient() )
834 {
836 if( menu )
837 {
838 //menu.Refresh();
839 }
840 }
841 }
842
845
848 proto native bool StatRegister( string name );
850
853 proto native float StatGet( string name );
855
859 proto void StatGetCounter( string name, out string value );
861
865 proto void StatGetAsTime( string name, out string value );
867
871 proto native void StatUpdate( string name, float value );
873
877 proto native void StatUpdateByTime( string name );
879
883 proto native void StatUpdateByPosition( string name );
885
889 proto native void StatUpdateByGivenPos( string name, vector pos );
893 proto native void StatInvokeUpdate();
897 proto native void StatSyncToClient();
899
900 bool IsInventorySoftLocked() { return false; }
901 void SetInventorySoftLock(bool status);
902
904 bool IsInTransport () { return null != Transport.Cast(GetParent()); }
905
907 bool PhysicalPredictiveDropItem(EntityAI entity, bool heavy_item_only = true) {}
908 void SetProcessUIWarning(bool state);
909 void OnGameplayDataHandlerSync(){};//depricated, sync now happens before the player is created, calling of this event still happens for legacy reasons
910};
void syncDebugPrint(string s)
Definition Debug.c:1
InventoryMode
Definition Inventory.c:20
override bool TakeToDst(InventoryMode mode, notnull InventoryLocation src, notnull InventoryLocation dst)
EPlayerStates
FindInventoryLocationType
flags for searching locations in inventory
override string GetDebugName()
Gets the debug name for the ParticleManager.
string name
proto native UIManager GetUIManager()
represents base for cargo storage for entities
Definition Cargo.c:7
protected bool SwapEntitiesImpl(InventoryMode mode, notnull EntityAI item1, notnull EntityAI item2)
Definition Man.c:503
proto native void StatInvokeUpdate()
override bool LocalTakeEntityToCargo(notnull EntityAI item)
Definition Man.c:374
override bool PredictiveTakeEntityAsAttachmentEx(notnull EntityAI item, int slot)
Definition Man.c:438
ScriptInvoker GetOnItemRemovedFromHands()
Definition Man.c:66
override bool LocalTakeToDst(notnull InventoryLocation src, notnull InventoryLocation dst)
Definition Man.c:801
void LocalTakeEntityToHands(EntityAI item)
Definition Man.c:153
proto native void SetSpeechRestricted(bool state)
Set speech restriction.
bool JunctureTakeEntityAsAttachmentEx(notnull EntityAI item, int slot)
as att ex juncture
Definition Man.c:433
override bool ServerTakeEntityAsAttachment(notnull EntityAI item)
Definition Man.c:418
override bool PredictiveTakeEntityToCargo(notnull EntityAI item)
Definition Man.c:360
proto native float StatGet(string name)
Gets counter value of the specified stat type.
bool JunctureForceSwapEntities(notnull EntityAI item1, notnull EntityAI item2, notnull InventoryLocation item2_dst)
ForceSwap juncture.
Definition Man.c:520
proto native UAInterface GetInputInterface()
Returns player's input interface.
override bool ServerTakeEntityToTargetCargoEx(notnull CargoBase cargo, notnull EntityAI item, int row, int col)
Definition Man.c:644
void ServerTakeEntityToHands(EntityAI item)
Definition Man.c:158
bool JunctureTakeEntityToTargetAttachment(notnull EntityAI target, notnull EntityAI item)
to target att juncture
Definition Man.c:741
void OnGameplayDataHandlerSync()
Definition Man.c:909
override bool CanDropEntity(notnull EntityAI item)
Definition Man.c:127
HumanInventory GetHumanInventory()
inventory
Definition Man.c:46
override bool ServerTakeEntityToInventory(FindInventoryLocationType flags, notnull EntityAI item)
Definition Man.c:340
bool ServerReplaceItemInHandsWithNewElsewhere(ReplaceItemWithNewLambdaBase lambda)
Definition Man.c:309
bool JunctureDropEntity(notnull EntityAI item)
drop juncture
Definition Man.c:89
override bool LocalTakeEntityToInventory(FindInventoryLocationType flags, notnull EntityAI item)
Definition Man.c:335
bool LocalForceSwapEntities(notnull EntityAI item1, notnull EntityAI item2, notnull InventoryLocation item2_dst)
Definition Man.c:541
override bool PredictiveDropEntity(notnull EntityAI item)
Definition Man.c:94
protected bool TakeEntityToInventoryImpl(InventoryMode mode, FindInventoryLocationType flags, notnull EntityAI item)
Definition Man.c:345
int GetPlayerState()
Definition Man.c:37
override bool LocalTakeEntityToTargetAttachmentEx(notnull EntityAI target, notnull EntityAI item, int slot)
Definition Man.c:721
protected bool TakeEntityToCargoImpl(InventoryMode mode, notnull EntityAI item)
Definition Man.c:384
bool ServerReplaceItemElsewhereWithNewInHands(ReplaceItemWithNewLambdaBase lambda)
Definition Man.c:269
proto native void StatUpdateByGivenPos(string name, vector pos)
Updates stat counter by given position.
proto native void SetMasterAttenuation(string masterAttenuation)
void PredictiveTakeEntityToHands(EntityAI item)
Definition Man.c:139
protected bool ReplaceItemInHandsWithNewImpl(InventoryMode mode, ReplaceItemWithNewLambdaBase lambda)
hand replace
Definition Man.c:276
proto void StatGetAsTime(string name, out string value)
Gets counter value as formatted time string of the specified stat type.
override bool PredictiveTakeEntityToTargetAttachmentEx(notnull EntityAI target, notnull EntityAI item, int slot)
Definition Man.c:707
bool JunctureTakeEntityToInventory(FindInventoryLocationType flags, notnull EntityAI item)
to inv juncture
Definition Man.c:316
bool JunctureSwapEntities(notnull EntityAI item1, notnull EntityAI item2)
swap juncture
Definition Man.c:472
override bool PredictiveTakeEntityToTargetAttachment(notnull EntityAI target, notnull EntityAI item)
Definition Man.c:746
override bool ServerTakeEntityAsAttachmentEx(notnull EntityAI item, int slot)
Definition Man.c:457
bool JunctureTakeEntityToTargetAttachmentEx(notnull EntityAI target, notnull EntityAI item, int slot)
to target att ex juncture
Definition Man.c:702
override bool PredictiveTakeEntityToTargetCargoEx(notnull CargoBase cargo, notnull EntityAI item, int row, int col)
Definition Man.c:625
proto native void SetFaceTexture(string texture_name)
Texture that is used on the Man's face and hands.
void SetInventorySoftLock(bool status)
void OnItemInHandsChanged()
Definition Man.c:129
proto native void StatSyncToClient()
protected bool ReplaceItemWithNewImpl(InventoryMode mode, ReplaceItemWithNewLambdaBase lambda)
!hand -> !hand replace
Definition Man.c:236
protected bool TakeEntityToTargetCargoExImpl(InventoryMode mode, notnull CargoBase cargo, notnull EntityAI item, int row, int col)
Definition Man.c:649
bool LocalReplaceItemInHandsWithNewElsewhere(ReplaceItemWithNewLambdaBase lambda)
Definition Man.c:304
override bool PredictiveTakeEntityToInventory(FindInventoryLocationType flags, notnull EntityAI item)
Definition Man.c:321
protected bool TakeEntityAsAttachmentImpl(InventoryMode mode, notnull EntityAI item)
Definition Man.c:423
void TakeEntityToHandsImpl(InventoryMode mode, EntityAI item)
Definition Man.c:163
proto native owned string GetMasterAttenuation()
bool ServerForceSwapEntities(notnull EntityAI item1, notnull EntityAI item2, notnull InventoryLocation item2_dst)
Definition Man.c:546
protected bool TakeToDstImpl(InventoryMode mode, notnull InventoryLocation src, notnull InventoryLocation dst)
Definition Man.c:811
override bool LocalTakeEntityToTargetInventory(notnull EntityAI target, FindInventoryLocationType flags, notnull EntityAI item)
Definition Man.c:605
override bool PredictiveTakeEntityAsAttachment(notnull EntityAI item)
Definition Man.c:399
protected bool TakeEntityToTargetAttachmentExImpl(InventoryMode mode, notnull EntityAI target, notnull EntityAI item, int slot)
Definition Man.c:731
override bool ServerTakeEntityToTargetCargo(notnull EntityAI target, notnull EntityAI item)
Definition Man.c:683
bool PhysicalPredictiveDropItem(EntityAI entity, bool heavy_item_only=true)
Definition Man.c:907
override bool LocalDropEntity(notnull EntityAI item)
Definition Man.c:108
proto native bool IsSoundInsideBuilding()
override bool PredictiveTakeToDst(notnull InventoryLocation src, notnull InventoryLocation dst)
Definition Man.c:787
void LocalDestroyEntityInHands()
Definition Man.c:191
bool IsInTransport()
returns true if man is in transport, false otherwise
Definition Man.c:904
void AddItemToDelete(EntityAI item)
Definition Man.c:43
override bool ServerTakeToDst(notnull InventoryLocation src, notnull InventoryLocation dst)
Definition Man.c:806
bool LocalSwapEntities(notnull EntityAI item1, notnull EntityAI item2)
Definition Man.c:493
proto native void StatUpdateByPosition(string name)
Updates stat counter by player's actual position.
override bool IsHealthVisible()
Definition Man.c:34
void SetProcessUIWarning(bool state)
protected bool TakeEntityToTargetCargoImpl(InventoryMode mode, notnull EntityAI target, notnull EntityAI item)
Definition Man.c:691
ScriptInvoker GetOnItemAddedToHands()
Definition Man.c:57
proto native void StatUpdate(string name, float value)
Updates stat counter with given value.
bool NeedInventoryJunctureFromServer(notnull EntityAI item, EntityAI currParent, EntityAI newParent)
Definition Man.c:131
bool IsUnconscious()
void EEItemIntoHands(EntityAI item)
Definition Man.c:74
proto native owned string GetCurrentWeaponMode()
protected bool TakeEntityToTargetAttachmentImpl(InventoryMode mode, notnull EntityAI target, notnull EntityAI item)
Definition Man.c:770
override bool LocalTakeEntityAsAttachmentEx(notnull EntityAI item, int slot)
Definition Man.c:452
void Man()
Definition Man.c:28
proto void StatGetCounter(string name, out string value)
Gets counter value as string of the specified stat type.
bool LocalReplaceItemInHandsWithNew(ReplaceItemWithNewLambdaBase lambda)
Definition Man.c:284
override bool ServerTakeEntityToTargetAttachmentEx(notnull EntityAI target, notnull EntityAI item, int slot)
Definition Man.c:726
override bool ServerTakeEntityToCargo(notnull EntityAI item)
Definition Man.c:379
protected bool ReplaceItemInHandsWithNewElsewhereImpl(InventoryMode mode, ReplaceItemWithNewLambdaBase lambda)
hand replace2
Definition Man.c:296
bool JunctureTakeToDst(notnull InventoryLocation src, notnull InventoryLocation dst)
to dst juncture
Definition Man.c:782
protected ref ScriptInvoker m_OnItemRemovedFromHands
Definition Man.c:55
protected bool TakeEntityToTargetInventoryImpl(InventoryMode mode, notnull EntityAI target, FindInventoryLocationType flags, notnull EntityAI item)
Definition Man.c:610
override bool ServerTakeEntityToTargetAttachment(notnull EntityAI target, notnull EntityAI item)
Definition Man.c:765
void PredictiveMoveItemFromHandsToInventory()
Definition Man.c:198
proto native bool IsSpeechRestricted()
Check if player has resctricted speech.
override bool CanBeSkinned()
Definition Man.c:826
override bool IsMan()
Definition Man.c:33
bool LocalReplaceItemWithNew(ReplaceItemWithNewLambdaBase lambda)
Definition Man.c:244
bool PredictiveTakeOrSwapAttachment(notnull EntityAI item)
Definition Man.c:584
protected bool ForceSwapEntitiesImpl(InventoryMode mode, notnull EntityAI item1, notnull EntityAI item2, notnull InventoryLocation item2_dst)
Definition Man.c:551
bool JunctureTakeEntityAsAttachment(notnull EntityAI item)
as att juncture
Definition Man.c:394
protected bool TakeEntityAsAttachmentExImpl(InventoryMode mode, notnull EntityAI item, int slot)
Definition Man.c:462
bool ServerReplaceItemInHandsWithNew(ReplaceItemWithNewLambdaBase lambda)
Definition Man.c:289
proto native void StatUpdateByTime(string name)
Updates stat counter by time.
proto native PlayerIdentity GetIdentity()
Returns player's identity.
proto native EntityAI GetDrivingVehicle()
Returns vehicle which this Man object is driving. If this Man object isn't as driver of any vehicle i...
override bool LocalTakeEntityToTargetCargoEx(notnull CargoBase cargo, notnull EntityAI item, int row, int col)
Definition Man.c:639
bool PredictiveSwapEntities(notnull EntityAI item1, notnull EntityAI item2)
Definition Man.c:477
void StopDeathDarkeningEffect()
Definition Man.c:906
proto native bool IsCameraInsideVehicle()
override bool PredictiveTakeEntityToTargetInventory(notnull EntityAI target, FindInventoryLocationType flags, notnull EntityAI item)
Definition Man.c:570
void JunctureDeleteItem(EntityAI item)
Definition Man.c:821
proto native bool StatRegister(string name)
proto native void SetFaceMaterial(string material_name)
Material that is used on the Man's face and hands.
override bool PredictiveTakeEntityToTargetCargo(notnull EntityAI target, notnull EntityAI item)
Definition Man.c:664
bool ServerSwapEntities(notnull EntityAI item1, notnull EntityAI item2)
Definition Man.c:498
void UpdateInventoryMenu()
Definition Man.c:831
bool PredictiveForceSwapEntities(notnull EntityAI item1, notnull EntityAI item2, notnull InventoryLocation item2_dst)
Definition Man.c:525
bool LocalReplaceItemElsewhereWithNewInHands(ReplaceItemWithNewLambdaBase lambda)
Definition Man.c:264
protected bool DropEntityImpl(InventoryMode mode, notnull EntityAI owner, notnull EntityAI item)
Definition Man.c:118
bool JunctureTakeEntityToCargo(notnull EntityAI item)
to cgo juncture
Definition Man.c:355
bool JunctureTakeEntityToTargetInventory(notnull EntityAI target, FindInventoryLocationType flags, notnull EntityAI item)
to target inv juncture
Definition Man.c:565
override bool LocalTakeEntityToTargetCargo(notnull EntityAI target, notnull EntityAI item)
Definition Man.c:678
bool IsInventorySoftLocked()
Definition Man.c:900
protected bool ReplaceItemElsewhereWithNewInHandsImpl(InventoryMode mode, ReplaceItemWithNewLambdaBase lambda)
!hand replace -> hand
Definition Man.c:256
bool ServerReplaceItemWithNew(ReplaceItemWithNewLambdaBase lambda)
Definition Man.c:249
override bool LocalTakeEntityAsAttachment(notnull EntityAI item)
Definition Man.c:413
override bool LocalTakeEntityToTargetAttachment(notnull EntityAI target, notnull EntityAI item)
Definition Man.c:760
void EEItemOutOfHands(EntityAI item)
Definition Man.c:81
protected ref ScriptInvoker m_OnItemAddedToHands
Definition Man.c:53
bool JunctureTakeEntityToTargetCargo(notnull EntityAI target, notnull EntityAI item)
to target cgo juncture
Definition Man.c:659
void JunctureTakeEntityToHands(notnull EntityAI item)
hand juncture
Definition Man.c:134
bool JunctureTakeEntityToTargetCargoEx(notnull CargoBase cargo, notnull EntityAI item, int row, int col)
to target cgo ex juncture
Definition Man.c:620
override bool ServerDropEntity(notnull EntityAI item)
Definition Man.c:113
script counterpart to engine's class Inventory
Definition Inventory.c:77
bool TakeEntityToCargo(InventoryMode mode, notnull EntityAI item)
moves item to cargo of this intentory
Definition Inventory.c:1044
bool TakeEntityAsAttachment(InventoryMode mode, notnull EntityAI item)
Definition Inventory.c:1125
static bool CanSwapEntitiesEx(notnull EntityAI item1, notnull EntityAI item2)
Definition Inventory.c:601
inventory for plain man/human
override bool TakeEntityAsAttachmentEx(InventoryMode mode, notnull EntityAI item, int slot)
bool ReplaceItemInHandsWithNew(InventoryMode mode, ReplaceItemWithNewLambdaBase lambda)
override bool TakeEntityToInventory(InventoryMode mode, FindInventoryLocationType flags, notnull EntityAI item)
override bool DropEntity(InventoryMode mode, EntityAI owner, notnull EntityAI item)
override bool TakeToDst(InventoryMode mode, notnull InventoryLocation src, notnull InventoryLocation dst)
bool ReplaceItemInHandsWithNewElsewhere(InventoryMode mode, ReplaceItemWithNewLambdaBase lambda)
override bool SwapEntities(InventoryMode mode, notnull EntityAI item1, notnull EntityAI item2)
override bool ReplaceItemWithNew(InventoryMode mode, ReplaceItemWithNewLambdaBase lambda)
proto native EntityAI GetEntityInHands()
bool ReplaceItemElsewhereWithNewInHands(InventoryMode mode, ReplaceItemWithNewLambdaBase lambda)
override bool ForceSwapEntities(InventoryMode mode, notnull EntityAI item1, notnull EntityAI item2, notnull InventoryLocation item2_dst)
override bool LocalDestroyEntity(notnull EntityAI item)
InventoryLocation.
proto native void SetHands(notnull EntityAI parent, EntityAI e)
sets current inventory location type to Hands
proto native int GetSlot()
returns slot id if current type is Attachment
static string DumpToStringNullSafe(InventoryLocation loc)
The class that will be instanced (moddable)
Definition gameplay.c:378
base class for transformation operations (creating one item from another)
proto static native bool CanStoreInputUserData()
ScriptInvoker Class provide list of callbacks usage:
Definition tools.c:116
Base native class for all motorized wheeled vehicles.
Definition Car.c:80
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
Definition UIManager.c:161
proto native CGame GetGame()
void Error(string err)
Messagebox with error message.
Definition EnDebug.c:90
proto void Print(void var)
Prints content of variable to console/log.
proto native void SetFlags(ShapeFlags flags)
EntityFlags
Entity flags.
Definition EnEntity.c:115
const int MENU_INVENTORY
Definition constants.c:158
proto native Widget GetParent()
Get parent of the Effect.
Definition Effect.c:396