Pre-release
AdventureJS Docs Downloads
Score: 0 Moves: 0
// fly.js

(function () {
  /* global adventurejs A */

  /**
   * @augments {adventurejs.Verb}
   * @class fly
   * @ajsnode game.dictionary.verbs.fly
   * @ajsextendverb go
   * @ajsconstruct MyGame.createVerb({ "name": "fly", [...] });
   * @ajsconstructedby adventurejs.Dictionary#createVerb
   * @hideconstructor
   * @ajsinstanceof Verb
   * @ajsnavheading LocomotionVerbs
   * @summary Verb meaning fly, as in "fly over lake"; or, travel in specified direction.
   * @tutorial Verbs_Subscriptions
   * @tutorial AdvancedVerbs_VerbAnatomy
   * @tutorial AdvancedVerbs_VerbProcess
   * @tutorial AdvancedVerbs_ModifyVerbs
   * @tutorial AdvancedVerbs_ModifyVerbs
   * @classdesc
   * <pre class="display border outline">
   * <span class="ajs-player-input">&gt; fly through mountain</span>
   * You fire up your primitive oscillation overthruster, slip off your shoes and set your feet to the pedals, try to align the three beams... and fail completely, scraping against the mountain and spilling a shower of sparks and spaceship parts.
   * </pre>
   * Fly extends core verb <a href="/doc/go.html">go</a>.
   * It checks whether "fly" is contextually available
   * before forwarding to "go" for further handling.
   * @ajsverbreactions doRemoveThisFromThat, doRemoveThatFromThis, doMoveThisToThat, doMoveThatToThis
   * @ajsverbphases doBeforeTry, doAfterTry, doBeforeSuccess, doAfterSuccess
   */
  A.Preverbs.fly = {
    name: "fly",
    prettyname: "fly",
    past_tense: "flew",
    synonyms: ["fly"],
    type: { locomotion: true, travel: true },
    extends: { go: true },
    gerund: "flying",
    override_aspect_scale_increments: { up: true, down: true },

    subject_must_be: {
      not_constrained: true,
      not_on_floor: true,
      not_nested_elsewhere: true,
      able_to_fly: true,
    },

    /**
     * @ajsadverbs
     * @memberof fly
     */
    accepts_adverbs: ["left", "right", "around", "back", "towards", "over"],

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

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

    doTry: function () {
      return this.game.dictionary.doVerb("go");
    },

    doSuccess: function () {
      return this.handleSuccess();
    },
  }; // END fly
})();