Pre-release
AdventureJS Docs Downloads
Score: 0 Moves: 0
// quiet.js
(function () {
  /* global adventurejs A */

  /**
   * @augments {adventurejs.Verb}
   * @class quiet
   * @ajsnode game.dictionary.verbs.quiet
   * @ajsconstruct MyGame.createVerb({ "name": "quiet", [...] });
   * @ajsconstructedby adventurejs.Dictionary#createVerb
   * @hideconstructor
   * @ajsinstanceof Verb
   * @ajsnavheading UtilityVerbs
   * @summary Verb meaning to quiet random events. It's up to authors whether to use it.
   * @tutorial Scripting_VerbSubscriptions
   * @tutorial Verbs_VerbAnatomy
   * @tutorial Verbs_VerbProcess
   * @tutorial Verbs_ModifyVerbs
   * @tutorial Verbs_WriteVerbs
   * @classdesc
   * <pre class="display border outline">
   * <span class="ajs-player-input">&gt; quiet</span>
   * Ok, I'll show fewer random events.
   * </pre>
   * <p>
   * <strong>quiet</strong> allows a player to suppress random
   * ambient events if the author has provided support for it.
   * </p>
   */
  A.Preverbs.quiet = {
    name: "quiet",
    synonyms: ["quiet"],

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

    do: function () {
      var input = this.game.getInput();
      this.game.settings.quiet = true;
      var msg = "Ok, I'll try to show fewer random events. ";
      if (msg) this.game.print(msg, input.output_class);
      return true;
    },
  };
})();