Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
container_base.c
Go to the documentation of this file.
2 {
3  override bool IsContainer()
4  {
5  return true;
6  }
7 
8  override bool CanPutInCargo(EntityAI parent)
9  {
10  if (!super.CanPutInCargo(parent))
11  return false;
12 
13  if (parent && (parent == this || GetType() == parent.GetType() || parent.GetInventory().IsCargoInHiearchy()))
14  return false;
15 
16  return true;
17  }
18 
19  override bool CanReceiveItemIntoCargo( EntityAI item )
20  {
21  if (!super.CanReceiveItemIntoCargo(item))
22  return false;
23 
24  //is 'this' somewhere in cargo?
25  if (GetInventory().IsCargoInHiearchy())
26  return false;
27 
28  return true;
29  }
30 }
31 
33 {
34  protected vector m_HalfExtents; // The Y value contains a heightoffset and not the halfextent !!!
35 
37  {
38  m_HalfExtents = vector.Zero;
39 
40  ProcessInvulnerabilityCheck(GetInvulnerabilityTypeString());
41  }
42 
43  override string GetInvulnerabilityTypeString()
44  {
45  return "disableContainerDamage";
46  }
47 
48  override void SetActions()
49  {
50  super.SetActions();
51 
54  }
55 
56  override bool CanReceiveAttachment(EntityAI attachment, int slotId)
57  {
58  if (GetHealthLevel() == GameConstants.STATE_RUINED)
59  return false;
60 
61  return super.CanReceiveAttachment(attachment, slotId);
62  }
63 
64  override bool CanLoadAttachment(EntityAI attachment)
65  {
66  if (GetHealthLevel() == GameConstants.STATE_RUINED)
67  return false;
68 
69  return super.CanLoadAttachment(attachment);
70  }
71 
72  override bool CanReceiveItemIntoCargo(EntityAI item)
73  {
74  if (GetHealthLevel() == GameConstants.STATE_RUINED)
75  return false;
76 
77  return super.CanReceiveItemIntoCargo(item);
78  }
79 
80  override bool CanLoadItemIntoCargo(EntityAI item)
81  {
82  if (!super.CanLoadItemIntoCargo(item))
83  return false;
84 
85  if (GetHealthLevel() == GameConstants.STATE_RUINED)
86  return false;
87 
88  return true;
89  }
90 
91  override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
92  {
93  super.EEHealthLevelChanged(oldLevel,newLevel,zone);
94 
95  if (newLevel == GameConstants.STATE_RUINED && !GetHierarchyParent())
96  MiscGameplayFunctions.DropAllItemsInInventoryInBounds(this, m_HalfExtents);
97  }
98 }
ItemBase
Definition: inventoryitem.c:730
ActionPlaceObject
Definition: actionplaceobject.c:9
CanReceiveItemIntoCargo
override bool CanReceiveItemIntoCargo(EntityAI item)
Definition: container_base.c:72
m_HalfExtents
Container_Base m_HalfExtents
ActionTogglePlaceObject
Definition: actiontoggleplaceobject.c:1
GetInvulnerabilityTypeString
override string GetInvulnerabilityTypeString()
Definition: container_base.c:43
vector
Definition: enconvert.c:105
DeployableContainer_Base
void DeployableContainer_Base()
Definition: container_base.c:36
EEHealthLevelChanged
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
Definition: container_base.c:91
AddAction
void AddAction(typename actionName)
Definition: advancedcommunication.c:86
GameConstants
Definition: constants.c:612
Container_Base
Definition: anniversarybox.c:1
CanLoadAttachment
override bool CanLoadAttachment(EntityAI attachment)
Definition: container_base.c:64
CanLoadItemIntoCargo
override bool CanLoadItemIntoCargo(EntityAI item)
Definition: container_base.c:80
EntityAI
Definition: building.c:5
GetType
override int GetType()
Definition: huddebugwincharagents.c:49
CanReceiveAttachment
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
Definition: container_base.c:56
SetActions
override void SetActions()
Definition: container_base.c:48