DayZ Scripts
v1.21.156300 ยท Jun 20, 2023
 
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 || (this.GetType() == parent.GetType())))
14 return false;
15
16 return true;
17 }
18}
19
21{
22 protected vector m_HalfExtents; // The Y value contains a heightoffset and not the halfextent !!!
23
25 {
27
28 ProcessInvulnerabilityCheck(GetInvulnerabilityTypeString());
29 }
30
32 {
33 return "disableContainerDamage";
34 }
35
36 override void SetActions()
37 {
38 super.SetActions();
39
42 }
43
44 override bool CanReceiveAttachment(EntityAI attachment, int slotId)
45 {
46 if (GetHealthLevel() == GameConstants.STATE_RUINED)
47 return false;
48
49 return super.CanReceiveAttachment(attachment, slotId);
50 }
51
52 override bool CanLoadAttachment(EntityAI attachment)
53 {
54 if (GetHealthLevel() == GameConstants.STATE_RUINED)
55 return false;
56
57 return super.CanLoadAttachment(attachment);
58 }
59
61 {
62 if (GetHealthLevel() == GameConstants.STATE_RUINED)
63 return false;
64
65 return super.CanReceiveItemIntoCargo(item);
66 }
67
68 override bool CanLoadItemIntoCargo(EntityAI item)
69 {
70 if (!super.CanLoadItemIntoCargo(item))
71 return false;
72
73 if (GetHealthLevel() == GameConstants.STATE_RUINED)
74 return false;
75
76 return true;
77 }
78
79 override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
80 {
81 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
82
83 if (newLevel == GameConstants.STATE_RUINED && !GetHierarchyParent())
84 MiscGameplayFunctions.DropAllItemsInInventoryInBounds(this, m_HalfExtents);
85 }
86}
eBleedingSourceType GetType()
void AddAction(typename actionName)
void DeployableContainer_Base()
Container_Base m_HalfExtents
override bool CanReceiveItemIntoCargo(EntityAI item)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override bool CanPutInCargo(EntityAI parent)
protected vector m_HalfExtents
Definition GiftBox_Base.c:3
override bool IsContainer()
override void SetActions()
override bool CanLoadItemIntoCargo(EntityAI item)
Definition TentBase.c:997
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanLoadAttachment(EntityAI attachment)
override string GetInvulnerabilityTypeString()
static const vector Zero
Definition EnConvert.c:110
const int STATE_RUINED
Definition constants.c:742