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

            attack.Hit(this);

            this.Shields -= 50;
        }
Exemple #2
0
 public virtual void RespondToAttack(IProjectile attack)
 {
     attack.Hit(this);
     if (this.Shields<0)
     {
         this.Shields = 0;
     }
     if (this.Health<0)
     {
         this.Health = 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;
            }
        }
 public virtual void RespondToAttack(IProjectile attack)
 {
     attack.Hit(this);
 }
Exemple #5
0
 public virtual void RespondToAttack(IProjectile projectile)
 {
     projectile.Hit(this);
 }
Exemple #6
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;
            }
        }
Exemple #7
0
 public override void RespondToAttack(IProjectile attack)
 {
     attack.Hit(this);
 }