Example #1
0
        public void ChengAngel(EAngel angel)
        {
            Angel = angel;


            C_Top.Visibility = Windows.UI.Xaml.Visibility.Visible;
        }
Example #2
0
        public void ChengAngel(EAngel angel)
        {
            Angel = angel;

            FrameworkElement[] all = { C_Left,
                                       C_Right,
                                       C_Top,
                                       C_Bottom,
                                       C_RoketBottom,
                                       C_RoketLeft,
                                       C_RoketRight,
                                       C_RoketTop };
            foreach (var item in all)
            {
                item.Visibility = Visibility.Collapsed;
            }

            if (angel == EAngel.Top)
            {
                C_Top.Visibility = Windows.UI.Xaml.Visibility.Visible;
            }
            else if (angel == EAngel.Left)
            {
                C_Left.Visibility = Windows.UI.Xaml.Visibility.Visible;
            }
            else if (angel == EAngel.Right)
            {
                C_Right.Visibility = Windows.UI.Xaml.Visibility.Visible;
            }
            else if (angel == EAngel.Bottom)
            {
                C_Bottom.Visibility = Windows.UI.Xaml.Visibility.Visible;
            }
        }
Example #3
0
        public void ShowAttack(EAngel angel, double attackSpeed)
        {
            DispatcherTimer dtr = new DispatcherTimer()
            {
                Interval = TimeSpan.FromSeconds(0.25)
            };

            dtr.Tick += dtr_Tick;
            dtr.Start();
            if (angel == EAngel.Top)
            {
                C_TopAttack.Visibility = Windows.UI.Xaml.Visibility.Visible;
            }
            else if (angel == EAngel.Left)
            {
                C_LeftAttack.Visibility = Windows.UI.Xaml.Visibility.Visible;
            }
            else if (angel == EAngel.Right)
            {
                C_RightAttack.Visibility = Windows.UI.Xaml.Visibility.Visible;
            }
            else if (angel == EAngel.Bottom)
            {
                C_BotAttack.Visibility = Windows.UI.Xaml.Visibility.Visible;
            }
        }
Example #4
0
        public void ChengAngel(EAngel angel)
        {
            Angel = angel;

            foreach (var item in C_Root.Children)
            {
                Image itemImage = item as Image;
                if (itemImage != null)
                {
                    itemImage.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
                }
            }


            if (angel == EAngel.Top)
            {
                C_1.Visibility = Windows.UI.Xaml.Visibility.Visible;
            }
            else if (angel == EAngel.Left)
            {
                C_2_Left.Visibility = Windows.UI.Xaml.Visibility.Visible;
            }
            else if (angel == EAngel.Right)
            {
                C_3_Right.Visibility = Windows.UI.Xaml.Visibility.Visible;
            }
            else if (angel == EAngel.Bottom)
            {
                C_4_Bottom.Visibility = Windows.UI.Xaml.Visibility.Visible;
            }
        }
Example #5
0
        public void ChengAngel(EAngel angel)
        {
            Angel = angel;

            C_Left.Visibility   = Visibility.Collapsed;
            C_Right.Visibility  = Visibility.Collapsed;
            C_Top.Visibility    = Visibility.Collapsed;
            C_Bottom.Visibility = Visibility.Collapsed;

            if (angel == EAngel.Top)
            {
                C_Top.Visibility = Windows.UI.Xaml.Visibility.Visible;
            }
            else if (angel == EAngel.Left)
            {
                C_Left.Visibility = Windows.UI.Xaml.Visibility.Visible;
            }
            else if (angel == EAngel.Right)
            {
                C_Right.Visibility = Windows.UI.Xaml.Visibility.Visible;
            }
            else if (angel == EAngel.Bottom)
            {
                C_Bottom.Visibility = Windows.UI.Xaml.Visibility.Visible;
            }
        }
Example #6
0
        private void SoulCreator(EAngel angl, Buff buff)
        {
            CreateBullet(angl, 0, 0.15, buff);

            if (buff.SoulCount == 32)
            {
                CreateBullet(angl, 0, 0.25, buff);
            }

            if (buff.SoulCount >= 20)
            {
                CreateBullet(angl, 1, 0.3, buff);
                CreateBullet(angl, 2, 0.3, buff);
            }
        }
Example #7
0
        private Command GetRotationCommand(EAngel angel)
        {
            switch (angel)
            {
            case EAngel._090:
                return(Command.Rotate90());

            case EAngel._180:
                return(Command.Rotate180());

            case EAngel._270:
                return(Command.Rotate270());

            default:
                throw new NotImplementedException();
            }
        }
Example #8
0
        public void ChengAngel(EAngel angel)
        {
            Angel = angel;

            /*
             * C_Left.Visibility = Visibility.Collapsed;
             * C_Right.Visibility = Visibility.Collapsed;
             * C_Top.Visibility = Visibility.Collapsed;
             * C_Bottom.Visibility = Visibility.Collapsed;
             *
             * if (angel == EAngel.Top)
             *  C_Top.Visibility = Windows.UI.Xaml.Visibility.Visible;
             * else if (angel == EAngel.Left)
             *  C_Left.Visibility = Windows.UI.Xaml.Visibility.Visible;
             * else if (angel == EAngel.Right)
             *  C_Right.Visibility = Windows.UI.Xaml.Visibility.Visible;
             * else if (angel == EAngel.Bottom)
             *  C_Bottom.Visibility = Windows.UI.Xaml.Visibility.Visible;
             */
        }
Example #9
0
        public void ChengAngel(EAngel angel)
        {
            Angel = angel;

            if (PlayerNumber == 1)
            {
                C_Model_H_Bonik.ChengAngel(angel);
            }
            else if (PlayerNumber == 2)
            {
                C_Model_H_Alhim.ChengAngel(angel);
            }
            else if (PlayerNumber == 3)
            {
                C_Model_H_Sniper.ChengAngel(angel);
            }
            else if (PlayerNumber == 4)
            {
                C_Model_H_Jakiro.ChengAngel(angel);
            }
            else if (PlayerNumber == 5)
            {
                C_Model_H_Mirana.ChengAngel(angel);
            }
            else if (PlayerNumber == 6)
            {
                C_Model_H_Jinx.ChengAngel(angel);
            }
            else if (PlayerNumber == 7)
            {
                C_Model_H_Nature.ChengAngel(angel);
            }
            else if (PlayerNumber == 8)
            {
                C_Model_H_Sf.ChengAngel(angel);
            }
            else
            {
                C_Model_Player1.ChengAngel(angel);
            }
        }
Example #10
0
        private void SfUlt(EAngel angle)
        {
            if (_bullet.Mode == 1 && _moveCount == 3 && (angle == EAngel.Left || angle == EAngel.Right))
            {
                _bullet.Angel = EAngel.Top;
            }

            if (_bullet.Mode == 2 && _moveCount == 3 && (angle == EAngel.Left || angle == EAngel.Right))
            {
                _bullet.Angel = EAngel.Bottom;
            }

            if (_bullet.Mode == 3 && _moveCount == 3 && (angle == EAngel.Left || angle == EAngel.Right))
            {
                _bullet.Angel = EAngel.Left;
            }

            if (_bullet.Mode == 4 && _moveCount == 3 && (angle == EAngel.Left || angle == EAngel.Right))
            {
                _bullet.Angel = EAngel.Right;
            }
        }
Example #11
0
 public void ShowAttack(EAngel angel, double attackSpeed)
 {
 }
Example #12
0
 public void ChengAngel(EAngel Angel)
 {
 }
Example #13
0
        private void CreateBullet(EAngel angel, int mode, double speed, Buff buff)
        {
            Bullet bullArrow = new Bullet();

            bullArrow.GameObject = new Game_Object_In_Call()
            {
                EnumCallType = EnumCallType.Bullet,
            };

            ///Создаем визуальный объект стрела
            UC_Sf_Ult arrow = new UC_Sf_Ult();

            arrow.ChengAngel(_unit.Angel);
            bullArrow.GameObject.View = arrow;

            bullArrow.UnitUsed  = _unit;
            bullArrow.PositionX = _unit.PositionX;
            bullArrow.PositionY = _unit.PositionY;
            bullArrow.Speed     = speed;

            if (buff.SoulCount > _damageMagic)
            {
                bullArrow.DemageMagic = buff.SoulCount;
            }
            else
            {
                bullArrow.DemageMagic = _damageMagic;
            }

            //UnitGenerator.MKB_Bush(bullArrow, _unit);
            ///Магический урон зависит от прокача стрел
            //bullArrow.DemageMagic = 5 * (int)property;

            bullArrow.MinusArmor = 3;
            bullArrow.SpeedSlow  = 0.3;

            bullArrow.Mode       = mode;
            bullArrow.CurrentMap = _map;
            bullArrow.Angel      = angel;

            SPB_Item_Maelstrom mel = new SPB_Item_Maelstrom()
            {
                Name = "Fly"
            };

            mel.HitCount    = 10;
            mel.IsSfUlt     = true;
            bullArrow.Range = 3;

            ///Поведение такое же как у стрел боника
            bullArrow.Spells.Add(mel);

            ///И его же добавим в масив всех объектов
            _map.GameObjectInCall.Add(bullArrow.GameObject);

            Canvas.SetLeft(bullArrow.GameObject.View, bullArrow.PositionX * 50);
            Canvas.SetTop(bullArrow.GameObject.View, bullArrow.PositionY * 50);
            ///Отображение
            _map.MapCanvas.Children.Add(bullArrow.GameObject.View);

            bullArrow.UseSpall("Fly");
        }
Example #14
0
 public void ChengAngel(EAngel angel)
 {
     Angel = angel;
 }
Example #15
0
        /// <summary>
        /// Перемещение юнита
        /// </summary>
        /// <param name="map">Карта</param>
        /// <param name="obj">нет</param>
        /// <param name="unit">Кто перемещается</param>
        /// <param name="property"></param>
        public void UseSpall(Map map, Game_Object_In_Call obj, IUnit unit, object property)
        {
            UnitGenerator.UpdatePlayerView(unit);
            if (unit.UnitFrozen == false && !CuldaunBool)
            {
                CuldaunBool = true;
                EAngel ang = (EAngel)property;
                _map  = map;
                _unit = unit;
                ///Проверим в какую сторону смотрит юнит, может его нужно просто развернуть
                ///а не перемещать
                if (unit.Angel == ang)
                {///Можно перемещать
                    Rotation = false;

                    int xNew = 0;
                    int yNew = 0;
                    if (unit.Angel == EAngel.Left)
                    {
                        xNew = unit.PositionX - 1;
                        yNew = unit.PositionY;
                    }
                    else if (unit.Angel == EAngel.Right)
                    {
                        xNew = unit.PositionX + 1;
                        yNew = unit.PositionY;
                    }
                    else if (unit.Angel == EAngel.Top)
                    {
                        xNew = unit.PositionX;
                        yNew = unit.PositionY - 1;
                    }
                    else if (unit.Angel == EAngel.Bottom)
                    {
                        xNew = unit.PositionX;
                        yNew = unit.PositionY + 1;
                    }


                    ///Теперь проверка можно ли переместится в данную ячейку
                    if (map.AllowMoveUnit(unit, xNew, yNew))
                    {   ///Можно
                        _invisMuve = unit.Invisibility;

                        ///Отмечаем что в заданную ячейку идет перемещение юнита
                        map.Calls.Single(p => p.IndexLeft == xNew && p.IndexTop == yNew).Using = true;
                        //  unit.UnitFrozen = true;
                        _xNew = xNew;
                        _yNew = yNew;

                        ///Сохраняем ячейку с которой был выполнен переход
                        UnitGenerator.EditWay(map.Calls.Single(p => p.IndexLeft == unit.PositionX &&
                                                               p.IndexTop == unit.PositionY), _unit);

                        ///Запуск анимации перемещения
                        StartStoryboard(unit, xNew, yNew);
                    }
                    else
                    {
                        CuldaunBool = false;

                        if (CompletedUseSpell != null)
                        {
                            CompletedUseSpell(this, null);
                        }
                    }
                }
                else
                {///Только развернуть
                    IGameControl contrGame = unit.GameObject.View as IGameControl;
                    unit.Angel = ang;
                    contrGame.ChengAngel(ang);
                    Rotation = true;

                    CuldaunBool = false;

                    if (CompletedUseSpell != null)
                    {
                        CompletedUseSpell(this, null);
                    }
                }
            }
            else if (CompletedUseSpell != null)
            {
                CompletedUseSpell(this, null);
            }
        }
Example #16
0
        /// <summary>
        /// Анимация перемещения закончена
        /// </summary>
        void storyboard_Completed(object sender, object e)
        {
            _storyboard.Completed -= storyboard_Completed;
            _storyboard            = null;

            if (_hitCount == 0 ||
                _bullet.Range == 0 ||
                _exept)
            {
                #region Эти 2 метода находятся в пуле
                ///Было попадение, анимация исчезновения стрелы
                //_bullet.GameObject.View.Visibility = Visibility.Collapsed;
                //_map.MapCanvas.Children.Remove(_bullet.GameObject.View);

                (_bullet.GameObject.View as IGameControl).Remove(_map.MapCanvas);
                #endregion
                ///Было попадение стрела исчезает
                ///Удаляем из масива всех объектов
                _map.GameObjectInCall.Remove(_bullet.GameObject);


                if (_map.Calls.Any(p => p.IndexLeft == _bullet.PositionX &&
                                   p.IndexTop == _bullet.PositionY))
                {
                    Map_Cell newCall = _map.Calls.Single(p => p.IndexLeft == _bullet.PositionX &&
                                                         p.IndexTop == _bullet.PositionY);
                    newCall.Bullet.Remove(_bullet);
                }
            }
            else
            {
                _bullet.Range--;
                if (_bullet.Exept)
                {
                    _exeptHit = true;

                    if (_bullet.Angel == EAngel.Left)
                    {
                        _stopAngels = EAngel.Right;
                    }
                    else if (_bullet.Angel == EAngel.Right)
                    {
                        _stopAngels = EAngel.Left;
                    }
                    else if (_bullet.Angel == EAngel.Top)
                    {
                        _stopAngels = EAngel.Bottom;
                    }
                    else if (_bullet.Angel == EAngel.Bottom)
                    {
                        _stopAngels = EAngel.Top;
                    }

                    ///Выбераем рандомную сторону куда отобется молния
                    Random rand = new Random((int)DateTime.Now.Ticks);
                    _bullet.Angel = (EAngel)rand.Next(0, 3);
                    _bullet.Exept = false;
                }
                ///Молния летит дальше, у нее не кончелся ренж
                ///или небыло максимального количества попадений
                BulletMuve(_bullet);
            }

            if (E_TestEvent != null)
            {
                E_TestEvent("Storyboard_Completed", null);
            }
        }
Example #17
0
        /// <summary>
        /// Запуск шарика который бъет врагов
        /// </summary>
        public void UseSpall(Map map, Game_Object_In_Call obj, IUnit unit, object property)
        {
            _unit = unit;

            if (unit.UnitFrozen == false &&
                !_culdaunBool && !unit.Silenced &&
                !unit.Hexed &&
                !Paused)
            {
                if (unit.Mana >= ManaCost)
                ///Проверка есть ли мана на каст
                {
                    Speed = unit.AttackSpeed;

                    ///Флаг кулдауна
                    _culdaunBool = true;

                    ///Отнимаем нужное количество
                    unit.Mana -= ManaCost;

                    EAngel[] angels = new EAngel[] { EAngel.Left, EAngel.Top, EAngel.Right, EAngel.Bottom };

                    foreach (var item in angels)
                    {
                        ///Создаем визуальный объект шарик
                        UC_EasyMobAttackBall arrow = new UC_EasyMobAttackBall();
                        //arrow.ViewBall(1);
                        //arrow.ChengAngel(unit.Angel);

                        Bullet bullArrow = new Bullet();
                        bullArrow.GameObject = new Game_Object_In_Call()
                        {
                            EnumCallType = EnumCallType.Bullet,
                            View         = arrow
                        };
                        bullArrow.UnitUsed   = unit;
                        bullArrow.PositionX  = unit.PositionX;
                        bullArrow.PositionY  = unit.PositionY;
                        bullArrow.Speed      = 0.4;
                        bullArrow.DemagePhys = unit.Demage;

                        bullArrow.CurrentMap = map;
                        bullArrow.Angel      = item;
                        bullArrow.Range      = _unit.Range;
                        bullArrow.Splash     = 0.5;

                        bullArrow.Spells.Add(new SPB_Jinx_Zap_Roket()
                        {
                            Name = "Fly", ExplosionStyle = 1
                        });

                        ///И его же добавим в масив всех объектов
                        map.GameObjectInCall.Add(bullArrow.GameObject);

                        Canvas.SetLeft(bullArrow.GameObject.View, bullArrow.PositionX * 50);
                        Canvas.SetTop(bullArrow.GameObject.View, bullArrow.PositionY * 50);
                        ///Отображение
                        map.MapCanvas.Children.Add(bullArrow.GameObject.View);

                        bullArrow.UseSpall("Fly");
                    }

                    ///Таймер кулдауна заклинания
                    _secondTimer = new Storyboard()
                    {
                        Duration = TimeSpan.FromSeconds(Culdaun)
                    };
                    _secondTimer.Completed += _secondTimer_Completed;
                    _secondTimer.Begin();

                    if (Paused)
                    {
                        Pause();
                    }

                    if (StartUseSpell != null)
                    {
                        StartUseSpell(this, null);
                    }

                    UnitGenerator.UpdatePlayerView(unit);
                }
                else
                ///Маны нету
                {
                }
            }
        }