public static void NamekM()
        {
            if (Console.CursorLeft == 93 && Console.CursorTop == 20)
            {
                Console.Clear();
                Console.WriteLine("This trip will cost $1200. Have fun!");
                Console.ReadKey();
                if (Stats.EMoney >= 1200)
                {
                    Stats.EMoney -= 1200;
                    Stats.age    += 1;
                    Console.Clear();
                    Display.UniverseMap(51, 28);
                }
                else if (Stats.EMoney < 1200)
                {
                    Console.Clear();
                    Console.WriteLine("You're broke.");
                    Console.ReadKey();
                    Console.Clear();
                    Namek namek = new Namek(93, 20);
                }
            }
            else if (Console.CursorLeft == 58 && Console.CursorTop == 14)
            {
                Stats.BuyStore();
                Namek namek = new Namek(58, 14);
            }
            else if (Console.CursorLeft == 62 && Console.CursorTop == 14)
            {
                Stats.SellStore();
                Namek namek = new Namek(62, 14);
            }
            else if (Console.CursorLeft == 62 && Console.CursorTop == 20)
            {
                Stats.SellStore();

                Namek namek = new Namek(62, 20);
            }
            else if (Console.CursorLeft == 58 && Console.CursorTop == 20)
            {
                Stats.BuyStore();

                Namek namek = new Namek(58, 20);
            }
            else if (Console.CursorLeft == 51 && Console.CursorTop == 17)
            {
                Console.Clear();
                Console.Write("You entered one of Frieza's hut.. Raccoon has spotted you and strucked a pose.\n You died from intense arrousal");
                Console.ReadKey();
                Environment.Exit(0);
            }
            else if (Console.CursorLeft == 69 && Console.CursorTop == 17)
            {
                Stats.SellStore(100, 600, 200, 1000);
                Namek namek = new Namek(69, 17);
            }
            else if (Console.CursorLeft == 114 && Console.CursorTop == 17)
            {
                Stats.SellStore(600, 100, 1000, 200);

                Namek namek = new Namek(114, 17);
            }
            else if (Console.CursorLeft == 132 && Console.CursorTop == 17)
            {
                Stats.BuyStore(100, 100, 100, 100);
                Namek namek = new Namek(132, 17);
            }
            else if (Console.CursorLeft == 121 && Console.CursorTop == 14)
            {
                Stats.BuyStore(300, 200, 600, 400);
                Namek namek = new Namek(121, 14);
            }
            else if (Console.CursorLeft == 121 && Console.CursorTop == 20)
            {
                Console.Clear();
                Console.Write("You entered one of Friez's huts.\nCaptian Ginyu has spotted you and blew you up..");
                Environment.Exit(0);
            }
            else if (Console.CursorLeft == 125 && Console.CursorTop == 14)
            {
                Console.Clear();
                Console.WriteLine("You walked into a 'store' and got robbed..\nAll your money and stones were taken.");
                Console.ReadKey();
                Stats.EMoney -= Stats.EMoney;
                if (Stats.diamond >= 1)
                {
                    Stats.diamond -= Stats.diamond;
                }
                if (Stats.jade >= 1)
                {
                    Stats.jade -= Stats.jade;
                }
                if (Stats.crystal >= 1)
                {
                    Stats.crystal -= Stats.crystal;
                }
                if (Stats.ruby >= 1)
                {
                    Stats.ruby -= Stats.ruby;
                }
                Console.Clear();
                Namek namek = new Namek(125, 14);
            }
            else if (Console.CursorLeft == 125 && Console.CursorTop == 20)
            {
                Console.Clear();
                if (t4 < 1)
                {
                    Console.WriteLine("This store is being runned by Frieza's goons...\nTry not to stand out.");
                    Console.WriteLine("You found $2000..");
                    Stats.EMoney += 2000;
                    t4++;
                }
                else if (t4 >= 1)
                {
                    Console.WriteLine("This store is being runned by Frieza's goons...\nTry not to stand out.");
                }
                Console.ReadKey();
                Console.Clear();
                Namek namek = new Namek(125, 20);
            }
            else if (Console.CursorLeft == 93 && Console.CursorTop == 14 || Console.CursorLeft == 92 && Console.CursorTop == 14 || Console.CursorLeft == 91 && Console.CursorTop == 14)
            {
                Console.Clear();
                Console.Write("You were caught in Frieza's ship and hit with a lazer.\n\n YOU DIED!!");
                Console.ReadKey();
                Environment.Exit(0);
            }
            else if (Console.CursorLeft == 93 && Console.CursorTop == 15 || Console.CursorLeft == 92 && Console.CursorTop == 15 || Console.CursorLeft == 91 && Console.CursorTop == 15)
            {
                if (t5 < 1)
                {
                    Console.Clear();
                    Console.Write("You obtained a dragon ball. This item is priceless.\n\nBy the way this is Frieza's ship be careful...");
                    Stats.dragonball += 1;
                    t5++;
                }
                else if (t5 >= 1)
                {
                    return;
                }
                Console.ReadKey();
                Console.Clear();
                Namek namek = new Namek(93, 16);
            }
            else if (Console.CursorLeft == 89 && Console.CursorTop == 20 || Console.CursorLeft == 96 && Console.CursorTop == 13)
            {
                Console.Clear();
                Console.Write("You were hit by a random Special Beam Cannon. \n\nCONGRATS BUD...");
                using (StreamReader sr = new StreamReader(@"C:\Users\Luis Saenz\source\repos\Class Project\Space_Adventure\SpaceAdventure\Example.txt"))
                {
                    // Read the stream to a string, and write the string to the console.
                    String line = sr.ReadToEnd();
                    Console.WriteLine(line);
                }
                Console.ReadKey();
                Environment.Exit(0);
            }
            else if (Console.CursorLeft == 60 && Console.CursorTop == 18)
            {
                Console.Clear();
                Console.Write("YOU TELEPORTED, WOAH!!!");
                Console.ReadKey();
                Console.Clear();
                Namek namek = new Namek(123, 18);
            }
            else if (Console.CursorLeft == 123 && Console.CursorTop == 18)
            {
                Console.Clear();
                Console.Write("YOU TELEPORTED, WOAH!!!");
                Console.ReadKey();
                Console.Clear();
                Namek namek = new Namek(60, 18);
            }
        }
예제 #2
0
        public static void UniverseMap(int x = 81, int y = 20)
        {
            Screen();
            // Print random stars as background
            Random rnd = new Random();

            for (int i = Sx1 + 1; i < Sx2; i += 5)
            {
                for (int j = Sy1 + 1; j < Sy2; j += 5)
                {
                    Cursor.WriteAt("*", rnd.Next(i, i + 5), rnd.Next(j, j + 5));
                }
            }

            // Print Planets
            var PlanetLocation = new List <(string color, (int x, int y) coord)> {
                ("Blue", (80, 20)), ("Red", (40, 10)),
                ("Cyan", (50, 28)), ("Green", (120, 10)), ("Magenta", (110, 25))
            };

            foreach (var item in PlanetLocation)
            {
                Console.ForegroundColor = (ConsoleColor)Enum.Parse(typeof(ConsoleColor), item.color);
                Cursor.WriteAt("*", item.coord.x, item.coord.y);
            }
            Console.ResetColor();

            // Print Spaceship
            Console.SetCursorPosition(x, y);
            Console.ForegroundColor = ConsoleColor.White;
            Console.OutputEncoding  = Encoding.Unicode;
            Console.WriteLine((char)0x25B2);
            Console.ResetColor();

            Stats stats = new Stats(42, 37);

            Console.SetCursorPosition(51, 38);
            Console.ForegroundColor = ConsoleColor.Red;
            Console.WriteLine("Planets include: earth | vegeta | alphac | namek | yardrat");
            Console.ResetColor();
            Console.SetCursorPosition(61, 39);
            Console.Write("What Planet would you like to go to? ");
            string choice = Console.ReadLine();

            switch (choice)
            {
            case "earth":
                Console.Clear();
                Stats.age += 8;
                if (Stats.age < 65)
                {
                    Earth earth = new Earth();
                }
                else if (Stats.age >= 65)
                {
                    Console.WriteLine("You have reached Death..");
                    Environment.Exit(0);
                }
                break;

            case "vegeta":
                Console.Clear();
                Stats.age += 8;
                if (Stats.age < 65)
                {
                    Vegeta vegeta = new Vegeta();
                }
                else if (Stats.age >= 65)
                {
                    Console.WriteLine("You have reached Death..");
                    Environment.Exit(0);
                }
                break;

            case "alphac":
                Console.Clear();
                Stats.age += 8;
                if (Stats.age < 65)
                {
                    AlphaC alphac = new AlphaC();
                }
                else if (Stats.age >= 65)
                {
                    Console.WriteLine("You have reached Death..");
                    Environment.Exit(0);
                }
                break;

            case "namek":
                Console.Clear();
                Stats.age += 8;
                if (Stats.age < 65)
                {
                    Namek namek = new Namek();
                }
                else if (Stats.age >= 65)
                {
                    Console.WriteLine("You have reached Death..");
                    Environment.Exit(0);
                }
                break;

            case "yardrat":
                Console.Clear();
                Stats.age += 8;
                if (Stats.age < 65)
                {
                    Yardrat yardrat = new Yardrat();
                }
                else if (Stats.age >= 65)
                {
                    Console.WriteLine("You have reached Death..");
                    Environment.Exit(0);
                }
                break;

            default:
                Console.Clear();
                Console.WriteLine("You didn't spell the planet correctly try again..");
                UniverseMap();
                break;
            }
        }