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

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

Engine class

Description

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.Dictionary.Phrase()
Inherited Overrides

Methods Collapse all  |  Expand all

Properties  | 

accepts_all
accepts_all :Boolean

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

Default value: false

Determines whether verb can act specifically on "all".
Examples:
"take all"
accepts_direction
accepts_direction :String

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

Currently unused.
accepts_noun
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_number
accepts_number :String

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

Currently unused.
accepts_plural_noun
accepts_plural_noun :Boolean

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

Default value: false

accepts_plural_noun means verb can act on multiple objects.
Examples:
"take shield and sword"
"take all keys"
"take all"
accepts_preposition
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
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"
accepts_string
accepts_string :String

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

Currently unused.
noun_must_be
noun_must_be :AdventureJS.Dictionary.NounMustBe

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

When the player enters a verb and one or more nouns, the parser will search all assets to determine which match the player's input. NounMustBe qualifiers are used to narrow down potential matches. For example, if your verb only acts on tangible objects, then set "tangible: true". If your verb only applies to characters, then set "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.
noun_prefers
noun_prefers :AdventureJS.Dictionary.NounPrefers

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

When the player enters a verb and one or more nouns, the parser will search all assets to determine which match the player's input. In some cases, multiple assets will be returned. NounPrefers qualifiers can be used to disambiguate among multiple assets. For example, if a verb can handle assets in the room or outside the room but has a preference for assets in the room, we can set noun_prefers: { present: true }. For more information, see NounPrefers. For more information about creating Verbs or modifying Verbs, see Verb Subscriptions, Verb Phases, Verb Actions, Verb Anatomy, Verb Process, or Modify Verbs.
requires_number
requires_number :String

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

Currently unused.
requires_preposition
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.
requires_string
requires_string :String

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

Currently unused.