Пример #1
0
        /// <summary>
        /// Метод востановления энергии
        /// </summary>
        static void BeHealed()
        {
            int tmpValue = rnd.Next(5, 20);

            if (_ship?.Energy < 100)
            {
                if (_ship?.Energy + tmpValue > 100)
                {
                    float tempValue = 0;
                    tempValue = 100 - _ship.Energy;
                    _ship.EnergyUp(tempValue);
                    str = Convert.ToInt32(tempValue).ToString();
                }
                else
                {
                    _ship?.EnergyUp(tmpValue);
                    str = tmpValue.ToString();
                }
                delLog.Healing(str);
                Del += delLog.Healing;
            }
            _heal.Geneerate();
            SystemSounds.Exclamation.Play();
        }