// north.js
// OK 09 2023
(function () {
/* global AdventureJS A */
/**
* @augments {AdventureJS.Dictionary.Verb}
* @class north
* @ajsnode game.dictionary.verbs.north
* @ajsconstruct MyGame.createVerb({ "name": "north", [...] });
* @ajsconstructedby AdventureJS.Dictionary#createVerb
* @hideconstructor
* @ajsinstanceof Verb
* @ajsnavheading DirectionVerbs
* @summary Verb meaning travel to north direction.
* @tutorial BasicVerbs_Subscriptions
* @tutorial Reference_HowAVerbIsBuilt
* @tutorial Reference_HowAVerbWorks
* @tutorial AdvancedVerbs_ModifyVerbs
* @tutorial AdvancedVerbs_ModifyVerbs
* @classdesc
* <div class="display">
* <div class="ajs-player-input">> north</div>
* <div class="ajs-p">You fly north with the Arctic winds, which frost your wings and drag you down into the frigid sea.</div>
* </div>
* <p>
* Direction verb: go <strong>north</strong>.
* To learn about {@link AdventureJS.Assets.Exit|Exits},
* see <a href="/doc/GettingStarted_CreateAnExit.html">Create an Exit</a>.
* </p>
* @ajsverbreactions doRemoveThisFromThat, doRemoveThatFromThis, doMoveThisToThat, doMoveThatToThis
* @ajsverbphases doBeforeTry, doAfterTry, doBeforeSuccess, doAfterSuccess
*/
A.Dictionary.VerbDefinitions.north = {
name: "north",
is_direction: true,
is_compass_direction: true,
synonyms: ["north", "n", "northward"],
adjectives: ["northern", "northernly"],
article: "the",
type: { direction: true },
adjective: "northerly",
/**
* @ajsverbstructures
* @memberof north
*/
accepts_structures: ["verb"],
doTry: function () {
var results = this.game.tryTravel(this.name);
if (!results) {
this.handleFailure();
}
return results;
},
doSuccess: function () {
var input = this.game.getInput();
var results;
if (input.did.tryTravel) {
results = this.game.doTravel();
if (!results) return results;
return this.handleSuccess();
}
return this.handleSuccess();
},
};
})();