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

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

  /**
   * @augments {adventurejs.Verb}
   * @class slither
   * @ajsnode game.dictionary.verbs.slither
   * @ajsconstruct MyGame.createVerb({ "name": "slither", [...] });
   * @ajsconstructedby adventurejs.Dictionary#createVerb
   * @hideconstructor
   * @ajsinstanceof Verb
   * @ajsnavheading LocomotionVerbs
   * @summary Verb meaning slither, as in "slither over log"; 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; slither under barbed wire</span>
   * Like the yellow bellied coward you are, you press yourself
   * as deeply into the mud as you are able, and slither under
   * the barbed wire.
   * </pre>
   * Swim extends core verb <a href="go.html">go</a>.
   * It checks whether "swim" is contextually available
   * before forwarding to "go" for further handling.
   * @ajsverbreactions
   * @ajsverbphases doBeforeTry, doAfterTry, doBeforeSuccess, doAfterSuccess
   */
  A.Preverbs.slither = {
    name: "slither",
    prettyname: "slither",
    past_tense: "slithered",
    synonyms: ["slither"],
    type: { locomotion: true, travel: true },
    extends: { go: true },

    player_must_be: {
      not_constrained: true,
      able_to_slither: true,
    },

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

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

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