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

  /**
   * @ajspath adventurejs.Atom.Asset.Matter.Tangible.Thing.Climbable
   * @augments adventurejs.Thing
   * @class adventurejs.Climbable
   * @ajsconstruct MyGame.createAsset({ "class":"Climbable", "name":"foo", [...] })
   * @ajsconstructedby adventurejs.Game#createAsset
   * @ajsnavheading MiscAssetClasses
   * @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 Players can climb it.
   * @classdesc
   * <p>
   * <strong>Climbable</strong> is meant for players to climb; things
   * like ladders, vine, arbors. Player can climb on/to/from it,
   * swing to it, jump on/to/from it.
   * </p>
   **/
  class Climbable extends adventurejs.Thing {
    constructor(name, game_name) {
      super(name, game_name);
      this.class = "Climbable";

      this.setDOVs(["climb", "jump", "tie"]);

      this.is.climbable = true;

      this.can.jump_from = true;
      this.can.jump_to = true;
      this.can.swing_to = true;
      //this.can,swing_from = true;
      this.dimensions.height = 2;
      this.default_aspect_for_climb = "on";
      this.quirks.climb_means_go_on = false;
      this.quirks.go_on_means_climb = false;

      this.default_aspect = "on";

      this.is.listed_in_room = false;

      this.aspects.on = new adventurejs.Aspect("on", this.game_name).set({
        parent_id: this.id,
        list_in_room: false,
        player: { posture: "hang", can: { enter: true, jump: true } },
        orientation: "vertical",
      });
    }
  }

  adventurejs.Climbable = Climbable;
})();