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

  /**
   * @ajspath adventurejs.Atom.Asset.Matter.Tangible.Thing.Money.PaperMoney
   * @augments adventurejs.Thing
   * @class adventurejs.PaperMoney
   * @ajsconstruct MyGame.createAsset({ "class":"PaperMoney", "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 piece of paper money.
   * @classdesc
   * <p>
   * <strong>PaperMoney</strong> is a subclass of
   * {@link adventurejs.Thing|Thing} meant for use as
   * currency.
   * </p>
   * <pre class="display border outline">
   * <span class="input">&gt; examine bill
   * It's a five dollar bill featuring Abraham Lincoln with an
   * old fashioned twirly mustache drawn on in black ink.
   * </pre>
   * <h3 class="examples">Example:</h3>
   * <pre class="display"><code class="language-javascript">MyGame.createAsset({
   *   class: "PaperMoney",
   *   name: "five dollar bill",
   *   descriptions: { look: "It's a five dollar bill. ", },
   *   place: { in: "leather wallet" },
   * });
   * </code></pre>
   **/
  class PaperMoney extends adventurejs.Thing {
    constructor(name, game_name) {
      super(name, game_name);
      this.class = "PaperMoney";

      this.synonyms = ["bill", "money", "dollar"];
      this.setDOVs(["get", "take", "give", "tear", "write"]);
      this.setIOV("type"); // ?

      this.append_written_strings_to_description = true;
    }
  }

  adventurejs.PaperMoney = PaperMoney;
})();