// drive.js
(function () {
/*global adventurejs A*/
/**
* @augments {adventurejs.Verb}
* @class drive
* @ajsnode game.dictionary.verbs.drive
* @ajsconstruct MyGame.createVerb({ "name": "drive", [...] });
* @ajsconstructedby adventurejs.Dictionary#createVerb
* @hideconstructor
* @ajsinstanceof Verb
* @ajsnavheading LocomotionVerbs
* @summary Verb meaning drive, as on a skateboard or skates.
* @tutorial Scripting_VerbSubscriptions
* @tutorial Verbs_VerbAnatomy
* @tutorial Verbs_VerbProcess
* @tutorial Verbs_ModifyVerbs
* @tutorial Verbs_WriteVerbs
* @classdesc
* <pre class="display border outline">
* <span class="input">> drive off bridge</span>
* You slam the pedal to the metal and accelerate toward the rising drawbridge.
* VROOOM! The car launches into the air, then slams down on the other side
* of the bridge.
* </pre>
* Drive extends core verb <a href="ride.html">ride</a>.
* It checks whether "drive" is contextually available
* before forwarding to "ride" for further handling.
* @ajsverbreactions doRemoveThisFromThat, doRemoveThatFromThis, doMoveThisToThat, doMoveThatToThis
* @ajsverbphases doBeforeTry, doAfterTry, doBeforeSuccess, doAfterSuccess
*/
A.Preverbs.drive = {
name: "drive",
prettyname: "drive",
past_tense: "drove",
synonyms: ["drive"],
type: { locomotion: true, travel: true },
extends: { go: true },
gerund: "driving",
player_must_be: {
not_constrained: true,
},
/**
* @ajsadverbs
* @memberof drive
*/
accepts_adverbs: ["left", "right", "around", "back", "towards", "over"],
/**
* @ajsverbstructures
* @memberof drive
*/
accepts_structures: [
"verb", // drive
"verb noun", // drive east
// "verb preposition", //
"verb preposition noun", // drive in car
// "verb noun noun", //
"verb noun preposition noun", // drive east in skateboard
],
/**
* @memberof drive
* @ajsverbphrase
* phrase1:
* {
* accepts_noun:true,
* noun_must_be:
* {
* known: true,
* tangible: true,
* present: true,
* visible: true,
* reachable: true,
* },
* accepts_preposition: true,
* },
*/
phrase1: {
accepts_noun: true,
noun_must_be: {
known: true,
tangible: true,
present: true,
visible: true,
reachable: true,
},
accepts_preposition: true,
},
/**
* @memberof drive
* @ajsverbphrase
* phrase2:
* {
* accepts_noun:true,
* noun_must_be:
* {
* known: true,
* tangible: true,
* present: true,
* visible: true,
* reachable: true,
* },
* accepts_preposition: true,
* },
*/
phrase2: {
accepts_noun: true,
noun_must_be: {
known: true,
tangible: true,
present: true,
visible: true,
reachable: true,
},
accepts_preposition: true,
},
/**
* @memberof drive
* @ajsverbparams
* with_params: {},
*/
with_params: {},
doTry: function () {
return this.game.dictionary.doVerb("ride");
},
doSuccess: function () {
var input = this.game.getInput();
var verb_phrase = input.verb_phrase;
if (input.did_doSuccess) return this.handleSuccess();
},
}; // END drive
})();