Пример #1
0
 /**
  * a worm is hit by a projectile
  *
  * @param worm the worm that is hit
  * @effect the worm loses HP according to the damage of the projectile
  *     |worm.decreaseCurrentHP(this.getWeapon().getHPDamage());
  * @effect the overlapping worm is set to null |this.setOverlappingWorm(null);
  * @effect the projectile is terminated |this.Terminate();
  */
 protected void hitWorm(Worm worm) {
   worm.decreaseCurrentHP(this.getWeapon().getHPDamage());
   this.setOverlappingWorm(null);
   this.Terminate();
 }