Dayz
Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Toggle main menu visibility
Loading...
Searching...
No Matches
containerlocked.c
Go to the documentation of this file.
1
class
ContainerLockedBase
:
BuildingSuper
2
{
3
protected
int
m_LockedMask
= 0;
4
protected
int
m_OpeningMask
= 0;
5
6
void
ContainerLockedBase
()
7
{
8
int
count = GetDoorCount();
9
for
(
int
i = 0; i < count; i++)
10
{
11
LockDoor(i);
12
}
13
}
14
15
override
void
OnStoreSave
(
ParamsWriteContext
ctx)
16
{
17
super.OnStoreSave(ctx);
18
19
ctx.
Write
(
m_LockedMask
);
20
ctx.
Write
(
m_OpeningMask
);
21
}
22
23
override
bool
OnStoreLoad
(
ParamsReadContext
ctx,
int
version)
24
{
25
if
(!super.OnStoreLoad(ctx, version))
26
return
false
;
27
28
ctx.
Read
(
m_LockedMask
);
29
ctx.
Read
(
m_OpeningMask
);
30
31
HandleDoorLoad
();
32
33
return
true
;
34
}
35
36
protected
void
HandleDoorLoad
()
37
{
38
int
count = GetDoorCount();
39
int
i;
40
41
//locking
42
for
(i = 0; i < count; i++)
43
{
44
if
(
m_LockedMask
& (1 << i))
45
{
46
LockDoor(i,
true
);
47
}
48
else
49
{
50
UnlockDoor(i);
51
}
52
}
53
54
//then opening
55
for
(i = 0; i < count; i++)
56
{
57
if
(
m_OpeningMask
& (1 << i) && !IsDoorLocked(i))
58
{
59
OpenDoor(i);
60
}
61
}
62
}
63
65
//events
66
67
override
void
OnDoorLocked
(
DoorLockParams
params)
68
{
69
super.OnDoorLocked(params);
70
71
m_LockedMask
|= 1 << params.param1;
72
73
74
string
selectionName =
string
.Format(
"side%1_lock"
,(params.param1 + 1));
75
SetAnimationPhase(selectionName,0);
76
}
77
78
override
void
OnDoorUnlocked
(
DoorLockParams
params)
79
{
80
super.OnDoorUnlocked(params);
81
82
int
doorIdx = params.param1;
83
84
m_LockedMask
&= ~(1 << doorIdx);
85
86
string
selectionName =
string
.Format(
"side%1_lock"
,(doorIdx + 1));
87
SetAnimationPhase(selectionName,1);
88
89
if
(!
g_Game
.IsDedicatedServer())
90
SEffectManager
.
PlaySoundEnviroment
(
"Land_ContainerLocked_lock_SoundSet"
,GetDoorSoundPos(doorIdx));
91
}
92
93
override
void
OnDoorCloseStart
(
DoorStartParams
params)
94
{
95
super.OnDoorCloseStart(params);
96
97
m_OpeningMask
&= ~(1 << params.param1);
98
}
99
100
override
void
OnDoorOpenStart
(
DoorStartParams
params)
101
{
102
super.OnDoorOpenStart(params);
103
104
m_OpeningMask
|= 1 << params.param1;
105
}
106
}
107
108
class
Land_ContainerLocked_Blue_DE :
ContainerLockedBase
109
{
110
override
int
GetLockCompatibilityType
(
int
doorIdx)
111
{
112
return
1 <<
EBuildingLockType
.SHIP_CONTAINER_0;
113
}
114
}
115
116
class
Land_ContainerLocked_Yellow_DE
:
ContainerLockedBase
117
{
118
override
int
GetLockCompatibilityType
(
int
doorIdx)
119
{
120
return
1 <<
EBuildingLockType
.SHIP_CONTAINER_1;
121
}
122
}
123
124
class
Land_ContainerLocked_Orange_DE :
ContainerLockedBase
125
{
126
override
int
GetLockCompatibilityType
(
int
doorIdx)
127
{
128
return
1 <<
EBuildingLockType
.SHIP_CONTAINER_2;
129
}
130
}
131
132
class
Land_ContainerLocked_Red_DE
:
ContainerLockedBase
133
{
134
override
int
GetLockCompatibilityType
(
int
doorIdx)
135
{
136
return
1 <<
EBuildingLockType
.SHIP_CONTAINER_3;
137
}
138
}
DoorStartParams
Param1< int > DoorStartParams
Definition
building.c:1
DoorLockParams
Param1< int > DoorLockParams
Definition
building.c:3
BuildingSuper
Definition
fuelstation.c:2
ContainerLockedBase
Definition
containerlocked.c:2
ContainerLockedBase::m_LockedMask
int m_LockedMask
Definition
containerlocked.c:3
ContainerLockedBase::ContainerLockedBase
void ContainerLockedBase()
Definition
containerlocked.c:6
ContainerLockedBase::OnStoreSave
override void OnStoreSave(ParamsWriteContext ctx)
Definition
containerlocked.c:15
ContainerLockedBase::HandleDoorLoad
void HandleDoorLoad()
Definition
containerlocked.c:36
ContainerLockedBase::OnDoorOpenStart
override void OnDoorOpenStart(DoorStartParams params)
Definition
containerlocked.c:100
ContainerLockedBase::m_OpeningMask
int m_OpeningMask
Definition
containerlocked.c:4
ContainerLockedBase::OnStoreLoad
override bool OnStoreLoad(ParamsReadContext ctx, int version)
Definition
containerlocked.c:23
ContainerLockedBase::OnDoorUnlocked
override void OnDoorUnlocked(DoorLockParams params)
Definition
containerlocked.c:78
ContainerLockedBase::OnDoorLocked
override void OnDoorLocked(DoorLockParams params)
Definition
containerlocked.c:67
ContainerLockedBase::OnDoorCloseStart
override void OnDoorCloseStart(DoorStartParams params)
Definition
containerlocked.c:93
Land_ContainerLocked_Red_DE
Definition
containerlocked.c:133
Land_ContainerLocked_Red_DE::GetLockCompatibilityType
override int GetLockCompatibilityType(int doorIdx)
Definition
containerlocked.c:134
Land_ContainerLocked_Yellow_DE
Definition
containerlocked.c:117
Land_ContainerLocked_Yellow_DE::GetLockCompatibilityType
override int GetLockCompatibilityType(int doorIdx)
Definition
containerlocked.c:118
SEffectManager
Manager class for managing Effect (EffectParticle, EffectSound).
Definition
effectmanager.c:6
SEffectManager::PlaySoundEnviroment
static EffectSound PlaySoundEnviroment(string sound_set, vector position, float play_fade_in=0, float stop_fade_out=0, bool loop=false)
Create and play an EffectSound, updating environment variables.
Definition
effectmanager.c:228
Serializer::Write
proto bool Write(void value_out)
Serializer::Read
proto bool Read(void value_in)
GetLockCompatibilityType
ContainerLockedBase BuildingSuper GetLockCompatibilityType(int doorIdx)
Definition
containerlocked.c:110
g_Game
DayZGame g_Game
Definition
dayzgame.c:3942
EBuildingLockType
EBuildingLockType
Definition
ebuildinglocktypes.c:2
ParamsReadContext
Serializer ParamsReadContext
Definition
gameplay.c:15
ParamsWriteContext
Serializer ParamsWriteContext
Definition
gameplay.c:16
Games
Dayz
scripts
4_world
entities
itembase
containerlocked.c
Generated by
1.17.0