Pre-release
Adventure.js Docs Downloads
Score: 0 Moves: 0
// IOVdidTryCount.js
(function() {
	/*global adventurejs A*/ 
  "use strict";
  var p = adventurejs.Asset.prototype;	
  /**
   * <strong>IOVdidTryCount</strong> is a method 
   * to get a count of times it was attempted to use this asset 
   * as an indirect object by the specified verb.
   * <br><br>
   * <strong>_iTryCount</strong> is an alias meant for authors.
   * @memberOf adventurejs.Asset
   * @method adventurejs.Asset#IOVdidTryCount
   * @param {String} verb
   * @returns {Boolean}
   */
  p.IOVdidTryCount = p._iTryCount = function Asset_IOVDidTryCount(verb)
  { 
    if( !verb || !this.game.dictionary.verbs[verb] ) return 0;
    if( this.iov[verb] ) 
    {
      return this.iov[verb].try_count;
    }
    else if( this.did_try_verb_count[verb] )
    {
      if( this.did_try_verb_count[verb].noun2 > 0 ) return this.did_try_verb_count[verb].noun2; 
      if( this.did_try_verb_count[verb].noun3 > 0 ) return this.did_try_verb_count[verb].noun3; 
    }
    return 0;
  }
}());