Exemplo n.º 1
0
    public void PrintShopList(Enumy pers)
    {
        Enumy Pers = pers;

        Console.WriteLine();
        foreach (string i in ShopList)
        {
            Console.WriteLine(i);
        }
        for (;;)
        {
            switch (ShopMenuResult())
            {
            case -1:
                break;

            case 1:
                if (ByShop(pers, SheildUp))
                {
                    pers.ShildUpUpEnemy();
                    Console.WriteLine("ShieldUp \nкошель: " + Pers.GetKoshel());
                }
                break;

            case 2:
                if (ByShop(pers, StrengUp))
                {
                    pers.StrengUpEnemy();
                    Console.WriteLine("StrengUp \nкошель: " + Pers.GetKoshel());
                }
                break;

            case 3:
                if (ByShop(pers, HillUp))
                {
                    pers.Hill(HillUp);
                    Console.WriteLine("HilldUp \nкошель: " + Pers.GetKoshel());
                }
                break;

            case 0:
                Podgotovka pdgtvk = new Podgotovka();
                pdgtvk.StartMenu(Pers, 0);
                break;

            default:
                Console.WriteLine("What?");
                break;
            }
        }
    }
Exemplo n.º 2
0
    public void battle(Enumy pers, int LvL)
    {
        Console.WriteLine("\nУровень: " + LvL);

        Enumy Enum       = new Enumy(LvL);
        Enumy Pers       = pers;
        Enumy PersReserv = pers;

        if (FirstAttackInizial() == 0)
        {
            Console.WriteLine("Первый - Вы!");
        }
        else
        {
            Console.WriteLine("Первый - ваш опонент");
            Pers.HPDown(Enum.Attack());
        }

        int round = 1;

        foreach (string i in BattleMenuList)
        {
            Console.WriteLine(i);
        }

        do
        {
            Console.WriteLine("Раунд: " + round);
            switch (BattleMenuResult())
            {
            case 1:
                Console.WriteLine("Атака: " + Pers.Attack());
                Enum.HPDown(Enum.Deffend() - Pers.Attack());
                Pers.HPDown(Enum.Attack() - Pers.GetStreng());
                break;

            case 2:
                Console.WriteLine("Защита: " + Pers.Deffend());
                Pers.HPDown(Enum.Attack() - Pers.Deffend());
                Enum.HPDown(Enum.Deffend() - Pers.Attack() / 2);
                break;

            case 3:
                Console.WriteLine("Ничего");
                break;

            default:
                break;
            }
            Console.WriteLine("HP player: " + Pers.GetHP() + "\nEnum HP: " + Enum.GetHP());
            round++;
        }while(Enum.GetHP() > 0 && Pers.GetHP() > 0);

        //result
        if (Pers.GetHP() > 0 && Enum.GetHP() <= 0)
        {
            Console.WriteLine("Winner");
            Pers.TakeMoney(Enum.GetKoshel());
            LvL++;
        }
        else if (Pers.GetHP() < 0 && Enum.GetHP() > 0)
        {
            Console.WriteLine("Loser");
            Console.WriteLine("Прощайте!");
            //Thread.Sleep(1000);
            Environment.Exit(0);
        }
        else
        {
            Console.WriteLine("No Winner!");
            Console.WriteLine("Битва будет происходить по новой!");
            battle(PersReserv, LvL);
        }
        Podgotovka pdgtvk = new Podgotovka();

        pdgtvk.StartMenu(Pers, LvL);
    }