예제 #1
0
        static void Main(string[] args)
        {
            string main = "";

            Console.WriteLine("Hello, unfortunately you ended up in the wrong place and consciousness.");
            Console.WriteLine("What is your name?");
            Human pers = new Human(Console.ReadLine());

            Human.Info(main);
            Console.WriteLine("Do you want to add some money for good start :D? Yes(1)/No(0)");
            if (Human.CheckInput() == 1)
            {
                bool checkMoney = Int32.TryParse(Console.ReadLine(), out int cheat);
                while (!checkMoney)
                {
                    Console.WriteLine("Wrong input, please try again.");
                    checkMoney = Int32.TryParse(Console.ReadLine(), out cheat);
                }
                pers.Money = cheat;
            }
            while (true)
            {
                pers.CheckDays();
                pers.IsAlive();
                pers.Info();
                int i = Human.Menu();
                switch (i)
                {
                case 1: pers.FillingHP(Human.CheckInput()); break;

                case 2: pers.AddHappiness(Human.CheckInput()); break;

                case 3: pers.FillingFulness(Human.CheckInput()); break;

                case 4:
                {
                    switch (Human.CheckInput())
                    {
                    case 1:
                    {
                        Console.WriteLine("Enter amount of begging: ");
                        pers.MoneyMake(Human.CheckInput());
                    }
                    break;

                    case 2: pers.MoneyMake(); break;

                    case 3: pers.BottlesToMoney(); break;

                    default: Console.WriteLine("At that period of time you can't make money by anoter way.."); break;
                    }
                }
                break;

                case 5:
                {
                    pers.FindingBottles(Human.CheckInput());
                }
                break;

                case 6:
                {
                    if (pers.CheckClothes())
                    {
                        Console.WriteLine("Please choose the game and input the sum of bet.");
                        pers.Casino(Human.CheckInput());
                    }
                }
                break;

                case 7:
                {
                    switch (Human.CheckInput())
                    {
                    case 1:
                    {
                        Console.WriteLine("Buying clothes:" +
                                          "\n1.Shirt(100 mon.)" +
                                          "\n2.Fashionable pents(150 mon.)" +
                                          "\n3.New boots(200 mon.)" +
                                          "\n4.Buy it all (500 mon.)" +
                                          "\n0.Exit");
                    }
                        pers.ShoppingClothes(Human.CheckInput());
                        break;

                    case 2:
                    {
                        for (int j = 0; j < 3; j++)
                        {
                            Console.WriteLine(pers[j] + "\n");
                        }
                    }
                    break;

                    default: Console.WriteLine("Wrong input."); break;
                    }
                }
                break;
                }
            }
        }
예제 #2
0
        public void Casino(byte n)
        {
            Random rnd = new Random();

            switch (n)
            {
            // CoinFlip
            case 1:
            {
                CasinoInfo(true);
                Console.WriteLine("Please, enter side of your side of coin: 0 - observe, 1 - reverse");
                bool checkSide = Int32.TryParse(Console.ReadLine(), out int side);
                while (!checkSide && (side != 0 || side != 1))
                {
                    Console.WriteLine("Haha, you are really hope that you can beat the casino!");
                    checkSide = Int32.TryParse(Console.ReadLine(), out side);
                }
                Console.WriteLine("Please, enter an amount bet.");
                bool checkBet = Int32.TryParse(Console.ReadLine(), out int bet);
                while (!checkBet)
                {
                    Console.WriteLine("Haha, you are really hope that you can beat the casino!");
                    checkBet = Int32.TryParse(Console.ReadLine(), out bet);
                }
                if (side == rnd.Next(0, 1))
                {
                    Console.WriteLine("Congratulations! You won a bet in the coinflip, definetly you should play again!");
                    bet        *= 2;
                    this.money += bet;
                }
                else
                {
                    this.money -= bet;
                    Console.WriteLine("Nothing terrible happened, you can try to win again!");
                }
            }
            break;

            // Jackpot
            case 2:
            {
                CasinoInfo(false);
                Console.WriteLine("Please, choose the type of room (Easy/1), (Middle/2), (Hard/3)");
                byte type = Human.CheckInput();
                Console.WriteLine("Please, enter an amount of bet.");
                bool checkBet = Int32.TryParse(Console.ReadLine(), out int bet);
                while (!checkBet)
                {
                    Console.WriteLine("Haha, you are really hope that you can beat the casino!");
                    checkBet = Int32.TryParse(Console.ReadLine(), out bet);
                }
                if (!Jackpot(type, bet))
                {
                    this.money -= bet;
                    Console.WriteLine("The main thing is that we are all safe and healthy. Others unnecessary!");
                }
            }
            break;

            case 0: break;

            default: Console.WriteLine("You try to find any other game but isn't find anything."); break;
            }
        }