public void BattleAuto() { int typeAttack; Random rnd = new Random(); typeAttack = rnd.Next(2); if (!p1.Dead && !p2.Dead) { switch (typeAttack) { case 0: if (lR) { _typePrintAuto = TypePrintAuto.Pulemet; Attack(p2, 10); } else { TimeStrelkaX = 100; _typePrintAuto = TypePrintAuto.PulemetLeft; Attack(p1, 10); } break; case 1: if (lR) { _typePrintAuto = TypePrintAuto.Fly; Attack(p2, 3); } else { TimeStrelkaX = 100; _typePrintAuto = TypePrintAuto.FlyLeft; Attack(p1, 3); } break; } } else { if (p1.Dead) { LogText.Content = p2.Name + " WIN!!!"; } else { LogText.Content = p1.Name + " WIN!!!"; } dispatcherTimer.Interval = new TimeSpan(0, 0, 0, 0, 50); dispatcherTimerAuto.Stop(); _typePrint = TypePrint.Rain; } }
private void NullAttack() { if (_typePrint == TypePrint.AutoStart) { _typePrintAuto = TypePrintAuto.NULL; } else { _typePrint = TypePrint.NULL; } }