Pre-release
Adventure.js Docs Downloads
Score: 0 Moves: 0
// $getKey.js
(function() {
	/*global adventurejs A*/ 
  "use strict";
  var p = adventurejs.Character.prototype;	
  /**
   * Returns one key that player is carrying, if any,
   * to unlock the specified asset.
   * @memberOf adventurejs.Character
	 * @method adventurejs.Character#$getKey
   * @param {Object|String} direct_object An asset or asset ID to unlock.
   * @returns {Object|null} A Key asset, if player has any.
   */
  p.$getKey = function Character__getKey(direct_object)
  {
    let keys = this.getIOVkeys('unlock',direct_object);
    return keys[0] || null;
  }
 }());