DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
ContainerLocked.c
См. документацию.
2{
3 protected int m_LockedMask = 0;
4 protected int m_OpeningMask = 0;
5
7 {
8 int count = GetDoorCount();
9 for (int i = 0; i < count; i++)
10 {
11 LockDoor(i);
12 }
13 }
14
16 {
17 super.OnStoreSave(ctx);
18
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);
30
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 (!GetGame().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
108class Land_ContainerLocked_Blue_DE : ContainerLockedBase
109{
110 override int GetLockCompatibilityType(int doorIdx)
112 return 1 << EBuildingLockType.SHIP_CONTAINER_0;
113 }
115
117{
118 override int GetLockCompatibilityType(int doorIdx)
119 {
120 return 1 << EBuildingLockType.SHIP_CONTAINER_1;
121 }
122}
124class Land_ContainerLocked_Orange_DE : ContainerLockedBase
125{
126 override int GetLockCompatibilityType(int doorIdx)
127 {
128 return 1 << EBuildingLockType.SHIP_CONTAINER_2;
129 }
130}
133{
134 override int GetLockCompatibilityType(int doorIdx)
135 {
136 return 1 << EBuildingLockType.SHIP_CONTAINER_3;
137 }
138}
Param1< int > DoorStartParams
Определения Building.c:1
Param1< int > DoorLockParams
Определения Building.c:3
ContainerLockedBase BuildingSuper GetLockCompatibilityType(int doorIdx)
Определения ContainerLocked.c:110
EBuildingLockType
Определения EBuildingLockTypes.c:2
Определения FuelStation.c:2
int m_OpeningMask
Определения ContainerLocked.c:4
int m_LockedMask
Определения ContainerLocked.c:3
void HandleDoorLoad()
Определения ContainerLocked.c:36
override void OnStoreSave(ParamsWriteContext ctx)
Определения ContainerLocked.c:15
void ContainerLockedBase()
Определения ContainerLocked.c:6
override void OnDoorOpenStart(DoorStartParams params)
Определения ContainerLocked.c:100
override void OnDoorCloseStart(DoorStartParams params)
Определения ContainerLocked.c:93
override void OnDoorUnlocked(DoorLockParams params)
Определения ContainerLocked.c:78
override void OnDoorLocked(DoorLockParams params)
Определения ContainerLocked.c:67
override bool OnStoreLoad(ParamsReadContext ctx, int version)
Определения ContainerLocked.c:23
override int GetLockCompatibilityType(int doorIdx)
Определения ContainerLocked.c:134
override int GetLockCompatibilityType(int doorIdx)
Определения ContainerLocked.c:118
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.
Определения EffectManager.c:228
Manager class for managing Effect (EffectParticle, EffectSound)
Определения EffectManager.c:6
proto bool Write(void value_out)
proto bool Read(void value_in)
Serializer ParamsReadContext
Определения gameplay.c:15
proto native CGame GetGame()
Serializer ParamsWriteContext
Определения gameplay.c:16