예제 #1
0
        void Endstand()
        {
            if (ActiveStand == null)
            {
                return;
            }

            if (StandSFXLoop != null)
            {
                SoundHandler.StopSound(StandSFXLoop);
            }

            var stand = ActiveStand;

            if (HordeMode.IsActive)
            {
                if (!string.IsNullOrWhiteSpace(stand.SFXStop))
                {
                    var def = new SoundDefinition(stand.SFXStop);
                    if (stand.GlobalSFX)
                    {
                        SoundHandler.PlaySound(def, 1.0f);
                    }
                    else
                    {
                        SoundHandler.PlaySound3D(def, stand.Position, 5000 + stand.Range, 1.0f);
                    }
                }
            }
            ActiveStand = null;
            messageTimer.Stop();
        }
예제 #2
0
        void StartStand(HordeScenario.Stand stand)
        {
            if (!HordeMode.IsActive)
            {
                return;
            }

            ActiveStand = stand;

            if (!string.IsNullOrWhiteSpace(stand.SFXStart))
            {
                var def = new SoundDefinition(stand.SFXStart);
                if (stand.GlobalSFX)
                {
                    SoundHandler.PlaySound(def, 1.0f);
                }
                else
                {
                    SoundHandler.PlaySound3D(def, stand.Position, 5000 + stand.Range, 1.0f);
                }
            }

            if (!string.IsNullOrWhiteSpace(stand.SFXLoop))
            {
                var def = new SoundDefinition(stand.SFXLoop);
                if (stand.GlobalSFX)
                {
                    SoundHandler.PlaySound(def, 1.0f);
                }
                else
                {
                    SoundHandler.PlaySound3D(def, stand.Position, 5000 + stand.Range, 0.5f, true);
                }
            }

            if (stand.Messages != null && stand.Messages.Length > 0)
            {
                messageIndex = 0;
                NextMessage();
                if (stand.Messages.Length > 1 && stand.Duration > 0)
                {
                    messageTimer.SetInterval(stand.Duration / (stand.Messages.Length - 1));
                    messageTimer.SetCallback(NextMessage);
                    messageTimer.Start();
                }
            }
        }