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

  /**
   * @ajstangiblecontainer on
   * @ajspath adventurejs.Atom.Asset.Matter.Tangible.Thing.Rideable.Skateboard
   * @augments adventurejs.Rideable
   * @class adventurejs.Skateboard
   * @ajsconstruct MyGame.createAsset({ "class":"Skateboard", "name":"foo", [...] })
   * @ajsconstructedby adventurejs.Game#createAsset
   * @ajsnavheading SportsEquipment
   * @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 Whoa, that's a gnarly deck, dude.
   * @tutorial Tangibles_SimpleVehicles
   * @classdesc
   * <p>
   * <strong>Skateboard</strong> is a child class of
   * {@link adventurejs.Rideable|Rideable},
   * which are unique in that
   * {@link adventurejs.Player|Player}
   * can both carry them in
   * inventory and simultaneously be nested in/on them.
   * Nesting is a special kind of parent/child relationship that
   * is only used for
   * {@link adventurejs.Character|Characters}.
   * For more information about the unique behavior of this class,
   * see the {@link adventurejs.Rideable|Rideable} page, or see
   * <a href="/doc/Tangibles_SimpleVehicles.html">Simple Vehicles</a>.
   * </p>
   * <h3 class="examples">Example:</h3>
   * <pre class="display"><code class="language-javascript">MyGame.createAsset({
   *   class: "Skateboard",
   *   name: "Road Rider",
   *   synonyms: ["board"], // the word "skateboard" is already provided with the class
   *   adjectives: ["vintage"],
   *   place: { in: "Garage" },
   *   descriptions: { look: "It's a vintage 1970's Road Rider. ", },
   *   customNestThatToThis: { // see <a href="/doc/Scripting_VerbActions.html">Verb Actions</a>
   *     "My Player": function(){
   *       MyGame.prependToOutput( "You nearly wipe out trying to put one foot on the board. " );
   *       MyGame.appendToOutput( "You steady yourself slightly. " );
   *       // see <a href="/doc/Scripting_CustomizeOutput.html">Customize Output</a>
   *     }
   *   },
   *   customUnnestThatFromThis: {
   *     "My Player": function(){
   *       MyGame.prependToOutput( "The board nearly gets away as you prepare to dismount. " );
   *       MyGame.appendToOutput( "You take a small trip. " );
   *     }
   *   },
   * });
   * </code></pre>
   * <p>
   * The example above includes the use of several advanced methods
   * that are worth noting:
   * </p>
   * <ul>
   * <li>
   * {@link adventurejs.Tangible#customNestThatToThis|customNestThatToThis}
   * and
   * {@link adventurejs.Tangible#customUnnestThatFromThis|customUnnestThatFromThis}
   * are verb reactions that provide a way to run custom code
   * when a Character moves in/out of any other Asset that is
   * not a Room. To learn more, see
   * <a href="/doc/Scripting_VerbReactions.html">Verb Reactions</a>.
   * </li>
   * <li>
   * {@link adventurejs.Game#prependToOutput|prependToOutput}
   * and
   * {@link adventurejs.Game#appendToOutput|appendToOutput}
   * are methods that provide a way to prepend or append custom
   * strings to whatever default message will be output this turn.
   * To learn more, see
   * <a href="/doc/Scripting_CustomizeOutput.html">Customize Output</a>.
   * </li>
   * </ul>  **/
  class Skateboard extends adventurejs.Rideable {
    constructor(name, game_name) {
      super(name, game_name);
      this.class = "Skateboard";
      this.singlePluralPairs = [["skateboard", "skateboards"]];
      this.default_aspect = "on";
      this.is.climbable = true;
      this.is.skateable = true;
      this.quirks.climb_means_go_on = true;
      this.quirks.step_on_means_stand_on = true;
    }
  }
  adventurejs.Skateboard = Skateboard;
})();