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

  /**
   * @ajspath adventurejs.Atom.Asset.Matter.Tangible.Thing.Clothing
   * @augments adventurejs.Thing
   * @class adventurejs.Clothing
   * @ajsconstruct MyGame.createAsset({ "class":"Clothing", "name":"foo", [...] })
   * @ajsconstructedby adventurejs.Game#createAsset
   * @ajsnavheading ClothingClasses
   * @param {String} game_name The name of the top level game object.
   * @param {String} name A name for the object, to be serialized and used as ID.
   * @summary Clothes make the [wo]man.
   * @classdesc
   * <p>
   * The primary characteristic of <strong>Clothing</strong>
   * is that it can be worn. Worn {@link adventurejs.Asset|Assets}
   * go {@link adventurejs.Aspect|in}
   * {@link adventurejs.Player|Player} inventory, but they are
   * treated a bit differently by some {@link adventurejs.Verb|Verb}
   * actions. For example, worn Assets are excluded from
   * <code class="property">all</code> by verbs including
   * <code class="property">drop all</code>,
   * <code class="property">put all</code>, and
   * <code class="property">give all</code>, and others.
   * </p>
   */
  class Clothing extends adventurejs.Thing {
    constructor(name, game_name) {
      super(name, game_name);
      this.class = "Clothing";

      this.setDOVs([
        "wear",
        "remove",
        "tear",
        "take",
        "give",
        "drop",
        "throw",
        "put",
      ]);

      this.can_wear = true;

      this.on_tie_to_this_take_this = true;
      this.on_tie_to_drag_behind_rope = true;
    }
  }

  adventurejs.Clothing = Clothing;
})();