DayZ 1.30
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
CombinationLock.c
См. документацию.
1const float DIGIT_ROTATION_POSITION_0 = 0.9;
2const float DIGIT_ROTATION_POSITION_1 = 0.0;
3const float DIGIT_ROTATION_POSITION_2 = 0.1;
4const float DIGIT_ROTATION_POSITION_3 = 0.2;
5const float DIGIT_ROTATION_POSITION_4 = 0.3;
6const float DIGIT_ROTATION_POSITION_5 = 0.4;
7const float DIGIT_ROTATION_POSITION_6 = 0.5;
8const float DIGIT_ROTATION_POSITION_7 = 0.6;
9const float DIGIT_ROTATION_POSITION_8 = 0.7;
10const float DIGIT_ROTATION_POSITION_9 = 0.8;
11
24
25class CombinationLock extends ItemBase
26{
27 static const string LOCK_SELECTION_OUTSIDE = "lock_attached_outside";
28 static const string LOCK_SELECTION_INSIDE = "lock_attached_inside";
29 static const int FACING_OUTSIDE = 0;
30 static const int FACING_INSIDE = 1;
31
32 int m_LockDigits; //how many digits will the combination contain
33 int m_Combination; //actual combination that is dialed on lock outside
34 int m_CombinationInside; //actual combination that is dialed on lock inside
35 int m_CombinationLocked; //combination that was dialed on lock before the shuffle
36 int m_DialIndex; //index of current combination dial on lock outside
37 int m_DialIndexInside; //index of current combination dial on lock inside
39 protected bool m_IsLocked;
40
42
43 protected bool m_IsInitialized;
44
45 //Sounds
46 //build
47 const string SOUND_LOCK_OPEN = "combinationlock_open_SoundSet";
48 const string SOUND_LOCK_CLOSE = "combinationlock_close_SoundSet";
49 const string SOUND_LOCK_CHANGE_NUMBER = "combinationlock_changenumber_SoundSet";
50 const string SOUND_LOCK_CHANGE_DIAL = "combinationlock_changedial_SoundSet";
51 const string SOUND_LOCK_WRONG_PIN = "combinationlock_wrong_combination_SoundSet";
52
54
56 {
58
59 //synchronized variables
60 int combinationLength = Math.Pow(10, m_LockDigits);
61 RegisterNetSyncVariableBool("m_IsLocked");
62 RegisterNetSyncVariableInt("m_Combination", 0, combinationLength - 1);
63 RegisterNetSyncVariableInt("m_CombinationInside", 0, combinationLength - 1);
64 RegisterNetSyncVariableInt("m_DialIndex", 0, m_LockDigits - 1);
65 RegisterNetSyncVariableInt("m_DialIndexInside", 0, m_LockDigits - 1);
66 RegisterNetSyncVariableInt("m_LockActionPerformed", 0, LockAction.COUNT);
67 RegisterNetSyncVariableInt("m_LockDigitsCount", 0, combinationLength - 1);
68 }
69
70 protected void SetBaseLockValues()
71 {
72 //set lock init values
73 m_LockDigits = 3;
74 m_Combination = 111;
77 m_LockDigitsCount = m_CombinationLocked.ToString().Length();
78 m_IsLocked = false;
79 }
80
81 override void EEInit()
82 {
83 super.EEInit();
84
85 g_Game.GetCallQueue( CALL_CATEGORY_GAMEPLAY ).CallLater( SetInitialized, 1000, false );
86
87 //set visual on init
89 }
90
92 {
93 m_IsInitialized = true;
94 }
95
96 override bool IsInitialized()
97 {
98 return m_IsInitialized;
99 }
100
101 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
102 {
103 super.EEItemLocationChanged(oldLoc, newLoc);
104
105 if (g_Game.IsServer())
106 {
107 EntityAI oldParent = oldLoc.GetParent();
108 if (oldParent && oldParent.CanUseConstruction() && oldLoc.GetType() == InventoryLocationType.ATTACHMENT)
109 SetTakeable(true);
110 }
111 }
112
113 override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
114 {
115 super.OnItemLocationChanged(old_owner, new_owner);
116
117 //Check combination lock
118 if (g_Game.IsServer())
119 {
120 if (IsInitialized() && new_owner && new_owner.CanUseConstruction())
121 {
122 LockServer(new_owner);
123 }
124 }
125 }
126
127 // --- EVENTS
128 override void OnStoreSave( ParamsWriteContext ctx )
129 {
130 super.OnStoreSave(ctx);
131
132 //write data
133 ctx.Write( m_Combination );
136 }
137
138 override bool OnStoreLoad(ParamsReadContext ctx, int version)
139 {
140 if (!super.OnStoreLoad(ctx, version))
141 return false;
142
143 //--- Combination Lock data ---
144 //combination one (outside lock)
145 if (!ctx.Read(m_Combination))
146 {
147 m_Combination = 0;
148 return false;
149 }
150
151 //combination locked
152 if (!ctx.Read(m_CombinationLocked))
153 {
156 return false;
157 }
158
159 //is lock attached
160 if (version < 105) //removed in 105
161 {
162 bool isLockAttached;
163 if (!ctx.Read(isLockAttached))
164 {
165 return false;
166 }
167 }
168
169 if (version >= 143) //added with 143
170 {
171 //combination two (inside lock)
172 if (!ctx.Read(m_CombinationInside))
173 {
175 return false;
176 }
177 }
178
179 return true;
180 }
181
182 override void AfterStoreLoad()
183 {
184 super.AfterStoreLoad();
185
186 m_LockDigitsCount = m_CombinationLocked.ToString().Length();
187
188 //Check combination lock
189 if ( g_Game.IsServer() )
190 {
191 EntityAI parent = GetHierarchyParent();
192 if (parent && (parent.IsInherited(BaseBuildingBase) || parent.CanUseConstruction()))
193 {
194 LockServer(parent, true);
195 }
196 else
197 {
198 //synchronize
199 Synchronize();
200 }
201 }
202 }
203
204 // --- SYNCHRONIZATION
206 {
207 if (LogManager.IsBaseBuildingLogEnable()) bsbDebugPrint("[bsb] CombinationLock.Synchronize " + " m_Combination=" + m_Combination + " m_CombinationLocked=" + m_CombinationLocked);
208 if ( g_Game.IsServer() )
209 {
210 SetSynchDirty();
211 g_Game.GetCallQueue( CALL_CATEGORY_SYSTEM ).CallLater( ResetActionVar, 1000);//synced var used to trigger client sound needs to be reset after triggering the sound
213
215 UpdateSound();
216 }
217 }
218
220 {
222 }
223
225 {
226 super.OnVariablesSynchronized();
227 //update visuals (client)
229
230 if (LogManager.IsBaseBuildingLogEnable()) bsbDebugPrint("[bsb] CombinationLock.OnVariablesSynchronized " + " m_Combination=" + m_Combination + " m_CombinationLocked=" + m_CombinationLocked);
231 }
232
233 void SetCombination(int combination, bool setOtherSide = true)
234 {
235 m_Combination = combination;
236
238 if (!GetInventory().IsAttachment() && setOtherSide)
239 SetCombinationInside(combination, false);
240 }
241
242 void SetCombinationInside(int combination, bool setOtherSide = true)
243 {
244 m_CombinationInside = combination;
245
247 if (!GetInventory().IsAttachment() && setOtherSide)
248 SetCombination(combination, false);
249 }
250
251 void SetCombinationLocked(int combination)
252 {
253 m_CombinationLocked = combination;
254 m_LockDigitsCount = m_CombinationLocked.ToString().Length();
255 }
256
258 {
259 return m_Combination;
260 }
261
263 {
264 return m_CombinationInside;
265 }
266
268 {
269 return m_LockDigits;
270 }
271
272 // --- ACTIONS
273 void DialNextNumber(int lockSide = FACING_OUTSIDE)
274 {
275 bool isInsideLock = (lockSide == FACING_INSIDE);
276
277 string combinationText;
278 string dialedText;
279
280 if (!isInsideLock)
281 {
282 combinationText = m_Combination.ToString();
283 }
284 else
285 {
286 combinationText = m_CombinationInside.ToString();
287 }
288
289 //insert zeros to dials with 0 value
290 int lengthDiff = m_LockDigits - combinationText.Length();
291 for (int i = 0; i < lengthDiff; ++i)
292 {
293 combinationText = "0" + combinationText;
294 }
295 //assemble the whole combination with increased part
296 for (int j = 0; j < combinationText.Length(); ++j)
297 {
298 if (!isInsideLock && j == m_DialIndex || isInsideLock && j == m_DialIndexInside)
299 {
300 int nextDialedNumber = combinationText.Get(j).ToInt() + 1;
301 if (nextDialedNumber > 9)
302 {
303 nextDialedNumber = 0;
304 }
305
306 dialedText += nextDialedNumber.ToString();
307 }
308 else
309 {
310 dialedText += combinationText.Get(j);
311 }
312 }
313
314 //set new number
315 if (!isInsideLock)
316 {
317 SetCombination(dialedText.ToInt());
318 m_LockActionPerformed = LockAction.DIAL_INDEX_CHANGED_OUTSIDE;
319 }
320 else
321 {
322 SetCombinationInside(dialedText.ToInt());
323 m_LockActionPerformed = LockAction.DIAL_INDEX_CHANGED_INSIDE;
324 }
325
326 //synchronize
327 Synchronize();
328 }
329
331 {
332 return m_DialIndex;
333 }
334
336 {
337 return m_DialIndexInside;
338 }
339
340 void SetNextDial(int lockSide = FACING_OUTSIDE)
341 {
342 bool isInsideLock = (lockSide == FACING_INSIDE);
343
344 int dialIndex;
345 if (!isInsideLock)
346 dialIndex = m_DialIndex;
347 else
348 dialIndex = m_DialIndexInside;
349
350 if (m_LockDigits > 1)
351 {
352 if (dialIndex <= m_LockDigits - 2)
353 {
354 dialIndex++;
355 }
356 else if (dialIndex >= m_LockDigits - 1)
357 {
358 dialIndex = 0;
359 }
360 }
361 else
362 {
363 dialIndex = 0;
364 }
365
366 if (!isInsideLock)
367 {
368 m_DialIndex = dialIndex;
369 //performed action
370 m_LockActionPerformed = LockAction.DIAL_NUMBER_CHANED_OUTSIDE;
371 }
372 else
373 {
374 m_DialIndexInside = dialIndex;
375 //performed action
376 m_LockActionPerformed = LockAction.DIAL_NUMBER_CHANED_INSIDE;
377 }
378
379 //synchronize
380 Synchronize();
381 }
382
383 //Lock lock
384 void LockServer(EntityAI parent, bool ignore_combination = false)
385 {
386 if (LogManager.IsBaseBuildingLogEnable()) bsbDebugPrint("[bsb] CombinationLock.LockServer " + " m_Combination=" + m_Combination + " m_CombinationLocked=" + m_CombinationLocked);
387 if (IsLockAttached())
388 {
389 if (!ignore_combination)
390 {
392
393 //set slot lock
394 InventoryLocation inventoryLocation = new InventoryLocation;
395 GetInventory().GetCurrentInventoryLocation(inventoryLocation);
396 parent.GetInventory().SetSlotLock(inventoryLocation.GetSlot(), true);
397
399 }
400 ShuffleLock();
401 SetTakeable(false);
403 //synchronize
404 Synchronize();
405 }
406 }
407
409 void UnlockOnServer(EntityAI player, EntityAI parent, bool isInsideLock = false)
410 {
411 if (LogManager.IsBaseBuildingLogEnable()) bsbDebugPrint("[bsb] CombinationLock.UnlockOnServer " + " m_Combination=" + m_Combination + " m_CombinationLocked=" + m_CombinationLocked);
412 if (IsLockAttached())
413 {
414 //set slot unlock
415 InventoryLocation inventoryLocation = new InventoryLocation;
416 GetInventory().GetCurrentInventoryLocation(inventoryLocation);
417 parent.GetInventory().SetSlotLock(inventoryLocation.GetSlot(), false);
418
419 //drop entity from attachment slot
420 if (g_Game.IsMultiplayer())
421 {
422 parent.GetInventory().DropEntity(InventoryMode.SERVER, parent, this);
423 }
424 else
425 {
426 parent.GetInventory().DropEntity(InventoryMode.LOCAL, parent, this);
427 }
428
429 vector groundPos;
430 if (player)
431 {
432 groundPos = player.GetPosition();
433 }
434 else
435 {
436 string slotName = InventorySlots.GetSlotName(inventoryLocation.GetSlot());
437 if (parent.MemoryPointExists(slotName))
438 {
439 groundPos = parent.ModelToWorld(parent.GetMemoryPointPos(slotName));
440 }
441 else
442 {
443 groundPos = GetPosition();
444 }
445 }
446
447 SetPosition(groundPos);
448 PlaceOnSurface();
449
451 SetTakeable(true);
452 CheckLockedStateServer(isInsideLock);
453
454 if (!isInsideLock)
455 {
457 }
458 else
459 {
461 }
462
464
465 //synchronize
466 Synchronize();
467 }
468 }
469
470 //Shuffle lock
471 protected void ShuffleLock()
472 {
473 ShuffleCombination(m_Combination.ToString(), false);
474 ShuffleCombination(m_CombinationInside.ToString(), true);
475 }
476
477 protected void ShuffleCombination(string combinationText, bool isInsideLock = false)
478 {
479 string shuffledText;
480
481 //insert zeros to dials with 0 value
482 int lengthDiff = m_LockDigits - combinationText.Length();
483 for (int i = 0; i < lengthDiff; ++i)
484 {
485 combinationText = "0" + combinationText;
486 }
487
488 //assemble the whole combination with increased part
489 for (int j = 0; j < combinationText.Length(); ++j)
490 {
491 int dialNumber = combinationText.Get(j).ToInt();
492 dialNumber = ( dialNumber + Math.RandomInt( 1, 9 ) ) % 10;
493 shuffledText = shuffledText + dialNumber.ToString();
494 if (!isInsideLock)
496 else
498 }
499
500 if (!isInsideLock)
501 SetCombination(shuffledText.ToInt());
502 else
503 SetCombinationInside(shuffledText.ToInt());
504 }
505
506 bool IsLocked()
507 {
508 return m_IsLocked;
509 }
510
511 void CheckLockedStateServer(bool insideLock = false)
512 {
513 if (!insideLock)
514 {
516 }
517 else
518 {
520 }
521 }
522
524 {
525 EntityAI parent = GetHierarchyParent();
526 if (parent && parent.CanUseConstruction() && IsLocked())
527 {
528 return true;
529 }
530
531 return false;
532 }
533
535 {
536 EntityAI parent = GetHierarchyParent();
537 if (parent && parent.CanUseConstruction())
538 {
539 return true;
540 }
541
542 return false;
543 }
544
545 //destroy lock
546 protected void DestroyLock()
547 {
548 g_Game.ObjectDelete( this );
549 }
550
551 // --- VISUALS
552 protected void UpdateVisuals()
553 {
554 //Client/Server
555 if (IsLockedOnParent())
556 {
557 g_Game.GetCallQueue( CALL_CATEGORY_GAMEPLAY ).CallLater( HideItem, 0, false );
558 g_Game.GetCallQueue( CALL_CATEGORY_GAMEPLAY ).CallLater( ShowAttached, 0, false );
559 }
560 else
561 {
562 g_Game.GetCallQueue( CALL_CATEGORY_GAMEPLAY ).CallLater( ShowItem, 0, false );
563 g_Game.GetCallQueue( CALL_CATEGORY_GAMEPLAY ).CallLater( HideAttached, 0, false );
564 }
565
566 bool changedOutside = (m_LockActionPerformed == LockAction.DIAL_INDEX_CHANGED_OUTSIDE);
567 bool changedInside = (m_LockActionPerformed == LockAction.DIAL_INDEX_CHANGED_INSIDE);
568
569 bool chanedOutside = (m_LockActionPerformed == LockAction.DIAL_NUMBER_CHANED_OUTSIDE);
570 bool chanedInside = (m_LockActionPerformed == LockAction.DIAL_NUMBER_CHANED_INSIDE);
571
572 string combinationText;
573 if (changedOutside)
574 {
575 combinationText = m_Combination.ToString();
576 }
577 else if (changedInside)
578 {
579 combinationText = m_CombinationInside.ToString();
580 }
581
582 //insert zeros to dials with 0 value
583 int lengthDiff = m_LockDigits - combinationText.Length();
584 for (int i = 0; i < lengthDiff; ++i)
585 {
586 combinationText = "0" + combinationText;
587 }
588
589 //assemble the whole combination with increased part
590 for (int j = 0; j < combinationText.Length(); ++j)
591 {
592 if (changedOutside && j == m_DialIndex || changedInside && j == m_DialIndexInside)
593 {
594 int nextDialedNumber = combinationText.Get(j).ToInt() + 1;
595 if (nextDialedNumber > 9)
596 {
597 nextDialedNumber = 0;
598 }
599
600 if (changedOutside)
601 {
603 }
604 else if (changedInside)
605 {
607 }
608 }
609 }
610
611 if (!changedOutside && !changedInside && !chanedOutside && !chanedInside)
612 {
614 }
615 }
616
617 // --- SOUNDS
618 protected void UpdateSound()
619 {
620 if (g_Game.IsServer() || !g_Game.IsMultiplayer())
621 {
622 // Lock was locked
623 if (m_LockActionPerformed == LockAction.LOCKED)
624 {
625 StartItemSoundServer(SoundConstants.ITEM_COMBINATION_LOCK_LOCK);
626 }
627
628 // Lock was unlocked
629 if (m_LockActionPerformed == LockAction.UNLOCKED)
630 {
631 StartItemSoundServer(SoundConstants.ITEM_COMBINATION_LOCK_UNLOCK);
632 }
633
634 // Lock next dial index
635 if (m_LockActionPerformed == LockAction.DIAL_INDEX_CHANGED_INSIDE || m_LockActionPerformed == LockAction.DIAL_INDEX_CHANGED_OUTSIDE)
636 {
637 StartItemSoundServer(SoundConstants.ITEM_COMBINATION_LOCK_CHANGE_DIAL);
638 }
639
640 // Lock dialed new number
641 if (m_LockActionPerformed == LockAction.DIAL_NUMBER_CHANED_INSIDE || m_LockActionPerformed == LockAction.DIAL_NUMBER_CHANED_OUTSIDE)
642 {
643 StartItemSoundServer(SoundConstants.ITEM_COMBINATION_LOCK_CHANGE_NUMBER);
644 }
645 }
646 }
647
648 //Show/Hide anims
649 protected void ShowItem()
650 {
651 SetAnimationPhase( "Combination_Lock_Item", 0 );
652 SetAnimationPhase( "Lock_Item_1", 0 );
653 SetAnimationPhase( "Lock_Item_2", 0 );
654 }
655
656 protected void HideItem()
657 {
658 SetAnimationPhase( "Combination_Lock_Item", 1 );
659 SetAnimationPhase( "Lock_Item_1", 1 );
660 SetAnimationPhase( "Lock_Item_2", 1 );
661 }
662
663 protected void ShowAttached()
664 {
665 SetAnimationPhase( "Combination_Lock_Attached", 0 );
666 SetAnimationPhase( "Lock_Attached_1", 0 );
667 SetAnimationPhase( "Lock_Attached_2", 0 );
668 }
669
670 protected void HideAttached()
671 {
672 SetAnimationPhase( "Combination_Lock_Attached", 1 );
673 SetAnimationPhase( "Lock_Attached_1", 1 );
674 SetAnimationPhase( "Lock_Attached_2", 1 );
675 }
676
688
689 static float GetDigitRotation(int digitValue)
690 {
691 switch (digitValue)
692 {
693 case 0:
695 case 1:
697 case 2:
699 case 3:
701 case 4:
703 case 5:
705 case 6:
707 case 7:
709 case 8:
711 case 9:
713 }
714
716 }
717
718 protected void SetDigitRotationAnimationPhaseOutside(string digitIndex, float rot)
719 {
720 SetAnimationPhase("Lock_Attached_2_Digit" + digitIndex, rot);
721 SetAnimationPhase("Lock_Item_2_Digit" + digitIndex, rot);
722 }
723
724 protected void SetDigitRotationAnimationPhaseInside(string digitIndex, float rot)
725 {
726 SetAnimationPhase("Lock_Attached_1_Digit" + digitIndex, rot);
727 SetAnimationPhase("Lock_Item_1_Digit" + digitIndex, rot);
728 }
729
730 protected void AnimateDigitsOutside(string digitIndex)
731 {
732 float animPhaseOffset = 0.1;
733 float animPhase = GetAnimationPhase("Lock_Attached_2_Digit" + digitIndex);
734
735 if (animPhase >= 1.0)
736 {
737 animPhase = 0;
738 ResetAnimationPhase("Lock_Attached_2_Digit" + digitIndex, animPhase);
739 ResetAnimationPhase("Lock_Item_2_Digit" + digitIndex, animPhase);
740 }
741
742 SetAnimationPhase("Lock_Attached_2_Digit" + digitIndex, animPhase + animPhaseOffset);
743 SetAnimationPhase("Lock_Item_2_Digit" + digitIndex, animPhase + animPhaseOffset);
744 }
745
746 protected void AnimateDigitsInside(string digitIndex)
747 {
748 float animPhaseOffset = 0.1;
749 float animPhase = GetAnimationPhase("Lock_Attached_1_Digit" + digitIndex);
750
751 if (animPhase >= 1.0)
752 {
753 animPhase = 0;
754 ResetAnimationPhase("Lock_Attached_1_Digit" + digitIndex, animPhase);
755 ResetAnimationPhase("Lock_Item_1_Digit" + digitIndex, animPhase);
756 }
757
758 SetAnimationPhase("Lock_Attached_1_Digit" + digitIndex, animPhase + animPhaseOffset);
759 SetAnimationPhase("Lock_Item_1_Digit" + digitIndex, animPhase + animPhaseOffset);
760 }
761
762 protected void UpdateLockDigits()
763 {
764 //Set digit anim on outside lock
765 string combinationText = m_Combination.ToString();
766 for (int i = 0; i < combinationText.Length(); ++i)
767 {
769 }
770
771 //Set digit anim on inside lock
772 combinationText = m_CombinationInside.ToString();
773 for (int j = 0; j < combinationText.Length(); ++j)
774 {
776 }
777 }
778
779 override bool IsExternalLockType()
780 {
781 return true;
782 }
783
784 int GetLockSideByComponentIndex(int componentIndex)
785 {
786 array<string> selections = new array<string>;
787 GetActionComponentNameList(componentIndex, selections);
788
789 int facingSide = -1;
790 foreach (string selectionName : selections)
791 {
792 if (selectionName == LOCK_SELECTION_OUTSIDE)
793 {
794 facingSide = FACING_OUTSIDE;
795 break;
796 }
797
798 if (selectionName == LOCK_SELECTION_INSIDE)
799 {
800 facingSide = FACING_INSIDE;
801 break;
802 }
803 }
804
805 return facingSide;
806 }
807
808 override void InitItemSounds()
809 {
810 super.InitItemSounds();
811
813 handler.AddSound(SoundConstants.ITEM_COMBINATION_LOCK_LOCK, SOUND_LOCK_CLOSE);
814 handler.AddSound(SoundConstants.ITEM_COMBINATION_LOCK_UNLOCK, SOUND_LOCK_OPEN);
815 handler.AddSound(SoundConstants.ITEM_COMBINATION_LOCK_CHANGE_NUMBER, SOUND_LOCK_CHANGE_NUMBER);
816 handler.AddSound(SoundConstants.ITEM_COMBINATION_LOCK_CHANGE_DIAL, SOUND_LOCK_CHANGE_DIAL);
817 handler.AddSound(SoundConstants.ITEM_COMBINATION_LOCK_WRONG_PIN, SOUND_LOCK_WRONG_PIN);
818 handler.AddSound(SoundConstants.ITEM_COMBINATION_LOCK_WRONG_COMBINATION, SOUND_LOCK_WRONG_PIN);
819 }
820
822 [Obsolete("1.30: Use ItemSoundHandler instead")]
823 protected void SoundLockOpen()
824 {
825 PlaySoundSet( m_Sound, SOUND_LOCK_OPEN, 0, 0 );
826 }
827
828 [Obsolete("1.30: Use ItemSoundHandler instead")]
829 protected void SoundLockClose()
830 {
831 PlaySoundSet( m_Sound, SOUND_LOCK_CLOSE, 0, 0 );
832 }
833
834 [Obsolete("1.30: Use ItemSoundHandler instead")]
835 protected void SoundLockChangeNumber()
836 {
837 PlaySoundSet( m_Sound, SOUND_LOCK_CHANGE_NUMBER, 0, 0 );
838 }
839
840 [Obsolete("1.30: Use ItemSoundHandler instead")]
841 protected void SoundLockChangeDial()
842 {
843 PlaySoundSet( m_Sound, SOUND_LOCK_CHANGE_DIAL, 0, 0 );
844 }
845
846 [Obsolete("1.30: Use IsLocked instead")]
848 {
849 Fence fence = Fence.Cast(GetHierarchyParent());
850 if (fence)
851 {
852 if (IsLocked())
853 {
854 return true;
855 }
856 }
857
858 return false;
859 }
860
861 [Obsolete("1.30: Use UnlockOnServer instead")]
862 void Unlock();
863 [Obsolete("1.30: Use SetDigitRotationAnimationPhaseOutside & SetDigitRotationAnimationPhaseInside instead")]
864 void SetDigitRotationAnimationPhase(string digitIndex, float rot);
865 [Obsolete("1.30: Use AnimateDigitsOutside & AnimateDigitsInside instead")]
866 void AnimateDigits(string digitIndex);
867}
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
override void InitItemSounds()
void OnItemLocationChanged(ItemBase item)
Определения ActionBase.c:1048
ActionDialCombinationLockCB ActionContinuousBaseCB ActionDialCombinationLock()
Определения ActionDialCombinationLock.c:13
ActionDialCombinationLockOnTargetCB ActionContinuousBaseCB ActionDialCombinationLockOnTarget()
void AddAction(typename actionName)
Определения AdvancedCommunication.c:220
class BaseBuildingBase extends ItemBase bsbDebugPrint(string s)
Определения BaseBuildingBase.c:1291
PlayerSpawnPreset slotName
void UnlockOnServer(EntityAI parent)
Unlock AND drop.
Определения CodeLock.c:844
bool m_IsLocked
Определения CodeLockComponent.c:34
bool IsLocked()
Определения CodeLockComponent.c:658
bool OnStoreLoad(ParamsReadContext ctx, int version)
Определения CodeLockComponent.c:264
void OnStoreSave(ParamsWriteContext ctx)
Определения CodeLockComponent.c:257
void UpdateVisuals()
Определения CodeLockVisualManager.c:91
@ UNLOCKED
Определения CodeLockVisualManager.c:6
@ LOCKED
Определения CodeLockVisualManager.c:5
void AnimateDigitsInside(string digitIndex)
Определения CombinationLock.c:746
void SetNextDial(int lockSide=FACING_OUTSIDE)
Определения CombinationLock.c:340
override bool IsInitialized()
Определения CombinationLock.c:96
void HideAttached()
Определения CombinationLock.c:670
const float DIGIT_ROTATION_POSITION_9
Определения CombinationLock.c:10
void SoundLockClose()
Определения CombinationLock.c:829
int m_LockDigits
Определения CombinationLock.c:32
void SetInitialized()
Определения CombinationLock.c:91
const float DIGIT_ROTATION_POSITION_5
Определения CombinationLock.c:6
void ShuffleLock()
Определения CombinationLock.c:471
void UpdateSound()
Определения CombinationLock.c:618
void ResetActionVar()
Определения CombinationLock.c:219
bool m_IsInitialized
Определения CombinationLock.c:43
const string SOUND_LOCK_CHANGE_NUMBER
Определения CombinationLock.c:49
int GetLockDigits()
Определения CombinationLock.c:267
bool IsLockedOnGate()
Определения CombinationLock.c:847
const string SOUND_LOCK_CHANGE_DIAL
Определения CombinationLock.c:50
enum LockAction LOCK_SELECTION_OUTSIDE
void SoundLockOpen()
DEPRECTAED.
Определения CombinationLock.c:823
void SetCombination(int combination, bool setOtherSide=true)
Определения CombinationLock.c:233
void ShowAttached()
Определения CombinationLock.c:663
void LockServer(EntityAI parent, bool ignore_combination=false)
Определения CombinationLock.c:384
static const int FACING_INSIDE
Определения CombinationLock.c:30
void SoundLockChangeNumber()
Определения CombinationLock.c:835
void AnimateDigits(string digitIndex)
const float DIGIT_ROTATION_POSITION_2
Определения CombinationLock.c:3
const float DIGIT_ROTATION_POSITION_7
Определения CombinationLock.c:8
const float DIGIT_ROTATION_POSITION_4
Определения CombinationLock.c:5
const string SOUND_LOCK_OPEN
Определения CombinationLock.c:47
void CheckLockedStateServer(bool insideLock=false)
Определения CombinationLock.c:511
int GetDialIndexInside()
Определения CombinationLock.c:335
void SetCombinationInside(int combination, bool setOtherSide=true)
Определения CombinationLock.c:242
int m_LockDigitsCount
Определения CombinationLock.c:38
int GetLockSideByComponentIndex(int componentIndex)
Определения CombinationLock.c:784
bool IsLockedOnParent()
Определения CombinationLock.c:523
static float GetDigitRotation(int digitValue)
Определения CombinationLock.c:689
void CombinationLock()
Определения CombinationLock.c:55
int GetCombinationInside()
Определения CombinationLock.c:262
const float DIGIT_ROTATION_POSITION_1
Определения CombinationLock.c:2
const float DIGIT_ROTATION_POSITION_3
Определения CombinationLock.c:4
void ShowItem()
Определения CombinationLock.c:649
static const int FACING_OUTSIDE
Определения CombinationLock.c:29
void SetCombinationLocked(int combination)
Определения CombinationLock.c:251
void Unlock()
LockAction
Определения CombinationLock.c:13
@ DIAL_INDEX_CHANGED_OUTSIDE
Определения CombinationLock.c:18
@ DIAL_NUMBER_CHANED_OUTSIDE
Определения CombinationLock.c:16
@ DIAL_INDEX_CHANGED_INSIDE
Определения CombinationLock.c:17
@ DIAL_NUMBER_CHANED_INSIDE
Определения CombinationLock.c:15
int GetCombination()
Определения CombinationLock.c:257
void Synchronize()
Определения CombinationLock.c:205
void SetDigitRotationAnimationPhase(string digitIndex, float rot)
void SetDigitRotationAnimationPhaseOutside(string digitIndex, float rot)
Определения CombinationLock.c:718
void SoundLockChangeDial()
Определения CombinationLock.c:841
void DialNextNumber(int lockSide=FACING_OUTSIDE)
Определения CombinationLock.c:273
int m_Combination
Определения CombinationLock.c:33
void UpdateLockDigits()
Определения CombinationLock.c:762
void AnimateDigitsOutside(string digitIndex)
Определения CombinationLock.c:730
const float DIGIT_ROTATION_POSITION_0
Определения CombinationLock.c:1
const string SOUND_LOCK_CLOSE
Определения CombinationLock.c:48
static const string LOCK_SELECTION_INSIDE
Определения CombinationLock.c:28
int m_CombinationLocked
Определения CombinationLock.c:35
bool IsLockAttached()
Определения CombinationLock.c:534
int m_DialIndexInside
Определения CombinationLock.c:37
void SetDigitRotationAnimationPhaseInside(string digitIndex, float rot)
Определения CombinationLock.c:724
const float DIGIT_ROTATION_POSITION_6
Определения CombinationLock.c:7
int m_DialIndex
Определения CombinationLock.c:36
int GetDialIndex()
Определения CombinationLock.c:330
int m_CombinationInside
Определения CombinationLock.c:34
LockAction m_LockActionPerformed
Определения CombinationLock.c:41
void ShuffleCombination(string combinationText, bool isInsideLock=false)
Определения CombinationLock.c:477
const float DIGIT_ROTATION_POSITION_8
Определения CombinationLock.c:9
const string SOUND_LOCK_WRONG_PIN
Определения CombinationLock.c:51
void DestroyLock()
Определения CombinationLock.c:546
void HideItem()
Определения CombinationLock.c:656
ContaminatedArea_Base EffectArea EEInit()
Определения ContaminatedArea.c:39
override void OnVariablesSynchronized()
Определения ContaminatedArea_Dynamic.c:94
DayZGame g_Game
Определения DayZGame.c:4074
@ COUNT
Определения EGameStateIcons.c:7
void AfterStoreLoad()
Определения EmoteManager.c:636
proto string ToString()
EffectSound m_Sound
Определения HungerSoundHandler.c:18
InventoryLocationType
types of Inventory Location
Определения InventoryLocation.c:4
bool IsExternalLockType()
Определения ItemBase.c:4848
ItemSoundHandler GetItemSoundHandler()
Определения ItemBase.c:4407
override void SetTakeable(bool pState)
Определения ItemBase.c:4362
void StartItemSoundServer(int id, int slotId)
Определения ItemBase.c:4436
void ItemSoundHandler(ItemBase parent)
Определения ItemSoundHandler.c:31
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
Определения RemoteDetonator.c:262
Определения Fence.c:2
override void SetBaseLockValues()
Определения CombinationLock4.c:3
Wrapper class for managing sound through SEffectManager.
Определения EffectSound.c:5
proto native int GetSlot()
returns slot id if current type is Attachment
InventoryLocation.
Определения InventoryLocation.c:30
static proto native owned string GetSlotName(int id)
converts slot_id to string
provides access to slot configuration
Определения InventorySlots.c:6
static bool IsBaseBuildingLogEnable()
Определения 3_Game/DayZ/tools/Debug.c:809
Определения EnMath.c:7
proto bool Write(void value_out)
proto bool Read(void value_in)
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
Определения EnConvert.c:119
Keffiyeh_LightBlue SetActions
Определения consumables.c:149
Serializer ParamsReadContext
Определения gameplay.c:15
Serializer ParamsWriteContext
Определения gameplay.c:16
proto native void SetPosition(vector position)
Set the world position of the Effect.
Определения Effect.c:463
void Obsolete(string msg="")
Определения EnScript.c:371
static proto float Pow(float v, float power)
Return power of v ^ power.
static proto int RandomInt(int min, int max)
Returns a random int number between and min [inclusive] and max [exclusive].
@ NONE
body is not in simulation, nor in collision world
Определения SimulationState.c:15
vector GetPosition()
Get the world position of the Effect.
Определения Effect.c:473
proto native int Length()
Returns length of string.
proto string Get(int index)
Gets n-th character from string.
static proto string ToString(void var, bool type=false, bool name=false, bool quotes=true)
Return string representation of variable.
proto native int ToInt()
Converts string to integer.
const int CALL_CATEGORY_GAMEPLAY
Определения 3_Game/DayZ/tools/tools.c:10
const int CALL_CATEGORY_SYSTEM
Определения 3_Game/DayZ/tools/tools.c:8