Pre-release
AdventureJS Docs Downloads
Score: 0 Moves: 0
// Clothing.js
(function () {
  /* global AdventureJS A */

  /**
   * @ajspath AdventureJS.Atom.Asset.Matter.Tangible.Thing.Clothing
   * @augments AdventureJS.Assets.Thing
   * @class AdventureJS.Assets.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.Assets.Asset|Assets}
   * go {@link AdventureJS.AssetHelpers.Aspect|in}
   * {@link AdventureJS.Assets.Player|Player} inventory, but they are
   * treated a bit differently by some {@link AdventureJS.Dictionary.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.Assets.Thing {
    constructor(name, game_name, context_id = "", id = "") {
      super(name, game_name, context_id, id);
      this.class = "Clothing";

      this.setDOVs([
        "wear",
        "remove",
        "tear",
        "get",
        "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.Assets.Clothing = Clothing;
})();