Example #1
0
 public void Bolezn(ref Resyrs tmp)
 {
     int die = rand.Next(tmp.hobit - (tmp.medic * 5));
     tmp.hobit -= die;
     Console.WriteLine("\n\n\n\t\t Осторожно!!!! В городе вспалахнула епидемия гриппа и умирают люди!!!! Примите какие-то меры!!!");
     Console.ReadLine();
 }
Example #2
0
 public void Print(int cursor, Resyrs tmp)
 {
     Console.Clear();
     Console.WriteLine("\t\t Приветствуем в игре \"ЧТО ПОПАЛО\"");
     tmp.Show();
     if (cursor >= 5)
     {
         cursor = (cursor % 5);
     }
     else
     if (cursor < 0)
     {
         cursor = (cursor % 5) + 5;
     }
     for (int i = 0; i < 5; i++)
     {
         if (cursor == i)
         {
             Console.WriteLine("=> " + menu[i]);
         }
         else
         {
             Console.WriteLine("  " + menu[i]);
         }
     }
 }
Example #3
0
        public void Bolezn(ref Resyrs tmp)
        {
            int die = rand.Next(tmp.hobit - (tmp.medic * 5));

            tmp.hobit -= die;
            Console.WriteLine("\n\n\n\t\t Осторожно!!!! В городе вспалахнула епидемия гриппа и умирают люди!!!! Примите какие-то меры!!!");
            Console.ReadLine();
        }
Example #4
0
 public void Golod(ref Resyrs tmp)
 {
     tmp.point -= 25;
     if (tmp.point < 100)
     {
         Bolezn(ref tmp);
         Console.WriteLine("\n\n\n\t\t Осторожно!!!! В городе голодомор!!!! Примите какие-то меры!!!");
         Console.ReadLine();
     }
 }
Example #5
0
        public void Year(ref Resyrs tmp)
        {
            int p = -1;

            Math.Pow(p, rand.Next(10));
            tmp.hobit -= (p * rand.Next(Convert.ToInt32(tmp.hobit * 0.1)));
            tmp.point += tmp.hobit * 2;
            Console.WriteLine(" В связи с окончением года произошли демографические изменения в жителях");
            Console.ReadLine();
        }
Example #6
0
 public void Golod(ref Resyrs tmp)
 {
     tmp.point -= 25;
     if (tmp.point < 100)
     {
         Bolezn(ref tmp);
         Console.WriteLine("\n\n\n\t\t Осторожно!!!! В городе голодомор!!!! Примите какие-то меры!!!");
         Console.ReadLine();
     }
 }
Example #7
0
 public void Debosh(ref Resyrs tmp)
 {
     if (tmp.hobit / 20 > tmp.security)
     {
         tmp.hobit -= rand.Next(tmp.hobit - 20 * tmp.security);
         Console.WriteLine("\n\n\n\t\t Осторожно!!!! В городе массовые безпорядки!!!! Примите какие-то меры!!!");
         Console.ReadLine();
     }
     else
         Console.WriteLine("\n\n\n\t\t  Было остановлено дебоши");
 }
Example #8
0
 public void GetDamba(ref Resyrs tmp)
 {
     if (tmp.point > 1000)
     {
         tmp.point -= 1000;
         tmp.damba += 100;
     }
     else
     {
         Console.WriteLine(" \n\n\n\t\t У тебя не достаточно денег");
     }
 }
Example #9
0
 public void TurnHome(ref Resyrs tmp)
 {
     if (tmp.point > 100)
     {
         tmp.point -= 100;
         tmp.home  += 1;
         tmp.hobit += 20;
     }
     else
     {
         Console.WriteLine(" У тебя не достаточно денег");
     }
 }
Example #10
0
 public void GetMedic(ref Resyrs tmp)
 {
     if (tmp.point > 100 && tmp.hobit > 20)
     {
         tmp.point -= 100;
         tmp.medic += 20;
         tmp.hobit -= 20;
     }
     else
     {
         Console.WriteLine(" \n\n\n\t\t У тебя не достаточно людей");
     }
 }
Example #11
0
 public void TurnScurity(ref Resyrs tmp)
 {
     if (tmp.point > 100 && tmp.hobit > 20)
     {
         tmp.point    -= 100;
         tmp.security += 20;
         tmp.hobit    -= 20;
     }
     else
     {
         Console.WriteLine(" \n\n\n\t\tУ тебя не достаточно людей");
     }
 }
Example #12
0
 public void Debosh(ref Resyrs tmp)
 {
     if (tmp.hobit / 20 > tmp.security)
     {
         tmp.hobit -= rand.Next(tmp.hobit - 20 * tmp.security);
         Console.WriteLine("\n\n\n\t\t Осторожно!!!! В городе массовые безпорядки!!!! Примите какие-то меры!!!");
         Console.ReadLine();
     }
     else
     {
         Console.WriteLine("\n\n\n\t\t  Было остановлено дебоши");
     }
 }
Example #13
0
 public void Napast(ref Resyrs tmp)
 {
     if (tmp.point > 1000 && tmp.security > 700)
     {
         tmp.point    += rand.Next(500, 10000) - 1000;
         tmp.security -= rand.Next(400);
         tmp.medic    -= rand.Next(150);
     }
     else
     {
         Console.WriteLine(" \n\n\n\t\t У тебя не достаточно или денег или воинов");
         Console.ReadLine();
     }
 }
Example #14
0
        public void Procent(ref Resyrs tmp)
        {
            switch (rand.Next(0, 5))
            {
            case 0:
            {
                if (rand.Next(10) <= 5)
                {
                    Navod(ref tmp);
                }
            }
            break;

            case 1:
            {
                if (rand.Next(50) <= 10)
                {
                    Ataka(ref tmp);
                }
            }
            break;

            case 2:
            {
                if (rand.Next(50) <= 10)
                {
                    Bolezn(ref tmp);
                }
            }
            break;

            case 3:
            {
                if (rand.Next(50) <= 10)
                {
                    Golod(ref tmp);
                }
            }
            break;

            case 4:
            {
                if (rand.Next(100) <= 10)
                {
                    Debosh(ref tmp);
                }
            }
            break;
            }
        }
Example #15
0
 public void Navod(ref Resyrs tmp)
 {
     if(tmp.hobit-tmp.damba>0)
     {
     int dom = rand.Next(tmp.home / rand.Next(tmp.home));
     tmp.home -= dom;
     tmp.hobit -= dom * 20;
     Console.WriteLine("\n\n\n\t\t Осторожно!!!! Произошло наводнение!!!! Примите какие-то меры!!!");
     Console.ReadLine();
     }
     else
         Console.WriteLine("\n\n\n\t\t  Произошло наводнение!!!! Но дамба спасла");
     Console.ReadLine();
 }
Example #16
0
        public void Ataka(ref Resyrs tmp)
        {
            int vrag = rand.Next(600);

            if ((tmp.security -= vrag) < 0)
            {
                tmp.hobit += tmp.security;
                tmp.home += (tmp.security / 20);
                tmp.security = 0;
                Console.WriteLine("\n\n\n\t\t Осторожно!!!! Произошла атака монстров!!!! Примите какие-то меры!!!");
                Console.ReadLine();
            }
            else
                Console.WriteLine("\n\n\n\t\t  Была отбита атака монстров!!!! ");
            Console.ReadLine();
        }
Example #17
0
 public void Navod(ref Resyrs tmp)
 {
     if (tmp.hobit - tmp.damba > 0)
     {
         int dom = rand.Next(tmp.home / rand.Next(tmp.home));
         tmp.home  -= dom;
         tmp.hobit -= dom * 20;
         Console.WriteLine("\n\n\n\t\t Осторожно!!!! Произошло наводнение!!!! Примите какие-то меры!!!");
         Console.ReadLine();
     }
     else
     {
         Console.WriteLine("\n\n\n\t\t  Произошло наводнение!!!! Но дамба спасла");
     }
     Console.ReadLine();
 }
Example #18
0
        public void Ataka(ref Resyrs tmp)
        {
            int vrag = rand.Next(600);

            if ((tmp.security -= vrag) < 0)
            {
                tmp.hobit   += tmp.security;
                tmp.home    += (tmp.security / 20);
                tmp.security = 0;
                Console.WriteLine("\n\n\n\t\t Осторожно!!!! Произошла атака монстров!!!! Примите какие-то меры!!!");
                Console.ReadLine();
            }
            else
            {
                Console.WriteLine("\n\n\n\t\t  Была отбита атака монстров!!!! ");
            }
            Console.ReadLine();
        }
Example #19
0
        public void Procent(ref Resyrs tmp)
        {
            switch(rand.Next(0,5))
            {
            case 0:
               {
                 if(rand.Next(10)<=5)
                    Navod(ref tmp);
                }
            break;
            case 1:
            {
                if (rand.Next(50) <= 10)
                    Ataka(ref tmp);
            }
            break;
            case 2:
            {
                if (rand.Next(50) <= 10)
                    Bolezn(ref tmp);
            }
            break;
            case 3:
            {
                if (rand.Next(50) <= 10)
                    Golod(ref tmp);
            }
            break;
            case 4:
            {
                if (rand.Next(100) <= 10)
                    Debosh(ref tmp);
            }
            break;

            }
        }
Example #20
0
 public void Year(ref Resyrs tmp)
 {
     int p = -1;
     Math.Pow(p, rand.Next(10));
     tmp.hobit -= (p * rand.Next(Convert.ToInt32(tmp.hobit * 0.1)));
     tmp.point+=tmp.hobit*2;
     Console.WriteLine(" В связи с окончением года произошли демографические изменения в жителях");
     Console.ReadLine();
 }
Example #21
0
        static void Main(string[] args)
        {
            ConsoleKeyInfo klava;
            Resyrs         tmp    = new Resyrs();
            Action         move   = new Action();
            Events         doit   = new Events();
            int            cursor = 0;

            move.Print(cursor, tmp);



            do
            {
                klava = Console.ReadKey(true);
                if (klava.Key == ConsoleKey.UpArrow)
                {
                    cursor--;
                    move.Print(cursor, tmp);
                }
                if (klava.Key == ConsoleKey.DownArrow)
                {
                    cursor++;
                    move.Print(cursor, tmp);
                }
                if (klava.Key == ConsoleKey.Enter)
                {
                    doit.Procent(ref tmp);
                    tmp.day++;
                    if (cursor >= 5)
                    {
                        cursor = (cursor % 5);
                    }
                    else
                    if (cursor < 0)
                    {
                        cursor = (cursor % 5) + 5;
                    }
                    switch (cursor)
                    {
                    case 0:
                        move.TurnScurity(ref tmp);
                        break;

                    case 1:
                        move.GetDamba(ref tmp);
                        break;

                    case 2:
                        move.TurnHome(ref tmp);
                        break;

                    case 3:
                        move.Napast(ref tmp);
                        break;

                    case 4:
                        move.GetMedic(ref tmp);
                        break;
                    }
                    if (tmp.day >= 12)
                    {
                        tmp.day = 0;
                        doit.Year(ref tmp);
                    }
                    move.Print(cursor, tmp);
                    Console.WriteLine("\n\n Твой ход");
                }
            }while(klava.Key != ConsoleKey.Escape);



            //Console.ReadLine();

//        if (klava.Key==ConsoleKey.UpArrow)
//{
//Console.WriteLine("upppppppp");
//}
        }
Example #22
0
        static void Main(string[] args)
        {
            ConsoleKeyInfo klava;
              Resyrs tmp = new Resyrs();
              Action move=new Action();
              Events doit = new Events();
              int cursor=0;
              move.Print(cursor, tmp);

             do
            {
            klava = Console.ReadKey(true);
            if(klava.Key==ConsoleKey.UpArrow)
                {
                    cursor--;
                    move.Print(cursor,tmp);
                }
            if(klava.Key==ConsoleKey.DownArrow)
            {
                cursor++;
                move.Print(cursor, tmp);
            }
            if (klava.Key == ConsoleKey.Enter)
            {
                doit.Procent(ref tmp);
                tmp.day++;
                if (cursor >= 5)
                    cursor = (cursor % 5);
                else
                    if (cursor < 0)
                        cursor = (cursor % 5) + 5;
                switch (cursor)
                {
                    case 0:
                        move.TurnScurity(ref tmp);
                    break;
                    case 1:
                        move.GetDamba(ref tmp);
                    break;
                    case 2:
                        move.TurnHome(ref tmp);
                    break;
                    case 3:
                        move.Napast(ref tmp);
                    break;
                    case 4:
                        move.GetMedic(ref tmp);
                    break;
                }
            if(tmp.day>=12)
                {
                    tmp.day=0;
                    doit.Year(ref tmp);
                }
            move.Print(cursor, tmp);
            Console.WriteLine("\n\n Твой ход");
            }
            }while(klava.Key!=ConsoleKey.Escape);

            //Console.ReadLine();

            //        if (klava.Key==ConsoleKey.UpArrow)
            //{
            //Console.WriteLine("upppppppp");
            //}
        }