// ClimbableVine.js
(function () {
/*global adventurejs A*/
"use strict";
/**
* @ajspath adventurejs.Atom.Asset.Matter.Tangible.Thing.Climbable.ClimbableVine
* @augments adventurejs.Climbable
* @class adventurejs.ClimbableVine
* @ajsconstruct MyGame.createAsset({ "class":"ClimbableVine", "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 A hanging vine that player can climb.
* @classdesc
* <p>
* <strong>ClimbableVine</strong> is a subclass of
* {@link adventurejs.Climbable|Climbable}, a hanging vine
* that a player can climb on/to/from,
* swing on/to/from, jump to/from. What makes ClimableVine
* special is its combination of its position.y and its height
* properties. Here is an example of a
* hanging vine that doesn't reach the ground, making a puzzle
* of how to reach it.
* </p>
* <pre class="display"><code class="language-javascript">MyGame.createAsset({
* class: "ClimbableVine",
* name: "vine",
* place: { in: "Cave" },
* descriptions: { look: "It's a vine. ", },
* position: { x:0, y:3, z:0 },
* height: -2,
* quirks.let_go_of_means_go_off: true,
* things_player_can_reach_from_this: [ "tree", "stalactite" ],
* });
* </code></pre>
* <p>
* See that the vine's position.y is 3 units high, presumably
* at ceiling height, and that its height is -2, meaning that
* it hangs down 2 units from the ceiling and reaches 1 unit
* above the ground, just out of reach of the player.
* </p>
**/
class ClimbableVine extends adventurejs.Climbable {
constructor(name, game_name) {
super(name, game_name);
this.class = "ClimbableVine";
this.singlePluralPairs = [["vine", "vines"]];
this.setDOVs(["hold", "take", "pull"]);
this.quirks.take_means_hold = true;
this.is.supported = true;
this.is.listed_in_room = false;
this.position.y = 2;
this.dimensions.height = -2;
this.player_can_hang_on_this = true;
this.can.jump_to = true;
this.can.jump_from = false;
this.can.swing_from = true;
this.can.swing_to = true;
this.can.swing_on = true;
this.can.swing_on_if_nested = true;
this.can.swing_on_if_holding = true;
this.can.swing_on_if_holding_and_supported = true;
this.default_aspect_for_climb = "on";
this.default_posture_for_jump_to = "hang";
this.default_aspect_for_jump_to = "on";
this.default_posture_for_jump_to = "hang";
this.default_aspect_for_jump_to = "on";
this.must.let_go_after_swing = true;
this.aspects.on.set({
player: { posture: "hang" },
});
}
}
adventurejs.ClimbableVine = ClimbableVine;
})();