Pre-release
AdventureJS Docs Downloads
Score: 0 Moves: 0

Class:Phrase

Defined in: adventure/dictionary/Phrase.js, line 5

Framework class

Phrase is a special class used while parsing Input to refer to and set rules for noun / preposition pairs.

Private Constructor:

var foo = new adventurejs.Phrase()
Inherited Overrides

Methods Collapse all  |  Expand all

Properties  | 

accepts_noun :Boolean

Defined in: adventure/dictionary/Phrase.js, line 54

Default value: false

If accepts_noun is true, the verb will accept a noun for this phrase. If requires_noun is false, verb will work with one noun or no nouns.
Examples: "look" or "look north"
accepts_preposition :Boolean

Defined in: adventure/dictionary/Phrase.js, line 73

Default value: false

If accepts_preposition is true, it is possible, but not required, to accept a preposition with noun3.
accepts_preposition_without_noun :Boolean

Defined in: adventure/dictionary/Phrase.js, line 81

Default value: false

If accepts_preposition_without_noun is true, parser will accept a preposition that has no corresponding noun.
Examples:
"fly over"
noun_must_be :adventurejs.NounMustBe

Defined in: adventure/dictionary/Phrase.js, line 113

Default value: false

When the player enters a verb and one or more nouns, the parser will perform disambiguation to determine what game object(s) match the player's input. You can use these qualifiers to narrow down potential matches. For example, if your verb only acts on tangible objects, like "take" for instance, then set "tangible: true". If your verb only applies to characters, like "talk to", then uncomment "character: true". For more information, see NounMustBe. For more information about creating Verbs or modifying Verbs, see Verb Subscriptions, Verb Phases, Verb Actions, Verb Anatomy, Verb Process, or Modify Verbs.
requires_preposition :Boolean

Defined in: adventure/dictionary/Phrase.js, line 92

Default value: false

If requires_preposition is true, a preposition must be provided with noun3.