Pre-release
AdventureJS Docs Downloads
Score: 0 Moves: 0
// verbose.js
// OK 09 2023
(function () {
  /* global AdventureJS A */

  /**
   * @augments {AdventureJS.Dictionary.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 BasicVerbs_Subscriptions
   * @tutorial Reference_HowAVerbIsBuilt
   * @tutorial Reference_HowAVerbWorks
   * @tutorial AdvancedVerbs_ModifyVerbs
   * @tutorial AdvancedVerbs_ModifyVerbs
   * @classdesc
   * <p>
   * <code>verbose</code> displays full {@link AdventureJS.Assets.Room|Room}
   * descriptions, if available.
   * </p>
   * <div class="display">
   * <div class="ajs-player-input">&gt; verbose</div>
   * <div class="ajs-p">Ok, I'll show full room descriptions.</div>
   * </div>
   */
  A.Dictionary.VerbDefinitions.verbose = {
    name: "verbose",
    synonyms: [],

    /**
     * @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;
    },
  };
})();