private void setUpPage()
        {
            //Idle Animation Begin
            IdleAnimation.Begin();

            //Create Monster and Player value
            Enemy = new Monster("Axalf", "Dire Dimunitive Drawf", 50, 20);
            You = new Player("You", 100, 50);

            //Creating and adding attacks to monster
            Attack Bite = new Attack("Bite", 1, 10, 18);
            Attack Stomp = new Attack("Stomp", 5, 10, 15);

            Enemy.addAttack(Bite);
            Enemy.addAttack(Stomp);

            //Creating and adding items  to player
            Item Potion = new Item("Potion", 20);
            Item MegaPotion = new Item("Mega Potion", 50);

            You.addItem(Potion);
            You.addItem(MegaPotion);

            //Creating and adding spells  to player
            Spell Fire = new Spell("Fire", 2, 7, 20, 10);
            Spell Thunder = new Spell("Thunder", 3, 10, 18, 15);

            You.addSpell(Fire);
            You.addSpell(Thunder);

            //Display Monster and Player value
            pageTitle.Text = Enemy.getSubtitle() + ": " + Enemy.getName();
            monsterName.Text = Enemy.getName();
            monsterHPText.Text = Enemy.getHPStart().ToString();
            monsterMPText.Text = Enemy.getMPStart().ToString();
            yourName.Text = You.getName();
            yourHPText.Text = You.getHPStart().ToString();
            yourMPText.Text = You.getMPStart().ToString();
        }
Пример #2
0
        private void SetUpPage()
        {
            //Idle Animation Begin
            IdleAnimation.Begin();

            //Creating Player Attack
            Attack PA = new Attack(0, Convert.ToDouble(localSettings.Values["CharMinDmg"].ToString()), Convert.ToDouble(localSettings.Values["CharMaxDmg"].ToString()));
            //Create Monster and Player value
            Enemy = new Monster(localSettings.Values["MonNm"].ToString(), localSettings.Values["MonSub"].ToString(), Convert.ToInt32(localSettings.Values["MonHP"].ToString()), Convert.ToInt32(localSettings.Values["MonMP"].ToString()));
            You = new Player(localSettings.Values["CharNm"].ToString(), Convert.ToInt32(localSettings.Values["CharHP"].ToString()), Convert.ToInt32(localSettings.Values["CharMP"].ToString()), PA);

            //Creating and adding attacks to monster
            Attack A1 = new Attack(localSettings.Values["A1Nm"].ToString(), 0, Convert.ToDouble(localSettings.Values["A1MinDmg"].ToString()), Convert.ToDouble(localSettings.Values["A1MaxDmg"].ToString()));
            Attack A2 = new Attack(localSettings.Values["A2Nm"].ToString(), 0, Convert.ToDouble(localSettings.Values["A2MinDmg"].ToString()), Convert.ToDouble(localSettings.Values["A2MaxDmg"].ToString()));
            Attack A3 = new Attack(localSettings.Values["A3Nm"].ToString(), 0, Convert.ToDouble(localSettings.Values["A3MinDmg"].ToString()), Convert.ToDouble(localSettings.Values["A3MaxDmg"].ToString()));
            Attack A4 = new Attack(localSettings.Values["A4Nm"].ToString(), 0, Convert.ToDouble(localSettings.Values["A4MinDmg"].ToString()), Convert.ToDouble(localSettings.Values["A4MaxDmg"].ToString()));

            if (!(A1.getName().Equals("")))
                Enemy.addAttack(A1);
            if (!(A2.getName().Equals("")))
                Enemy.addAttack(A2);
            if (!(A3.getName().Equals("")))
                Enemy.addAttack(A3);
            if (!(A4.getName().Equals("")))
                Enemy.addAttack(A4);

            //Creating and adding items  to player
            Item I1 = new Item(localSettings.Values["I1Nm"].ToString(), Convert.ToInt32(localSettings.Values["I1HP"].ToString()));
            Item I2 = new Item(localSettings.Values["I2Nm"].ToString(), Convert.ToInt32(localSettings.Values["I2HP"].ToString()));
            Item I3 = new Item(localSettings.Values["I3Nm"].ToString(), Convert.ToInt32(localSettings.Values["I3HP"].ToString()));
            Item I4 = new Item(localSettings.Values["I4Nm"].ToString(), Convert.ToInt32(localSettings.Values["I4HP"].ToString()));

            if (!(I1.getName().Equals("")))
                You.addItem(I1, Convert.ToInt32(localSettings.Values["I1Qnt"].ToString()));

            if (!(I2.getName().Equals("")))
                You.addItem(I2, Convert.ToInt32(localSettings.Values["I2Qnt"].ToString()));

            if (!(I3.getName().Equals("")))
                You.addItem(I3, Convert.ToInt32(localSettings.Values["I3Qnt"].ToString()));

            if (!(I4.getName().Equals("")))
                You.addItem(I4, Convert.ToInt32(localSettings.Values["I4Qnt"].ToString()));

            //Creating and adding spells  to player
            Spell S1 = new Spell(localSettings.Values["S1Nm"].ToString(), 0, Convert.ToDouble(localSettings.Values["S1MinDmg"].ToString()), Convert.ToDouble(localSettings.Values["S1MaxDmg"].ToString()), Convert.ToInt32(localSettings.Values["S1MP"].ToString()));
            Spell S2 = new Spell(localSettings.Values["S2Nm"].ToString(), 0, Convert.ToDouble(localSettings.Values["S2MinDmg"].ToString()), Convert.ToDouble(localSettings.Values["S2MaxDmg"].ToString()), Convert.ToInt32(localSettings.Values["S2MP"].ToString()));
            Spell S3 = new Spell(localSettings.Values["S3Nm"].ToString(), 0, Convert.ToDouble(localSettings.Values["S3MinDmg"].ToString()), Convert.ToDouble(localSettings.Values["S3MaxDmg"].ToString()), Convert.ToInt32(localSettings.Values["S3MP"].ToString()));
            Spell S4 = new Spell(localSettings.Values["S4Nm"].ToString(), 0, Convert.ToDouble(localSettings.Values["S4MinDmg"].ToString()), Convert.ToDouble(localSettings.Values["S4MaxDmg"].ToString()), Convert.ToInt32(localSettings.Values["S4MP"].ToString()));

            if (!(S1.getName().Equals("")))
                You.addSpell(S1);
            if (!(S2.getName().Equals("")))
                You.addSpell(S2);
            if (!(S3.getName().Equals("")))
                You.addSpell(S3);
            if (!(S4.getName().Equals("")))
                You.addSpell(S4);

            //Set monster portrait
            Object MonPortrait = localSettings.Values["MonPortrait"];

            if ((int)MonPortrait == 1)
                Axalf.Source = new BitmapImage(new Uri("ms-appx:///Assets/Monster Pics/mon1.png"));
            else if ((int)MonPortrait == 2)
                Axalf.Source = new BitmapImage(new Uri("ms-appx:///Assets/Monster Pics/mon2.png"));
            else if ((int)MonPortrait == 3)
                Axalf.Source = new BitmapImage(new Uri("ms-appx:///Assets/Monster Pics/mon3.png"));
            else if ((int)MonPortrait == 4)
                Axalf.Source = new BitmapImage(new Uri("ms-appx:///Assets/Monster Pics/mon4.png"));
            else
                Axalf.Source = new BitmapImage(new Uri("ms-appx:///Assets/Monster Pics/mon5.png"));

            //Display Monster and Player value
            pageTitle.Text = Enemy.getSubtitle() + ": " + Enemy.getName();
            monsterName.Text = Enemy.getName();
            monsterHPText.Text = Enemy.getHPStart().ToString();
            monsterMPText.Text = Enemy.getMPStart().ToString();
            yourName.Text = You.getName();
            yourHPText.Text = You.getHPStart().ToString();
            yourMPText.Text = You.getMPStart().ToString();
        }