Pre-release
Adventure.js Docs Downloads
Score: 0 Moves: 0
// walk.js

(function () {
  /*global adventurejs A*/
  "use strict";

  /**
   * @augments {adventurejs.Verb}
   * @class walk
   * @ajsnode game.dictionary.verbs.walk
   * @ajsconstruct MyGame.createVerb({ "name": "walk", [...] });
   * @ajsconstructedby adventurejs.Dictionary#createVerb
   * @hideconstructor
   * @ajsinstanceof Verb
   * @ajsnavheading LocomotionVerbs
   * @summary Verb meaning walk, as in "walk to diving board"; or, travel in specified direction.
   * @tutorial Scripting_VerbSubscriptions
   * @tutorial Verbs_VerbAnatomy
   * @tutorial Verbs_VerbProcess
   * @tutorial Verbs_ModifyVerbs
   * @tutorial Verbs_WriteVerbs
   * @classdesc
   * <pre class="display border outline">
   * <span class="input">&gt; walk under ladder</span>
   * Throwing caution to the winds, you walk under the ladder.
   * You slip on a bit of rope hung from the ladder, which
   * dislodges a bucket of paint from the top of the ladder.
   * The bucket glances off your head, spilling a full gallon
   * of paint that puddles at your feet. You slip in the paint
   * and flail wildly, bringing the ladder crashing down
   * on top of you, as you and it fall to the ground.
   * </pre>
   * Walk extends core verb <a href="go.html">go</a>.
   * It checks whether "walk" is contextually available
   * before forwarding to "go" for further handling.
   * @ajsverbreactions
   * @ajsverbphases doBeforeTry, doAfterTry, doBeforeSuccess, doAfterSuccess
   */
  A.Preverbs.walk = {
    name: "walk",
    prettyname: "walk",
    past_tense: "walked",
    synonyms: ["walk"],
    type: { locomotion: true, travel: true },
    extends: { go: true },

    player_must_be: {
      not_constrained: true,
      not_on_floor: true,
      not_nested_elsewhere: true,
      able_to_walk: true,
    },

    /**
     * @ajsverbstructures
     * @memberof walk
     */
    accepts_structures: [
      "verb",
      "verb noun",
      "verb preposition",
      "verb preposition noun",
      "verb noun preposition noun",
    ],

    /**
     * @memberof walk
     * @ajsverbphrase
     * phrase1:
     * {
     *   accepts_noun:true,
     *   noun_must_be:
     *   {
     *     known: true,
     *     tangible: true,
     *     present: true,
     *     visible: true,
     *     reachable: true,
     *   },
     *   accepts_preposition: true,
     * },
     */
    phrase1: {
      accepts_noun: true,
      noun_must_be: {
        known: true,
        tangible: true,
        present: true,
        visible: true,
        reachable: true,
      },
      accepts_preposition: true,
    },

    /**
     * @memberof walk
     * @ajsverbphrase
     * phrase2:
     * {
     *   accepts_noun:true,
     *   noun_must_be:
     *   {
     *     known: true,
     *     tangible: true,
     *     present: true,
     *     visible: true,
     *     reachable: true,
     *   },
     *   accepts_preposition: true,
     * },
     */
    phrase2: {
      accepts_noun: true,
      noun_must_be: {
        known: true,
        tangible: true,
        present: true,
        visible: true,
        reachable: true,
      },
      accepts_preposition: true,
    },

    /**
     * @memberof walk
     * @ajsverbparams
     * with_params: {},
     */
    with_params: {},

    do: function () {
      return this.game.dictionary.doVerb("go");
    },
  }; // END walk
})();