takeDamage(amount) {
    if (this.isBound()) {
      this.unbind();
    }

    const revisedAmount = this.health - amount < 0 ? this.health : amount;
    this.health -= revisedAmount;
    this.log(`takes ${amount} damage, ${this.health} health power left`);

    if (this.health === 0) {
      this.vanish();
      this.log('dies');
    }
  }
/**
   * Subtracts the given amount of health in HP.
   *
   * @param {number} amount The amount of HP to subtract.
   */
Subtracts the given amount of health in HP.
@param {number} amount The amount of HP to subtract.
Subtracts the given amount of health in HP . @param { number } amount The amount of HP to subtract .
takeDamage(amount) {
    if (this.isBound()) {
      this.unbind();
    }
    const revisedAmount = this.health - amount < 0 ? this.health : amount;
    this.health -= revisedAmount;
    this.log(`takes ${amount} damage, ${this.health} health power left`);
    if (this.health === 0) {
      this.vanish();
      this.log('dies');
    }
  }
takeDamage ( amount ) { if ( this . isBound ( ) ) { this . unbind ( ) ; } const revisedAmount = this . health - amount < 0 ? this . health : amount ; this . health -= revisedAmount ; this . log ( ` ${ amount } ${ this . health } ` ) ; if ( this . health === 0 ) { this . vanish ( ) ; this . log ( 'dies' ) ; } }
Subtracts the given amount of health in HP.
Subtracts the given amount of health in HP .