Pre-release
AdventureJS Docs Downloads
Score: 0 Moves: 0
// getAdverb.js

(function () {
  /* global adventurejs A */

  var p = adventurejs.Dictionary.prototype;

  /**
   * Determine whether string is recognized as an adverb
   * and return the string.
   * @memberOf adventurejs.Dictionary
   * @method adventurejs.Dictionary#getAdverb
   * @kind function
   * @param {String} word
   * @returns {String|Boolean}
   */
  p.getAdverb = function Dictionary_getAdverb(word) {
    this.game.log(
      "L1527",
      "log",
      "high",
      `[Dictionary.js] getAdverb receive: ${word}`,
      "Parser"
    );
    if (this.adverbs.includes(word)) {
      this.game.log(
        "L1528",
        "log",
        "high",
        `[Dictionary.js] getAdverb found: ${word}`,
        "Parser"
      );
      return word;
    } else return false;
  };
})();