Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
land_underground_stairs_exit.c
Go to the documentation of this file.
2 {
3  EffectSound m_LockingSound;
4 
5  EffectSound m_OpenSoundIn;
6  //EffectSound m_OpenSoundLoop;
7  EffectSound m_OpenSoundOut;
8 
9  EffectSound m_CloseSoundIn;
10  EffectSound m_CloseSoundLoop;
11  EffectSound m_CloseSoundOut;
12 
13  const string LOCKING_SOUNDSET = "UndergroundDoor_Lock_SoundSet";
14  const string OPENING_SOUNDSET_LOOP_IN = "UndergroundSmallExitDoor_Open_Start_SoundSet";
15  const string OPENING_SOUNDSET_LOOP = "UndergroundSmallExitDoor_Open_Loop_SoundSet";
16  const string OPENING_SOUNDSET_LOOP_OUT = "UndergroundSmallExitDoor_Open_End_SoundSet";
17 
18  const string CLOSING_SOUNDSET_LOOP_IN = "UndergroundSmallExitDoor_Close_Start_SoundSet";
19  const string CLOSING_SOUNDSET_LOOP = "UndergroundSmallExitDoor_Close_Loop_SoundSet";
20  const string CLOSING_SOUNDSET_LOOP_OUT = "UndergroundSmallExitDoor_Close_End_SoundSet";
21 
23  {
24  m_DoorType = EUndegroundDoorType.SMALL;
25  }
26 
27  override void CleanUpOnClosedClient()
28  {
29  SEffectManager.DestroySound(m_LockingSound);
30 
31  SEffectManager.DestroySound(m_OpenSoundIn);
32  //SEffectManager.DestroySound(m_OpenSoundLoop);
33  SEffectManager.DestroySound(m_OpenSoundOut);
34 
35  SEffectManager.DestroySound(m_CloseSoundIn);
36  SEffectManager.DestroySound(m_CloseSoundLoop);
37  SEffectManager.DestroySound(m_CloseSoundOut);
38 
39  }
40 
41  override float GetOpeningTime()
42  {
43  return AdjustTime(3);
44  }
45 
46  override void OnDoorStateChangedServer(EUndegroundEntranceState newState)
47  {
48  switch (newState)
49  {
50  case EUndegroundEntranceState.OPENING_A:
51  RequestLatentTransition(AdjustTime(1));
52  SetAnimationPhase("EntranceDoor",1);
53  break;
54  case EUndegroundEntranceState.OPENING_B:
55  GetGame().UpdatePathgraphRegionByObject(this);
56  RequestLatentTransition(AdjustTime(6), EUndegroundEntranceState.CLOSING_A);
57  break;
58  case EUndegroundEntranceState.CLOSING_A:
59  m_AnimTimerDoorServer = new AnimationTimer();
60  m_AnimTimerDoorServer.Run(0, this, "OnUpdateServer", "OnFinishedTimerServer", GetOpeningTime(), false,1/ AdjustTime(1));
61  RequestLatentTransition(AdjustTime(3));
62  break;
63  case EUndegroundEntranceState.CLOSING_B:
64  RequestLatentTransition(AdjustTime(1), EUndegroundEntranceState.CLOSED);
65  GetGame().UpdatePathgraphRegionByObject(this);
66  break;
67  }
68  }
69  void SoundEnded(Effect eff)
70  {
71  if (eff == m_CloseSoundIn)
72  {
73  PlaySoundSetLoop( m_CloseSoundLoop, CLOSING_SOUNDSET_LOOP, 0, 0 );
74  }
75  }
76 
77  override void HandleAudioPlayback(EUndegroundEntranceState newState, EUndegroundEntranceState prevState)
78  {
79  if (newState == EUndegroundEntranceState.OPENING_A)
80  {
81  PlaySoundSet( m_LockingSound, LOCKING_SOUNDSET, 0, 0 );
82  PlaySoundSet( m_OpenSoundIn, OPENING_SOUNDSET_LOOP_IN, 0, 0 );
83  }
84  else if (newState == EUndegroundEntranceState.OPENING_B)
85  {
86  if (m_OpenSoundIn)
87  m_OpenSoundIn.Stop();
88  PlaySoundSet( m_OpenSoundOut, OPENING_SOUNDSET_LOOP_OUT, 0, 0 );
89  }
90  else if (newState == EUndegroundEntranceState.CLOSING_A)
91  {
92  PlaySoundSet( m_CloseSoundIn, CLOSING_SOUNDSET_LOOP_IN, 0, 0 );
93  if(m_CloseSoundIn)
94  m_CloseSoundIn.Event_OnEffectEnded.Insert(SoundEnded);
95  }
96  else if (newState == EUndegroundEntranceState.CLOSING_B)
97  {
98  if (m_CloseSoundLoop)
99  m_CloseSoundLoop.Stop();
100  PlaySoundSet( m_CloseSoundOut, CLOSING_SOUNDSET_LOOP_OUT, 0, 0 );
101  PlaySoundSet( m_LockingSound, LOCKING_SOUNDSET, 0, 0 );
102 
103  }
104  }
105 
106  override void CreateLights()
107  {
108  m_InteriorLight1 = EntranceLight.Cast(ScriptedLightBase.CreateLightAtObjMemoryPoint(EntranceLightStairs1, this, "Light1"));
109  m_InteriorLight2 = EntranceLight.Cast(ScriptedLightBase.CreateLightAtObjMemoryPoint(EntranceLightStairs2, this, "Light2"));
110  }
111 
112 }
GetGame
proto native CGame GetGame()
Land_Underground_EntranceBase
Definition: land_underground_entrance.c:51
AnimationTimer
AnimationTimer class. This timer is for animating float value. usage:
Definition: tools.c:652
m_LockingSound
EffectSound m_LockingSound
Definition: land_underground_entrance.c:321
LOCKING_SOUNDSET
const string LOCKING_SOUNDSET
Definition: land_underground_entrance.c:333
EUndegroundEntranceState
EUndegroundEntranceState
Definition: land_underground_entrance.c:1
EntranceLight
void EntranceLight()
Definition: entrancelight.c:5
EffectSound
Wrapper class for managing sound through SEffectManager.
Definition: effectsound.c:4
Effect
void Effect()
ctor
Definition: effect.c:70
AdjustTime
protected float AdjustTime(float originalTime)
Definition: land_underground_waterreservoir.c:901
ScriptedLightBase
Definition: pointlightbase.c:1
Land_Underground_Stairs_Exit
Definition: land_underground_stairs_exit.c:1
SEffectManager
Manager class for managing Effect (EffectParticle, EffectSound)
Definition: effectmanager.c:5
EntranceLightStairs1
class EntranceLight extends PointLightBase EntranceLightStairs1()
Definition: entrancelight.c:22
EntranceLightStairs2
Definition: entrancelight.c:32