Пример #1
0
 private void timer3_Tick(object sender, EventArgs e)
 {
     Hesperos = Hesperos.AddSeconds(1);
     DefensiveLaunch();
     label9.Text       = DeLaunch.ListLength().ToString();
     checkBox6.Checked = true;
 }
Пример #2
0
        private void timer2_Tick(object sender, EventArgs e)
        {
            Hesperos = Hesperos.AddSeconds(1);
            AttackLaunch();
            double a = DefconCalculating();

            label15.Text      = DefCount.ToString();
            label18.Text      = label14.Text = "АТАКА";
            checkBox4.Checked = checkBox5.Checked = true;
            label8.Text       = AtLaunch.ListLength().ToString();

            if (DefCount >= 4)
            {
                AllTimersShutDown();
                timer4.Start();
            }
        }
Пример #3
0
 private bool HitProbability(Amaranthus List1, Amaranthus List2)
 {
     if ((List1 != null) && (List2 != null))
     {
         for (int i = 0; i < List1.ListLength(); i++)
         {
             double a   = List1.CountedNode(i).Info;
             double at  = a * ((2 * Service.NextDouble()) - 1) + (a + 5);
             double de  = a * ((2 * Service.NextDouble()) - 1) + (a + 5);
             double de1 = a * ((2 * Service.NextDouble()) - 1) + (a + 5);
             if (at > de)
             {
                 if (at > de1)
                 {
                     Hit = true;
                     checkBox8.Checked = true;
                     textBox1.Text    += "\r\n Ракета №" + (i + 1) + " попала в цель! \r\n";
                     Musice2();
                     HitMis++;
                 }
                 else
                 {
                     Hit            = false;
                     textBox1.Text += "\r\n Ракета №" + (i + 1) + " сбита ракетой №" + (i + 2) + "!\r\n";
                     MisMis++;
                 }
             }
             else
             {
                 Hit            = false;
                 textBox1.Text += "\r\n Ракета №" + (i + 1) + " сбита ракетой №" + (i + 1) + "!\r\n";
                 MisMis++;
             }
         }
     }
     return(true);
 }