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

Class:Spell

Extends: adventurejs.Intangible

Defined in: adventure/assets/intangibles/Spell.js, line 9

Public Constructor:

MyGame.createAsset({ "class":"Spell", "name":"foo", [...] })

Example:


Private Constructor:

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

Though all in-game glasses use a standard constructor method under the hood, it's unlikely that you'd need to call it directly. To create an instance of the Spell class, it must be defined in a game file as a generic object. That object will be used at runtime to construct a new game class instance, which will be validated and initialized before adding it to the Game. See above for the public constructor, or see Game#createAsset to learn more.

Parameters:

  • game_name String
    The name of the top level game object.
  • name String
    A name for the object, to be serialized and used as ID.
Inherited Overrides

Index

Methods:

Properties:

Methods Collapse all  |  Expand all

$can()

Defined in: adventure/asset/$can.js, line 6

Inherited from: adventurejs.Asset#$can

$can() is a general method for getting at asset properties stored in asset.can.
$is()

Defined in: adventure/asset/$is.js, line 6

Inherited from: adventurejs.Asset#$is

$is() is a generalized method for getting various asset states, usually stored in the asset.is nested object. It can also test for more complex circumstances, such as in the case of Tangibles. For example, if your game has a sword in a stone, you can test whether the sword is currently in the stone with MyGame.$("sword").is("in", "stone")
$must()

Defined in: adventure/asset/$must.js, line 6

Inherited from: adventurejs.Asset#$must

$must() is a general method for getting at asset properties stored in asset.must.
$quirks() → {Boolean}

Defined in: adventure/asset/$quirk.js, line 6

Inherited from: adventurejs.Asset#$quirks

$quirk() is a general method for getting at asset properties stored in asset.quirks.

Returns:

Boolean
addWordsToLookup(words, type)

Defined in: adventure/asset/addWordsToLookup.js, line 5

Inherited from: adventurejs.Asset#addWordsToLookup

Parameters:

  • words Array
  • type String
addWordsToLookup() takes words associated with this asset and adds them to the global lookup table.
aliases()

Defined in: adventure/Asset.js, line 807

Inherited from: adventurejs.Asset#aliases

aliases() is a collection of method names that are meant for authors to use. Since they don't exist on all classes, we set up these aliases so that, if authors call them on classes they're not applicable to, they will politely return null instead of throwing a "not a function" error.
allowVerbOnce(verb, ov) → {Boolean}

Defined in: adventure/asset/allowVerbOnce.js, line 5

Inherited from: adventurejs.Asset#allowVerbOnce

Parameters:

  • verb String
    The name of a verb.
  • ov String
    Direct or indirect object of verb.
allowVerbOnce is a method to check whether this asset is subscribed to allow the specified verb to act on it as only once.

Returns:

Boolean
allowVerbWithAnything(verb, ov) → {Boolean}

Defined in: adventure/asset/allowVerbWithAnything.js, line 5

Inherited from: adventurejs.Asset#allowVerbWithAnything

Parameters:

  • verb String
    The name of a verb.
  • ov String
    Direct or indirect object of verb.
allowVerbWithAnything is a method to check whether this asset is subscribed to act as a direct object with the specified verb without any direct object.

Returns:

Boolean
allowVerbWithAsset(verb, asset, ov) → {Boolean}

Defined in: adventure/asset/allowVerbWithAsset.js, line 5

Inherited from: adventurejs.Asset#allowVerbWithAsset

Parameters:

  • verb String
    The name of a verb.
  • asset Object
    A game asset.
  • ov String
    Direct or indirect object of verb.
allowVerbWithAsset is a method to check whether this asset is subscribed to act as an object with the specified verb and object.

Returns:

Boolean
allowVerbWithNothing(verb, ov) → {Boolean}

Defined in: adventure/asset/allowVerbWithNothing.js, line 5

Inherited from: adventurejs.Asset#allowVerbWithNothing

Parameters:

  • verb String
    The name of a verb.
  • ov String
    Direct or indirect object of verb.
allowVerbWithNothing is a method to check whether this asset is subscribed to act as a direct object with the specified verb without any indirect object. For example, "plug in computer" where when an outlet is implied but not defined.

Returns:

Boolean
allowVerbWithPreposition(verb, prep, ov) → {Boolean}

Defined in: adventure/asset/allowVerbWithPreposition.js, line 5

Inherited from: adventurejs.Asset#allowVerbWithPreposition

Parameters:

  • verb String
    A verb name.
  • prep String
    A preposition.
  • ov String
    Direct or indirect object of verb.
Return whether the specified preposition is explicitly allowed for this verb and object.

Returns:

Boolean
callAction(action, asset2, asset3, params) → {Boolean}

Defined in: adventure/asset/callAction.js, line 5

Inherited from: adventurejs.Asset#callAction

Parameters:

  • action string
  • asset2 string
    We use asset.name here instead of asset.id in support of authors, because we're never asking them to deal in IDs, only names. Hooks will only be defined by authors, so we let them use asset.name as their identifier. We do however make an effort to see if an id has been passed instead of a name, because Ivan.
  • asset3 string
  • params object
    Arbitrary parameter object.
Check if this asset has a general verb action or reaction for the specified event, or if the asset has an action for the specific asset. If either form is found, pass it to getStringOrArrayOrFunction and return the results. If the result returns false or null it will terminate the calling verb's default behavior.

Returns:

Boolean
canDoVerbAutomatically(verb) → {Boolean}

Defined in: adventure/asset/canDoVerbAutomatically.js, line 5

Inherited from: adventurejs.Asset#canDoVerbAutomatically

Parameters:

  • verb String
canDoVerbAutomatically is a method to check whether the specified verb can be performed automatically. Assumes that asset.dov[verb].enabled is true.

Returns:

Boolean
canSetVerbState(verb) → {Boolean}

Defined in: adventure/asset/canSetVerbState.js, line 5

Inherited from: adventurejs.Asset#canSetVerbState

Parameters:

  • verb String
canSetVerbState is a method to check whether the specified verb can set state on this asset. Assumes that asset.dov[verb].enabled is true

Returns:

Boolean
destroy()

Defined in: adventure/asset/destroy.js, line 6

Inherited from: adventurejs.Asset#destroy

Todos: What else needs to happen on destroy?

destroy is called to remove an asset from the game world.
didDoVerbs(verbs) → {Boolean}

Defined in: adventure/asset/didDoVerbs.js, line 5

Inherited from: adventurejs.Asset#didDoVerbs

Parameters:

  • verbs Array
didDoVerbs check whether any of the specified verbs has ever been applied to the asset as a direct object. This is a convenience method that relies on asset.didVerb()

Returns:

Boolean
didIoVerbs(verbs) → {Boolean}

Defined in: adventure/asset/didIoVerbs.js, line 5

Inherited from: adventurejs.Asset#didIoVerbs

Parameters:

  • verbs Array
didIoVerbs check whether any of the specified verbs has ever been applied to the asset as an indirect object. This is a convenience method that relies on asset.iDidVerb()

Returns:

Boolean
didVerb(verb, ov) → {Boolean}

Defined in: adventure/asset/didVerb.js, line 5

Inherited from: adventurejs.Asset#didVerb

Parameters:

  • verb String
    The name of a verb.
  • ov String
    Direct or indirect object of verb.
didVerb is a method to check whether this asset was already used as an object by the specified verb.

$did is an alias for authors.

Returns:

Boolean
didVerbCount(verb, ov) → {Int}

Defined in: adventure/asset/didVerbCount.js, line 5

Inherited from: adventurejs.Asset#didVerbCount

Parameters:

  • verb String
    The name of a verb.
  • ov String
    Direct or indirect object of verb.
didVerbCount is a method to get a count of times this asset was used as a direct object by the specified verb.

$didCount is an alias for authors.

Returns:

Int
getClassInheritance() → {Array}

Defined in: adventure/Atom.js, line 150

Inherited from: adventurejs.Atom#getClassInheritance

getClassInheritance is a utility method to get an asset's class inheritance chain. Returns a list of class names from high to low.

Returns:

Array
getVerbConnectionCount(verb, to_ov) → {Int}

Defined in: adventure/asset/getVerbConnectionCount.js, line 5

Inherited from: adventurejs.Asset#getVerbConnectionCount

Parameters:

  • verb String
    The name of a verb.
  • to_ov String
    Connection to direct or indirect objects of verb.
Return the number of assets connected to this asset via the specified verb.

Returns:

Int
getVerbConnections(verb, to_ov) → {Array}

Defined in: adventure/asset/getVerbConnections.js, line 5

Inherited from: adventurejs.Asset#getVerbConnections

Parameters:

  • verb String
    The name of a verb.
  • to_ov String
    Connection to direct or indirect objects of verb.
Return an array of asset ids connected to this asset via the specified verb.

Returns:

Array
getVerbMaxConnections(verb, ov) → {Boolean}

Defined in: adventure/asset/getVerbMaxConnections.js, line 5

Inherited from: adventurejs.Asset#getVerbMaxConnections

Parameters:

  • verb String
    The name of a verb.
  • ov String
    Direct or indirect object of verb.
Get the maximum number of connections allowed by the specified verb, inclusive of direct and indirect subscriptions.

Returns:

Boolean
getVerbParam(verb, param) → {*}

Defined in: adventure/asset/getVerbParam.js, line 5

Inherited from: adventurejs.Asset#getVerbParam

Parameters:

  • verb String
    The name of a verb.
  • param String
    The name of a param in with_params.
Return the value of the specified parameter in the specified verb subscription.

Returns:

*
getVerbState()
has()

Defined in: adventure/asset/$has.js, line 6

Inherited from: adventurejs.Asset#has

has is an alias to asset.isWithin() that reverses the direct and indirect objects, to test whether that asset is in this asset.
if( MyGame.$('crown').$has('jewel') ){ // do stuff }
hasAction(hook_name, asset1_name, asset2_name) → {Boolean}

Defined in: adventure/asset/hasAction.js, line 5

Inherited from: adventurejs.Asset#hasAction

Parameters:

  • hook_name string
  • asset1_name string
    We use asset.name here instead of asset.id to make life slightly easier for authors. Asset IDs are formed from asset names, but generally we don't expect authors to be aware of IDs. Hooks will only be defined by authors, so let them use asset.name as their identifier. We do however make an effort to see if an id has been passed instead of a name.
  • asset2_name string
Check if this asset has a general verb action or reaction for the specified event, or if the asset has an action for the specific asset.

Returns:

Boolean
hasClass(prop) → {Boolean}

Defined in: adventure/Atom.js, line 130

Inherited from: adventurejs.Atom#hasClass

Parameters:

  • prop String
    Name of the class to test for.
A method to test whether the Atom is an instance of a given class.

Returns:

Boolean
hasDescription(identifier) → {String|Boolean}

Defined in: adventure/asset/hasDescription.js, line 5

Inherited from: adventurejs.Asset#hasDescription

Parameters:

  • identifier String
See if asset has a description for an identifier, such as "look in book", where "in" has been defined as a key at asset.descriptions.in. "look" is always the default identifier.

Returns:

String | Boolean
hasDirectObjects(verb) → {Boolean}

Defined in: adventure/asset/hasDirectObjects.js, line 5

Inherited from: adventurejs.Asset#hasDirectObjects

Parameters:

  • verb String
hasDirectObjects is a method to check whether this asset has any particular direct objects specified by the author for use with the specified verb.

Returns:

Boolean
hasIndirectDescription(indirect_aspect, indirect_asset, direct_aspect) → {String|Boolean}

Defined in: adventure/asset/hasIndirectDescription.js, line 5

Inherited from: adventurejs.Asset#hasIndirectDescription

Deprecated
  • Yes

Todos: delete

Parameters:

  • indirect_aspect String
  • indirect_asset Object
  • direct_aspect String
Determine whether asset has an indirect description, such as "look at this through magnifying glass", where "through magnifying glass" becomes a key at asset.descriptions["through magnifying glass"]. "look" is always the default direct object description.

Returns:

String | Boolean
hasIndirectObjects(verb) → {Boolean}

Defined in: adventure/asset/hasIndirectObjects.js, line 5

Inherited from: adventurejs.Asset#hasIndirectObjects

Parameters:

  • verb String
hasIndirectObjects is a method to check whether this asset has any particular indirect objects specified by the author for use with the specified verb.

Returns:

Boolean
hasVerbMaxConnections(verb, to_ov) → {Boolean}

Defined in: adventure/asset/hasVerbMaxConnections.js, line 5

Inherited from: adventurejs.Asset#hasVerbMaxConnections

Todos: dov/iov or both

Parameters:

  • verb String
    The name of a verb.
  • to_ov String
    Connection to direct or indirect objects of verb.
Get whether the asset's specific verb connections are at the maximum set by verb.with_params.max_connections.

Returns:

Boolean
hasVerbParam(verb, param) → {*}

Defined in: adventure/asset/hasVerbParam.js, line 5

Inherited from: adventurejs.Asset#hasVerbParam

Parameters:

  • verb String
    The name of a verb.
  • param String
    The name of a param in with_params.
Return a boolean to indicate whether the specified parameter exists in the specified verb subscription.

Returns:

*
iDidVerb(verb, ov) → {Boolean}

Defined in: adventure/asset/iDidVerb.js, line 5

Inherited from: adventurejs.Asset#iDidVerb

Parameters:

  • verb String
    The name of a verb.
  • ov String
    Direct or indirect object of verb.
iDidVerb is a method to check whether this asset was already used as an indirect objecb by the specified verb.

$iDidDo is an alias for authors.

Returns:

Boolean
iDidVerbCount(verb, ov) → {Int}

Defined in: adventure/asset/iDidVerbCount.js, line 5

Inherited from: adventurejs.Asset#iDidVerbCount

Parameters:

  • verb String
    The name of a verb.
  • ov String
    Direct or indirect object of verb.
iDidVerbCount is a method to get a count of times this asset was used as an indirect object by the specified verb.

$iDidCount is an alias for authors.

Returns:

Int
incrementDoVerbCount(verb, ov)

Defined in: adventure/asset/incrementDoVerbCount.js, line 5

Inherited from: adventurejs.Asset#incrementDoVerbCount

Parameters:

  • verb String
  • ov String
    "dov" or "iov" representing a direct or indirect object.
incrementDoVerbCount takes a verb and an object and updates this asset's count of the number of times the verb has acted upon it.
incrementTryVerbCount(verb, index)

Defined in: adventure/asset/incrementTryVerbCount.js, line 5

Inherited from: adventurejs.Asset#incrementTryVerbCount

Parameters:

  • verb String
  • index Int
incrementTryVerbCount takes a verb and an index and updates this asset's count of the number of times the verb has attempted upon it.
initialize()

Defined in: adventure/Asset.js, line 641

Inherited from: adventurejs.Asset#initialize

initialize() is the final step of creating a new game world asset, following construction and validation. The chief job of initialization is to add all of this asset's words to MyGame.world_lookup.

Because we're not doing natural language processing and everything is indexed, we want to increase the chances that the parser understands player input that is partial or has words jumbled. We add a lookup entry for every combination of an object's adjectives with its noun(s). For example we have a "green colored pencil", and we want the parser to understand "green pencil" or "colored pencil". If there are other colored pencils, we want the parser to understand "colored pencils". If there are colored pencils in three shades of green, we want the parser to understand "green pencils". We store all of these combinations to the lookup.
isConnectedToAnything(verb, to_ov) → {Boolean}

Defined in: adventure/asset/isConnectedToAnything.js, line 5

Inherited from: adventurejs.Asset#isConnectedToAnything

Parameters:

  • verb String
    The name of a verb.
  • to_ov String
    Direct or indirect object of verb.
Check whether this asset is currently connected to anything by a verb such as plugIn or tie. For example, if this asset is a computer plugged into an outlet, this method would return true.

Returns:

Boolean
isConnectedToAsset(verb, asset, to_ov) → {Boolean}

Defined in: adventure/asset/isConnectedToAsset.js, line 5

Inherited from: adventurejs.Asset#isConnectedToAsset

Parameters:

  • verb String
    The name of the verb to test.
  • asset Object | String
    A game asset or asset id to test.
  • to_ov String
    Connection to direct or indirect objects of verb.
Check whether this asset is currently connected as a direct object to the specified indirect object by the specified verb. For example, in the case of a computer plugged into an outlet, the computer would be the direct object, and calling this method on it would return true.

Returns:

Boolean
isConnectedToNothing(verb, ov) → {Boolean}

Defined in: adventure/asset/isConnectedToNothing.js, line 5

Inherited from: adventurejs.Asset#isConnectedToNothing

Parameters:

  • verb String
    The name of a verb.
  • ov String
    Direct or indirect object of verb.
Check whether this asset is currently connected as an indirect object to nothing (aka null) by the specified verb. For example, in the case of a computer that can be plugged in, an author might prefer not to create a specific outlet into which to plug the computer. For that case we allow 'plug in computer', and write a null value to asset.is.connected_by.plugIn.to_iov to represent the computer's plugged in state.

Returns:

Boolean
isDOV(verb) → {Boolean}

Defined in: adventure/asset/isDOV.js, line 5

Inherited from: adventurejs.Asset#isDOV

Parameters:

  • verb String
isDOV is a method to check whether this asset is subscribed to allow the specified verb to act on it as a direct object.

Returns:

Boolean
isIOV(verb) → {Boolean}

Defined in: adventure/asset/isIOV.js, line 5

Inherited from: adventurejs.Asset#isIOV

Parameters:

  • verb String
isIOV is a method to check whether this asset is subscribed to allow the specified verb to act on it as an indirect object.

Returns:

Boolean
isOV(verb) → {Boolean}

Defined in: adventure/asset/isOV.js, line 5

Inherited from: adventurejs.Asset#isOV

Parameters:

  • verb String
isOV is a method to check whether this asset is subscribed to allow the specified verb to act on it as either a direct or indirect object.

Returns:

Boolean
isVerbState(verb) → {Boolean}

Defined in: adventure/asset/isVerbState.js, line 5

Inherited from: adventurejs.Asset#isVerbState

Parameters:

  • verb String
isVerbState is a method to check whether this asset already has state set by the specified verb.

Returns:

Boolean
iTriedVerb(verb, ov) → {Boolean}

Defined in: adventure/asset/iTriedVerb.js, line 5

Inherited from: adventurejs.Asset#iTriedVerb

Parameters:

  • verb String
    The name of a verb.
  • ov String
    Direct or indirect object of verb.
iTriedVerb is a method to check whether it was attempted to use this asset as an indirect object by the specified verb.

$iTried is an alias for authors.

Returns:

Boolean
iTriedVerbCount(verb, ov) → {Boolean}

Defined in: adventure/asset/iTriedVerbCount.js, line 5

Inherited from: adventurejs.Asset#iTriedVerbCount

Parameters:

  • verb String
    The name of a verb.
  • ov String
    Direct or indirect object of verb.
iTriedVerbCount is a method to get a count of times it was attempted to use this asset as an indirect object by the specified verb.

$iTryCount is an alias for authors.

Returns:

Boolean
redirectVerb(oldVerb, newVerb)

Defined in: adventure/asset/redirectVerb.js, line 6

Inherited from: adventurejs.Asset#redirectVerb

Parameters:

  • oldVerb String
  • newVerb String
redirectVerb is a method for setting a verb redirect on this asset, such that when one verb is called on the asset, another verb will be called instead. Example: player enters "hit person", it is redirected to "slap person".
set(props) → {Object}

Defined in: adventure/Atom.js, line 118

Inherited from: adventurejs.Atom#set

Parameters:

  • props Object
    A generic object containing properties to copy to the Object instance.
Provides a chainable shortcut method for setting a number of properties on the instance.

Returns:

Object Returns the instance the method is called on (useful for chaining calls.)
setDOV(verb, params)

Defined in: adventure/asset/setDOV.js, line 6

Inherited from: adventurejs.Asset#setDOV

Parameters:

  • verb String
  • params Object
setDOV is a passthrough to setVerbSubscription with direct object specified.
setDOVs(verb, params)

Defined in: adventure/asset/setDOVs.js, line 6

Inherited from: adventurejs.Asset#setDOVs

Parameters:

  • verb String
  • params Object
setDOVs is a passthrough to send multiple verbs to setVerbSubscription with direct object specified.
setIOV(verb, params)

Defined in: adventure/asset/setIOV.js, line 6

Inherited from: adventurejs.Asset#setIOV

Parameters:

  • verb String
  • params Object
setIOV is a passthrough to setVerbSubscription with indirect object specified.
setIOVs(verb, params)

Defined in: adventure/asset/setIOVs.js, line 6

Inherited from: adventurejs.Asset#setIOVs

Parameters:

  • verb String
  • params Object
setIOVs is a passthrough to send multiple verbs to setVerbSubscription with indirect object specified.
setIs(bool)

Defined in: adventure/asset/setIs.js, line 6

Inherited from: adventurejs.Asset#setIs

Parameters:

  • bool Boolean
Set asset.is.state.
setLinkedState(bool)

Defined in: adventure/asset/setLinkedState.js, line 6

Inherited from: adventurejs.Asset#setLinkedState

Parameters:

  • bool Boolean
setLinkedState sets an asset and its linked asset to the specified state.
setObjectOfVerbs(object_of, verb)

Defined in: adventure/asset/setObjectOfVerbs.js, line 6

Inherited from: adventurejs.Asset#setObjectOfVerbs

Parameters:

  • object_of String
  • verb String
setObjectOfVerbs is a convenience method that passes a list of verb names through to setVerbSubscription.
setVerbState()
setVerbSubscription(object_of, verb, params)

Defined in: adventure/asset/setVerbSubscription.js, line 5

Inherited from: adventurejs.Asset#setVerbSubscription

Todos: phase out earlier version

Parameters:

  • object_of String
  • verb String | Object
    An early version takes a string, with separate params object. A later version takes an object that includes the verb name as an object key and params as value.
  • params Object
    An optional param that works with the earlier version.
setVerbSubscription constructs verb subscriptions at asset.dov / asset.iov. It's intended mostly as a private function, though it is available to authors. An early version takes a string with separate params object. A later version takes an object that includes the verb name as an object key and params as value. // valid (for now) early version this.setIOV('hold',{with_params:{max_connections:2}}); // valid later version with one verb this.setIOV( { hold: { with_params: { max_connections:2 } } } ); // valid later version with multiple verbs this.setIOVs([ { hold: { with_params: { max_connections:3 } } }, { smell: true }, ]);
setVerbSubscriptionsWithAssets(description) → {String}

Defined in: adventure/asset/setVerbSubscriptionsWithAssets.js, line 5

Inherited from: adventurejs.Asset#setVerbSubscriptionsWithAssets

Parameters:

  • description String
Link assets that connect via verb subscriptions. For example, imagine "hit target with sword", where we have target.dov.hit.with_assets:["sword"] This pass will set sword.iov.hit.with_assets:["target"] to ensure that both assets are in sync and either can be queried.

Returns:

String
setVerbWithAsset(verb, asset, ov) → {Boolean}

Defined in: adventure/asset/setVerbWithAsset.js, line 5

Inherited from: adventurejs.Asset#setVerbWithAsset

Parameters:

  • verb String
    The name of a verb.
  • asset Object
  • ov String
    Direct or indirect object of verb.
setVerbWithAsset is used to specify another asset that can be used as an object with this asset. For example, if this asset is a locking chest, chest.setVerbWithAsset('unlock', 'gold key', 'iov') would add the gold key as an indirect object of the chest.

Returns:

Boolean
setVerbWithClass(verb, klass, ov) → {Boolean}

Defined in: adventure/asset/setVerbWithClass.js, line 5

Inherited from: adventurejs.Asset#setVerbWithClass

Parameters:

  • verb String
    The name of a verb.
  • klass String
  • ov String
    Direct or indirect object of verb.
setVerbWithClass is a method to add an indirect object class to asset.dov[verb].with_classes.

Returns:

Boolean
toggleState(verb) → {Boolean}

Defined in: adventure/asset/toggleState.js, line 5

Inherited from: adventurejs.Asset#toggleState

Parameters:

  • verb String
Apply the specified verb's state change to the asset.

Returns:

Boolean
triedVerb(verb, ov) → {Boolean}

Defined in: adventure/asset/triedVerb.js, line 5

Inherited from: adventurejs.Asset#triedVerb

Parameters:

  • verb String
    The name of a verb.
  • ov String
    Direct or indirect object of verb.
triedVerb is a method to check whether it was attempted to use this asset as a direct object by the specified verb.

$tried is an alias for authors.

Returns:

Boolean
triedVerbCount(verb, ov) → {Boolean}

Defined in: adventure/asset/triedVerbCount.js, line 5

Inherited from: adventurejs.Asset#triedVerbCount

Parameters:

  • verb String
    The name of a verb.
  • ov String
    Direct or indirect object of verb.
triedVerbCount is a method to get a count of times it was tried to use this asset as a direct object by the specified verb.

$triedCount is an alias for authors.

Returns:

Boolean
undestroy()

Defined in: adventure/asset/undestroy.js, line 6

Inherited from: adventurejs.Asset#undestroy

undestroy is called to return a destroyed asset to the game world.
unredirectVerb(oldVerb)

Defined in: adventure/asset/unredirectVerb.js, line 6

Inherited from: adventurejs.Asset#unredirectVerb

Parameters:

  • oldVerb String
unredirectVerb is a method for removing previously set verb redirects.
unsetDOV(verb)

Defined in: adventure/asset/unsetDOV.js, line 6

Inherited from: adventurejs.Asset#unsetDOV

Parameters:

  • verb String
unsetDOV is a passthrough to unsetVerbSubscription.
unsetDOVs(verbs)

Defined in: adventure/asset/unsetDOVs.js, line 6

Inherited from: adventurejs.Asset#unsetDOVs

Parameters:

  • verbs Array
unsetDOVs is a passthrough to unsetVerbSubscription.
unsetIOV(verb)

Defined in: adventure/asset/unsetIOV.js, line 6

Inherited from: adventurejs.Asset#unsetIOV

Parameters:

  • verb String
unsetIOV is a passthrough to unsetVerbSubscription.
unsetIOVs(verbs)

Defined in: adventure/asset/unsetIOVs.js, line 6

Inherited from: adventurejs.Asset#unsetIOVs

Parameters:

  • verbs Array
unsetIOVs is a passthrough to unsetVerbSubscription.
unsetVerbSubscription(object_of, verb)

Defined in: adventure/asset/unsetVerbSubscription.js, line 5

Inherited from: adventurejs.Asset#unsetVerbSubscription

Parameters:

  • object_of String
  • verb String
unsetVerbSubscription disables the use of the specified verb with this asset, if it has been previously set.
validate()

Defined in: adventure/Asset.js, line 619

Inherited from: adventurejs.Asset#validate

validate() provides an opportunity to check author-made Assets for errors before initializing them.
validateVerbConnections()

Defined in: adventure/asset/validateVerbConnections.js, line 5

Inherited from: adventurejs.Asset#validateVerbConnections

Validate any connections specified in the game file. Assets can subscribe to verbs with dov[verb] and some verbs can make connections between assets that they act upon. Connections are stored in asset.is.connected_by.verbname.to_iov["array of asset ids"]. Authors can preset connections in their game file, so we validate any preset connections here.

Properties  | 

adjectives :Getter/Setter

Defined in: adventure/Asset.js, line 328

Inherited from: adventurejs.Asset#adjectives

A list of adjectives defined for this asset in the game file. Some asset classes may have predefined adjectives. If a class has predefined adjectives, and an author creates an instance of the class with custom adjectives, the custom adjectives will be appended to the predefined ones.
article_name :Getter

Defined in: adventure/Asset.js, line 410

Inherited from: adventurejs.Asset#article_name

Getter function returns asset name preceded either by definite article or indefinite article, depending on what's set for the asset's use_definite_article_in_lists property.
articlename :Getter

Defined in: adventure/Asset.js, line 424

Inherited from: adventurejs.Asset#articlename

Getter function returns asset name or proper name, depending on settings.
Articlename :Getter

Defined in: adventure/Asset.js, line 491

Inherited from: adventurejs.Asset#Articlename

Returns this.articlename with propercase.
articlename_is :Getter

Defined in: adventure/Asset.js, line 451

Inherited from: adventurejs.Asset#articlename_is

Getter function returns asset name or proper name plus is or are, depending on settings.
Articlename_is :Getter

Defined in: adventure/Asset.js, line 500

Inherited from: adventurejs.Asset#Articlename_is

Returns this.articlename_is with propercase.
articlename_isnt :Getter

Defined in: adventure/Asset.js, line 461

Inherited from: adventurejs.Asset#articlename_isnt

Getter function returns asset name or proper name plus isn't or aren't, depending on settings.
Articlename_isnt :Getter

Defined in: adventure/Asset.js, line 509

Inherited from: adventurejs.Asset#Articlename_isnt

Returns this.articlename_isnt with propercase.
articlename_was :Getter

Defined in: adventure/Asset.js, line 471

Inherited from: adventurejs.Asset#articlename_was

Getter function returns asset name or proper name plus was or were, depending on settings.
Articlename_was :Getter

Defined in: adventure/Asset.js, line 518

Inherited from: adventurejs.Asset#Articlename_was

Returns this.articlename_was with propercase.
articlename_wasnt :Getter

Defined in: adventure/Asset.js, line 481

Inherited from: adventurejs.Asset#articlename_wasnt

Getter function returns asset name or proper name plus wasn't or weren't, depending on settings.
Articlename_wasnt :Getter

Defined in: adventure/Asset.js, line 527

Inherited from: adventurejs.Asset#Articlename_wasnt

Returns this.articlename_wasnt with propercase.
can :Object

Defined in: adventure/Asset.js, line 50

Inherited from: adventurejs.Asset#can

can is a generalized container for asset boolean properties.
collection :Getter/Setter

Defined in: adventure/Asset.js, line 192

Inherited from: adventurejs.Asset#collection

Collection is a special property that lets one object stand in for a group of objects. For example, object desk has three drawers: top_drawer, middle_drawer, bottom_drawer. desk_drawers is a scenery object attached to desk which intercepts player input like "examine drawers", so that author can return a response like "You see three drawers."
definite_article :String

Defined in: adventure/Asset.js, line 223

Inherited from: adventurejs.Asset#definite_article

Default value: 'the'

The asset's preferred definite article. Can be overridden in game file.
definite_name :Getter

Defined in: adventure/Asset.js, line 369

Inherited from: adventurejs.Asset#definite_name

Getter function returns asset name preceded by its definite article, example: 'the asset'.
description :*

Defined in: adventure/Asset.js, line 556

Inherited from: adventurejs.Asset#description

An alias to descriptions.look.
descriptions :Object

Defined in: adventure/Asset.js, line 168

Inherited from: adventurejs.Asset#descriptions

A list of descriptions for a variety of contexts. Only description is required, all others are optional. Most of these apply only to Tangible Asset.
  • descriptions.description -
  • descriptions.brief - used for room descriptions if player has typed "brief"
  • descriptions.verbose - used for room descriptions if player has typed "verbose"
  • descriptions.listen - used if player types "listen" or "listen to thing"
  • descriptions.in - used if player types "look in thing"
  • descriptions.through - used if player types "look through thing"
  • descriptions.smell - used if player types "smell thing"
  • descriptions.taste - used if player types "taste thing"
  • descriptions.touch - used if player types "touch thing"
  • descriptions.careful - used if player types "carefully examine thing"
did :Object

Defined in: adventure/Asset.js, line 338

Inherited from: adventurejs.Asset#did

did is used to track which verbs have acted upon this object.
dont_use_articles :Boolean

Defined in: adventure/Asset.js, line 250

Inherited from: adventurejs.Asset#dont_use_articles

Default value: false

An option to prevent definite/indefinite articles from appearing before an asset name. Used chiefly for characters, to prevent phrases such as "the Mrs. Beasley". Can be overridden in game file.
dov :Boolean

Defined in: adventure/Asset.js, line 72

Inherited from: adventurejs.Asset#dov

Default value: {}

dov is a container for direct object verb subscriptions.
exclude_from_lookup :Boolean

Defined in: adventure/Asset.js, line 142

Inherited from: adventurejs.Asset#exclude_from_lookup

Default value: false

Almost all assets will be listed in the world_lookup table that is used to find assets from player input , with some exceptions, such as SceneryZones.
game :Getter

Defined in: adventure/Atom.js, line 109

Inherited from: adventurejs.Atom#game

Returns the top level game object. Use this.game.
image :String

Defined in: adventure/Asset.js, line 352

Inherited from: adventurejs.Asset#image

image is used to store the id of an image in game.image_lookup that is associated with this asset.
indefinite_article :String

Defined in: adventure/Asset.js, line 231

Inherited from: adventurejs.Asset#indefinite_article

Default value: 'a'

The asset's preferred indefinite article. Can be overridden in game file.
indefinite_name :Getter

Defined in: adventure/Asset.js, line 396

Inherited from: adventurejs.Asset#indefinite_name

Getter function returns asset name preceded by its indefinite article, example: 'an asset'.
iov :Boolean

Defined in: adventure/Asset.js, line 90

Inherited from: adventurejs.Asset#iov

Default value: {}

iov is a container for direct object verb subscriptions.
is :Object

Defined in: adventure/Asset.js, line 37

Inherited from: adventurejs.Asset#is

is is a generalized container for asset states. Many states are / can be stored here. A chief benefit of this is being able to get specific states by testing asset.is.state. Note that there is also an asset.$is() method which is related to this, but is a distinct function.
is.abstract :Boolean

Defined in: adventure/Asset_Is.js, line 90

Inherited from: adventurejs.Asset#is.abstract

Default value: false

Nested property of Is

Abstractions are universally available and bypass reachability tests.
is.collection :Boolean

Defined in: adventure/Asset_Is.js, line 50

Inherited from: adventurejs.Asset#is.collection

Default value: true

Nested property of Is

Set whether object is a collection of other object IDs.
is.destroyed :Boolean

Defined in: adventure/Asset_Is.js, line 35

Inherited from: adventurejs.Asset#is.destroyed

Default value: false

Nested property of Is

Set to true when an object is removed from the game by destruction.
is.extant :Boolean

Defined in: adventure/Asset_Is.js, line 43

Inherited from: adventurejs.Asset#is.extant

Default value: true

Nested property of Is

Set to true when an object is in the game.
is.global :Boolean

Defined in: adventure/Asset_Is.js, line 81

Inherited from: adventurejs.Asset#is.global

Default value: false

Nested property of Is

Almost all tangible assets have a singular location. Global assets are available in all locations in order to catch player input.
is.initialized :Boolean

Defined in: adventure/Asset_Is.js, line 64

Inherited from: adventurejs.Asset#is.initialized

Default value: false

Nested property of Is

Used at runtime to keep track of asset's initialization state.
is.known :Boolean

Defined in: adventure/Asset_Is.js, line 26

Inherited from: adventurejs.Asset#is.known

Default value: false

Nested property of Is

Todos: In games with multiple characters, any character the player takes will share this knowledge. May want an option to set this per player character.

Used to track whether player knows about an asset.
is.nameless :Boolean

Defined in: adventure/Asset_Is.js, line 71

Inherited from: adventurejs.Asset#is.nameless

Default value: false

Nested property of Is

Almost all assets are given a name which is then used to create their id, with some exceptions. For example, exit ids are generated by taking the name of the exit's room + the exit's direction.
is.plugged :Boolean

Defined in: adventure/assets/Tangible_Is.js, line 28

Inherited from: adventurejs.Asset#is.plugged

Default value: false

Nested property of Is

Set whether this asset is plugged, like a drain.
is.pluggedIn :Boolean

Defined in: adventure/assets/Tangible_Is.js, line 35

Inherited from: adventurejs.Asset#is.pluggedIn

Default value: false

Nested property of Is

Set whether this asset is plugged in, like an appliance.
is.plural :Boolean

Defined in: adventure/Asset_Is.js, line 107

Inherited from: adventurejs.Asset#is.plural

Default value: false

Nested property of Is

Define whether an asset is plural, as opposed to singular, in the sense of eyeglasses vs a drinking glass. Used to help select pronouns.
is.singleton :Boolean

Defined in: adventure/Asset_Is.js, line 97

Inherited from: adventurejs.Asset#is.singleton

Default value: false

Nested property of Is

Todos: Have only applied this to several special global assets, and have not implemented any code around it. Is it still useful?

Meant for use to distinguish some assets as being singular in the game world.
is.validated :Boolean

Defined in: adventure/Asset_Is.js, line 57

Inherited from: adventurejs.Asset#is.validated

Default value: false

Nested property of Is

Used at runtime to keep track of asset's validation state.
must :Object

Defined in: adventure/Asset.js, line 59

Inherited from: adventurejs.Asset#must

must is a generalized container for asset boolean properties.
Name :String

Defined in: adventure/Atom.js, line 96

Inherited from: adventurejs.Atom#Name

Name returns the name of the class instance with the first character uppercased.
name_is_proper :Boolean

Defined in: adventure/Asset.js, line 207

Inherited from: adventurejs.Asset#name_is_proper

Default value: false

Used to determine whether to display a name or proper name.
noun :String

Defined in: adventure/Asset.js, line 260

Inherited from: adventurejs.Asset#noun

noun is a string representing the type of asset this is, for example 'mug' or 'rock'. Players can input this word to refer to any asset of its type.
plural :String

Defined in: adventure/Asset.js, line 299

Inherited from: adventurejs.Asset#plural

plural is a string representing multiple assets of this type, for example 'swords'. Players can input this word to refer to groups of assets.
possessive :String

Defined in: adventure/Asset.js, line 277

Inherited from: adventurejs.Asset#possessive

possessive is a string representing the generic possessive pronoun.
print_bold :Boolean

Defined in: adventure/Asset.js, line 112

Inherited from: adventurejs.Asset#print_bold

Default value: false

Set to true to have an object's name be printed bold.
print_class :String

Defined in: adventure/Asset.js, line 134

Inherited from: adventurejs.Asset#print_class

Default value: ""

Set an arbitrary string to apply CSS classes to an object's name whenever it is printed.
print_italic :Boolean

Defined in: adventure/Asset.js, line 119

Inherited from: adventurejs.Asset#print_italic

Default value: false

Set to true to have an object's name be printed italic.
print_style :String

Defined in: adventure/Asset.js, line 126

Inherited from: adventurejs.Asset#print_style

Default value: ""

Set an arbitrary string to apply CSS styles to an object's name whenever it is printed.
pronoun :String

Defined in: adventure/Asset.js, line 269

Inherited from: adventurejs.Asset#pronoun

pronoun is a string representing the generic pronoun.
propername :String

Defined in: adventure/Asset.js, line 214

Inherited from: adventurejs.Asset#propername

The asset's proper name, as provided in the game file. Assets can have both a name and a proper name. Used chiefly for characters, so that, for example, an asset can be both 'cat' and 'Mister Whiskers'.
proxy :Getter

Defined in: adventure/Asset.js, line 546

Inherited from: adventurejs.Asset#proxy

Return a proxy if this asset has one. Most will not. Exits have Apertures as proxies.
quirks :Object

Defined in: adventure/Asset.js, line 101

Inherited from: adventurejs.Asset#quirks

quirks is a container for setting how to handle ambiguous verbs based on context. For example, if player inputs "stand" while sitting in a chair with quirks.stand_means_get_off set to true, player will get off the chair, as opposed to trying to stand in place on the chair.
short_name :Getter

Defined in: adventure/Asset.js, line 383

Inherited from: adventurejs.Asset#short_name

Getter/setter returns a short name for the asset, if one has been given, or the full name if not.
singlePluralPairs :Array

Defined in: adventure/Asset.js, line 287

Inherited from: adventurejs.Asset#singlePluralPairs

singlePluralPairs is a collection of strings representing the singular and plural forms of this asset, for example ['mug', 'mugs']. Players can use the singular to refer to a single asset or the plural to refer to a group of assets. These are stored in pairs so we can check for correspondence between the forms.
split_name_for_world_lookup :Boolean

Defined in: adventure/Asset.js, line 151

Inherited from: adventurejs.Asset#split_name_for_world_lookup

Default value: true

Object names are split into individual words for the world_lookup table. For example, given an object named "crystal sword", adventurejs creates lookup table entries for "crystal" and "sword". This lets the game recognize either word as player input, such as "get crystal" or "swing sword".

But, an author might want to name a thing, eg, "hole in the ground", in which case we wind up with lookup table entries for "hole" and "in" and "the" and "ground", which is likely to lead to bad input parsing. To avoid name splitting, set split_name_for_world_lookup to false. The object's full name will still be added to the lookup.
to_be :Getter

Defined in: adventure/Asset.js, line 590

Inherited from: adventurejs.Asset#to_be

Getter function returns singular or plural form of "to be" depending on asset.is.plural property.
tried :Object

Defined in: adventure/Asset.js, line 345

Inherited from: adventurejs.Asset#tried

tried is used to track which verbs have been tried upon this object.
use_definite_article_in_lists :Boolean

Defined in: adventure/Asset.js, line 239

Inherited from: adventurejs.Asset#use_definite_article_in_lists

Default value: false

A preference for how an asset's name appears when it is printed in certain contexts. Chiefly used for room names. For example, you might name a room 'Sitting Room', but want it to appear as 'the Sitting Room' in some contexts for narrative clarity. Can be overridden in game file.