Pre-release
Adventure.js Docs Downloads
Score: 0 Moves: 0
// port.js
// OK 09 2023
(function () {
  /*global adventurejs A*/
  "use strict";

  /**
   * @augments {adventurejs.Verb}
   * @class port
   * @ajsnode game.dictionary.verbs.port
   * @ajsconstruct MyGame.createVerb({ "name": "port", [...] });
   * @ajsconstructedby adventurejs.Dictionary#createVerb
   * @hideconstructor
   * @ajsinstanceof Verb
   * @ajsnavheading DirectionVerbs
   * @summary Verb meaning travel to port direction.
   * @tutorial Scripting_VerbSubscriptions
   * @tutorial Verbs_VerbAnatomy
   * @tutorial Verbs_VerbProcess
   * @tutorial Verbs_ModifyVerbs
   * @tutorial Verbs_WriteVerbs
   * @classdesc
   * <pre class="display border outline">
   * <span class="input">&gt; port</span>
   * Against all common sense, you move to port, capsizing the small boat.
   * </pre>
   * <p>
   * Direction verb: go <strong>port</strong>.
   * To learn about {@link adventurejs.Exit|Exits},
   * see <a href="/doc/GetStarted_CreateAnExit.html">Create an Exit</a>.
   * </p>
   * @ajsverbphases doBeforeTry, doAfterTry, doBeforeSuccess, doAfterSuccess
   */
  A.Preverbs.port = {
    name: "port",
    is_direction: true,
    is_spatial_direction: true,
    synonyms: ["port", "left"],
    type: { direction: true },

    /**
     * @ajsverbstructures
     * @memberof port
     */
    accepts_structures: ["verb"],

    doSuccess: function () {
      this.game.tryTravel(this.name);
      return true;
    },
  };
})();