Pre-release
Adventure.js Docs Downloads
Score: 0 Moves: 0
// onUnnestThisFromThat.js
(function() {
	/*global adventurejs A*/ 
  "use strict";
  var p = adventurejs.Character.prototype;	
  /**
   * Called when player is unnested from another asset.
   * Provides an opportunity to override default behavior 
   * through the use of
   * <a href="/doc/Scripting_VerbReactions.html">verb reactions</a> 
   * doUnnestThisFromThat and doUnnestThatFromThis.
   * @memberOf adventurejs.Character
	 * @method adventurejs.Character#onUnnestThisFromThat
   * @param {Object} asset
   * @returns {Boolean}
   */
  p.onUnnestThisFromThat = function Character_unnestThisFromThat( asset ) 
  {
    this.game.log( "log", "high", this.name + " onUnnestThisFromThat " + asset.name + "." , 'Behavior' );
    if(!asset) return;
    var results;

    results = this.callAction('doUnnestThisFromThat', asset.name, {} );
    if( "undefined" !== typeof results ) return results;            
      
    results = asset.callAction('doUnnestThatFromThis', this.name, {} );
    if( "undefined" !== typeof results ) return results;            
 
    this.unsetNest();
    //this.game.updateDisplayRoom();
    return;
  } 
}());