Beispiel #1
0
        static public bool ChangePlanets(Planet destination, Planet CurrentPlanet)
        {
            bool travelAble = true;

            if (destination == CurrentPlanet)
            {
                Console.WriteLine("You are already there. . . . .\n" +
                                  " . . . . . . . . . . . . . . . \n" +
                                  " . . . . . . . . . . . . . . . \n" +
                                  " . . . . . . . . . . . . . . . \n" +
                                  "What did I do to deserve to be\n" +
                                  "stuck with you . . . . . . . . ");
                Console.ReadKey();
            }
            double distance = Equations.DistanceTo(destination, CurrentPlanet);
            double time     = Equations.TravelTime(distance);
            var    fuelCost = Game.NewShip.fuelPerLightYear * distance;

            if ((Game.NewShip.currentFuel - fuelCost) <= 0)
            {
                if (Game.NewShip.currentFuel == Game.NewShip.maxFuel)
                {
                    Console.WriteLine("Do you not understand the concept of fuel?\n" +
                                      "Or is it the idea of fuel capacity that seems to elude you?\n" +
                                      "It's not like there's a universe of tiny people powering our ship.\n" +
                                      "Upgrade and try again.");
                    Console.ReadKey();
                }
                else
                {
                    Console.WriteLine("Just like your crush left you on read,\n" +
                                      "you've left the tank on empty.\n" +
                                      "Fill it up and try again.\n\n" +
                                      "Loser.");
                    Console.ReadKey();
                }
                travelAble = false;
            }
            else
            {
                bool gameWin = MiniGame.Minigame();
                if (gameWin == true)
                {
                    Game.NewShip.currentFuel -= fuelCost;
                    Game.NewPlayer.age       += time;
                    UpdateMarketPrices(CurrentPlanet);
                }
                else
                {
                    travelAble = false;
                }
            }
            return(travelAble);
        }
Beispiel #2
0
        public static void PlanetTravelFunction(int planetSel, Planet CurrentPlanet)
        {
            Console.SetCursorPosition((Console.WindowWidth - planetTravel[planetSel].name.Length - 18) / 2, 8);

            Console.WriteLine($"<----    {planetTravel[planetSel].name}    ---->");

            Draw.DrawImage(planetTravel[planetSel].imageFile, (Console.WindowWidth / 2), Console.WindowHeight / 5, 45);

            Console.SetCursorPosition(Console.CursorLeft, 14);

            Console.ForegroundColor = ConsoleColor.Green;
            Console.WriteLine("Description: " + planetTravel[planetSel].description);
            Console.WriteLine();
            Console.WriteLine();
            Console.WriteLine();
            Console.WriteLine("Inhabitants: " + planetTravel[planetSel].inhabitants);
            Console.WriteLine();
            Console.WriteLine();
            Console.WriteLine("Travel Distance: " + Equations.DistanceTo(planetTravel[planetSel], CurrentPlanet) + " light years");
            Console.WriteLine();
            Console.WriteLine();
            Console.WriteLine("Travel Time: " + Equations.TravelTime(Equations.DistanceTo(planetTravel[planetSel], CurrentPlanet)) + " years");
            Console.WriteLine();
            Console.WriteLine();
            Console.WriteLine("Fuel Cost: " + (NewShip.fuelPerLightYear * Equations.DistanceTo(planetTravel[planetSel], CurrentPlanet)));
            Console.WriteLine();
            Console.WriteLine();
            Console.WriteLine("Danger Rating: " + planetTravel[planetSel].dangerRating);
            Console.WriteLine();
            Console.WriteLine();
            //if (planetSel == 3)
            //{
            //    Console.WriteLine(planetTravel[4].screamingProduct);
            //}
            //else
            //{
            //    Market displayMarket = planetMarket[planetSel];
            //    double[] displayMarket2 = {displayMarket.air, displayMarket.fur, displayMarket.robot, displayMarket.doors, displayMarket.seeds };

            //    Console.Write("Product Prices: ");

            //    int cursor = Console.CursorTop;
            //    int i = 0;
            //    foreach (var x in displayMarket2)
            //    {
            //        Console.SetCur +;

            PlanetProducePrint(planetSel + 1);
        }