DayZ 1.24
Loading...
Searching...
No Matches
Land_Underground_Entrance.c File Reference

Go to the source code of this file.

Classes

class  Land_Underground_EntranceBase
 

Enumerations

enum  EUndegroundEntranceState
 

Functions

enum EUndegroundEntranceState AlarmLight ()
 
override void CreateLights ()
 
override void CleanUpOnClosedClient ()
 
override void OnDoorStateChangedServer (EUndegroundEntranceState newState)
 
vector GetLightPosition ()
 
void SoundEnded (Effect eff)
 
override void HandleAudioPlayback (EUndegroundEntranceState newState, EUndegroundEntranceState prevState)
 
override void OnUpdateClient (float timeSlice)
 
override void HandleVisualPlayback (EUndegroundEntranceState newState, EUndegroundEntranceState prevState)
 

Variables

enum EUndegroundEntranceState MAIN
 
enum EUndegroundEntranceState SMALL
 
 UNINITIALIZED
 
 CLOSED
 
 OPENING_A
 
 OPENING_B
 
 OPENING_C
 
 OPENING_D
 
 OPENING_E
 
 OPENING_F
 
 OPENING_G
 
 CLOSING_A
 
 CLOSING_B
 
 CLOSING_C
 
 CLOSING_D
 
 CLOSING_E
 
 CLOSING_F
 
 CLOSING_G
 
Land_Underground_EntranceBase m_SirenSound
 
EffectSound m_DoorEngineSoundIn
 
EffectSound m_DoorEngineSoundLoop
 
EffectSound m_DoorEngineSoundOut
 
EffectSound m_LockingSound
 
EffectSound m_DoorMovementSoundIn
 
EffectSound m_DoorMovementSoundLoop
 
EffectSound m_DoorMovementSoundOut
 
AlarmLight m_AlarmLight
 
const string SIREN_SOUNDSET = "UndergroundDoor_Alarm_Loop_SoundSet"
 
const string ENGINE_SOUNDSET_LOOP_IN = "UndergroundDoor_ElectricMotor_Start_SoundSet"
 
const string ENGINE_SOUNDSET_LOOP = "UndergroundDoor_ElectricMotor_Loop_SoundSet"
 
const string ENGINE_SOUNDSET_LOOP_OUT = "UndergroundDoor_ElectricMotor_End_SoundSet"
 
const string LOCKING_SOUNDSET = "UndergroundDoor_Lock_SoundSet"
 
const string DOORMOVING_SOUNDSET_LOOP = "UndergroundDoor_DoorOpen_Loop_SoundSet"
 
const string DOORMOVING_SOUNDSET_LOOP_OUT = "UndergroundDoor_DoorOpen_End_SoundSet"
 
const string DOORMOVING_SOUNDSET_LOOP_IN = "UndergroundDoor_DoorOpen_Start_SoundSet"
 
const float LIGHT_ROT_SPEED = -400
 

Enumeration Type Documentation

◆ EUndegroundEntranceState

Function Documentation

◆ AlarmLight()

Definition at line 1 of file Land_Underground_Entrance.c.

32 {
33 SetVisibleDuringDaylight(true);
34 SetRadiusTo(15);
35 SetBrightnessTo(10);
36 SetFlareVisible(false);
37 SetAmbientColor(1.0, 0.0, 0.0);
38 SetDiffuseColor(1.0, 0.0, 0.0);
39 SetLifetime(1000);
40 SetDisableShadowsWithinRadius(-1);
41 SetFadeOutTime(1);
42 SetCastShadow(false);
43 m_FadeInTime = 0.25;
44 }

References CLOSED, CLOSING_A, CLOSING_B, CLOSING_C, CLOSING_D, CLOSING_E, CLOSING_F, CLOSING_G, OPENING_A, OPENING_B, OPENING_C, OPENING_D, OPENING_E, OPENING_F, OPENING_G, and UNINITIALIZED.

Referenced by HandleVisualPlayback().

◆ CleanUpOnClosedClient()

override void CleanUpOnClosedClient ( )

Definition at line 330 of file Land_Underground_Entrance.c.

331 {
340
341 if (m_AlarmLight && GetGame())
342 m_AlarmLight.Destroy();
343 }
AlarmLight m_AlarmLight
Land_Underground_EntranceBase m_SirenSound
EffectSound m_DoorEngineSoundIn
EffectSound m_DoorMovementSoundLoop
EffectSound m_DoorEngineSoundOut
EffectSound m_DoorEngineSoundLoop
EffectSound m_LockingSound
EffectSound m_DoorMovementSoundOut
EffectSound m_DoorMovementSoundIn
Manager class for managing Effect (EffectParticle, EffectSound)
static bool DestroySound(EffectSound sound_effect)
Legacy, backwards compatibility.
proto native CGame GetGame()

References SEffectManager::DestroySound(), GetGame(), m_AlarmLight, m_DoorEngineSoundIn, m_DoorEngineSoundLoop, m_DoorEngineSoundOut, m_DoorMovementSoundIn, m_DoorMovementSoundLoop, m_DoorMovementSoundOut, m_LockingSound, and m_SirenSound.

◆ CreateLights()

override void CreateLights ( )

Definition at line 324 of file Land_Underground_Entrance.c.

325 {
326 m_InteriorLight1 = EntranceLight.Cast(ScriptedLightBase.CreateLightAtObjMemoryPoint(EntranceLightMain1, this, "InteriorLightPos1"));
327 m_InteriorLight2 = EntranceLight.Cast(ScriptedLightBase.CreateLightAtObjMemoryPoint(EntranceLightMain2, this, "InteriorLightPos2"));
328 }

◆ GetLightPosition()

vector GetLightPosition ( )

Definition at line 406 of file Land_Underground_Entrance.c.

407 {
408 vector pos;
409 if (MemoryPointExists("SirenLightPos"))
410 {
411 pos = GetMemoryPointPos("SirenLightPos");
412 pos = ModelToWorld(pos);
413 }
414 else
415 ErrorEx("GetLightPosition could not locate memory point 'SirenLightPos'");
416 return pos;
417 }
enum ShapeType ErrorEx

References ErrorEx.

Referenced by HandleVisualPlayback().

◆ HandleAudioPlayback()

override void HandleAudioPlayback ( EUndegroundEntranceState newState,
EUndegroundEntranceState prevState )

Definition at line 435 of file Land_Underground_Entrance.c.

436 {
437 //Print("HandleAudioVisualPlayback " + newState + ", " + prevState);
438 //opening
439 if (CheckShouldPlayPersistent(EUndegroundEntranceState.OPENING_A, EUndegroundEntranceState.OPENING_F))
440 PlaySoundSetAtMemoryPointLooped(m_SirenSound, SIREN_SOUNDSET, "SirenSoundPos", 0.5, 0.5);
441 if (newState == EUndegroundEntranceState.OPENING_B)
442 {
443 if (prevState == EUndegroundEntranceState.OPENING_A)//if they connected already during B, do not play the in
444 {
445 PlaySoundSetAtMemoryPoint(m_DoorEngineSoundIn, ENGINE_SOUNDSET_LOOP_IN, "DoorEngineSoundPos");
447 m_DoorEngineSoundIn.Event_OnEffectEnded.Insert(SoundEnded);
448 }
449 }
450
451 if (CheckShouldPlayPersistent(EUndegroundEntranceState.OPENING_B, EUndegroundEntranceState.OPENING_E))
452 {
453 if (!m_DoorEngineSoundLoop && !m_DoorEngineSoundIn)//missed playing of the IN soundset which automatically triggers playing of the loop(connected after ?)
454 PlaySoundSetAtMemoryPointLooped(m_DoorEngineSoundLoop, ENGINE_SOUNDSET_LOOP, "DoorEngineSoundPos");
455 }
456 if (newState == EUndegroundEntranceState.OPENING_C)
457 PlaySoundSetAtMemoryPoint(m_LockingSound, LOCKING_SOUNDSET, "DoorEngineSoundPos");
458 if (newState == EUndegroundEntranceState.OPENING_D)
459 {
460 if (prevState == EUndegroundEntranceState.OPENING_C)//if they connected already during C, do not play the in
461 {
462 PlaySoundSetAtMemoryPoint(m_DoorMovementSoundIn, DOORMOVING_SOUNDSET_LOOP_IN, "DoorEngineSoundPos");
464 m_DoorMovementSoundIn.Event_OnEffectEnded.Insert(SoundEnded);
465 }
466 else if (!m_DoorMovementSoundIn && !m_DoorMovementSoundLoop)//missed playing of the IN soundset which automatically triggers playing of the loop(connected after ?)
467 PlaySoundSetAtMemoryPointLooped(m_DoorMovementSoundLoop, DOORMOVING_SOUNDSET_LOOP, "DoorEngineSoundPos");
468 }
469
470 if (newState == EUndegroundEntranceState.OPENING_E)
471 {
472 StopSoundSet(m_DoorMovementSoundLoop);
473 PlaySoundSetAtMemoryPoint(m_DoorMovementSoundOut, DOORMOVING_SOUNDSET_LOOP_OUT, "DoorEngineSoundPos");
474 }
475 if (newState == EUndegroundEntranceState.OPENING_F)
476 {
477 StopSoundSet(m_DoorEngineSoundLoop);
478 PlaySoundSetAtMemoryPoint(m_DoorEngineSoundOut, ENGINE_SOUNDSET_LOOP_OUT, "DoorEngineSoundPos");
479 }
480 if (newState == EUndegroundEntranceState.OPENING_G)
481 StopSoundSet(m_SirenSound);
482
483 //closing
484 if (CheckShouldPlayPersistent(EUndegroundEntranceState.CLOSING_A, EUndegroundEntranceState.CLOSING_F))
485 PlaySoundSetAtMemoryPointLooped(m_SirenSound, SIREN_SOUNDSET, "SirenSoundPos", 0.5, 0.5);
486 if (CheckShouldPlayPersistent(EUndegroundEntranceState.CLOSING_B, EUndegroundEntranceState.CLOSING_E))
487 {
488 if (prevState == EUndegroundEntranceState.CLOSING_A)//if they connected already during B, do not play the in
489 {
490 PlaySoundSetAtMemoryPoint(m_DoorEngineSoundIn, ENGINE_SOUNDSET_LOOP_IN, "DoorEngineSoundPos");
492 m_DoorEngineSoundIn.Event_OnEffectEnded.Insert(SoundEnded);
493 }
494 }
495 if (newState == EUndegroundEntranceState.CLOSING_C)
496 {
497 if (prevState == EUndegroundEntranceState.CLOSING_B)//if they connected already during C, do not play the in
498 {
499 PlaySoundSetAtMemoryPoint(m_DoorMovementSoundIn, DOORMOVING_SOUNDSET_LOOP_IN, "DoorEngineSoundPos");
501 m_DoorMovementSoundIn.Event_OnEffectEnded.Insert(SoundEnded);
502 }
503 else if (!m_DoorMovementSoundIn && !m_DoorMovementSoundLoop)//missed playing of the IN soundset which automatically triggers playing of the loop(connected after ?)
504 PlaySoundSetAtMemoryPointLooped(m_DoorMovementSoundLoop, DOORMOVING_SOUNDSET_LOOP, "DoorEngineSoundPos");
505 }
506 if (newState == EUndegroundEntranceState.CLOSING_D)
507 {
508 StopSoundSet(m_DoorMovementSoundLoop);
509 PlaySoundSetAtMemoryPoint(m_DoorMovementSoundOut, DOORMOVING_SOUNDSET_LOOP_OUT, "DoorEngineSoundPos");
510 }
511 if (newState == EUndegroundEntranceState.CLOSING_E)
512 PlaySoundSetAtMemoryPoint(m_LockingSound, LOCKING_SOUNDSET, "DoorEngineSoundPos");
513 if (newState == EUndegroundEntranceState.CLOSING_F)
514 {
515 StopSoundSet(m_DoorEngineSoundLoop);
516 PlaySoundSetAtMemoryPoint(m_DoorEngineSoundOut, ENGINE_SOUNDSET_LOOP_OUT, "DoorEngineSoundPos");
517 }
519 StopSoundSet(m_SirenSound);
520 }
const string ENGINE_SOUNDSET_LOOP_IN
const string LOCKING_SOUNDSET
const string DOORMOVING_SOUNDSET_LOOP
const string DOORMOVING_SOUNDSET_LOOP_OUT
void SoundEnded(Effect eff)
const string DOORMOVING_SOUNDSET_LOOP_IN
const string ENGINE_SOUNDSET_LOOP_OUT
const string ENGINE_SOUNDSET_LOOP
const string SIREN_SOUNDSET

References DOORMOVING_SOUNDSET_LOOP, DOORMOVING_SOUNDSET_LOOP_IN, DOORMOVING_SOUNDSET_LOOP_OUT, ENGINE_SOUNDSET_LOOP, ENGINE_SOUNDSET_LOOP_IN, ENGINE_SOUNDSET_LOOP_OUT, LOCKING_SOUNDSET, m_DoorEngineSoundIn, m_DoorEngineSoundLoop, m_DoorEngineSoundOut, m_DoorMovementSoundIn, m_DoorMovementSoundLoop, m_DoorMovementSoundOut, m_LockingSound, m_SirenSound, SIREN_SOUNDSET, and SoundEnded().

◆ HandleVisualPlayback()

override void HandleVisualPlayback ( EUndegroundEntranceState newState,
EUndegroundEntranceState prevState )

Definition at line 532 of file Land_Underground_Entrance.c.

533 {
534 if (CheckShouldPlayPersistent(EUndegroundEntranceState.OPENING_A, EUndegroundEntranceState.OPENING_F) || CheckShouldPlayPersistent(EUndegroundEntranceState.CLOSING_A, EUndegroundEntranceState.CLOSING_F))
537 {
538 if (m_AlarmLight)
539 m_AlarmLight.Destroy();
540 }
541 }
enum EUndegroundEntranceState AlarmLight()
vector GetLightPosition()

References AlarmLight(), GetLightPosition(), and m_AlarmLight.

◆ OnDoorStateChangedServer()

override void OnDoorStateChangedServer ( EUndegroundEntranceState newState)

Definition at line 345 of file Land_Underground_Entrance.c.

346 {
347 switch (newState)
348 {
349 case EUndegroundEntranceState.OPENING_A:
350 RequestLatentTransition(AdjustTime(3));
351 break;
352 case EUndegroundEntranceState.OPENING_B:
353 RequestLatentTransition(AdjustTime(2));
354 break;
355 case EUndegroundEntranceState.OPENING_C:
356 RequestLatentTransition(AdjustTime(1));
357 break;
358 case EUndegroundEntranceState.OPENING_D:
359 m_AnimTimerDoorServer = new AnimationTimer();
360 m_AnimTimerDoorServer.Run(AdjustTime(GetOpeningTime()), this, "OnUpdateServer", "OnFinishedTimerServer", 0, false,/*1/ AdjustTime(1)*/ 1);
361 m_NavmeshTimer = new Timer();
362 m_NavmeshTimer.Run(3, this, "NavmeshUpdate", NULL, true);
363 RequestLatentTransition(AdjustTime(GetOpeningTime()));
364 break;
365 case EUndegroundEntranceState.OPENING_E:
366 m_AnimTimerDoorServer.Stop();
367 NavmeshUpdate();
368 m_NavmeshTimer = null;
369 RequestLatentTransition(AdjustTime(3));
370 break;
371 case EUndegroundEntranceState.OPENING_F:
372 RequestLatentTransition(AdjustTime(3));
373 break;
374 case EUndegroundEntranceState.OPENING_G:
375 RequestLatentTransition(AdjustTime(300));
376 break;
377 case EUndegroundEntranceState.CLOSING_A:
378 RequestLatentTransition(AdjustTime(3));
379 break;
380 case EUndegroundEntranceState.CLOSING_B:
381 RequestLatentTransition(AdjustTime(3));
382 break;
383 case EUndegroundEntranceState.CLOSING_C:
384 m_NavmeshTimer = new Timer();
385 m_NavmeshTimer.Run(3, this, "NavmeshUpdate", NULL, true);
386 m_AnimTimerDoorServer.Run(0, this, "OnUpdateServer", "OnFinishedTimerServer", AdjustTime(GetOpeningTime()), false, /*1/ AdjustTime(1)*/ 1);
387 RequestLatentTransition(AdjustTime(GetOpeningTime()));
388 break;
389 case EUndegroundEntranceState.CLOSING_D:
390 NavmeshUpdate();
391 m_NavmeshTimer = null;
392 RequestLatentTransition(AdjustTime(2));
393 break;
394 case EUndegroundEntranceState.CLOSING_E:
395 RequestLatentTransition(AdjustTime(1));
396 break;
397 case EUndegroundEntranceState.CLOSING_F:
398 RequestLatentTransition(AdjustTime(3));
399 break;
400 case EUndegroundEntranceState.CLOSING_G:
401 RequestLatentTransition(0.25, EUndegroundEntranceState.CLOSED);
402 break;
403 }
404 }
float AdjustTime(float originalTime)
AnimationTimer class. This timer is for animating float value. usage:
Definition tools.c:618

References AdjustTime().

◆ OnUpdateClient()

override void OnUpdateClient ( float timeSlice)

Definition at line 522 of file Land_Underground_Entrance.c.

523 {
524 SetAnimationPhaseNow("EntranceDoor", m_AnimPhase);
525 if (m_AlarmLight)
526 {
527 vector newOri = m_AlarmLight.GetOrientation() + Vector(timeSlice * LIGHT_ROT_SPEED, 0, 0);
528 m_AlarmLight.SetOrientation(newOri);
529 }
530 }
const float LIGHT_ROT_SPEED
proto native vector Vector(float x, float y, float z)
Vector constructor from components.

References LIGHT_ROT_SPEED, m_AlarmLight, and Vector().

◆ SoundEnded()

void SoundEnded ( Effect eff)

Definition at line 419 of file Land_Underground_Entrance.c.

420 {
422 {
423 PlaySoundSetAtMemoryPointLooped(m_DoorMovementSoundLoop, DOORMOVING_SOUNDSET_LOOP, "DoorEngineSoundPos");
425 }
426 else if (eff == m_DoorEngineSoundIn)
427 {
428 PlaySoundSetAtMemoryPointLooped(m_DoorEngineSoundLoop, ENGINE_SOUNDSET_LOOP, "DoorEngineSoundPos");
430 }
431 }

References DOORMOVING_SOUNDSET_LOOP, ENGINE_SOUNDSET_LOOP, m_DoorEngineSoundIn, m_DoorEngineSoundLoop, m_DoorMovementSoundIn, and m_DoorMovementSoundLoop.

Referenced by HandleAudioPlayback().

Variable Documentation

◆ CLOSED

CLOSED

Definition at line 33 of file Land_Underground_Entrance.c.

Referenced by AlarmLight().

◆ CLOSING_A

CLOSING_A

Definition at line 43 of file Land_Underground_Entrance.c.

Referenced by AlarmLight().

◆ CLOSING_B

CLOSING_B

Definition at line 44 of file Land_Underground_Entrance.c.

Referenced by AlarmLight().

◆ CLOSING_C

CLOSING_C

Definition at line 45 of file Land_Underground_Entrance.c.

Referenced by AlarmLight().

◆ CLOSING_D

CLOSING_D

Definition at line 46 of file Land_Underground_Entrance.c.

Referenced by AlarmLight().

◆ CLOSING_E

CLOSING_E

Definition at line 47 of file Land_Underground_Entrance.c.

Referenced by AlarmLight().

◆ CLOSING_F

CLOSING_F

Definition at line 48 of file Land_Underground_Entrance.c.

Referenced by AlarmLight().

◆ CLOSING_G

CLOSING_G

Definition at line 49 of file Land_Underground_Entrance.c.

Referenced by AlarmLight().

◆ DOORMOVING_SOUNDSET_LOOP

const string DOORMOVING_SOUNDSET_LOOP = "UndergroundDoor_DoorOpen_Loop_SoundSet"

Definition at line 318 of file Land_Underground_Entrance.c.

Referenced by HandleAudioPlayback(), and SoundEnded().

◆ DOORMOVING_SOUNDSET_LOOP_IN

const string DOORMOVING_SOUNDSET_LOOP_IN = "UndergroundDoor_DoorOpen_Start_SoundSet"

Definition at line 320 of file Land_Underground_Entrance.c.

Referenced by HandleAudioPlayback().

◆ DOORMOVING_SOUNDSET_LOOP_OUT

const string DOORMOVING_SOUNDSET_LOOP_OUT = "UndergroundDoor_DoorOpen_End_SoundSet"

Definition at line 319 of file Land_Underground_Entrance.c.

Referenced by HandleAudioPlayback().

◆ ENGINE_SOUNDSET_LOOP

const string ENGINE_SOUNDSET_LOOP = "UndergroundDoor_ElectricMotor_Loop_SoundSet"

Definition at line 315 of file Land_Underground_Entrance.c.

Referenced by HandleAudioPlayback(), and SoundEnded().

◆ ENGINE_SOUNDSET_LOOP_IN

const string ENGINE_SOUNDSET_LOOP_IN = "UndergroundDoor_ElectricMotor_Start_SoundSet"

Definition at line 314 of file Land_Underground_Entrance.c.

Referenced by HandleAudioPlayback().

◆ ENGINE_SOUNDSET_LOOP_OUT

const string ENGINE_SOUNDSET_LOOP_OUT = "UndergroundDoor_ElectricMotor_End_SoundSet"

Definition at line 316 of file Land_Underground_Entrance.c.

Referenced by HandleAudioPlayback().

◆ LIGHT_ROT_SPEED

const float LIGHT_ROT_SPEED = -400

Definition at line 322 of file Land_Underground_Entrance.c.

Referenced by OnUpdateClient().

◆ LOCKING_SOUNDSET

const string LOCKING_SOUNDSET = "UndergroundDoor_Lock_SoundSet"

Definition at line 317 of file Land_Underground_Entrance.c.

Referenced by HandleAudioPlayback().

◆ m_AlarmLight

AlarmLight m_AlarmLight

◆ m_DoorEngineSoundIn

EffectSound m_DoorEngineSoundIn

◆ m_DoorEngineSoundLoop

EffectSound m_DoorEngineSoundLoop

◆ m_DoorEngineSoundOut

EffectSound m_DoorEngineSoundOut

Definition at line 304 of file Land_Underground_Entrance.c.

Referenced by CleanUpOnClosedClient(), and HandleAudioPlayback().

◆ m_DoorMovementSoundIn

EffectSound m_DoorMovementSoundIn

◆ m_DoorMovementSoundLoop

EffectSound m_DoorMovementSoundLoop

◆ m_DoorMovementSoundOut

EffectSound m_DoorMovementSoundOut

Definition at line 308 of file Land_Underground_Entrance.c.

Referenced by CleanUpOnClosedClient(), and HandleAudioPlayback().

◆ m_LockingSound

◆ m_SirenSound

◆ MAIN

◆ OPENING_A

OPENING_A

Definition at line 35 of file Land_Underground_Entrance.c.

Referenced by AlarmLight().

◆ OPENING_B

OPENING_B

Definition at line 36 of file Land_Underground_Entrance.c.

Referenced by AlarmLight().

◆ OPENING_C

OPENING_C

Definition at line 37 of file Land_Underground_Entrance.c.

Referenced by AlarmLight().

◆ OPENING_D

OPENING_D

Definition at line 38 of file Land_Underground_Entrance.c.

Referenced by AlarmLight().

◆ OPENING_E

OPENING_E

Definition at line 39 of file Land_Underground_Entrance.c.

Referenced by AlarmLight().

◆ OPENING_F

OPENING_F

Definition at line 40 of file Land_Underground_Entrance.c.

Referenced by AlarmLight().

◆ OPENING_G

OPENING_G

Definition at line 41 of file Land_Underground_Entrance.c.

Referenced by AlarmLight().

◆ SIREN_SOUNDSET

const string SIREN_SOUNDSET = "UndergroundDoor_Alarm_Loop_SoundSet"

Definition at line 313 of file Land_Underground_Entrance.c.

Referenced by HandleAudioPlayback().

◆ SMALL

◆ UNINITIALIZED

UNINITIALIZED

Definition at line 32 of file Land_Underground_Entrance.c.

Referenced by AlarmLight().