DayZ 1.24
Loading...
Searching...
No Matches
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
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
32class DeployableContainer_Base : Container_Base
33{
34 protected vector m_HalfExtents; // The Y value contains a heightoffset and not the halfextent !!!
35
37 {
39
40 ProcessInvulnerabilityCheck(GetInvulnerabilityTypeString());
41 }
42
44 {
45 return "disableContainerDamage";
46 }
47
48 override void SetActions()
49 {
50 super.SetActions();
51
54 }
55
57 {
58 if (GetHealthLevel() == GameConstants.STATE_RUINED)
59 return false;
60
61 return super.CanReceiveAttachment(attachment, slotId);
62 }
63
65 {
66 if (GetHealthLevel() == GameConstants.STATE_RUINED)
67 return false;
68
69 return super.CanLoadAttachment(attachment);
70 }
71
73 {
74 if (GetHealthLevel() == GameConstants.STATE_RUINED)
75 return false;
76
77 return super.CanReceiveItemIntoCargo(item);
78 }
79
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}
eBleedingSourceType GetType()
void AddAction(typename actionName)
void SetActions()
override string GetInvulnerabilityTypeString()
void DeployableContainer_Base()
override bool CanLoadItemIntoCargo(EntityAI item)
Container_Base m_HalfExtents
override bool CanLoadAttachment(EntityAI attachment)
override bool CanReceiveItemIntoCargo(EntityAI item)
Definition ItemBase.c:8715
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
Definition ItemBase.c:8724
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
Definition ItemBase.c:6535
override bool CanPutInCargo(EntityAI parent)
override bool IsContainer()
override bool CanReceiveItemIntoCargo(EntityAI item)
static const vector Zero
Definition EnConvert.c:110
const int STATE_RUINED
Definition constants.c:757