Ejemplo n.º 1
0
        public override void CreateGame()
        {
            var slot = GamePlayMenus.SaveGameMenu("load");

            if (slot == 7)
            {
                GameCreationMenus.StartMenu();
            }
            var path = PathFinder(slot);

            LoadGame(path);
            InitializeBoard();
            var play = new PlayerTurn();

            play.GamePlay();
        }
Ejemplo n.º 2
0
        public void BattleMenu()
        {
            var complete = false;

            while (complete == false)
            {
                var player = GameBoard.GetBoard().CurrentPlayer;
                Console.Clear();
                Colour.SouthAmericaRed("\t     **** Risk! ****\n");
                Console.WriteLine("\t==========================");
                Console.WriteLine("\t       Battle Menu");
                Console.Write("\tCurrently ");
                Colour.PrintPlayer(player.Colour, player.Name + "'s");
                Console.Write(" turn.\n");
                Console.WriteLine("\t1. Select territory to attack");
                Console.WriteLine("\t2. Game Menu");
                Console.WriteLine("\t3. Finish Fighting");
                Console.WriteLine("\t==========================");
                var option = GameEngine.UserInputTest("\t(1-3)>", "\tInvalid input, please try again!", 1, 3);

                switch (option)
                {
                case 1:
                    var attack = BuildBattle();
                    if (attack.AttackingTerritory != null)
                    {
                        var unused = new WorldConquered(this);
                        BeginBattle(attack);
                    }
                    break;

                case 2:
                    GamePlayMenus.PlayerTurnMenu();
                    break;

                case 3:
                    complete = true;
                    break;

                default:
                    Console.WriteLine("Error");
                    break;
                }
            }
        }
Ejemplo n.º 3
0
        public static void FortificationMenu()
        {
            var complete = false;

            while (complete == false)
            {
                var player = GameBoard.GetBoard().CurrentPlayer;
                Console.Clear();
                Colour.SouthAmericaRed("\t     **** Risk! ****\n");
                Console.WriteLine("\t==========================");
                Console.WriteLine("\t    Fortification Menu");
                Console.Write("\tCurrently ");
                Colour.PrintPlayer(player.Colour, player.Name + "'s");
                Console.Write(" turn.\n");
                Console.WriteLine("\t1. Move Troops");
                Console.WriteLine("\t2. Game Menu");
                Console.WriteLine("\t3. End Turn");
                Console.WriteLine("\t==========================");
                var option = GameEngine.UserInputTest("\t(1-3)>", "\tInvalid input, please try again!", 1, 3);

                switch (option)
                {
                case 1:
                    MoveTroops();
                    break;

                case 2:
                    GamePlayMenus.PlayerTurnMenu();
                    break;

                case 3:
                    complete = true;
                    break;

                default:
                    Console.WriteLine("Error");
                    break;
                }
            }
        }
Ejemplo n.º 4
0
        public static int TradeMenu()
        {
            var player = GameBoard.GetBoard().CurrentPlayer;

            _cards = new PlayersCards(player.Cards);

            var doneTrading = false;

            while (doneTrading == false)
            {
                Console.Clear();
                Colour.SouthAmericaRed("\t     **** Risk! ****\n");
                Console.WriteLine("\t==========================");
                Console.WriteLine("\t       Card trade menu");
                Console.Write("\tCurrently ");
                Colour.PrintPlayer(player.Colour, player.Name + "'s");
                Console.Write(" turn.\n");
                if (player.Cards.Count > 6)
                {
                    Colour.SouthAmericaRed("\tYou must trade at least one set of cards!\n");
                }

                int infantryCount, cavalryCount, artillaryCount, wildCount;
                if (_cards.Infantry == null)
                {
                    infantryCount = 0;
                }
                else
                {
                    infantryCount = _cards.Infantry.Count;
                }

                if (_cards.Cavalry == null)
                {
                    cavalryCount = 0;
                }
                else
                {
                    cavalryCount = _cards.Cavalry.Count;
                }

                if (_cards.Artillary == null)
                {
                    artillaryCount = 0;
                }
                else
                {
                    artillaryCount = _cards.Artillary.Count;
                }

                if (_cards.Wild == null)
                {
                    wildCount = 0;
                }
                else
                {
                    wildCount = _cards.Wild.Count;
                }

                Console.WriteLine("\tInfantry cards = " + infantryCount);
                Console.WriteLine("\tCavalry cards = " + cavalryCount);
                Console.WriteLine("\tArtillary cards = " + artillaryCount);
                Console.WriteLine("\tWild cards = " + wildCount);

                Console.WriteLine("\n\t1. Play three of a kind");
                Console.WriteLine("\t2. Play one of each");
                Console.WriteLine("\t3. Play a wild card");
                Console.WriteLine("\t4. Game Menu");
                Console.WriteLine("\t5. Commence deployment of reinforcements");
                Console.WriteLine("\t==========================");
                var option = GameEngine.UserInputTest("\t(1-5)>", "\tInvalid input, please try again!", 1, 5);

                switch (option)
                {
                case 1:
                    PlayThreeOfAKind(infantryCount, cavalryCount, artillaryCount, wildCount);
                    break;

                case 2:
                    PlayOneOfEach(infantryCount, cavalryCount, artillaryCount, wildCount);
                    break;

                case 3:
                    PlayWildCard(infantryCount, cavalryCount, artillaryCount, wildCount);
                    break;

                case 4:
                    GamePlayMenus.PlayerTurnMenu();
                    break;

                case 5:
                    if (player.Cards.Count <= 6)
                    {
                        doneTrading = true;
                    }
                    else
                    {
                        Console.WriteLine("\tYou have more than 6 cards, You must trade some!");
                    }
                    break;

                default:
                    Console.WriteLine("\tError");
                    break;
                }
            }
            return(_armies);
        }