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

  /**
   * @ajspath adventurejs.Atom.Asset.Matter.Substance.Slurry
   * @augments adventurejs.Substance
   * @class adventurejs.Slurry
   * @ajsconstruct MyGame.createAsset({ "class":"Slurry", "name":"foo", [...] })
   * @ajsconstructedby adventurejs.Game#createAsset
   * @ajsnavheading SubstanceClasses
   * @param {String} game_name Name of top level game instance that is scoped to window.
   * @param {String} name Instance name.
   * @summary Base class for Slurry Substances, like mud.
   * @tutorial Substances_AboutSubstances
   * @classdesc
   * <p>
   * <strong>Slurry</strong> is a subclass of
   * {@link adventurejs.Substance|Substance} with mixed
   * =properties of Solid and Liquid.
   * </p>
   * <h3 class="examples">Example:</h3>
   * <p>
   * Substances are different from
   * {@link adventurejs.Tangible|Tangibles} in that they're
   * semi-global, rather than singular. The class represents
   * all of its kind in a {@link adventurejs.Game|Game},
   * meaning, if you create an instance called "mud", all
   * mud in the Game is the same mud, whether it's in a
   * puddle or a bowl.
   * </p>
   * <pre class="display"><code class="language-javascript">MyGame.createAsset({
   *   class: "Slurry",
   *   name: "mud",
   *   description: "It's mud. ",
   * });
   * MyGame.createAsset({
   *   class: "Bucket",
   *   name: "bucket",
   *   place: { in: "shed" },
   *   description: "It's a bucket. ",
   *   in:
   *   {
   *     vessel: {
   *       volume: 2000,
   *       substance_id: "mud",
   *     },
   *   },
   * });
   * </code></pre>
   **/
  class Slurry extends adventurejs.Substance {
    constructor(name, game_name) {
      super(name, game_name);
      this.class = "Slurry";
      
      this.noun = "Slurry";
      this.setDOVs(["pour", "take", "put", "give"]);
      this.setIOVs(["fill"]);
      this.is.slurry = true;

      //this.freezing_temperature = 0; // water // TODO lookup table
      //this.boiling_temperature = 100; // water // TODO lookup table
      this.specific_heat = 0.8; // soil = 0.8Kj or 800j // TODO lookup table
      this.state = this.game.settings.states.SLURRY;
    }
  }

  adventurejs.Slurry = Slurry;
})();