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

  /**
   * @ajspath adventurejs.Atom.Asset.Matter.Tangible.Thing.OpticalDevice.Telescope
   * @class adventurejs.Telescope
   * @augments adventurejs.OpticalDevice
   * @ajsconstruct MyGame.createAsset({ "class":"Telescope", "name":"foo", [...] })
   * @ajsconstructedby adventurejs.Game#createAsset
   * @ajsnavheading OpticalClasses
   * @param {String} name A name for the object, to be serialized and used as ID.
   * @param {String} game_name The name of the top level game object.
   * @summary Curse this blasted balcony seat.
   * @classdesc
   * <p>
   * <strong>Telescope</strong> is a subclass of
   * {@link adventurejs.OpticalDevice|OpticalDevice},
   * which can be looked through or with via
   * <code>iov.look</code>.
   * Telescope is a handheld device. For stationary
   * telescopes, see the
   * {@link adventurejs.StationaryTelescope|StationaryTelescope} class.
   * </p>
   * <p>
   * Authors might find the distinction between
   * "look through" and "look with" unnecessary, in which case it's
   * possible to combine these verbs or disable one or the other.
   * To learn more, see
   * <a href="/doc/Verbs_ModifyVerbs.html">Modify Verbs</a>
   * </p>
   * <h3 class="examples">Example:</h3>
   * <pre class="display"><code class="language-javascript">MyGame.createAsset({
   *   class: "Telescope",
   *   name: "telescope",
   *   descriptions: { look: "It's a brass pocket telescope. ", },
   *   place: { in: "saddlebag" },
   * });
   * </code></pre>
   **/
  class Telescope extends adventurejs.OpticalDevice {
    constructor(name, game_name) {
      super(name, game_name);
      this.class = "Telescope";

      this.singlePluralPairs = [["telescope", "telescopes"]];

      // only if it's handheld
      this.must.be_in_hands_to_look_through = true;
    }
  }
  adventurejs.Telescope = Telescope;
})();