DayZ 1.24
Loading...
Searching...
No Matches
AnniversaryBox.c
Go to the documentation of this file.
2{
3 private const int SPAWN_SHIRTS_MAX = 60;
4
5#ifndef SERVER
6 protected AnniversaryBoxLight m_Light;
7#endif
8
9 override void DeferredInit()
10 {
11 super.DeferredInit();
12
13#ifndef SERVER
14 m_Light = AnniversaryBoxLight.Cast(ScriptedLightBase.CreateLight(AnniversaryBoxLight, "0 0 0"));
15 if (m_Light)
16 m_Light.AttachOnMemoryPoint(this, "light");
17#endif
18
19 }
20
21 override void EEDelete(EntityAI parent)
22 {
23 super.EEDelete(parent);
24
25#ifndef SERVER
26 if (m_Light)
27 m_Light.Destroy();
28#endif
29 }
30
31 override bool IsContainer()
32 {
33 return true;
34 }
35
36 override bool IsTakeable()
37 {
38 return false;
39 }
40
45
46 override bool CanPutInCargo(EntityAI parent)
47 {
48 return false;
49 }
50
51 override bool DisableVicinityIcon()
52 {
53 if (GetAnimationPhase("lidclosing") == 1)
54 return true;
55 else
56 return false;
57 }
58
59 override bool CanDisplayCargo()
60 {
61 if (GetAnimationPhase("lidclosing") == 1)
62 return false;
63 else
64 return true;
65 }
66
68 {
69 if (GetGame().IsServer())//server or single player
70 {
71 for (int j = 0; j < GetInventory().GetCargo().GetItemCount(); j++)
72 GetInventory().GetCargo().GetItem(j).Delete();
73 }
74 }
75
77 {
78 if (GetGame().IsServer())//server or single player
79 {
80 EntityAI ent = GetInventory().CreateInInventory("TShirt_10thAnniversary");
81
82 for (int i = 0; ent && i < SPAWN_SHIRTS_MAX - 1; i++)
83 ent = GetInventory().CreateInInventory("TShirt_10thAnniversary");
84 }
85 }
86}
ExplosiveLight m_Light
light
override bool CanSwapEntities(EntityAI otherItem, InventoryLocation otherDestination, InventoryLocation destination)
override bool IsTakeable()
override void EEDelete(EntityAI parent)
override bool CanPutInCargo(EntityAI parent)
override bool IsContainer()
AnniversaryBoxLight m_Light
override bool CanDisplayCargo()
override bool DisableVicinityIcon()
override void DeferredInit()
InventoryLocation.
proto native CGame GetGame()