Esempio n. 1
0
        public void setup(Player currentPlayer)
        {
            //Shuffle the opponets deck
            currentPlayer.shuffleDeck();

            //Draw seven cards
            currentPlayer.draw(7);

            //Check that the user got some basics in the draw
            //While the current player doesn't have any basics in their hand
            while (!(currentPlayer.Hand.Exists(p => p.stage == Enums.Stage.Basic)))
            {
                Console.WriteLine("You have no basic cards in your hand; a new hand will be drawn");
                currentPlayer.deck.AddRange(currentPlayer.Hand);
                currentPlayer.Hand.Clear();
                currentPlayer.deck.shuffle();
                currentPlayer.draw(7);

                //Offer player 2 two more cards
                //TODO: ^
            }

            //Place Prizes
            currentPlayer.initPrizes(6);

            //Pick a basic pokemon (Hand to active)
            int choosen = 0;
            Card chsn;
            bool bench = true;
            bool bCont = true;

            // The user wants to put cards in their bench
            /* --- Code beyond this point is a cluster**** and I barely know what it does anymore :/ --- */
            while (bench == true)
            {
                Console.WriteLine("Please select a input to put on your bench (" + currentPlayer.getName() + ")");

                if (choosen != -1)
                {
                    do
                    {
                        int check = choosecard(currentPlayer.Hand);
                        if (currentPlayer.Hand[check] == null || currentPlayer.Hand[check].Stage != "Basic")
                        {
                            Console.WriteLine("The selection was invalid, please slect a basic pokemon");
                        }
                        else
                        {
                            currentPlayer.move(currentPlayer.Hand, check, currentPlayer.Bench);
                            bCont = false;
                        }
                    } while (bCont);
                }
                else if (choosen == -1)
                {
                    bench = false;
                    break;
                }
                Console.WriteLine("Would you like to put another input on the bench?");
                string inputCs = Console.ReadLine();

                //Convert the input to lowercase so that we have less possibilties that they can enter.
                if (inputCs.ToLower() == "no" | inputCs.ToLower() == "n")
                {
                    bench = false;
                }
            }

            //Tell the player to select an active pokemon
            Console.WriteLine("Please select an active pokemon");

            //Call the overloaded chooseCard method which will iterate the cards in the source (bench)
            currentPlayer.setActPkm(currentPlayer.Bench, choosecard(currentPlayer.Bench));

            //choosecard method will be launched before the setActPKM command
            currentPlayer.isFirstTurn = false;

            //Up to 5 basic pkm on the bench

            //Flip coin
            //--Heads player1, Tails Player2
        }
Esempio n. 2
0
        public void menu_Hand(Player curPlayer)
        {
            //Show the user all of their cards.
            printCards(curPlayer.Hand);

            //The user can chose any of there cards
            int chosen = getValidUserInput(0, curPlayer.Hand.Count); //Number of cards in your hand lol
            //If the user chooses a input
            //If the input is a basic pokemon

            if (curPlayer.Hand[chosen].stage == Enums.Stage.Basic)
            {
                //Allow user to check, put on bench or go back
                Console.WriteLine("1. Check \n 2. Bench 3. \n Back \n");
                switch (getValidUserInput(1, 3))
                {
                    case 1:
                        check(curPlayer.Hand[chosen]);
                        break;

                    case 2:
                        curPlayer.move(curPlayer.Hand, chosen, curPlayer.Bench);
                        break;

                    case 3: break;
                }
            }
            else if (curPlayer.Hand[chosen].stage == Enums.Stage.Trainer)
            {
                Console.WriteLine("Sorry Trainers haven't been implemented yet");
            }
            else if (curPlayer.Hand[chosen].stage == Enums.Stage.Energy)
            {
                //If this is the first energy attached
                if (curPlayer.isFirstEnergy == true)
                {
                    //Allow the user to attach the input to a Pokemon
                    Console.WriteLine("Please pick a pokemon to attach this to");
                    printCards(curPlayer.Bench); //<-- TODO: Code something incase there is nothing in the bench or other input source
                    Console.WriteLine("A for ActivePkm");

                    //The next code block is probably a bad idea TODO: Clean / Fix this.
                    string temp = Console.ReadLine();
                    int tryP;
                    int.TryParse(temp, out tryP);
                    //This exemplfies why getValidUserInput was written in the first place
                    if ((temp != "a" && temp != "A") || tryP > curPlayer.Bench.Count || tryP < 0)//Serious bidness if you enter something wrong here.
                    {
                        Console.WriteLine("That input was invalid");
                    }
                    else if (temp == "A" || temp == "a")
                    {
                        curPlayer.move(curPlayer.Hand, chosen, curPlayer.actPkm.attached);
                        curPlayer.isFirstEnergy = false;
                    }
                    else
                    {
                        curPlayer.move(curPlayer.Hand, chosen, curPlayer.Bench[int.Parse(temp)].attached);
                        curPlayer.isFirstEnergy = false;
                    }

                }
                else
                {
                    //Tell them they can't do it and go back
                    Console.WriteLine("Sorry, you can only attach one energy per turn");
                }
            }
            //If it is some other input
            else
            {
                //Check if it is an evolution and allow the user to change it out?
                Console.WriteLine("Sorry, I'm still working on evolutions as well ;_;"); //TODO: Write evolution code
                int evolT = choosecard(curPlayer.Hand);

                //If the chose input is a valid evolution
                if (curPlayer.validEvol(curPlayer.actPkm, curPlayer.Hand[evolT]))
                {
                    curPlayer.doEvol(curPlayer.Hand, evolT);
                }
            }
        }