Pre-release
Adventure.js Docs Downloads
Score: 0 Moves: 0
// createGlobalExits.js

(function () {
  /*global adventurejs A*/
  "use strict";

  var p = adventurejs.Game.prototype;

  /**
   * Create global exits.
   * @memberOf adventurejs.Game
   * @method adventurejs.Game#createGlobalExits
   * @kind function
   */
  p.createGlobalExits = function Game_createGlobalExits() {
    for (var i = 0; i < A.GlobalAssets.Exits.length; i++) {
      var exit = A.GlobalAssets.Exits[i];

      this.world["global_" + exit.direction] = new adventurejs.Exit(
        exit.direction,
        this.game_name
      );
      this.world["global_" + exit.direction].game_name = this.game_name;
      this.world["global_" + exit.direction].set({
        is: {
          global: true,
          known: true,
          seen: true,
        },
        name: "non-existant " + exit.direction + " exit",
        direction: exit.direction,
        class: "Exit",
        id: "global_" + exit.direction,
        game_name: this.game_name,

        singlePluralPairs: [
          ["exit", "exit"],
          ["passage", "passage"],
        ],
        //adjectives: [ exit.direction ],
        //adjectives: this.game.dictionary.directionLookup[ exit.direction ],
      });

      if (exit.descriptions.look) {
        this.world["global_" + exit.direction].descriptions.look =
          exit.descriptions.look;
      }
    }
  };
})();