DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ HandleDoorLoad()

void GetLockCompatibilityType::HandleDoorLoad ( )
protected

См. определение в файле ContainerLocked.c строка 144

145{
146 protected int m_LockedMask = 0;
147 protected int m_OpeningMask = 0;
148
150 {
151 int count = GetDoorCount();
152 for (int i = 0; i < count; i++)
153 {
154 LockDoor(i);
155 }
156 }
157
158 override void OnStoreSave(ParamsWriteContext ctx)
159 {
160 super.OnStoreSave(ctx);
161
162 ctx.Write(m_LockedMask);
163 ctx.Write(m_OpeningMask);
164 }
165
166 override bool OnStoreLoad(ParamsReadContext ctx, int version)
167 {
168 if (!super.OnStoreLoad(ctx, version))
169 return false;
170
171 ctx.Read(m_LockedMask);
172 ctx.Read(m_OpeningMask);
173
175
176 return true;
177 }
178
179 protected void HandleDoorLoad()
180 {
181 int count = GetDoorCount();
182 int i;
183
184 //locking
185 for (i = 0; i < count; i++)
186 {
187 if (m_LockedMask & (1 << i))
188 {
189 LockDoor(i,true);
190 }
191 else
192 {
193 UnlockDoor(i);
194 }
195 }
196
197 //then opening
198 for (i = 0; i < count; i++)
199 {
200 if (m_OpeningMask & (1 << i) && !IsDoorLocked(i))
201 {
202 OpenDoor(i);
203 }
204 }
205 }
206
208 //events
209
210 override void OnDoorLocked(DoorLockParams params)
211 {
212 super.OnDoorLocked(params);
213
214 m_LockedMask |= 1 << params.param1;
215
216
217 string selectionName = string.Format("side%1_lock",(params.param1 + 1));
218 SetAnimationPhase(selectionName,0);
219 }
220
221 override void OnDoorUnlocked(DoorLockParams params)
222 {
223 super.OnDoorUnlocked(params);
224
225 int doorIdx = params.param1;
226
227 m_LockedMask &= ~(1 << doorIdx);
228
229 string selectionName = string.Format("side%1_lock",(doorIdx + 1));
230 SetAnimationPhase(selectionName,1);
231
232 if (!GetGame().IsDedicatedServer())
233 SEffectManager.PlaySoundEnviroment("Land_ContainerLocked_lock_SoundSet",GetDoorSoundPos(doorIdx));
234 }
235
236 override void OnDoorCloseStart(DoorStartParams params)
237 {
238 super.OnDoorCloseStart(params);
239
240 m_OpeningMask &= ~(1 << params.param1);
241 }
242
243 override void OnDoorOpenStart(DoorStartParams params)
244 {
245 super.OnDoorOpenStart(params);
246
247 m_OpeningMask |= 1 << params.param1;
248 }
249}
250
251class Land_ContainerLocked_Blue_DE : ContainerLockedBase
252{
253 override int GetLockCompatibilityType(int doorIdx)
254 {
255 return 1 << EBuildingLockType.SHIP_CONTAINER_0;
256 }
257}
258
260{
261 override int GetLockCompatibilityType(int doorIdx)
262 {
263 return 1 << EBuildingLockType.SHIP_CONTAINER_1;
264 }
265}
266
267class Land_ContainerLocked_Orange_DE : ContainerLockedBase
268{
269 override int GetLockCompatibilityType(int doorIdx)
270 {
271 return 1 << EBuildingLockType.SHIP_CONTAINER_2;
272 }
273}
274
276{
277 override int GetLockCompatibilityType(int doorIdx)
278 {
279 return 1 << EBuildingLockType.SHIP_CONTAINER_3;
280 }
281}
Param1< int > DoorStartParams
Определения Building.c:1
Param1< int > DoorLockParams
Определения Building.c:3
int m_LockedMask
Определения ContainerLocked.c:111
override void OnDoorOpenStart(DoorStartParams params)
Определения ContainerLocked.c:208
ContainerLockedBase BuildingSuper GetLockCompatibilityType(int doorIdx)
Определения ContainerLocked.c:110
override void OnStoreSave(ParamsWriteContext ctx)
Определения ContainerLocked.c:123
override void OnDoorLocked(DoorLockParams params)
Определения ContainerLocked.c:175
override bool OnStoreLoad(ParamsReadContext ctx, int version)
Определения ContainerLocked.c:131
int m_OpeningMask
Определения ContainerLocked.c:112
void ContainerLockedBase()
Определения ContainerLocked.c:114
override void OnDoorUnlocked(DoorLockParams params)
Определения ContainerLocked.c:186
override void OnDoorCloseStart(DoorStartParams params)
Определения ContainerLocked.c:201
void HandleDoorLoad()
Определения ContainerLocked.c:144
EBuildingLockType
Определения EBuildingLockTypes.c:2
Определения FuelStation.c:2
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
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.