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

  /**
   * @augments {adventurejs.Verb}
   * @class verbose
   * @ajsnode game.dictionary.verbs.verbose
   * @ajsconstruct MyGame.createVerb({ "name": "verbose", [...] });
   * @ajsconstructedby adventurejs.Dictionary#createVerb
   * @hideconstructor
   * @ajsinstanceof Verb
   * @ajsnavheading UtilityVerbs
   * @summary Verb that instructs game to provide verbose room descriptions.
   * @tutorial Scripting_VerbSubscriptions
   * @tutorial Verbs_VerbAnatomy
   * @tutorial Verbs_VerbProcess
   * @tutorial Verbs_ModifyVerbs
   * @tutorial Verbs_WriteVerbs
   * @classdesc
   * <p>
   * <code>verbose</code> displays full {@link adventurejs.Room|Room}
   * descriptions, if available.
   * </p>
   * <pre class="display border outline">
   * <span class="input">&gt; verbose</span>
   * Ok, I'll show full room descriptions.
   * </pre>
   */
  A.Preverbs.verbose = {
    name: "verbose",
    synonyms: ["verbose"],

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

    do: function () {
      var input = this.game.getInput();
      if (this.game.settings.verbosity < this.game.settings.max_verbosity) {
        this.game.settings.verbosity += 1;
      }
      var msg = "Ok, I'll try to show longer room descriptions. ";
      if (msg) this.game.print(msg, input.output_class);

      return true;
    },
  };
})();