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

Class:VerbSubscription

Extends: adventurejs.VerbSubscription

Defined in: adventure/VerbSubscription.js, line 5

VerbSubscription is a special class that offers methods to manage which verbs are allowed to act on which assets. This is intended to provide very fine grained control over verb/noun interactions. Verb subscriptions are defined on assets at asset.dov[verb] and asset.iov[verb].

VerbSubscriptions and their values are passed down the inheritance chain. For example: asset.dov.examine is available on Matter, and inherited by Tangible, which allows all Tangible subclasses to be examined.

Private Constructor:

var foo = new adventurejs.VerbSubscription(game_name, name)

Parameters:

  • game_name String
    Name of top level game instance that is scoped to window.
  • name String
    Instance name.
Inherited Overrides

Index

Methods:

  • Overrides from VerbSubscription disable
  • Overrides from VerbSubscription enable

Properties:

Methods Collapse all  |  Expand all

disable()

Defined in: adventure/VerbSubscription.js, line 252

Overrides from: adventurejs.VerbSubscription#disable

Disable this verb on its parent asset.
enable()

Defined in: adventure/VerbSubscription.js, line 243

Overrides from: adventurejs.VerbSubscription#enable

Enable this verb on its parent asset.

Properties  | 

automatically :Boolean

Defined in: adventure/VerbSubscription.js, line 40

Overrides from: adventurejs.VerbSubscription#automatically

automatically allows for some verbs to be performed automatically if context calls for it; for example, when unlocking a door in order to pass through it. This takes precedence over global settings.
automatically_after_use :Boolean

Defined in: adventure/VerbSubscription.js, line 46

Overrides from: adventurejs.VerbSubscription#automatically_after_use

automatically_after_use if automatically is set true, this sets it so that a verb can only be applied automatically after a player has already used it manually. This is to prevent automatic use of tools from breaking puzzles. For example, imagine one door with many keys but only one that works; if choosing the right key is part of the puzzle, this option prevents players from simply saying "unlock door" and having the right key automatically selected for them.
doAfterSuccess :String

Defined in: adventure/VerbSubscription.js, line 79

Overrides from: adventurejs.VerbSubscription#doAfterSuccess

doAfterSuccess is one of four verb phases that provide methods to override default verb behaviors. See Start Scripting: Verb Phases for more information.
doAfterTry :String

Defined in: adventure/VerbSubscription.js, line 61

Overrides from: adventurejs.VerbSubscription#doAfterTry

doAfterTry is one of four verb phases that provide methods to override default verb behaviors. See Start Scripting: Verb Phases for more information.
doBeforeSuccess :String

Defined in: adventure/VerbSubscription.js, line 70

Overrides from: adventurejs.VerbSubscription#doBeforeSuccess

doBeforeSuccess is one of four verb phases that provide methods to override default verb behaviors. See Start Scripting: Verb Phases for more information.
doBeforeTry :String

Defined in: adventure/VerbSubscription.js, line 52

Overrides from: adventurejs.VerbSubscription#doBeforeTry

doBeforeTry is one of four verb phases that provide methods to override default verb behaviors. See Start Scripting: Verb Phases for more information.
enabled :Boolean

Defined in: adventure/VerbSubscription.js, line 88

Overrides from: adventurejs.VerbSubscription#enabled

enabled allows changing the state of an asset's responsiveness to a given verb. If set false, a subscribed asset will not respond to the verb. This is useful for temporarily disabling verbs for specific assets; for example, if you had a door that could not be unlocked until another action was completed.
inherited_from :String

Defined in: adventure/VerbSubscription.js, line 94

Overrides from: adventurejs.VerbSubscription#inherited_from

Todos: this isn't currently working as envisioned

inherited_from the name of the asset class this verb subscription is inherited from. Since these properties aren't distinctly documented, this is offered as a convenience method for tracking down inherited verb settings.
name :String

Defined in: adventure/VerbSubscription.js, line 101

Overrides from: adventurejs.VerbSubscription#name

name the name of the verb being subscribed to.
on_failure :String|*

Defined in: adventure/VerbSubscription.js, line 131

Overrides from: adventurejs.VerbSubscription#on_failure

on_failure is an optional parameter. It is set as a string by default, but authors may provide a string or array or function to be served by getStringOrArrayOrFunction(). The resulting string will be appended to the verb's default failure message.
on_first_failure :String|*

Defined in: adventure/VerbSubscription.js, line 143

Overrides from: adventurejs.VerbSubscription#on_first_failure

on_first_failure is an optional parameter. It is set as a string by default, but authors may provide a string or array or function to be served by getStringOrArrayOrFunction(). The resulting string will be appended to the verb's default failure message.
on_first_success :String|*

Defined in: adventure/VerbSubscription.js, line 119

Overrides from: adventurejs.VerbSubscription#on_first_success

on_first_success is an optional parameter. It is set as a string by default, but authors may provide a string or array or function to be served by getStringOrArrayOrFunction(). The resulting string will be appended to the verb's default success message.
on_success :String|*

Defined in: adventure/VerbSubscription.js, line 107

Overrides from: adventurejs.VerbSubscription#on_success

on_success is an optional parameter. It is set as a string by default, but authors may provide a string or array or function to be served by getStringOrArrayOrFunction(). The resulting string will be appended to the verb's default success message.
once :Boolean

Defined in: adventure/VerbSubscription.js, line 155

Overrides from: adventurejs.VerbSubscription#once

once if true, the verb can only be applied once to the asset. The verb subscription will be disabled after use.
then_destroy :Boolean|*

Defined in: adventure/VerbSubscription.js, line 161

Overrides from: adventurejs.VerbSubscription#then_destroy

then_destroy allows author to specify that this asset should be destroyed after using. If then_destroy is set, the asset will be destroyed after a single use regardless of how once is set. By default, then_destroy is set to a boolean. It may optionally be set to string or array or function subject to getStringOrArrayOrFunction(). If any of those types are found, they will be called and returned as results.
with_anything :Boolean

Defined in: adventure/VerbSubscription.js, line 168

Overrides from: adventurejs.VerbSubscription#with_anything

with_anything pertains only to indirect objects. If true, this asset can be used as an indirect object of this verb with any direct object.
with_assets :Array

Defined in: adventure/VerbSubscription.js, line 176

Overrides from: adventurejs.VerbSubscription#with_assets

with_assets allows author to specify particular assets that can interact with this one using the given verb. For example "unlock door with key" where the specified key is the only asset that can unlock door.
with_classes :Array

Defined in: adventure/VerbSubscription.js, line 186

Overrides from: adventurejs.VerbSubscription#with_classes

with_classes allows author to specify particular classes that can interact with this asset using the given verb. For example "unlock door with skeleton key" where any instance of the class SkeletonKey can unlock door.
with_nothing :Boolean

Defined in: adventure/VerbSubscription.js, line 196

Overrides from: adventurejs.VerbSubscription#with_nothing

with_nothing pertains only to direct objects. If true, the specified verb can be applied to the direct object without the use of any indirect object.
with_params :Object

Defined in: adventure/VerbSubscription.js, line 204

Overrides from: adventurejs.VerbSubscription#with_params

with_params is used to contain a set of parameters that are specific to this particular verb. For example, plugIn includes with_params.max_connections for setting limits on how many other assets one asset can be plugged into. See any given verb's documentation to learn if it has any special parameters.
with_prepositions :Array

Defined in: adventure/VerbSubscription.js, line 215

Overrides from: adventurejs.VerbSubscription#with_prepositions

with_prepositions allows author to explicitly permit certain prepositions to be used with a verb on this object. For instance: "knock over umbrella stand" might fail with a message of "you can't knock over the umbrella stand"; setting umbrella_stand.dov.knock.with_prepositions = ["over"] will allow the action to succeed.