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

  /**
   * @ajspath adventurejs.Atom.Asset.Matter.Tangible.Thing.Extrusion.ExtrusionBranch
   * @augments adventurejs.Extrusion
   * @class adventurejs.ExtrusionBranch
   * @ajsconstruct MyGame.createAsset({ "class":"ExtrusionBranch", "name":"foo", [...] })
   * @ajsconstructedby adventurejs.Game#createAsset
   * @ajsnavheading ForestClasses
   * @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 branch that player can tie rope to and swing from.
   * @classdesc
   * <p>
   * <strong>ExtrusionBranch</strong> is a subclass of
   * {@link adventurejs.Extrusion|Extrusion}, with properties that allow
   * a player to {@link lasso_with|lasso} it, or
   * {@link tie_noun1_to_noun2|tie} a {@link adventurejs.Rope|Rope}
   * to it, and {@link swing_on|swing on} the tied Rope.
   * For example, you might attach an ExtrusionBranch to a
   * {@link adventurejs.Tree|Tree}, to give players a unique
   * part of the Tree to interact with.
   * </p>
   * <h3 class="examples">Example:</h3>
   * <pre class="display"><code class="language-javascript">MyGame.createAsset({
   *   class: "Tree",
   *   name: "blasted tree",
   *   place: { in: "east side of moat" },
   *   descriptions: {
   *     look: "The tree has been blasted by lightning,
   *     and fire, leaving only one stubby branch. ",
   *   },
   *   height: 3,
   *   attached:{
   *     enabled: true,
   *     list_in_room: false,
   *     list_in_examine: true, // must examine tree to see
   *   },
   *   is: { listed_in_room: false }, // tree is in room description
   *   is.climbable: false,
   * });
   *
   * MyGame.createAsset({
   *   class: "ExtrusionBranch",
   *   name: "stubby branch",
   *   place: { attached: "blasted tree" },
   *   descriptions: { look: "A short, thick branch. ", },
   *   position: { z: 2 }, // out of reach
   * });
   * </code></pre>
   * <p>
   * To learn more about swinging, see
   * <a href="/doc/Tangibles_SwingingAndChasms.html">Swinging and Chasms</a>.
   * </p>
   **/
  class ExtrusionBranch extends adventurejs.Extrusion {
    constructor(name, game_name) {
      super(name, game_name);
      this.class = "ExtrusionBranch";

      this.singlePluralPairs = [["branch", "branches"]];
      this.group = ["branches"];

      this.is.climbable = true;
      this.can.jump_to = true;
    }
  }

  adventurejs.ExtrusionBranch = ExtrusionBranch;
})();