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

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

  /**
   * @augments {adventurejs.Verb}
   * @class run
   * @ajsnode game.dictionary.verbs.run
   * @ajsconstruct MyGame.createVerb({ "name": "run", [...] });
   * @ajsconstructedby adventurejs.Dictionary#createVerb
   * @hideconstructor
   * @ajsinstanceof Verb
   * @ajsnavheading LocomotionVerbs
   * @summary Verb meaning run, as in "run on treadmill"; 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; run under cat</span>
   * You run under the old half-blind cat. It sniffs the air and
   * mews with confusion. You're safe for a moment, but there's
   * no time to waste. You wrack your brain for ways to reverse
   * the witch's spell with your little mousey paws.
   * </pre>
   * Run extends core verb <a href="go.html">go</a>.
   * It checks whether "run" is contextually available
   * before forwarding to "go" for further handling.
   * @ajsverbreactions
   * @ajsverbphases doBeforeTry, doAfterTry, doBeforeSuccess, doAfterSuccess
   */
  A.Preverbs.run = {
    name: "run",
    prettyname: "run",
    past_tense: "ran",
    synonyms: ["run"],
    type: { locomotion: true, travel: true },
    extends: { go: true },

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

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

    /**
     * @memberof run
     * @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 run
     * @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 run
     * @ajsverbparams
     * with_params: {},
     */
    with_params: {},

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