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); }
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); }
public static bool StoryCheck(int wFactor, Planet CurrentPlanet, bool gameFinish) { bool travelAvailable = true; if (NewPlayer.wallet < Actions.UpdateFuelPrice(CurrentPlanet) && NewShip.currentInventory == 0) { travelAvailable = false; foreach (Planet a in Universe.planetTravel) { if ((NewShip.currentFuel - (NewShip.fuelPerLightYear * Equations.DistanceTo(a, CurrentPlanet))) > 0) { travelAvailable = true; } } } else if (NewPlayer.age >= 60) { travelAvailable = false; } if (travelAvailable == false) { TextOutput(story_GameOver, gameEnd: true); gameFinish = false; } if (travelAvailable == true) { if (wFactor >= 1 && NewPlayer.storyTracker == 1) { TextOutput(story_1); NewPlayer.storyTracker++; } else if (wFactor >= 2 && NewPlayer.storyTracker == 2) { TextOutput(story_2); NewPlayer.storyTracker++; } else if (wFactor >= 3 && NewPlayer.storyTracker == 3) { TextOutput(story_3); NewPlayer.storyTracker++; } else if (wFactor >= 4 && NewPlayer.storyTracker == 4) { TextOutput(story_4, 300, true); NewPlayer.storyTracker++; } else if (wFactor >= 5 && NewPlayer.storyTracker == 5) { TextOutput(story_5); NewPlayer.storyTracker++; } else if (wFactor >= 6 && NewPlayer.storyTracker == 6) { TextOutput(story_6); NewPlayer.storyTracker++; } else if (wFactor >= 7 && NewPlayer.storyTracker == 7) { TextOutput(story_7); NewPlayer.storyTracker++; } else if (wFactor >= 8 && NewPlayer.storyTracker == 8) { TextOutput(story_8); NewPlayer.storyTracker++; } else if (wFactor >= 9 && NewPlayer.storyTracker == 9) { TextOutput(story_9); TextOutput(story_glitch, 0); TextOutput(story_ending); gameFinish = true; } } return(gameFinish); }