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

  /**
   * @augments {adventurejs.Verb}
   * @class info
   * @ajsnode game.dictionary.verbs.info
   * @ajsconstruct MyGame.createVerb({ "name": "info", [...] });
   * @ajsconstructedby adventurejs.Dictionary#createVerb
   * @hideconstructor
   * @ajsinstanceof Verb
   * @ajsnavheading UtilityVerbs
   * @summary Verb meaning replace unknown word with new input.
   * @tutorial BasicVerbs_Subscriptions
   * @tutorial AdvancedVerbs_VerbAnatomy
   * @tutorial AdvancedVerbs_VerbProcess
   * @tutorial AdvancedVerbs_ModifyVerbs
   * @tutorial AdvancedVerbs_ModifyVerbs
   * @classdesc
   * <pre class="display border outline">
   * <span class="ajs-player-input">&gt; info</span>
   * Desert Drifter
   * Version 0.0.1
   * By Ivan Cockrum
   *
   * It was foolish to step away from the camel string. You were quickly separated by the raging sandstorm. All it took was one, two, three steps, before the buffeting wind had you completely disoriented. Now you are lost with nothing but an empty water skin.
   * </pre>
   * <p>
   * <strong>Info</strong> prints metadata about the game.
   * </p>
   */
  A.Preverbs.info = {
    name: "info",
    synonyms: [],

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

    /**
     * @memberof info
     * @ajsverbphrase
     * phrase1:
     * {
     * },
     */
    phrase1: {},

    do: function () {
      let msg =
        this.game.settings.info_text ||
        `
        <b>{title}</b> <br>
        Version {version} <br>
        By <em>{author}</em> <br>
        <br>
        {description}
      `;
      this.game.print(msg);
    },
  };
})();