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

  /**
   * @ajspath adventurejs.Atom.Asset.Matter.Substance.Gas
   * @augments adventurejs.Substance
   * @class adventurejs.Gas
   * @ajsconstruct MyGame.createAsset({ "class":"Gas", "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 Gas Substances, like helium.
   * @tutorial Substances_AboutSubstances
   * @classdesc
   * <p>
   * <strong>Gas</strong> is a subclass of
   * {@link adventurejs.Substance|Substance} with gaseous
   * (as opposed to liquid or solid) properties.
   * </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 "helium", all
   * helium in the Game is the same helium, whether it's in a
   * cylinder or a balloon.
   * </p>
   * <pre class="display"><code class="language-javascript">MyGame.createAsset({
   *   class: "Gas",
   *   name: "helium",
   *   description: "It's invisible. ",
   * });
   * MyGame.createAsset({
   *   class: "Balloon",
   *   name: "balloon",
   *   place: { in: "Party" },
   *   description: "It's a balloon. ",
   *   in:
   *   {
   *     vessel: {
   *       volume: 2000,
   *       substance_id: "helium",
   *     },
   *   },
   * });
   * </code></pre>
   **/
  class Gas extends adventurejs.Substance {
    constructor(name, game_name) {
      super(name, game_name);
      this.class = "Gas";

      this.noun = "Gas";
      this.is.gas = true;

      //this.freezing_temperature = 0; // water // TODO lookup table
      //this.boiling_temperature = 100; // water // TODO lookup table
      this.specific_heat = 5.2; // helium = 5.2Kj or 5200j // TODO lookup table
      this.state = this.game.settings.states.GAS;
    }
  }
  adventurejs.Gas = Gas;
})();