public PostEffect AddPostEffect(PostEffectType _type)
    {
        PostEffect effect = null;

        switch (_type)
        {
        case PostEffectType.Shock:
            effect = new Shock();
            break;

        case PostEffectType.TwoScreen:
            effect = new TwoScreen();
            break;

        case PostEffectType.BulletCurtain:
            effect = new BulletCurtain();
            break;

        default:
            break;
        }

        if (effect != null)
        {
            effect.Initial();
            mPostEffectList.Add(effect);
        }

        return effect;
    }
示例#2
0
        /// <summary>Загружаем атрибуты магии</summary>
        private void LoadAttributes(XmlNode node)
        {
            Name       = node.SelectSingleNode("Name").InnerText;
            _Animation = new PlayerAnimation(node.SelectSingleNode("MovementAnimation"));
            _Width     = int.Parse(node.SelectSingleNode("width").InnerText);
            _Speed     = int.Parse(node.SelectSingleNode("MovementAnimation/speed").InnerText);
            _Height    = int.Parse(node.SelectSingleNode("height").InnerText);
            double res = Convert.ToDouble(node.SelectSingleNode("Animation").InnerText);

            _Reload   = Convert.ToInt32(node.SelectSingleNode("Reload").InnerText) * 100;
            Animation = (int)((double)res * 100);
            res       = Convert.ToDouble(node.SelectSingleNode("Delay").InnerText);
            Delay     = (int)((double)res * 100);
            Cost      = Convert.ToInt32(node.SelectSingleNode("Cost").InnerText);
            Effect    = Convert.ToInt32(node.SelectSingleNode("Effect").InnerText);
            var type = node.SelectSingleNode("Direction").InnerText;

            Direction      = (DirectionType)Enum.Parse(typeof(DirectionType), type);
            type           = node.SelectSingleNode("Type").InnerText;
            Type           = (MagicType)Enum.Parse(typeof(MagicType), type);
            Radius         = Convert.ToInt32(node.SelectSingleNode("Radius").InnerText);
            EffectRadius   = Convert.ToInt32(node.SelectSingleNode("EffectRadius").InnerText);
            type           = node.SelectSingleNode("PostEffect").InnerText;
            PostEffect     = (PostEffectType)Enum.Parse(typeof(PostEffectType), type);
            PostEffectTime = Convert.ToInt32(node.SelectSingleNode("PostEffectTime").InnerText);
            Targets        = new List <TargetType>();
            var lst = node.SelectNodes("Targets/Target");

            foreach (XmlNode current in lst)
            {
                Targets.Add((TargetType)Enum.Parse(typeof(TargetType), current.InnerText));
            }
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="IRenderTechnic"/> class.
 /// </summary>
 /// <param name="PostEffectType">Type of the post effect.</param>
 public IRenderTechnic(PostEffectType PostEffectType)
 {
     this.PostEffectType = PostEffectType;
 }
示例#4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="IPostEffect"/> class.
 /// </summary>
 /// <param name="PostEffectType">Type of the post effect.</param>
 public IPostEffect(PostEffectType PostEffectType)
 {
     this.PostEffectType = PostEffectType;
     Priority            = 0;
     Enabled             = true;
 }
示例#5
0
        /// <summary>Загружаем атрибуты магии</summary>
        private void LoadAttributes(XmlNode node)
        {
            Name = node.SelectSingleNode("Name").InnerText;
              _Animation = new PlayerAnimation(node.SelectSingleNode("MovementAnimation"));
              _Width = int.Parse(node.SelectSingleNode("width").InnerText);
              _Speed = int.Parse(node.SelectSingleNode("MovementAnimation/speed").InnerText);
              _Height = int.Parse(node.SelectSingleNode("height").InnerText);
              double res = Convert.ToDouble(node.SelectSingleNode("Animation").InnerText);
              _Reload = Convert.ToInt32(node.SelectSingleNode("Reload").InnerText) * 100;
              Animation = (int)((double)res * 100);
              res = Convert.ToDouble(node.SelectSingleNode("Delay").InnerText);
              Delay = (int)((double)res * 100);
              Cost = Convert.ToInt32(node.SelectSingleNode("Cost").InnerText);
              Effect = Convert.ToInt32(node.SelectSingleNode("Effect").InnerText);
              var type = node.SelectSingleNode("Direction").InnerText;
              Direction = (DirectionType)Enum.Parse(typeof(DirectionType), type);
              type = node.SelectSingleNode("Type").InnerText;
              Type = (MagicType)Enum.Parse(typeof(MagicType), type);
              Radius = Convert.ToInt32(node.SelectSingleNode("Radius").InnerText);
              EffectRadius = Convert.ToInt32(node.SelectSingleNode("EffectRadius").InnerText);
              type = node.SelectSingleNode("PostEffect").InnerText;
              PostEffect = (PostEffectType)Enum.Parse(typeof(PostEffectType), type);
              PostEffectTime = Convert.ToInt32(node.SelectSingleNode("PostEffectTime").InnerText);
              Targets = new List<TargetType>();
              var lst = node.SelectNodes("Targets/Target");

              foreach (XmlNode current in lst)
            Targets.Add((TargetType)Enum.Parse(typeof(TargetType), current.InnerText));
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="IRenderTechnic"/> class.
 /// </summary>
 /// <param name="PostEffectType">Type of the post effect.</param>
 public IRenderTechnic(PostEffectType PostEffectType)
 {
     this.PostEffectType = PostEffectType;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="RenderTechnich2D"/> class.
 /// </summary>
 /// <param name="PostEffectType">Type of the post effect.</param>
 public RenderTechnich2D(PostEffectType PostEffectType)
 {
     this.PostEffectType = PostEffectType;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="RenderTechnich2D"/> class.
 /// </summary>
 /// <param name="PostEffectType">Type of the post effect.</param>
 public RenderTechnich2D(PostEffectType PostEffectType)
 {
     this.PostEffectType = PostEffectType;
 }