christmastree.c 808 B

1234567891011121314151617181920212223242526272829303132333435
  1. class ChristmasTree extends House
  2. {
  3. XmasTreeLight m_TreeLight;
  4. EffectSound m_AmbientSoundLoop;
  5. const string LOOP_SOUND = "ChristmasMusic_SoundSet";
  6. void ChristmasTree()
  7. {
  8. if ( !GetGame().IsDedicatedServer() )
  9. {
  10. m_TreeLight = XmasTreeLight.Cast( ScriptedLightBase.CreateLight( XmasTreeLight, "0 0 0" ) );
  11. m_TreeLight.AttachOnMemoryPoint( this, "action" );
  12. }
  13. }
  14. override void EEInit()
  15. {
  16. if ( !GetGame().IsDedicatedServer() )
  17. {
  18. PlaySoundSetLoop( m_AmbientSoundLoop, LOOP_SOUND, 0, 0 );
  19. }
  20. }
  21. override void EEDelete(EntityAI parent)
  22. {
  23. if ( !GetGame().IsDedicatedServer() )
  24. {
  25. if ( m_TreeLight )
  26. m_TreeLight.Destroy();
  27. if ( m_AmbientSoundLoop )
  28. SEffectManager.DestroyEffect(m_AmbientSoundLoop);
  29. }
  30. }
  31. };
  32. class ChristmasTree_Green extends ChristmasTree {};