Ejemplo n.º 1
0
        public static void Shop(Player player)
        {
            string choice;

            do
            {
                Console.WriteLine("$$$$$$$", Color.Gold);
                Console.WriteLine($"Welcome to the store, champion, what do you want to buy?", Color.Gold);
                Console.WriteLine($"Your gold: {player.Gold}", Color.Gold);
                Console.WriteLine("1. Weapons\n2. Armor\n3. Potions\n4. Heal for 10 golds\n5. Leave", Color.Gold);
                choice = Console.ReadLine();
                Console.WriteLine("-------", Color.GhostWhite);
                if (choice == "1")
                {
                    Console.WriteLine($"1.{shield2.Name}: {shield2.Cost} gold.\n2.{shield3.Name}: {shield3.Cost} gold.", Color.AliceBlue);
                    Console.WriteLine($"3.{shield4.Name}: {shield4.Cost} gold.\n4.{shield5.Name}: {shield5.Cost} gold.", Color.AliceBlue);
                    Console.WriteLine("-------");
                    Console.WriteLine($"5.{dagger2.Name}: {dagger2.Cost} gold.\n6.{dagger3.Name}: {dagger3.Cost} gold.", Color.BlueViolet);
                    Console.WriteLine($"7.{dagger4.Name}: {dagger4.Cost} gold.\n8.{dagger5.Name}: {dagger5.Cost} gold.", Color.BlueViolet);

                    string buy = Console.ReadLine();
                    if (buy == "1")
                    {
                        Trade(player, shield2);
                    }
                    else if (buy == "2")
                    {
                        Trade(player, shield3);
                    }
                    else if (buy == "3")
                    {
                        Trade(player, shield4);
                    }
                    else if (buy == "4")
                    {
                        Trade(player, shield5);
                    }
                    else if (buy == "5")
                    {
                        Trade(player, dagger2);
                    }
                    else if (buy == "6")
                    {
                        Trade(player, dagger3);
                    }
                    else if (buy == "7")
                    {
                        Trade(player, dagger4);
                    }
                    else if (buy == "8")
                    {
                        Trade(player, dagger5);
                    }
                }
                else if (choice == "2")
                {
                    Console.WriteLine("No armor loool, just spam overheal, dude.", Color.OrangeRed);
                }
                else if (choice == "3")
                {
                    Trade(player);
                }
                else if (choice == "4")
                {
                    if (player.Gold >= 10)
                    {
                        Consumable.Heal(player);
                    }
                    else
                    {
                        Console.WriteLine("You poor shit.", Color.Gold);
                    }
                }
                else if (choice == "5")
                {
                    Console.WriteLine("You leave...");
                }
                Console.WriteLine("-------", Color.GhostWhite);
            } while (choice != "5");
        }