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

  var p = AdventureJS.Game.prototype;

  /**
   * Ensure that the verb agrees with the subject.
   * @method AdventureJS.Game#renderVerb
   * @memberOf AdventureJS.Game
   * @param {string} token The original template such as {our}.
   * @param {string} pronouns An optional pronoun type. If none provided, assumes subject.
   * @returns string
   */
  p.renderVerb = function Game_renderVerb(token, pronouns) {
    const subject = this.game.getInput().getSubject();
    if (!pronouns) pronouns = subject.pronouns;
    const lookup = this.dictionary.verb_form_lookup[token];
    if (!lookup) return token;
    const source = lookup.source;
    return this.game.dictionary.conjugate(source, pronouns);
  }; // renderVerb
})();