Dayz Explorer 1.28.160049
Loading...
Searching...
No Matches
giftbox_base.c
Go to the documentation of this file.
1class GiftBox_Base extends Container_Base
2{
3 protected vector m_HalfExtents; // The Y value contains a heightoffset and not the halfextent !!!
5
7 {
9 m_Openable = new OpenableBehaviour(false);
10
11 RegisterNetSyncVariableBool("m_Openable.m_IsOpened");
12 }
13
15 {
16 if (!super.CanReceiveItemIntoCargo(item))
17 return false;
18
20 {
21 if (!GetGame().IsDedicatedServer())
22 return IsOpen();
23 }
24
25 return true;
26 }
27
28
29 override void Open()
30 {
31 m_Openable.Open();
32 SetSynchDirty();
33 }
34
35 override void Close()
36 {
37 m_Openable.Close();
38 SetSynchDirty();
39 }
40
41 override bool IsOpen()
42 {
43 return m_Openable.IsOpened();
44 }
45
46 override void SetActions()
47 {
48 super.SetActions();
49
51 }
52
53 override void OnDebugSpawn()
54 {
55 EntityAI entity;
56 if (Class.CastTo(entity, this))
57 {
58 entity.GetInventory().CreateInInventory("Chemlight_Green");
59 }
60 }
61
62 override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
63 {
64 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
65
66 if (newLevel == GameConstants.STATE_RUINED && GetGame().IsServer())
67 {
68 MiscGameplayFunctions.DropAllItemsInInventoryInBounds(this, m_HalfExtents);
69 DeleteSafe();
70 }
71 }
72}
73
74class GiftBox_Small extends GiftBox_Base {}
75class GiftBox_Medium extends GiftBox_Base {}
76class GiftBox_Large extends GiftBox_Base {}
InventoryCheckContext
Definition inventory.c:58
void AddAction(typename actionName)
Super root of all classes in Enforce script.
Definition enscript.c:11
void GiftBox_Base()
Definition giftbox_base.c:6
override bool CanReceiveItemIntoCargo(EntityAI item)
override void OnDebugSpawn()
ref OpenableBehaviour m_Openable
Definition giftbox_base.c:4
override void Open()
override void SetActions()
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
vector m_HalfExtents
Definition giftbox_base.c:3
override void Close()
override bool IsOpen()
script counterpart to engine's class Inventory
Definition inventory.c:79
static int GetInventoryCheckContext()
Definition inventory.c:373
Container_Base m_HalfExtents
proto native CGame GetGame()