예제 #1
0
        public static void Score(Player player)
        {
            Console.Clear();
            getScoreFactor(player);
            Console.WriteLine("Points for arriving in Oregon");
            Console.WriteLine("{0}  people in {1} health  {2}  ", player.teamSize, player.health, player.peopleScore += player.teamSize * player.peopleFactor * player.scoreFactor);//poor = 200, fair = 400, good = 600
            Console.WriteLine("{0}  wagon                 {1}  ", player.wagon, player.wagonScore                  += player.wagon * 50 * player.scoreFactor);
            Console.WriteLine("{0}  oxen                  {1}  ", player.numberOfOxs, player.oxenScore             += player.numberOfOxs * 4 * player.scoreFactor);
            Console.WriteLine("{0}  spare wagon parts     {1}  ", player.spareParts, player.sparepartScore         += player.spareParts * 2 * player.scoreFactor);
            Console.WriteLine("{0}  sets of clothing      {1}  ", player.setsOfClothing, player.setofclothingScore += player.setsOfClothing * 2 * player.scoreFactor);
            Console.WriteLine("{0} bullets               {1}  ", player.ammo, player.bulletScore       += player.ammo / 100 * 2 * player.scoreFactor);
            Console.WriteLine("{0} pounds of food       {1}  ", player.poundsOfFoods, player.foodScore += (player.poundsOfFoods / 100) * 4 * player.scoreFactor);
            Console.WriteLine("    ${0} cash           {1}  ", player.money, player.cashScore          += (Convert.ToInt32(player.money / 5) * player.scoreFactor));
            Console.WriteLine("");
            player.totalScore = player.peopleScore + player.wagonScore + player.oxenScore + player.sparepartScore + player.setofclothingScore + player.bulletScore + player.foodScore + player.cashScore;
            Console.WriteLine("                 Total:   {0}", player.totalScore);
            if (player.occupation == "farmer")
            {
                Console.WriteLine("For going as a farmer, your");
                Console.WriteLine("points are tripled");
            }

            InputDetection.Spacebar(player);
            player.GameIsOn = false;
        }
예제 #2
0
        public static void ToMuchFood(Player player, Shop shop)
        {
            //This prints out if to much food are bought

            headerWithOutDate();
            Console.WriteLine("");
            Console.WriteLine("          Your wagon may only carry");
            Console.WriteLine("          2000 pounds of food");
            Console.WriteLine("");
            Console.WriteLine("");
            Console.WriteLine("");

            InputDetection.Spacebar(shop);
            HowMuchFood(player, shop);
        }
예제 #3
0
 public static void DifferenceMenu(Player player, Shop shop)
 {
     Console.WriteLine("     Traveling to Oregon isn't easy!");
     Console.WriteLine("     But if you're a banker, you'll");
     Console.WriteLine("     have more money for supplies");
     Console.WriteLine("     and services than a carpenter");
     Console.WriteLine("     or a farmer.");
     Console.WriteLine("");
     Console.WriteLine("     However, harder you have");
     Console.WriteLine("     to try, the more points you");
     Console.WriteLine("     deserve! Therefore, the");
     Console.WriteLine("     farmer earns the greatest");
     Console.WriteLine("     number of points and the");
     Console.WriteLine("     banker earns the least.");
     Console.WriteLine("");
     InputDetection.Spacebar(shop);
     Menus.OccupationMenu(player, shop);
 }
예제 #4
0
        public static void Cycle(Player player, Shop shop, List <Landmarks> listOfLandmarks)//, Program program)
        {
            player.AtFort = false;

            while (player.Traveling)
            {
                if (player.InitLeg)
                {
                    player.theLeg  = listOfLandmarks[player.IndexForLandmarks].DistanceToNextLandmark;
                    player.InitLeg = false;
                }
                else
                {
                    if (player.theLeg <= 0)
                    {
                        if (listOfLandmarks[player.IndexForLandmarks + 1].Name == "Willameete Valley Oregon")
                        {
                            Console.Clear();
                            Console.WriteLine("pic of valley");
                            Console.WriteLine("");
                            Console.WriteLine("");
                            headerWithDate(player);
                            InputDetection.Spacebar(player);

                            Console.Clear();
                            Console.WriteLine("     Congratulations! You have");
                            Console.WriteLine("     made it to Oregon! Let's");
                            Console.WriteLine("     see how many points you have");
                            Console.WriteLine("     recived.");
                            Console.WriteLine("      Willamwette Valley");
                            Console.WriteLine("      September 24, 1848");
                            InputDetection.Spacebar(player);
                            player.Traveling = false;
                            Score(player);
                            break;
                        }
                        player.IndexForLandmarks += 1;
                        var i = listOfLandmarks[player.IndexForLandmarks].DistanceToNextLandmark;
                        player.MilesToNextLandmark = i;
                        player.Landmark            = listOfLandmarks[player.IndexForLandmarks].Name;
                        player.InitLeg             = true;
                        player.ArrivingLanmark     = true;
                        player.LegMiles            = player.MilesToNextLandmark;
                        if (player.greenRiverCrossing)
                        {
                            player.IndexForLandmarks += 2;
                            player.Landmark           = listOfLandmarks[player.IndexForLandmarks].Name;
                            player.greenRiverCrossing = false;
                        }
                        if (player.WillametteValley)
                        {
                        }
                    }
                    else
                    {
                        //calculates miles traveled
                        //player.pace = player.
                        //food consumed
                        player.date           = player.date.AddDays(1);
                        player.poundsOfFoods -= player.teamSize * player.rations;
                        var TempNextLandmark = player.theLeg;

                        var tempMiles = TempNextLandmark - player.pace;
                        if (tempMiles <= 0)
                        {
                            player.MilesTraveled += player.theLeg;
                            player.theLeg         = 0;
                        }
                        else
                        {
                            player.theLeg         = player.theLeg - player.pace;
                            player.MilesTraveled += player.pace;
                        }
                        player.AtLandmark = false;
                    }
                }


                if (player.fortBridger)
                {
                    player.IndexForLandmarks += 1;
                    player.theLeg             = listOfLandmarks[9].Distance;
                    player.fortBridger        = false;
                }

                if (player.fortWallaWalla)
                {
                    //player.IndexForLandmarks += 1;
                    player.theLeg = listOfLandmarks[14].DistanceToNextLandmark;
                    //player.fortWallaWalla = false;
                }
                if (player.theDalles)
                {
                    player.IndexForLandmarks += 1;
                    player.theLeg             = listOfLandmarks[15].DistanceToNextLandmark;
                    player.theDalles          = false;
                }

                if (player.ShowMessage)
                {
                    Message(player, listOfLandmarks);
                }

                if (!player.AtLandmark)
                {
                    Console.WriteLine("  Press ENTER to size up the situation");
                }

                Status(player);
                if (player.LeavingALandmark)
                {
                    if (player.ArrivingLanmark)
                    {
                        InputDetection.YesOrNo(player, shop, listOfLandmarks);
                    }
                    else
                    {
                        InputDetection.SpacebarAndCycle(player, shop, listOfLandmarks);
                        player.LeavingALandmark = false;
                    }
                    if (player.gameMenuInput == "Y")
                    {
                        GameMenu.ShowRiverCrossing(player);
                        GameMenu.PrintGameMenu(player, shop, listOfLandmarks);
                    }
                    if (player.gameMenuInput == "N")
                    {
                        GameMenu.PrintGameMenu(player, shop, listOfLandmarks);
                    }
                    if (player.gameMenuInput == "")
                    {
                        //GameMenu.PrintGameMenu(player, shop, listOfLandmarks);
                    }
                }


                if (!player.AtLandmark)
                {
                    while (Console.KeyAvailable)
                    {
                        if (Console.ReadKey(true).Key == ConsoleKey.Enter)
                        {
                            player.insidecycle = true;
                            PrintGameMenu(player, shop, listOfLandmarks);
                        }
                    }
                    System.Threading.Thread.Sleep(1000);
                }
            }
            player.insidecycle = false;
        }
예제 #5
0
        static void Main(string[] args)
        {
            //INIT



            bool startGame = true;

            while (startGame)
            {
                Program program = new Program();

                Player           player          = new Player();
                Shop             shop            = new Shop();
                List <Landmarks> listOfLandmarks = new List <Landmarks>();
                program.gameon(player, shop, listOfLandmarks);


                var input = 1;
                if (player.debug)
                {
                    player.occupation  = "Farmer";
                    player.scoreFactor = 3;//banker = 1, carpenter = 2, farmer = 3
                    player.money       = 4;
                    player.name1       = "Gunni";
                    player.name2       = "Liney";
                    player.name3       = "Birta";
                    player.name4       = "Victor";
                    player.name5       = "Margret";
                    string   date            = "01-03-1848";
                    DateTime dateOfDeparture = Convert.ToDateTime(date);
                    player.date           = dateOfDeparture;
                    player.numberOfOxs    = 6;
                    player.numberOfYokes  = 3;
                    player.poundsOfFoods  = 140;
                    player.setsOfClothing = 4;
                    player.money          = 500;
                    player.ammo           = 57;
                    player.spareParts     = 6;
                    player.wagonWheel     = 2;
                    player.wagonAxel      = 2;
                    player.wagonTounge    = 2;
                }
                else
                {
                    input = Menus.StartScreenMenu();

                    if (input == 1)
                    {
                        Menus.OccupationMenu(player, shop);
                    }

                    if (input == 1 || input == 2 || input == 3)
                    {
                        Menus.NameMenu(player);
                    }

                    Menus.DateOfDeparture(player);

                    Console.Clear();

                    Store.TheStore(player, shop);
                    //Gameloop
                    InputDetection.Spacebar(shop);
                }

                while (player.GameIsOn)
                {
                    player.Landmark = listOfLandmarks[player.IndexForLandmarks].Name;
                    GameMenu.PrintGameMenu(player, shop, listOfLandmarks);
                }
            }
        }
예제 #6
0
        public static void TheStore(Player player, Shop shop)
        {
            if (!player.debug)
            {
                Console.WriteLine("Before leaving Independence you");
                Console.WriteLine("should buy equipment and");
                Console.WriteLine("supplies.you have $1600.00 in");
                Console.WriteLine("cash, but don't have to");
                Console.WriteLine("spend it all now.");
                Console.WriteLine("");
                InputDetection.Spacebar(shop);
                Console.Clear();

                Console.WriteLine("You can buy whatever you need at");
                Console.WriteLine("Matt's General Store.");
                Console.WriteLine("");
                InputDetection.Spacebar(shop);
                Console.Clear();

                Console.WriteLine("Hello, I'm Matt. So you're going");
                Console.WriteLine("to Oregon!I can fix you up with");
                Console.WriteLine("what you need:");
                Console.WriteLine("");
                Console.WriteLine("-a team of oxen to pull your wagon");
                Console.WriteLine("- clothing for both summer and winter");
                Console.WriteLine("");
                InputDetection.Spacebar(shop);
                Console.Clear();

                Console.WriteLine("Hello, I'm Matt. So you're going");
                Console.WriteLine("to Oregon!I can fix you up with");
                Console.WriteLine("what you need:");
                Console.WriteLine("");
                Console.WriteLine("- plenty of food for the trip");
                Console.WriteLine("- ammunition for your rifles");
                Console.WriteLine("- spare parts for your wagon");
                Console.WriteLine("");
                InputDetection.Spacebar(shop);
                Console.Clear();
            }

            PrintStoreMenu(player, shop);

            if (shop.shopInput == "D1")
            {
                HowManyOxen(player, shop, shop.shopInput);
            }
            if (shop.shopInput == "D2")
            {
                HowMuchFood(player, shop);
            }
            if (shop.shopInput == "D3")
            {
                HowManySetsOfClothes(player, shop, shop.shopInput);
            }
            if (shop.shopInput == "D4")
            {
                HowMuchAmmo(player, shop, shop.shopInput);
            }
            if (shop.shopInput == "D5")
            {
                HowManySpareParts(player, shop, shop.shopInput);
            }
        }
예제 #7
0
 public static void PrintStoreMenu(Player player, Shop shop)
 {
     while (shop.shoping)
     {
         if (shop.shopInput == "" || shop.shopInput == "Spacebar")
         {
             headerWithDate(player);
         }
         if (shop.shopInput == "D1" || shop.shopInput == "D2" || shop.shopInput == "D3" || shop.shopInput == "D4" || shop.shopInput == "D5")
         {
             headerWithOutDate();
         }
         if (shop.shopInput == "D1")
         {
             HowManyOxen(player, shop, shop.shopInput);
             break;
         }
         if (shop.shopInput == "D2")
         {
             HowMuchFood(player, shop);
             break;
         }
         if (shop.shopInput == "D3")
         {
             HowManySetsOfClothes(player, shop, shop.shopInput);
             shop.shopInput = "";
             break;
         }
         if (shop.shopInput == "D4")
         {
             HowMuchAmmo(player, shop, shop.shopInput);
             shop.shopInput = "";
             break;
         }
         if (shop.shopInput == "D5")
         {
             HowManySpareParts(player, shop, shop.shopInput);
             shop.shopInput = "";
             break;
         }
         if (shop.shopInput == "" || shop.shopInput == "Spacebar")
         {
             printBill(shop, shop.billTotal);
         }
         if (shop.shopInput == "")
         {
             AmountYouHave(player);
         }
         if (shop.shopInput == "")
         {
             WichItemToBuy();
         }
         if (shop.shopInput == "")
         {
             DetectIfSpaceBarIsHit(player, shop);
         }
         if (shop.shopInput == "Spacebar" && shop.playersMoney == true)
         {
             DontForgetToBuyOx();
             InputDetection.Spacebar(shop);
         }
         if (shop.shopInput == "Spacebar" && shop.playersMoney == false)
         {
             NotEnoughMoney(player, shop);
             InputDetection.Spacebar(shop);
         }
     }
 }
예제 #8
0
        public static void HowManySpareParts(Player player, Shop shop, string shopInput)
        {
            while (!shop.shopSpareParts)
            {
                if (!shop.wheel)
                {
                    headerWithOutDate();
                    SparePartHeader();
                    if (!shop.ToManySpearParts)
                    {
                        Console.WriteLine("          How many wagon wheels ?");
                        BillSoFar(shop);
                        if (player.debug)
                        {
                            shop.wagonWheel = 1;
                        }
                        else
                        {
                            shop.wagonWheel = int.Parse(Console.ReadLine());
                        }
                    }
                    if (shop.ToManySpearParts)
                    {
                        Console.WriteLine("          Your wagon may only carry 3");
                        Console.WriteLine("          wagon wheels");
                        Console.WriteLine("");
                        InputDetection.Spacebar(shop);
                        shop.wagonWheel       = -1;
                        shop.ToManySpearParts = false;
                    }
                    if (shop.wagonWheel >= 0 && shop.wagonWheel < 4)
                    {
                        shop.wheel            = true;
                        shop.axel             = true;
                        shop.ToManySpearParts = false;
                    }
                    if (shop.wagonWheel > 3)
                    {
                        shop.ToManySpearParts = true;
                    }
                }

                if (shop.axel)
                {
                    headerWithOutDate();
                    SparePartHeader();
                    if (!shop.ToManySpearParts)
                    {
                        Console.WriteLine("          How many wagon axles ?");
                        BillSoFar(shop);
                        shop.wagonAxel = int.Parse(Console.ReadLine());
                    }
                    if (shop.ToManySpearParts)
                    {
                        Console.WriteLine("          Your wagon may only carry 3");
                        Console.WriteLine("          wagon axles.");
                        Console.WriteLine("");
                        InputDetection.Spacebar(shop);
                        shop.wagonWheel       = -1;
                        shop.ToManySpearParts = false;
                    }
                    if (shop.wagonAxel >= 0 && shop.wagonAxel < 4)
                    {
                        shop.axel             = false;
                        shop.tongue           = true;
                        shop.ToManySpearParts = false;
                    }
                    if (shop.wagonAxel > 3)
                    {
                        shop.ToManySpearParts = true;
                    }
                }

                if (shop.tongue)
                {
                    headerWithOutDate();
                    SparePartHeader();
                    if (!shop.ToManySpearParts)
                    {
                        Console.WriteLine("          How many wagon tounge ?");
                        BillSoFar(shop);
                        shop.wagonTounge = int.Parse(Console.ReadLine());
                    }
                    if (shop.ToManySpearParts)
                    {
                        Console.WriteLine("          Your wagon may only carry 3");
                        Console.WriteLine("          wagon tounge.");
                        Console.WriteLine("");
                        InputDetection.Spacebar(shop);
                        shop.wagonTounge      = -1;
                        shop.ToManySpearParts = false;
                    }
                    if (shop.wagonTounge >= 0 && shop.wagonTounge < 4)
                    {
                        shop.tongue           = false;
                        shop.shopSpareParts   = true;
                        shop.ToManySpearParts = false;
                    }
                    if (shop.wagonTounge > 3)
                    {
                        shop.ToManySpearParts = true;
                    }
                }
            }

            shop.spareParts = shop.wagonWheel + shop.wagonAxel + shop.wagonTounge;

            shop.totalSparePartsPrice = shop.spareParts * shop.sparePartsPrice;
            shop.billTotal            = shop.totalSparePartsPrice;

            shop.shopInput = "";
            PrintStoreMenu(player, shop);
        }