protected override void StartEffectivePerform()
        {
            base.StartEffectivePerform();
            dialog = new Graphics.Interface.Control
            {
                Background = new Graphics.Content.ImageGraphic
                {
                    SizeMode = SizeMode.AutoAdjust,
                    Texture = new TextureFromFile(Image) { DontScale = true },
                },
                Anchor = Orientation.Center,
                Size = ImageSize,
                Position = Offset
            };
            Program.Instance.Interface.AddChild(dialog);
            if (FadeInTime > 0)
            {
                alpha.Value = 0;
                alpha.AddKey(new Common.InterpolatorKey<float>
                {
                    Time = FadeInTime,
                    TimeType = Common.InterpolatorKeyTimeType.Relative,
                    Value = 1
                });
            }
            else
                alpha.Value = 1;

            if (FadeOutTime > 0)
            {
                alpha.AddKey(new Common.InterpolatorKey<float>
                {
                    Time = EffectiveDuration - FadeOutTime,
                    TimeType = Common.InterpolatorKeyTimeType.Relative,
                    Value = 1
                });
                alpha.AddKey(new Common.InterpolatorKey<float>
                {
                    Time = EffectiveDuration,
                    TimeType = Common.InterpolatorKeyTimeType.Relative,
                    Value = 0
                });
            }
        }
 protected override void EndPerform(bool aborted)
 {
     base.EndPerform(aborted);
     if (dialog != null)
     {
         dialog.Remove();
         dialog = null;
     }
 }
        protected override void StartPerform()
        {
            InitDelay = 2;
            base.StartPerform();
            var sm = Program.Instance.SoundManager;
            malariaSound = sm.GetSFX(Client.Sound.SFX.Malaria1).Play(
                new Sound.PlayArgs
            {
                Position = Game.Instance.Map.MainCharacter.Translation,
                Velocity = Vector3.Zero,
                Looping = true
            });
            /*Game.Instance.RendererSettingsController.ColorChannelPercentageIncrease.ClearKeys();
            Game.Instance.RendererSettingsController.ColorChannelPercentageIncrease.AddKey(
                new Common.LinearKey<Vector3>
                {
                    Time = 0.2f,
                    TimeType = Common.KeyTimeType.Relative,
                    Value = new Vector3(0, 1, 0)
                });*/
            Game.Instance.Scene.Add(mosquitos);
            runSpeedDec = Game.Instance.Map.MainCharacter.MaxRunSpeed * 0.35f;
            Game.Instance.Map.MainCharacter.MaxRunSpeed -= runSpeedDec;
            //mosquitoOpacity.SetTarget(1);

            Program.Instance.Profile.GetScriptVariable("MalariaIntroduced", (o) =>
            {
                if (o == null)
                {
                    Program.Instance.Profile.SetScriptVariable("MalariaIntroduced", true);
                    new DialogScript
                    {
                        Title = Locale.Resource.HUDMalariaWarningTitle,
                        Text = Locale.Resource.HUDMalariaWarning,
                    }.TryStartPerform();
                }
            });
            TickDamage = 40;
            TickPeriod = 2;

            //Game.Instance.Interface.AddChild(text = new Interface.WarningFlashText { Text = "M a l a r i a !" });
            Game.Instance.Interface.AddChild(malariaSign = new Interface.MalariaSign());
        }
        protected override void EndPerform(bool aborted)
        {
            base.EndPerform(aborted);

            //malariaSound.Looping = false;
            malariaSound.Stop();
            malariaSound = null;
            /*Game.Instance.RendererSettingsController.ColorChannelPercentageIncrease.ClearKeys();
            Game.Instance.RendererSettingsController.ColorChannelPercentageIncrease.AddKey(
                new Common.LinearKey<Vector3>
                {
                    Time = 0.2f,
                    TimeType = Common.KeyTimeType.Relative,
                    Value = Program.DefaultSettings.RendererSettings.ColorChannelPercentageIncrease
                });*/
            //mosquitoOpacity.SetTarget(0);
            mosquitos.Remove();
            Game.Instance.Map.MainCharacter.MaxRunSpeed += runSpeedDec;

            //if (text != null && !text.IsRemoved)
            //    text.Remove();
            if (malariaSign != null && !malariaSign.IsRemoved)
            {
                malariaSign.Remove();
                malariaSign = null;
            }
        }
 protected override void StartEffectivePerform()
 {
     base.StartEffectivePerform();
     var res = Program.Instance.GraphicsDevice.Settings.Resolution;
     top = new Graphics.Interface.Control
     {
         Size = new Vector2(res.Width, 150),
         Background = new StretchingImageGraphic
         {
             Texture = new TextureConcretizer
             {
                 TextureDescription = new
                     Graphics.Software.Textures.SingleColorTexture(System.Drawing.Color.Black)
             }
         }
     };
     bottom = new Graphics.Interface.Control
     {
         Anchor = Orientation.BottomLeft,
         Size = new Vector2(res.Width, 150),
         Background = new StretchingImageGraphic
         {
             Texture = new TextureConcretizer
             {
                 TextureDescription = new
                     Graphics.Software.Textures.SingleColorTexture(System.Drawing.Color.Black)
             }
         }
     };
     if (ScrollTime > 0)
     {
         top.Size = bottom.Size = new Vector2(res.Width, 0);
         scroll.Value = 0;
         scroll.AddKey(new Common.InterpolatorKey<float>
         {
             Time = ScrollTime,
             Value = 150,
             TimeType = Common.InterpolatorKeyTimeType.Absolute
         }
         );
         scroll.AddKey(new Common.InterpolatorKey<float>
         {
             Time = EffectiveDuration - ScrollTime,
             Value = 150,
             TimeType = Common.InterpolatorKeyTimeType.Absolute
         });
         scroll.AddKey(new Common.InterpolatorKey<float>
         {
             Time = EffectiveDuration,
             Value = 0,
             TimeType = Common.InterpolatorKeyTimeType.Absolute
         });
     }
     Program.Instance.Interface.AddChild(top);
     Program.Instance.Interface.AddChild(bottom);
     Program.Instance.Interface.AddChild(pressEscToSkip);
 }
 protected override void EndPerform(bool aborted)
 {
     base.EndPerform(aborted);
     if (top != null && !top.IsRemoved)
         top.Remove();
     if (bottom != null && !bottom.IsRemoved)
         bottom.Remove();
     if(pressEscToSkip != null && !pressEscToSkip.IsRemoved)
         pressEscToSkip.Remove();
     top = bottom = null;
 }