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

  /**
   * @augments {adventurejs.Verb}
   * @class again
   * @ajsnode game.dictionary.verbs.again
   * @ajsconstruct MyGame.createVerb({ "name": "again", [...] });
   * @ajsconstructedby adventurejs.Dictionary#createVerb
   * @hideconstructor
   * @ajsinstanceof Verb
   * @ajsnavheading UtilityVerbs
   * @summary Verb meaning repeat last turn's input.
   * @ajssynonyms again, g
   * @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; jump on bed</span>
   * You jump up and down on the bed for a bit.
   *
   * <span class="input">&gt; again</span>
   * You jump up and down on the bed for a bit.
   * </pre>
   * <p>
   * <strong>again</strong> repeats the last turn. It has no
   * executable code of its own and is only used by the parser.
   * It does not support verb subscriptions.
   * </p>
   */
  A.Preverbs.again = {
    name: "again",
    synonyms: ["again", "g"],
    // again.do should never execute.
    // sanitizeInput.js looks for "again" in input
    // and replaces it with the prior turn's input.

    /**
     * @ajsverbstructures
     * @memberof again
     */
    accepts_structures: ["verb"],

    do: function () {
      this.game.log(
        "error",
        "high",
        "again.do fired, but it never should because again is handled by parser.",
        "verbs"
      );
      return null;
    },
  };
})(); // again