예제 #1
0
 public static void AddLabel(string labelScript, Default page)
 {
     Label label = new Label();
     label.Text = string.Format("{0}", labelScript);
     label.Visible = true;
     page.Controls.Add(label);
 }
예제 #2
0
 public static void AddImage(Player Player, int counter, Default page)
 {
     Image myImage = new Image();
     myImage.ImageUrl = "Images/" + Player.CardsOwned[counter].CardNumber + Player.CardsOwned[counter].CardType + ".png";
     myImage.Visible = true;
     page.Controls.Add(myImage);
 }
예제 #3
0
        public static void normalCombat(Player Player1, Player Player2, Player Winner, Player Loser, int counter, Default page)
        {
            MakeImage.AddImage(Player1, counter, page);
            MakeLabel.AddLabel(String.Format("{0} vs {1}", Player1.Name, Player2.Name), page);
            MakeImage.AddImage(Player2, counter, page);
            MakeLabel.AddLabel(String.Format("{0} has captured {1}'s unit!</br>", Winner.Name, Loser.Name), page);

            SingleCapture.captureCards(Winner, Loser, counter);
        }
예제 #4
0
        public static int warCombat(Player Player1, Player Player2, Default page, int counter, int cardsCapt)
        {
            MakeLabel.AddLabel("</br>", page);
            MakeImage.AddImage(Player1, (counter + cardsCapt), page);
            MakeLabel.AddLabel(String.Format("  {0} vs {1}  ", Player1.Name, Player2.Name), page);
            MakeImage.AddImage(Player2, (counter + cardsCapt), page);
            MakeLabel.AddLabel(String.Format("{0} and {1} are locked in a heated battle. THIS IS WAR!!</br>", Player1.Name, Player2.Name), page);

            MakeLabel.AddLabel(String.Format("{0}'s at stake pool:", Player1.Name), page);
            MakeImage.AddImage(Player1, (counter + 1 + cardsCapt), page);
            MakeImage.AddImage(Player1, (counter + 2 + cardsCapt), page);
            MakeImage.AddImage(Player1, (counter + 3 + cardsCapt), page);

            MakeLabel.AddLabel(String.Format("</br>{0}'s at stake pool:", Player2.Name), page);
            MakeImage.AddImage(Player2, (counter + 1 + cardsCapt), page);
            MakeImage.AddImage(Player2, (counter + 2 + cardsCapt), page);
            MakeImage.AddImage(Player2, (counter + 3 + cardsCapt), page);

            cardsCapt += 4;

            if (Player1.CardsOwned[counter + cardsCapt].CardNumber == Player2.CardsOwned[counter + cardsCapt].CardNumber)
            {
                if (((Player1.CardsOwned.Count() + 4) > (8 + cardsCapt)) && (Player2.CardsOwned.Count() + 4) > (8 + cardsCapt))
                {
                    cardsCapt = warCombat(Player1, Player2, page, counter, cardsCapt);
                }
                else
                {
                    MakeLabel.AddLabel("</br>", page);
                    MakeImage.AddImage(Player1, counter + cardsCapt, page);
                    MakeLabel.AddLabel(String.Format("  {0} vs {1}  ", Player1.Name, Player2.Name), page);
                    MakeImage.AddImage(Player2, counter + cardsCapt, page);
                    MakeLabel.AddLabel(String.Format("{0} and {1} continue their stalemate. THE WAR RAGES ON!!</br>", Player1.Name, Player2.Name), page);
                    MakeLabel.AddLabel("But someone ran out of cards!", page);
                    cardsCapt = 10000000;

                }
            }

                else if (Player1.CardsOwned[counter + cardsCapt].CardNumber > Player2.CardsOwned[counter + cardsCapt].CardNumber)
                {
                    MakeLabel.AddLabel("</br>", page);
                    MakeImage.AddImage(Player1, counter + cardsCapt, page);
                    MakeLabel.AddLabel(String.Format("  {0} vs {1}  ", Player1.Name, Player2.Name), page);
                    MakeImage.AddImage(Player2, counter + cardsCapt, page);
                    MakeLabel.AddLabel(String.Format("{0} captured {1}'s unit and won the war!!!</br>", Player1.Name, Player2.Name), page);

                    MassCapture.massCapture(Player1, Player2, cardsCapt, counter);
                }

                else if (Player1.CardsOwned[counter + cardsCapt].CardNumber < Player2.CardsOwned[counter + cardsCapt].CardNumber)
                {
                    MakeLabel.AddLabel("</br>", page);
                    MakeImage.AddImage(Player1, counter + cardsCapt, page);
                    MakeLabel.AddLabel(String.Format("  {0} vs {1}  ", Player1.Name, Player2.Name), page);
                    MakeImage.AddImage(Player2, counter + cardsCapt, page);
                    MakeLabel.AddLabel(String.Format("{0} captured {1}'s unit and won the war!!!</br>", Player2.Name, Player1.Name), page);

                    MassCapture.massCapture(Player2, Player1, cardsCapt, counter);
                }

            return cardsCapt;
        }