Pre-release
AdventureJS Docs Downloads
Score: 0 Moves: 0
// allowVerbWithNothing.js
(function () {
  /*global adventurejs A*/
  var p = adventurejs.Asset.prototype;
  /**
   * <strong>allowVerbWithNothing</strong> is a method
   * to check whether this asset is subscribed to act as a direct
   * object with the specified verb without any indirect object.
   * For example, "plug in computer" where when an outlet is
   * implied but not defined.
   * @memberOf adventurejs.Asset
   * @method adventurejs.Asset#allowVerbWithNothing
   * @param {String} verb The name of a verb.
   * @param {String} ov Direct or indirect object of verb.
   * @returns {Boolean}
   */
  p.allowVerbWithNothing = function Asset_allowVerbWithNothing(verb, ov) {
    if (!ov || (ov !== "dov" && ov !== "iov")) ov = "dov";
    if (!verb || !this.game.dictionary.verbs[verb]) return false;
    if (!this[ov][verb]) return false;
    return this[ov][verb].with_nothing;
  };
})();