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

Class:VerbSubscription

Extends: adventurejs.VerbSubscription

Defined in: adventure/VerbSubscription.js, line 5

Description

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
disable()

Defined in: adventure/VerbSubscription.js, line 275

Overrides from: adventurejs.VerbSubscription#disable

Disable this verb on its parent asset.
enable
enable()

Defined in: adventure/VerbSubscription.js, line 266

Overrides from: adventurejs.VerbSubscription#enable

Enable this verb on its parent asset.

Properties  | 

automatically
automatically :Boolean

Defined in: adventure/VerbSubscription.js, line 37

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
automatically_after_use :Boolean

Defined in: adventure/VerbSubscription.js, line 43

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
doAfterSuccess :String

Defined in: adventure/VerbSubscription.js, line 76

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
doAfterTry :String

Defined in: adventure/VerbSubscription.js, line 58

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
doBeforeSuccess :String

Defined in: adventure/VerbSubscription.js, line 67

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
doBeforeTry :String

Defined in: adventure/VerbSubscription.js, line 49

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
enabled :Boolean

Defined in: adventure/VerbSubscription.js, line 85

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.
name
name :String

Defined in: adventure/VerbSubscription.js, line 98

Overrides from: adventurejs.VerbSubscription#name

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

Defined in: adventure/VerbSubscription.js, line 128

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
on_first_failure :String|*

Defined in: adventure/VerbSubscription.js, line 140

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
on_first_success :String|*

Defined in: adventure/VerbSubscription.js, line 116

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
on_success :String|*

Defined in: adventure/VerbSubscription.js, line 104

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
once :Boolean

Defined in: adventure/VerbSubscription.js, line 152

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
then_destroy :Boolean|*

Defined in: adventure/VerbSubscription.js, line 158

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
with_anything :Boolean

Defined in: adventure/VerbSubscription.js, line 165

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
with_assets :Array

Defined in: adventure/VerbSubscription.js, line 173

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
with_classes :Array

Defined in: adventure/VerbSubscription.js, line 191

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
with_nothing :Boolean

Defined in: adventure/VerbSubscription.js, line 209

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
with_params :Object

Defined in: adventure/VerbSubscription.js, line 217

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
with_prepositions :Array

Defined in: adventure/VerbSubscription.js, line 228

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.
without_assets
without_assets :Array

Defined in: adventure/VerbSubscription.js, line 182

Overrides from: adventurejs.VerbSubscription#without_assets

without_assets allows author to specify particular assets that can not interact with this one using the given verb. For example "unlock door with key" where the specified key can not unlock the door.
without_classes
without_classes :Array

Defined in: adventure/VerbSubscription.js, line 200

Overrides from: adventurejs.VerbSubscription#without_classes

without_classes allows author to specify particular classes that can not interact with this asset using the given verb. For example "unlock door with lockpick" where instance of the class Lockpick can not unlock the door.
without_prepositions
without_prepositions :Array

Defined in: adventure/VerbSubscription.js, line 240

Overrides from: adventurejs.VerbSubscription#without_prepositions

without_prepositions allows author to explicitly prevent certain prepositions from being used with a verb on this object. For instance: "knock over umbrella stand" might normally succeed; setting umbrella_stand.dov.knock.without_prepositions = ["over"] will prevent the action from succeeding.