Pre-release
Adventure.js Docs Downloads
Score: 0 Moves: 0
// Character_Is.js
(function () {
  /*global adventurejs A*/
  "use strict";

  /**
   * @ajspath adventurejs.Atom.StateManager.Asset_Is.Tangible_Is.Character_Is
   * @augments adventurejs.Tangible_Is
   * @class adventurejs.Character_Is
   * @ajsnavheading StateClasses
   * @param {String} game_name Name of top level game instance that is scoped to window.
   * @param {String} name Instance name.
   * @summary A container for state variables.
   * @classdesc
   * <strong>Character_Is.js</strong> is a state management class
   * used to handle a variety of properties for
   * {@link adventurejs.Character|Character Assets}.
   **/

  class Character_Is extends adventurejs.Tangible_Is {
    constructor(name = "is", game_name, parent_id) {
      // Call the constructor of the parent class
      super(name, game_name, parent_id);
      this.class = "Character_Is";

      //this.alive = true;
      this.blind = false;
      this.dead = false;
      this.deaf = false;
      this.mute = false;
      this.asleep = false;
      this.unconscious = false;
      this.constrained = false;

      return this;
    }

    get climbing() {
      return this.parent.posture === "climb";
    }
    get crawling() {
      return this.parent.posture === "crawl";
    }
    get floating() {
      return this.parent.posture === "float";
    }
    get flying() {
      return this.parent.posture === "fly";
    }
    get hovering() {
      return this.parent.posture === "hover";
    }
    get kneeling() {
      return this.parent.posture === "kneel";
    }
    get slithering() {
      return this.parent.posture === "slither";
    }
    get swimming() {
      return this.parent.posture === "swim";
    }
    get hopping() {
      return this.parent.posture === "hop";
    }

    get clinging() {
      return this.parent.posture === "cling";
    }
    get hanging() {
      return this.parent.posture === "hang";
    }
    get lying() {
      return this.parent.posture === "lie";
    }
    get sitting() {
      return this.parent.posture === "sit";
    }
    get standing() {
      return this.parent.posture === "stand";
    }
  }
  adventurejs.Character_Is = Character_Is;
})();