Пример #1
0
        public List <(MarketResources, int)> MarketGenerate(Characters self) //adjusts for distance inflation!
        {
            //Planet none = new Planet();
            MarketResources        market   = new MarketResources();
            List <MarketResources> allItems = market.Resources();

            Formulas form = new Formulas();


            //List<MarketResources> allItems = Resources();
            Random numbers   = new Random();
            var    inventory = new List <(MarketResources, int)> {
            };
            MarketResources itemsSelect;
            int             quantity;

            for (int i = 0; i < allItems.Count; i++)
            {
                itemsSelect = allItems[i];

                quantity          = numbers.Next(200, 2000);
                itemsSelect.Price = form.ItemValue(self, itemsSelect);
                inventory.Add((itemsSelect, quantity));
            }


            return(inventory);
        }
Пример #2
0
        public void Run()
        {
            Dialogue dialogue   = new Dialogue();
            Planet   planet     = new Planet();
            var      planetList = planet.PlanetSystem();

            MarketResources MarsBars        = new MarketResources(planetList[0], "Mars Bars", 250);
            MarketResources SunScreen       = new MarketResources(planetList[0], "Sun Screen", 1); /// TODO: 42 sold on earth will give $500,000
            MarketResources MoonPies        = new MarketResources(planetList[1], "Moon Pies", 200);
            MarketResources Honey           = new MarketResources(planetList[2], "Honey [sourced by local Proxima Bees]", 500);
            MarketResources Kryptonite      = new MarketResources(planetList[3], "Kryptonite", 15000);
            MarketResources Widgets         = new MarketResources(planetList[4], "Widget", 800);
            MarketResources BugSpray        = new MarketResources(planetList[5], "Bug Spray by K", 486);
            MarketResources ZombieRepellent = new MarketResources(planetList[6], "Zombie Repellent", 7200);

            (MarketResources resource, int quantity)[] inventory =
Пример #3
0
        public void TravelPlanetPrompt(Characters self, Planet toPlanet)
        {
            Formulas form             = new Formulas();
            double   distanceToPlanet = form.Dist2Points(self.location.PlanetCoordinate, toPlanet.PlanetCoordinate);

            Console.ForegroundColor = ConsoleColor.Red;
            Console.WriteLine($"Your max speed is {form.WarpSpeed(self.mySpaceShip.engines.speed)}");
            Console.Write($"Please enter a speed between zero and {self.mySpaceShip.engines.speed}: ");
            bool isValidSpeed = double.TryParse(Console.ReadLine(), out double selectedSpeed);

            if (isValidSpeed && selectedSpeed > 0 && selectedSpeed <= self.mySpaceShip.engines.speed)
            {
                Console.WriteLine($"Your trip to {toPlanet.PlanetName} will take approximately {form.TravelTime(selectedSpeed, distanceToPlanet)} years\nDo you accept?");
                Console.ForegroundColor = ConsoleColor.Blue;
                Console.Write("\n[Janet] Press 'Y' for yes or 'N'....please pick yes: ");
                ConsoleKeyInfo option = new ConsoleKeyInfo();
                bool           valid  = true;
                Movement       game   = new Movement();

                while (valid)
                {
                    Console.ForegroundColor = ConsoleColor.White;
                    option = Console.ReadKey();
                    switch (option.Key)
                    {
                    case ConsoleKey.Y:
                        self.location = toPlanet;
                        game.MovementMain(self, distanceToPlanet, selectedSpeed);
                        MarketResources item = new MarketResources();
                        item.MarketGenerate(self);
                        valid = false;
                        break;

                    case ConsoleKey.N:
                        Console.Clear();
                        TravelMenu(self);
                        break;

                    default:
                        Console.WriteLine("Invalid input!");
                        break;
                    }
                }
            }
        }
Пример #4
0
        public List <MarketResources> Resources()
        {
            Planet planet     = new Planet();
            var    planetList = planet.PlanetSystem();

            MarketResources MarsBars        = new MarketResources(planetList[0], "Mars Bars", 250);
            MarketResources SunScreen       = new MarketResources(planetList[0], "Sun Screen", 1); /// TODO: 42 sold on earth will give $500,000
            MarketResources MoonPies        = new MarketResources(planetList[1], "Moon Pies", 200);
            MarketResources Honey           = new MarketResources(planetList[2], "Honey [sourced by local Proxima Bees]", 500);
            MarketResources Kryptonite      = new MarketResources(planetList[3], "Kryptonite", 15000);
            MarketResources Widgets         = new MarketResources(planetList[4], "Widget", 800);
            MarketResources BugSpray        = new MarketResources(planetList[5], "Bug Spray by K", 486);
            MarketResources ZombieRepellent = new MarketResources(planetList[6], "Zombie Repellent", 7200);

            List <MarketResources> Inventory = new List <MarketResources>()
            {
                MarsBars, SunScreen, MoonPies, Honey, Kryptonite, Widgets, BugSpray, ZombieRepellent
            };

            return(Inventory);
        }
Пример #5
0
        public void MainMenu(Characters self)
        {
            Planet locale = new Planet();

            Console.Clear();
            Console.SetCursorPosition(Console.LargestWindowWidth / 3, 0);
            Console.WriteLine($"You are {self.Age} years old at the planet {self.location.PlanetName}");

            Console.SetCursorPosition(Console.LargestWindowWidth / 3, 2);
            Console.WriteLine($"You've got about {self.mySpaceShip.fuel.weight / 100}  LY of fuel.");

            Console.SetCursorPosition(Console.LargestWindowWidth / 3, 4);
            Console.WriteLine("T- Travel S-Trade M-ShipShop");

            while (true)
            {
                ConsoleKeyInfo keyInfo;
                if (Console.KeyAvailable)
                {
                    keyInfo = Console.ReadKey(true);
                    switch (keyInfo.Key)
                    {
                    case ConsoleKey.T:
                        Console.Clear();
                        Console.ForegroundColor = ConsoleColor.Red;
                        Console.WriteLine("\t\tYou have chosen to travel");
                        Thread.Sleep(2000);
                        Console.WriteLine("\t\t\n\nIt's a dangerous business, Frodo, going out your door. You step onto the road, and if you don't keep your feet, there's no knowing where you might be swept off to");
                        Thread.Sleep(4000);
                        Console.ForegroundColor = ConsoleColor.Blue;
                        Console.WriteLine("\t\t\n[Janet] I just love when you quote JRR Tolkien");
                        Thread.Sleep(2000);
                        Console.ForegroundColor = ConsoleColor.Red;
                        Console.WriteLine("\t\t\n You say that EVERYTIME.");
                        Thread.Sleep(2000);
                        Console.ForegroundColor = ConsoleColor.Blue;
                        Console.WriteLine("\t\t\n[Janet] I know");
                        Thread.Sleep(2000);
                        Console.WriteLine("\t\t\n...but you should have written the program better.");
                        Thread.Sleep(5000);
                        Console.Clear();
                        TravelMenu(self);
                        break;

                    case ConsoleKey.S:
                        Console.Clear();
                        Console.ForegroundColor = ConsoleColor.Red;
                        Console.WriteLine("trade");
                        MarketPlace     marketPlace = new MarketPlace();
                        MarketResources thing       = new MarketResources();
                        var             list        = thing.MarketGenerate(self);
                        marketPlace.InTheMarketPlace(self, list);
                        break;

                    case ConsoleKey.M:
                        Console.Clear();
                        Console.WriteLine("Welcome to the ShipShop!");
                        MoonMarket shipshop = new MoonMarket();
                        shipshop.moonMarketMenu(self);
                        break;
                    }
                }
            }
        }