public override void RespondToAttack(IProjectile attack)
        {
            this.Shields += 50;

            base.RespondToAttack(attack);

            this.Shields -= 50;
        }
        public override void RespondToAttack(IProjectile attack)
        {
            this.Shields += 50;

            attack.Hit(this);

            this.Shields -= 50;
        }
Example #3
0
 public virtual void RespondToAttack(IProjectile attack)
 {
     attack.Hit(this);
     if (this.Shields<0)
     {
         this.Shields = 0;
     }
     if (this.Health<0)
     {
         this.Health = 0;
     }
 }
Example #4
0
        // Responds to an attack by raising its shields by 50 before the attack and removes them after it.
        public override void RespondToAttack(IProjectile attack)
        {
            if (this.Attacked)
            {
                this.Shields += 50;
                this.Attacked = false;
            }
            else
            {
                this.Shields -= 50;
                this.Attacked = true;

            }
        }
Example #5
0
        public override void RespondToAttack(IProjectile attack)
        {
            this.Shields += 50;

            attack.Hit(this);

            this.Shields -= 50;

            if (this.Health <= 0)
            {
                this.Health = 0;
                Console.WriteLine(Messages.ShipDestroyed, this.Name);
            }

            if (this.Shields <= 0)
            {
                this.Shields = 0;
            }
        }
Example #6
0
 public virtual void RespondToAttack(IProjectile attack)
 {
     attack.Hit(this);
 }
 public override void RespondToAttack(IProjectile attack)
 {
     this.Shields += 50;
     base.RespondToAttack(attack);//преизползваме базовия клас
     this.Shields -= 50;
 }
Example #8
0
 public abstract void RespondToAttack(IProjectile attack);
Example #9
0
 public virtual void RespondToAttack(IProjectile projectile)
 {
     projectile.Hit(this);
 }
Example #10
0
        public virtual void RespondToAttack(IProjectile attack)
        {
            attack.Hit(this);

            if (this.Health <= 0)
            {
                this.Health = 0;
                Console.WriteLine(Messages.ShipDestroyed, this.Name);
            }

            if (this.Shields < 0)
            {
                this.Shields = 0;
            }
        }
 public void RespondToAttack(IProjectile attack)
 {
     throw new NotImplementedException();
 }
Example #12
0
 public override void RespondToAttack(IProjectile attack)
 {
     attack.Hit(this);
 }
Example #13
0
 public override void RespondToAttack(IProjectile attack)
 {
 }
Example #14
0
 public virtual void RespondToAttack(IProjectile attack)
 {
 }