Пример #1
0
        public void CastSkill(int Button)
        {
            if (!ControllerGame.IsSkillHitting(CharacterSkill, Mob1))
            {
                Canvas.SetLeft(CharacterSkill, Canvas.GetLeft(CharacterSkill) + 45);
                AttackingAnimation(true);
            }


            else if (ControllerGame.IsSkillHitting(CharacterSkill, Mob1))
            {
                BattleController.CheckTurn(BattlePlayer, Mob_, Button);
                PaintDamageGiven(1);
                AttackingAnimation(false);
                Canvas.SetLeft(CharacterSkill, Canvas.GetLeft(Person1) + 82);
                CharacterSkill.Source = null;
                ChosenSkill           = null;
            }

            BattleController.FinishBattle(BattlePlayer, Mob_);
        }
Пример #2
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            if (ControllerGame.CheckLastPage(typeof(Map), this))
            {
                CharList = e.Parameter as List <Object>;

                BattlePlayer = CharList.ElementAt(0) as Character;
                Mob_         = CharList.ElementAt(1) as Mob;
                CharList.Clear();

                Debug.WriteLine("DANO MOB: " + Mob_.Damage);
                Debug.WriteLine("Dano Player " + BattlePlayer.Damage);
                Debug.WriteLine("EU SOU " + Mob_.name);

                AdjustProgessBar();

                Person1.Source = BattlePlayer.IdleUp;
            }

            if (ControllerGame.CheckLastPage(typeof(Map2), this))
            {
                CharList = e.Parameter as List <Object>;

                BattlePlayer = CharList.ElementAt(0) as Character;
                Mob_         = CharList.ElementAt(1) as Mob;
                CharList.Clear();

                Debug.WriteLine("DANO MOB: " + Mob_.Damage);
                Debug.WriteLine("Dano Player " + BattlePlayer.Damage);
                Debug.WriteLine("EU SOU " + Mob_.name);

                AdjustProgessBar();

                Person1.Source = BattlePlayer.IdleUp;
            }

            if (BattlePlayer is Berserker)
            {
                btnSkillBasic.Content = "Basic Attack";
                btnSkillOne.Content   = "Corrupted Strike";
                btnSkillTwo.Content   = "Double Edged Sword";
            }
            if (BattlePlayer is Dicer)
            {
                btnSkillBasic.Content = "Waterball";
                btnSkillOne.Content   = "Mystic Snake";
                btnSkillTwo.Content   = "Nether Blast";
            }

            btnLifePot.IsEnabled = false;
            if (BattlePlayer.inventory.checkPotCount("LifePot"))
            {
                btnLifePot.IsEnabled = true;
            }

            BtnManaPot.IsEnabled = false;
            if (BattlePlayer.inventory.checkPotCount("ManaPot"))
            {
                BtnManaPot.IsEnabled = true;
            }

            Mob1.Source = Mob_.GifBattle;
            SignPageEvents();
            turn = BattleController.InicializeBattle(BattlePlayer, Mob_, button);
        }