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

  /**
   * @ajspath adventurejs.Atom.Asset.Matter.Tangible.Thing.Container.LiquidContainer.Chalice
   * @augments adventurejs.LiquidContainer
   * @class adventurejs.Chalice
   * @ajsconstruct MyGame.createAsset({ "class":"Chalice", "name":"foo", [...] })
   * @ajsconstructedby adventurejs.Game#createAsset
   * @ajsnavheading TreasureClasses
   * @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 You have chosen wisely.
   * @classdesc <strong>Chalice</strong> is child class of
   * {@link adventurejs.Container|Container} /
   * {@link adventurejs.LiquidContainer|LiquidContainer}.
   * It can hold liquids (or other fluid substances),
   * be filled, emptied, poured from, drunk from.
   * This Chalice class is set to have an infinite volume of water,
   * so it never empties.
   * See {@link adventurejs.LiquidContainer|LiquidContainer} for
   * more information about how substances are handled under the hood.
   * <pre class="display"><code class="language-javascript">MyGame.createAsset({
   *   class: "Chalice",
   *   name: "carpenter's cup",
   *   descriptions: { look: "Now this is the cup of a carpenter. ", },
   *   in: {
   *     vessel: {
   *       volume: Infinity,
   *       maxvolume: Infinity,
   *       substance_id: "water",
   *     }
   *   },
   * });
   * </code></pre>
   **/
  class Chalice extends adventurejs.LiquidContainer {
    constructor(name, game_name) {
      super(name, game_name);
      this.class = "Chalice";

      this.noun = "chalice";
      this.plural = "chalices";
      this.singlePluralPairs = [["chalice", "chalices"]];

      this.setDOVs(["take", "give", "put"]);

      this.aspects.in.vessel.volume = Infinity;
      this.aspects.in.vessel.maxvolume = Infinity;
    }
  }
  adventurejs.Chalice = Chalice;
})();