Pre-release
AdventureJS Docs Downloads
Score: 0 Moves: 0
// onUnnestThisFromThat.js
(function () {
  /*global adventurejs A*/
  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(
      "L1432",
      "log",
      "high",
      `onUnnestThisFromThat.js > unnest ${this.id} from ${asset.id}`,
      "VerbActions"
    );
    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.posture = this.getPlaceAspect().player.posture;
    //this.game.updateDisplayRoom();
    return;
  };
})();