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

  /**
   * @ajspath adventurejs.Atom.Asset.Matter.Tangible.Thing.WritingImplement.Crayon
   * @augments adventurejs.WritingImplement
   * @class adventurejs.Crayon
   * @ajsconstruct MyGame.createAsset({ "class":"Crayon", "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 A writing implement.
   * @tutorial Tangibles_AboutTangibles
   * @ajsdemo WritingDemo, Office, Playroom, Classroom, Library, Scorecard
   * @ajscss Styles
   * @classdesc
   * <p>
   * <strong>Crayon</strong> is a subclass of
   * {@link adventurejs.WritingImplement|WritingImplement}.
   * Pens and other WritingImplements have their
   * <code class="property">iov.write.enabled</code>
   * property set to true, which allows a player to write on things
   * with <code class="property">asset.dov.write.enabled</code>
   * set to true, such as {@link adventurejs.Paper|Paper}.
   * </p>
   * <h3 class="examples">Example:</h3>
   * <pre class="display"><code class="language-javascript">MyGame.createAsset({
   *   class: "Crayon",
   *   name: "purple crayon",
   *   place: { on: "table" },
   *   descriptions: { look: "It's a well worn purple crayon with slightly fraying paper wrapping. ", },
   * });
   * MyGame.createAsset({
   *   class: "Paper",
   *   name: "construction paper",
   *   descriptions: { look: "It's a thick sheet of white construction paper. ", },
   *   adjectives: ["white"]
   *   place: { in: "bottom drawer" },
   * });
   * </code></pre>
   **/
  class Crayon extends adventurejs.WritingImplement {
    constructor(name, game_name) {
      super(name, game_name);
      this.class = "Crayon";
      this.noun = "crayon";
      this.plural = "crayons";
      this.singlePluralPairs = [["crayon", "crayons"]];
      this.setIOV({
        write: { with_classes: ["Paper"] },
      });
    }
  }
  adventurejs.Crayon = Crayon;
})();