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

  /**
   * @ajspath adventurejs.Atom.Asset.Matter.Tangible.Thing.WritingImplement
   * @augments adventurejs.Thing
   * @class adventurejs.WritingImplement
   * @ajsconstruct MyGame.createAsset({ "class":"WritingImplement", "name":"foo", [...] })
   * @ajsconstructedby adventurejs.Game#createAsset
   * @ajsnavheading WritingClasses
   * @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 Generic base class for pens, pencils and the like.
   * @ajstangiblecontainer attached
   * @classdesc
   * <p>
   * <strong>WritingImplement</strong> is a subclass of
   * {@link adventurejs.Thing|Thing}, and is chiefly notable
   * in that its <code class="property">iov.write</code>
   * property is set to true, which allows a player to write on things
   * with <code class="property">dov.write</code>
   * set to true, such as {@link adventurejs.Paper|Paper}.
   * </p>
   * <p>
   * WritingImplement has an <code class="property">attached</code>
   * {@link adventurejs.Aspect|Aspect}
   * which allows one thing to be attached to it. No particular
   * things are specified. See
   * {@link adventurejs.Pen|Pen} and
   * {@link adventurejs.Pencil|Pencil} for examples of
   * WritingImplements that specify a certain class which
   * may be attached.
   * To learn more about limiting what may be attached, see
   * <a href="/doc/Tangibles_Aspects.html">How to Use Aspects</a>.
   * </p>
   * <h3 class="examples">Example:</h3>
   * <pre class="display"><code class="language-javascript">MyGame.createAsset({
   *   class: "WritingImplement",
   *   name: "purple crayon",
   *   article: "a",
   *   place: { in: "crayon box" },
   *   descriptions: { look: "This purple crayon looks like it could be used to draw anything. ", },
   * });
   * MyGame.createAsset({
   *   class: "Paper",
   *   name: "construction paper",
   *   descriptions: { look: "It's a pink sheet of construction paper. ", },
   *   adjectives: ["pink"]
   *   place: { in: "bottom drawer" },
   * });
   * </code></pre>
   **/
  class WritingImplement extends adventurejs.Thing {
    constructor(name, game_name) {
      super(name, game_name);
      this.class = "WritingImplement";

      this.setIOV("write");
      this.setDOVs(["take", "give", "tie", "turn"]);

      this.on_tie_to_this_take_this = true;
      this.on_tie_to_drag_behind_rope = true;
      this.can.turn = true;
    }
  }
  adventurejs.WritingImplement = WritingImplement;
})();