Class: Exit
Extends: adventurejs.Tangible
Defined in: adventure/assets/tangibles/Exit.js, line 6
How to: CreateExit CreateLockKey
Public Constructor:
MyGame.createAsset({
"class":"Exit",
"direction":"x",
"place":{in:"room a"},
"destination":"room b",
[...]
})
Exit allows travel between Rooms. An Exit must be assigned a location, a direction, and a destination. Unlike other classes, no name is required. Though Exits are created via Game.createAsset() like other Assets, they are unique in that they don't take a name to generate an id. Rather, an id is generated from the exit's location and direction.
Exits have no physical properties of their own. By default,
they allow travel with no special actions from the player.
If there's a north exit, typing
go north
take the player north.
To add physical elements to an Exit, it must be paired with an
Aperture,
which is a class that includes subclasses such as lockable
Doors and
Windows, etc.
Apertures provide
Tangible
Assets
with all the usual methods for physical interactions.
Exits are one-way. To create a two-way passage, you'll need to create two Exits, one in each Room. Ordinary Exits are singular, meaning that they only exist in the Room they are assigned to.
The exception to the singular rule are GlobalExits.
GlobalExits are a set of predefined Exits with their
is.global
property set to true.
GlobalExits capture direction inquiries
in rooms without exits in those directions.
For example, if a player inputs
go north
in a Room with no north Exit, Game will return
the description for global_north,
which should be some version of
You don't see any exit to the north.
GlobalExit descriptions can be customized,
so you can write a different snarky comment
for each direction, if you so desire. To learn more about
customizing GlobalExits, see
How to Use Built-in Scenery.
But let's say you want to provide Room-specific messages when a player tries to travel in a wrong direction. Maybe you've built a maze and you want to provide hints. That's possible too, by creating Exits with no destination. When a player tries to travel, only a description is returned. Keep reading to see examples of this below.
Example:
There are two ways to create an Exit.
If you don't need an Aperture, you can use this
simple shortcut: define a Room with an
exits
property,
with nested properties for each direction you
want to place an Exit. Set each
key/value pair
to a direction / a name of a Room to travel to.
This provides the minimum information for the game
to automatically construct new Exits at runtime.
In this example, we define a Room
called "Field of Dreams" with Exits to north and south.
This example assumes that there are additional Rooms called
"Corn Field" and "Front Yard".
MyGame.createAsset({
class: "Room",
name: "Field of Dreams",
descriptions: { look: "If you build it, he will come. ", },
exits: {
north: "Corn Field"
south: "Front Yard",
}
});
This method can also be used to create non-functioning exits that return an error when a player tries to use a non-existent exit. Instead of providing a Room name, simply provide a string to return as a message. This method can provide useful feedback to players. (This provides results that are very similar to setting custom GlobalExit messages as mentioned above. It's just another way of doing it.)
MyGame.createAsset({
class: "Room",
name: "Middle Beach",
descriptions: {
look: {
"A sandy strip between a rough tide to the
east and a rocky sea wall to the west. You can walk north
or south along the water's edge. ",
},
},
exits: {
north: "North Beach",
south: "South Beach",
east: "The rough tides turn you back. ",
west: "A towering rock wall blocks passage to the west. ",
},
});
This results in an interaction like the following example.
> go west
A towering rock wall blocks passage to the west.
Alternately, Exits can be defined like other distinct Assets. In this example, we create a Room, an Exit, a lockable Aperture, and a Key. Note that the Exit is given a direction, a location, and a destination, and a name for the Aperture it should be linked with. The main benefit of this arrangement is that it provides more granular control over the Exit details.
MyGame.createAsset({
class: "Room",
name: "Ice King's Living Room",
descriptions: {
look: "It's the Ice King's Living Room. Man that guy is a slob.
No wonder he can't get a Princess. Schmowza! ",
},
});
MyGame.createAsset({
class: "Exit",
direction: "north",
place: { in: "Ice King's Living Room" },
destination: "Ice King's Boudoir",
aperture: "icy door",
descriptions: {
look: "It looks frosty that way. Brrr. ",
for_exits_list: "north to the Boudoir",
}
});
MyGame.createAsset({
class: "Door",
name: "icy door",
adjectives: "icy, north",
synonyms: ["icy north door"],
place: { in: "Ice King's Living Room" },
direction: "north",
descriptions: {
look: "The icy door is very slightly translucent.
You can't see through it, but it has a bit of a glow. ",
open: "The icy door is open. ",
closed: "The icy door is closed. ",
touch: "The icy door is cold to the touch. ",
through: function()
{
if( MyGame.$( "icy door" ).$is("open") )
{
return "Through the open door you can see
the Ice King's Boudoir. "
}
else
{
return "Though the closed door appears to be
very slightly translucent, you can't see through it. "
}
},
}
is: {
direct_object_of_verb: {
unlock: { with_assets: ['glass key'], },
},
},
is: {
closed: true,
locked: true
},
linked_asset: "boudoir door",
});
MyGame.createAsset({
class: "Key",
name: "Boudoir key",
article: "the",
opacity: .5,
is: {
indirect_object_of_verb: {
unlock: { then_destroy: { with_success: 'The fragile key crumbles into pieces after use. ' }, },
},
},
});
As with the simpler method, it's also possible to construct a non-functioning Exit that returns a message when a player tries to go that way. Though the outcome is the same as with the simpler method, you might find that this method provides more granular control over the Exit Asset.
MyGame.createAsset({
class: "Room",
name: "Pantheon",
descriptions: {
look: "One of the most inspiring sites in Rome. ",
),
exits: {
north: "Piazza della Rotonda",
},
});
MyGame.createAsset({
class: "Exit",
name: "hole in the roof",
place: { in: "Pantheon" },
direction: "up",
descriptions: {
look: {
"You see a dot of blue sky through a
tiny hole in the roof, but you could never reach it. ",
split_name_for_world_lookup: false,
},
},
});
It's ok to mix the two methods. For instance a Room might have one exit with an Aperture and another without. It's fine to construct an Exit instance to go with the Aperture, and use the simple method for the other Exit. To learn more about Apertures and Exits, see How to Create an Exit.
Private Constructor:
var foo = new adventurejs.Exit(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 Exit 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.
Index
Methods:
- Inherited from Tangible $is
- Inherited from Tangible $moveTo
- Inherited from Tangible addAssetAt
- Inherited from Asset addWordsToLookup
- Inherited from Asset aliases
- Inherited from Tangible areAnscestorsClosed
- Inherited from Tangible areAnscestorsKnown
- Inherited from Tangible areAnscestorsOpen
- Inherited from Tangible areAnscestorsUnknown
- Inherited from Tangible canBePlacedInAspectOfAsset
- Inherited from Tangible canContainAnySubstance
- Inherited from Tangible canContainAssetAt
- Inherited from Tangible canPlayerNest
- Inherited from Tangible canPlayerReachThatFromThis
- Inherited from Asset canSetVerbState
- Inherited from Tangible destroy
- Inherited from Asset didDoVerbs
- Inherited from Asset didIoVerbs
- Inherited from Tangible doesContainAnyAsset
- Inherited from Tangible doesContainAnyAssetAt
- Inherited from Tangible doesContainAnySubstance
- Inherited from Tangible doesContainAnySubstanceAt
- Inherited from Tangible doesContainAsset
- Inherited from Tangible doesContainAssetAt
- Inherited from Tangible doesContainSubstance
- Inherited from Tangible doesContainSubstanceAt
- Inherited from Asset DOVallowOnce
- Inherited from Asset DOVallowWithAnything
- Inherited from Asset DOVallowWithAsset
- Inherited from Asset DOVallowWithNothing
- Inherited from Asset DOVdidDo
- Inherited from Asset DOVdidDoCount
- Inherited from Asset DOVdidTry
- Inherited from Asset DOVdidTryCount
- Inherited from Asset DOVgetConnectionCount
- Inherited from Asset DOVgetConnections
- Inherited from Asset DOVgetMaxConnections
- Inherited from Asset DOVhasIndirectObjects
- Inherited from Asset DOVhasMaxConnections
- Inherited from Asset DOVincrementDoCount
- Inherited from Asset DOVincrementTryCount
- Inherited from Asset DOVisConnectedToAnything
- Inherited from Asset DOVisConnectedToAsset
- Inherited from Asset DOVisConnectedToNothing
- Inherited from Asset DOVsetConnection
- Inherited from Asset DOVsetWithAsset
- Inherited from Asset DOVsetWithClass
- Inherited from Asset DOVunsetConnection
- Inherited from Tangible event_hooks
- Inherited from Tangible get
- Inherited from Tangible getAllContents
- Inherited from Tangible getAllNestedContents
- Inherited from Tangible getAncestorId
- Inherited from Tangible getAnySubstanceThisContains
- Inherited from Tangible getAspectAt
- Inherited from Tangible getAspectWithVessel
- Inherited from Tangible getClosedAnscestors
- Inherited from Tangible getContentsAt
- Inherited from Tangible getCountOfListableContentsAt
- Inherited from Asset getDescription
- Inherited from Asset getIndirectDescription
- Inherited from Atom getInheritance
- Inherited from Tangible getListableContents
- Inherited from Tangible getNestedInstancesOfClass
- Inherited from Tangible getOpenOrClosed
- Inherited from Tangible getPlaceAspect
- Inherited from Tangible getPlaceAspectId
- Inherited from Tangible getPlaceAsset
- Inherited from Tangible getPlaceAssetId
- Inherited from Tangible getPrintableListOfContents
- Inherited from Atom getProperty
- Inherited from Tangible getRoomAsset
- Inherited from Tangible getRoomId
- Inherited from Tangible getRopesThatBlockTravel
- Inherited from Tangible getSubstanceAt
- Inherited from Tangible getThingThisIsTiedToPlayerBy
- Inherited from Tangible getTiedThingsThatDragOnTravel
- Inherited from Tangible getVesselAt
- Inherited from Tangible getYBottom
- Inherited from Tangible getYRange
- Inherited from Tangible getYTop
- Inherited from Asset has
- Inherited from Tangible hasAspectAt
- Inherited from Atom hasClass
- Inherited from Tangible hasContentsAtAspect
- Inherited from Asset hasDescription
- Inherited from Asset hasEventHook
- Inherited from Asset hasIndirectDescription
- Inherited from Tangible hasListableContents
- Inherited from Tangible hasPlace
- Inherited from Atom hasProperty
- Inherited from Tangible hasPropertyOnAspectAt
- Inherited from Tangible hasRopesThatBlockTravel
- Inherited from Tangible hasTiedThingsThatDragOnTravel
- Inherited from Tangible hasVessel
- Inherited from Tangible hasVesselAtAspect
- Inherited from Asset incrementDoVerbCount
- Inherited from Asset incrementTryVerbCount
- Inherited from Tangible initialize
- Inherited from Asset IOVallowOnce
- Inherited from Asset IOVallowWithAnything
- Inherited from Asset IOVallowWithAsset
- Inherited from Asset IOVallowWithNothing
- Inherited from Asset IOVdidDo
- Inherited from Asset IOVdidDoCount
- Inherited from Asset IOVdidTry
- Inherited from Asset IOVdidTryCount
- Inherited from Asset IOVgetConnectionCount
- Inherited from Asset IOVgetConnections
- Inherited from Asset IOVgetMaxConnections
- Inherited from Asset IOVhasDirectObjects
- Inherited from Asset IOVhasMaxConnections
- Inherited from Asset IOVincrementDoCount
- Inherited from Asset IOVincrementTryCount
- Inherited from Asset IOVisConnectedToAnything
- Inherited from Asset IOVisConnectedToAsset
- Inherited from Asset IOVisConnectedToNothing
- Inherited from Asset IOVsetConnection
- Inherited from Asset IOVsetWithAsset
- Inherited from Asset IOVsetWithClass
- Inherited from Asset IOVunsetConnection
- Inherited from Asset isDOV
- Inherited from Tangible isIn
- Inherited from Asset isIOV
- Inherited from Tangible isPlacedAtAspect
- Inherited from Tangible isPlacedAtAspectAndAsset
- Inherited from Asset isVerbState
- Inherited from Tangible isWithinYRange
- Inherited from Tangible linkRegisteredParts
- Inherited from Tangible Overrides from Tangible moveFrom
- Inherited from Tangible moveTo
- Inherited from Tangible onAddSubstanceToThis
- Inherited from Tangible onChangeGravity
- Inherited from Tangible onChangeMoisture
- Inherited from Tangible onChangeTemperature
- Inherited from Tangible onMoveThatToThis
- Inherited from Tangible onNestThatToThis
- Inherited from Tangible onRemoveThatFromThis
- Inherited from Tangible onSubtractSubstanceFromThis
- Inherited from Tangible onTieThisToThat
- Inherited from Tangible onTurnThatWithThis
- Inherited from Tangible onTurnThis
- Inherited from Tangible onTurnThisWithThat
- Inherited from Tangible onUnnestThatFromThis
- Inherited from Tangible onUntieThisFromThat
- Inherited from Tangible put
- Inherited from Asset redirectVerb
- Inherited from Tangible registerParts
- Inherited from Tangible removeAssetAt
- Inherited from Tangible removeThatFromThis
- Inherited from Atom set
- Inherited from Tangible setAspectAt
- Inherited from Tangible setAttachmentsKnown
- Inherited from Tangible setContentsKnown
- Inherited from Asset setDOV
- Inherited from Asset setDOVs
- Inherited from Asset setIOV
- Inherited from Asset setIOVs
- Inherited from Asset setObjectOfVerbs
- Inherited from Tangible setPlace
- Inherited from Asset setVerbSubscription
- Inherited from Asset setVerbSubscriptionsWithAssets
- Inherited from Asset setVerbSubscriptionsWithConnection
- Inherited from Tangible setVesselAt
- Inherited from Asset toggleVerbState
- Inherited from Asset tryEventHook
- Inherited from Tangible trySetContentsKnown
- Inherited from Asset undestroy
- Inherited from Asset unredirectVerb
- Inherited from Asset unsetDOV
- Inherited from Asset unsetDOVs
- Inherited from Asset unsetIOV
- Inherited from Asset unsetIOVs
- Inherited from Asset unsetVerbSubscription
- Inherited from Tangible validate
Properties:
- Inherited from Tangible absorption_quantity
- Inherited from Asset adjectives
- Inherited from Tangible aperture
- Inherited from Tangible append_written_strings_to_description
- Inherited from Asset article_name
- Inherited from Asset articlename
- Inherited from Asset Articlename
- Inherited from Tangible buoyancy
- Inherited from Tangible can_auto_open
- Inherited from Tangible can_auto_unlock
- Inherited from Tangible can_auto_unseal
- Inherited from Tangible can_be_filled_from
- Inherited from Tangible can_be_filled_from_without_turning_on
- Inherited from Tangible can_be_given_to
- Inherited from Tangible can_be_in_multiple_rooms
- Inherited from Tangible can_be_looked_through
- Inherited from Tangible can_be_moved_from_room
- Inherited from Tangible can_be_opened_without_taking
- Inherited from Tangible can_be_poured_into
- Inherited from Tangible can_be_pushed_from_room
- Inherited from Tangible can_be_swung
- Inherited from Tangible can_be_swung_at
- Inherited from Tangible can_be_thrown_at
- Inherited from Tangible can_be_thrown_to
- Inherited from Tangible can_be_typed_on
- Inherited from Tangible can_deep_nest
- Inherited from Tangible can_drink_from
- Inherited from Tangible can_go_out
- Inherited from Tangible can_hang_things_on_this
- Inherited from Tangible can_hang_this_on_things
- Inherited from Tangible can_jump_across
- Inherited from Tangible can_jump_from
- Inherited from Tangible can_jump_in
- Inherited from Tangible can_jump_over
- Inherited from Tangible can_jump_through
- Inherited from Tangible can_jump_to
- Inherited from Tangible can_kick_while_in_hands
- Inherited from Tangible can_peddle
- Inherited from Tangible can_put
- Inherited from Tangible can_run
- Inherited from Tangible can_skate
- Inherited from Tangible can_step
- Inherited from Tangible can_support_swinging
- Inherited from Tangible can_swing_across
- Inherited from Tangible can_swing_from
- Inherited from Tangible can_swing_on
- Inherited from Tangible can_swing_on_if_holding
- Inherited from Tangible can_swing_on_if_holding_and_supported
- Inherited from Tangible can_swing_on_if_nested
- Inherited from Tangible can_swing_over
- Inherited from Tangible can_swing_to
- Inherited from Tangible can_take_from
- Inherited from Tangible can_tie_this_to_things_without_holding
- Inherited from Tangible can_walk
- Inherited from Tangible cant_get_off
- Inherited from Atom class
- Inherited from Asset collection
- Inherited from Tangible control_positions
- Inherited from Tangible control_target_id
- Inherited from Tangible current_position
- Inherited from Tangible default_aspect
- Inherited from Tangible default_aspect_for_climb
- Inherited from Tangible default_aspect_for_swing_to
- Inherited from Tangible default_posture_for_swing_to
- Inherited from Asset definite_article
- Inherited from Asset definite_name
- Inherited from Asset description
- Inherited from Asset descriptions
- Inherited from Asset did_do_verb
- Inherited from Asset did_do_verb_count
- Inherited from Asset did_try_verb
- Inherited from Asset did_try_verb_count
- Inherited from Tangible direction
- Inherited from Asset dont_use_articles
- Inherited from Tangible emits
- Inherited from Asset exclude_from_lookup
- Inherited from Tangible exit
- Inherited from Atom game
- Inherited from Atom game_name
- Inherited from Atom id
- Inherited from Asset image
- Inherited from Asset indefinite_article
- Inherited from Asset indefinite_name
- Inherited from Asset is
- Inherited from Asset is.abstract
- Inherited from Tangible is.body
- Overrides from Tangible is.closed
- Inherited from Asset is.collection
- Inherited from Asset is.destroyed
- Inherited from Asset is.direct_object_of_verb
- Inherited from Tangible is.direct_object_of_verb!hit
- Inherited from Tangible is.distant
- Inherited from Asset is.extant
- Inherited from Tangible is.fixed
- Inherited from Asset is.global
- Inherited from Tangible is.hidden
- Inherited from Tangible is.hollow
- Inherited from Asset is.initialized
- Inherited from Asset is.known
- Inherited from Tangible is.listed_in_parent
- Inherited from Tangible is.listed_in_room
- Overrides from Tangible is.locked
- Overrides from Tangible is.nameless
- Inherited from Tangible is.open
- Inherited from Tangible is.plugged
- Inherited from Asset is.pluggedIn
- Inherited from Tangible is.rideable
- Inherited from Tangible is.screwed
- Overrides from Tangible is.sealed
- Overrides from Tangible is.seen
- Inherited from Asset is.singleton
- Inherited from Tangible is.supported
- is.tryGetLinkedApertureProperty
- is.trySetLinkedApertureProperty
- Inherited from Tangible is.typing_target
- Inherited from Tangible is.unlisted_but_list_children
- Inherited from Asset is.used
- Inherited from Asset is.validated
- Inherited from Tangible is.watertight
- Inherited from Tangible is.worn
- Inherited from Tangible is.zipped
- Inherited from Tangible list_group
- Inherited from Tangible location_required
- Inherited from Tangible location_unneccessary
- Inherited from Tangible measurements
- Inherited from Tangible min_light_required_to_see
- Inherited from Tangible must_be_in_hands_to_look_through
- Inherited from Tangible must_be_in_hands_to_look_with
- Inherited from Tangible must_be_in_hands_to_read
- Inherited from Tangible must_be_worn_to_look_with
- Inherited from Tangible must_let_go_after_swing
- Inherited from Atom name
- Inherited from Asset name_is_proper
- Inherited from Asset noun
- Inherited from Asset object_of_verb
- Inherited from Tangible on_drink_destroy
- Inherited from Tangible on_drink_empty
- Inherited from Tangible on_eat_destroy
- Inherited from Tangible on_tie_to_drag_behind_rope
- Inherited from Tangible on_tie_to_this_take_this
- Inherited from Tangible opacity
- Inherited from Tangible parts
- Inherited from Tangible Overrides from Tangible place
- Inherited from Tangible player_can_climb_this
- Inherited from Tangible player_can_exit
- Inherited from Tangible player_can_hang_on_this
- Inherited from Tangible player_knows_its_hidden
- Inherited from Asset plural
- Inherited from Tangible position
- Inherited from Tangible posture_position
- Inherited from Asset print_bold
- Inherited from Asset print_italic
- Inherited from Tangible print_open_or_closed
- Inherited from Asset pronoun
- Inherited from Asset propername
- Inherited from Asset quirks
- Inherited from Tangible quirks.climb_means_go_on
- Inherited from Tangible quirks.climb_means_stand_on
- Inherited from Tangible quirks.crawl_means_go
- Inherited from Tangible quirks.get_up_means_get_off
- Inherited from Tangible quirks.go_on_means_climb
- Inherited from Tangible quirks.in_means_on
- Inherited from Tangible quirks.jump_means_jump_off
- Inherited from Tangible quirks.jump_means_jump_on
- Inherited from Tangible quirks.let_go_of_means_go_down
- Inherited from Tangible quirks.let_go_of_means_go_off
- Inherited from Tangible quirks.look_with_means_look_through
- Inherited from Tangible quirks.pick_means_unlock
- Inherited from Tangible quirks.point_means_aim
- Inherited from Tangible quirks.put_means_pour
- Inherited from Tangible quirks.stand_means_get_off
- Inherited from Tangible quirks.step_on_means_stamp_on
- Inherited from Tangible quirks.step_on_means_stand_on
- Inherited from Tangible quirks.take_means_hold
- Inherited from Tangible quirks.write_on_means_write_in
- Inherited from Tangible redirected_verbs
- Inherited from Tangible registerableClasses
- Inherited from Tangible registered_parts
- Inherited from Tangible show_things_this_is_tied_to_in_description
- Inherited from Asset singlePluralPairs
- Inherited from Asset split_name_for_world_lookup
- Inherited from Tangible things_player_can_climb_to_from_this
- Inherited from Tangible things_player_can_do_all_verbs_to_from_this
- Inherited from Tangible things_player_can_jump_to_from_this
- Inherited from Tangible things_player_can_reach_from_this
- Inherited from Tangible Overrides from Tangible things_player_can_reach_from_top_of_this
- Inherited from Tangible things_player_can_swing_to_across_this
- Inherited from Tangible things_player_can_swing_to_from_this
- Inherited from Tangible turn_positions
- Inherited from Tangible turn_rotation
- Inherited from Tangible turn_target_id
- Inherited from Tangible typing_target_id
- Inherited from Atom UID
- Inherited from Asset use_definite_article_in_lists
- Inherited from Tangible use_once_message
- Inherited from Asset verb_hooks
- Inherited from Tangible written_strings
Methods Collapse all |
Defined in: adventure/assets/tangible/$is.js, line 6
Inherited from: adventurejs.Tangible#$is
Todos: Leaving open the possibility for other params.
Parameters:
-
property
String -
asset
Object
- assetA.$is("in", assetB)
- accepts any preposition, asking, is this asset in that aspect of that asset?
- assetA.$is("nested in", assetB)
- nested in, specific to character classes, asking, is this asset nested in that asset?
- assetA.$is("closed")
- asking, is this asset closed?
- assetA.$is("locked")
- asking, is this asset locked?
- assetA.$is("plugged")
- asking, is this asset plugged?
- assetA.$is("sealed")
- asking, is this asset sealed?
- assetA.$is("held", assetB)
- asking, is this asset held by that asset, as in a bannister held by player?
- assetA.$is("holding", assetB)
- asking, is this asset holding that asset, as in player holding a rope?
- assetA.$is("worn")
- asking, is this asset being worn?
- assetA.$is("zipped")
- asking, is this asset zipped?
- assetA.$is("open")
- asking, is this asset open?
- assetA.$is("unlocked")
- asking, is this asset unlocked?
- assetA.$is("unplugged")
- asking, is this asset unplugged?
- assetA.$is("unsealed")
- asking, is this asset unsealed?
Defined in: adventure/assets/tangible/$moveTo.js, line 6
Inherited from: adventurejs.Tangible#$moveTo
Parameters:
-
aspect
String -
asset
Object
Defined in: adventure/assets/tangible/addAssetAt.js, line 6
Inherited from: adventurejs.Tangible#addAssetAt
Returns:
Array
Defined in: adventure/asset/addWordsToLookup.js, line 6
Inherited from: adventurejs.Asset#addWordsToLookup
Parameters:
-
allTheWords
Array -
typeOfWord
String
Defined in: adventure/Asset.js, line 951
Inherited from: adventurejs.Asset#aliases
Defined in: adventure/assets/tangible/areAnscestorsClosed.js, line 6
Inherited from: adventurejs.Tangible#areAnscestorsClosed
Returns:
Boolean
Defined in: adventure/assets/tangible/areAnscestorsKnown.js, line 6
Inherited from: adventurejs.Tangible#areAnscestorsKnown
Returns:
Boolean
Defined in: adventure/assets/tangible/areAnscestorsOpen.js, line 6
Inherited from: adventurejs.Tangible#areAnscestorsOpen
Returns:
Boolean
Defined in: adventure/assets/tangible/areAnscestorsUnknown.js, line 6
Inherited from: adventurejs.Tangible#areAnscestorsUnknown
Parameters:
-
nestlevel
int
Returns:
Boolean
Defined in: adventure/assets/tangible/canBePlacedInAspectOfAsset.js, line 6
Inherited from: adventurejs.Tangible#canBePlacedInAspectOfAsset
Parameters:
-
aspect
String -
asset
Object
with_assets
and
with_classes
properties.
Returns:
Boolean
Defined in: adventure/assets/tangible/canContainAnySubstance.js, line 6
Inherited from: adventurejs.Tangible#canContainAnySubstance
Returns:
Boolean
Defined in: adventure/assets/tangible/canContainAssetAt.js, line 6
Inherited from: adventurejs.Tangible#canContainAssetAt
Parameters:
-
object
Object
Returns:
Boolean
Defined in: adventure/assets/tangible/canPlayerNest.js, line 9
Inherited from: adventurejs.Tangible#canPlayerNest
Parameters:
-
aspect
String
A Tangible Aspect ID.
Returns:
Boolean
Defined in: adventure/assets/tangible/canPlayerReachThatFromThis.js, line 6
Inherited from: adventurejs.Tangible#canPlayerReachThatFromThis
Parameters:
-
object
Object
Returns:
Boolean
Defined in: adventure/asset/canSetVerbState.js, line 6
Inherited from: adventurejs.Asset#canSetVerbState
Parameters:
-
verb
String
Returns:
Boolean
Defined in: adventure/assets/Tangible.js, line 2151
Inherited from: adventurejs.Tangible#destroy
Todos: What else needs to happen on destroy?
Defined in: adventure/asset/didDoVerbs.js, line 6
Inherited from: adventurejs.Asset#didDoVerbs
Parameters:
-
verbs
Array
Returns:
Boolean
Defined in: adventure/asset/didIoVerbs.js, line 6
Inherited from: adventurejs.Asset#didIoVerbs
Parameters:
-
verbs
Array
Returns:
Boolean
Defined in: adventure/assets/tangible/doesContainAnyAsset.js, line 6
Inherited from: adventurejs.Tangible#doesContainAnyAsset
Returns:
Boolean
Defined in: adventure/assets/tangible/doesContainAnyAssetAt.js, line 6
Inherited from: adventurejs.Tangible#doesContainAnyAssetAt
Parameters:
-
aspect
String
Returns:
Boolean
Defined in: adventure/assets/tangible/doesContainAnySubstance.js, line 6
Inherited from: adventurejs.Tangible#doesContainAnySubstance
Returns:
Boolean
Defined in: adventure/assets/tangible/doesContainAnySubstanceAt.js, line 6
Inherited from: adventurejs.Tangible#doesContainAnySubstanceAt
Parameters:
-
aspect
String
Returns:
Boolean
Defined in: adventure/assets/tangible/doesContainAsset.js, line 6
Inherited from: adventurejs.Tangible#doesContainAsset
Parameters:
-
id
String
Returns:
String
Defined in: adventure/assets/tangible/doesContainAssetAt.js, line 6
Inherited from: adventurejs.Tangible#doesContainAssetAt
Parameters:
-
id
String -
aspect
String
Returns:
Boolean
Defined in: adventure/assets/tangible/doesContainSubstance.js, line 6
Inherited from: adventurejs.Tangible#doesContainSubstance
Parameters:
-
id
String
Returns:
String
Defined in: adventure/assets/tangible/doesContainSubstanceAt.js, line 6
Inherited from: adventurejs.Tangible#doesContainSubstanceAt
Parameters:
-
id
String -
aspect
String
Returns:
Boolean
Defined in: adventure/asset/DOVallowOnce.js, line 6
Inherited from: adventurejs.Asset#DOVallowOnce
Parameters:
-
verb
String
Returns:
Boolean
Defined in: adventure/asset/DOVallowWithAnything.js, line 6
Inherited from: adventurejs.Asset#DOVallowWithAnything
Parameters:
-
verb
String
Returns:
Boolean
Defined in: adventure/asset/DOVallowWithAsset.js, line 6
Inherited from: adventurejs.Asset#DOVallowWithAsset
Parameters:
-
verb
String -
asset
Object
Returns:
Boolean
Defined in: adventure/asset/DOVallowWithNothing.js, line 6
Inherited from: adventurejs.Asset#DOVallowWithNothing
Parameters:
-
verb
String
Returns:
Boolean
Defined in: adventure/asset/DOVdidDo.js, line 6
Inherited from: adventurejs.Asset#DOVdidDo
Parameters:
-
verb
String
_didDo is an alias meant for authors.
Returns:
Boolean
Defined in: adventure/asset/DOVdidDoCount.js, line 6
Inherited from: adventurejs.Asset#DOVdidDoCount
Parameters:
-
verb
String
_doCount is an alias meant for authors.
Returns:
Int
Defined in: adventure/asset/DOVdidTry.js, line 6
Inherited from: adventurejs.Asset#DOVdidTry
Parameters:
-
verb
String
_didTry is an alias meant for authors.
Returns:
Boolean
Defined in: adventure/asset/DOVdidTryCount.js, line 6
Inherited from: adventurejs.Asset#DOVdidTryCount
Parameters:
-
verb
String
_tryCount is an alias meant for authors.
Returns:
Boolean
Defined in: adventure/asset/DOVgetConnectionCount.js, line 6
Inherited from: adventurejs.Asset#DOVgetConnectionCount
Parameters:
-
verb
String
The name of a verb.
Returns:
Int
Defined in: adventure/asset/DOVgetConnections.js, line 6
Inherited from: adventurejs.Asset#DOVgetConnections
Parameters:
-
verb
String
The name of a verb.
Returns:
Array
Defined in: adventure/asset/DOVgetMaxConnections.js, line 6
Inherited from: adventurejs.Asset#DOVgetMaxConnections
Parameters:
-
verb
String
The name of a verb.
Returns:
Int
Defined in: adventure/asset/DOVhasIndirectObjects.js, line 6
Inherited from: adventurejs.Asset#DOVhasIndirectObjects
Parameters:
-
verb
String
Returns:
Boolean
Defined in: adventure/asset/DOVhasMaxConnections.js, line 6
Inherited from: adventurejs.Asset#DOVhasMaxConnections
Parameters:
-
verb
String
The name of a verb.
Returns:
Boolean
Defined in: adventure/asset/DOVincrementDoCount.js, line 6
Inherited from: adventurejs.Asset#DOVincrementDoCount
Parameters:
-
verb
String
Defined in: adventure/asset/DOVincrementTryCount.js, line 6
Inherited from: adventurejs.Asset#DOVincrementTryCount
Parameters:
-
verb
String
Defined in: adventure/asset/DOVisConnectedToAnything.js, line 6
Inherited from: adventurejs.Asset#DOVisConnectedToAnything
Parameters:
-
verb
String
The name of a verb.
plugIn
or tie
. For example, if this asset
is a computer plugged into an outlet, this method would return true.
Returns:
Boolean
Defined in: adventure/asset/DOVisConnectedToAsset.js, line 6
Inherited from: adventurejs.Asset#DOVisConnectedToAsset
Parameters:
-
verb
String
The name of the verb to test. -
asset
Object | String
A game asset or asset id to test.
Returns:
Boolean
Defined in: adventure/asset/DOVisConnectedToNothing.js, line 6
Inherited from: adventurejs.Asset#DOVisConnectedToNothing
Parameters:
-
verb
String
The name of a verb.
asset.is.direct_object_of_verb.plugIn.with_params.connections
to represent the computer's plugged in state.
Returns:
Boolean
Defined in: adventure/asset/DOVsetConnection.js, line 6
Inherited from: adventurejs.Asset#DOVsetConnection
Parameters:
-
verb
String -
asset
Object
Defined in: adventure/asset/DOVsetWithAsset.js, line 6
Inherited from: adventurejs.Asset#DOVsetWithAsset
Parameters:
-
verb
String -
asset
Object
Returns:
Boolean
Defined in: adventure/asset/DOVsetWithClass.js, line 6
Inherited from: adventurejs.Asset#DOVsetWithClass
Parameters:
-
verb
String -
clas
String
Returns:
Boolean
Defined in: adventure/asset/DOVunsetConnection.js, line 6
Inherited from: adventurejs.Asset#DOVunsetConnection
Parameters:
-
verb
String -
asset
Object
Defined in: adventure/assets/Tangible.js, line 1498
Inherited from: adventurejs.Tangible#event_hooks
Todos: move all this!
MyGame.createAsset({
class: "Bicycle",// THIS asset to be nested to
name: "bicycle",
event_hooks: {
onNestThatToThis: {
"Mighty Hero": function(params){ // THAT asset to be nested
MyGame.prependToNextPrint("You wobble a bit getting on the bike. ");
MyGame.appendToNextPrint("Success! ");
}
},
},
});
This example only adds some text to the output for the turn,
but overrides can be used to add any kind of logic. Here's are
some of the reactions that can be overriden:
Defined in: adventure/assets/tangible/$get.js, line 6
Inherited from: adventurejs.Tangible#get
Parameters:
-
property
String -
qualifier
String
- all - list things anywhere in this
- behind - list things behind this
- in - list things in this
- on - list things on this
- under - list things under this
- attached - list things attached to this
Defined in: adventure/assets/tangible/getAllContents.js, line 6
Inherited from: adventurejs.Tangible#getAllContents
Returns:
Array
Defined in: adventure/assets/tangible/getAllNestedContents.js, line 6
Inherited from: adventurejs.Tangible#getAllNestedContents
Returns:
Array
Defined in: adventure/assets/tangible/getAncestorId.js, line 6
Inherited from: adventurejs.Tangible#getAncestorId
Returns:
String
Defined in: adventure/assets/tangible/getAnySubstanceThisContains.js, line 6
Inherited from: adventurejs.Tangible#getAnySubstanceThisContains
Returns:
String
Defined in: adventure/assets/tangible/getAspectAt.js, line 6
Inherited from: adventurejs.Tangible#getAspectAt
Parameters:
-
aspect
string
The aspect to get.
Returns:
Object
|
Null
Defined in: adventure/assets/tangible/getAspectWithVessel.js, line 6
Inherited from: adventurejs.Tangible#getAspectWithVessel
Returns:
String
Defined in: adventure/assets/tangible/getClosedAnscestors.js, line 6
Inherited from: adventurejs.Tangible#getClosedAnscestors
Returns:
Array
Defined in: adventure/assets/tangible/getContentsAt.js, line 6
Inherited from: adventurejs.Tangible#getContentsAt
Returns:
Array
Defined in: adventure/assets/tangible/getCountOfListableContentsAt.js, line 6
Inherited from: adventurejs.Tangible#getCountOfListableContentsAt
Parameters:
-
where
String
Returns:
int
Defined in: adventure/asset/getDescription.js, line 6
Inherited from: adventurejs.Asset#getDescription
Parameters:
-
description
String
Returns:
String
Defined in: adventure/asset/getIndirectDescription.js, line 6
Inherited from: adventurejs.Asset#getIndirectDescription
Parameters:
-
indirect_aspect
String -
indirect_asset
Object -
direct_aspect
String
Returns:
String
Defined in: adventure/Atom.js, line 238
Inherited from: adventurejs.Atom#getInheritance
Returns:
Array
Defined in: adventure/assets/tangible/getListableContents.js, line 6
Inherited from: adventurejs.Tangible#getListableContents
Returns:
Array
Defined in: adventure/assets/tangible/getNestedInstancesOfClass.js, line 6
Inherited from: adventurejs.Tangible#getNestedInstancesOfClass
Parameters:
-
instanceClass
String
Returns:
Array
Defined in: adventure/assets/tangible/getOpenOrClosed.js, line 6
Inherited from: adventurejs.Tangible#getOpenOrClosed
Returns:
Array
Defined in: adventure/assets/tangible/getPlaceAspect.js, line 6
Inherited from: adventurejs.Tangible#getPlaceAspect
Returns:
Object
|
null
Defined in: adventure/assets/tangible/getPlacePreposition.js, line 6
Inherited from: adventurejs.Tangible#getPlaceAspectId
Returns:
String
Defined in: adventure/assets/tangible/getPlaceAsset.js, line 6
Inherited from: adventurejs.Tangible#getPlaceAsset
Returns:
Object
|
Boolean
Defined in: adventure/assets/tangible/getPlaceAssetId.js, line 6
Inherited from: adventurejs.Tangible#getPlaceAssetId
Returns:
String
Defined in: adventure/assets/tangible/getPrintableListOfContents.js, line 6
Inherited from: adventurejs.Tangible#getPrintableListOfContents
Parameters:
-
params
Object
Returns:
String
Defined in: adventure/Atom.js, line 184
Inherited from: adventurejs.Atom#getProperty
Parameters:
-
prop
String
Name of the property to test for. Can include dot notation.
if(false === foo.bar.baz)
comparisons.
Returns:
Boolean
Defined in: adventure/assets/tangible/getRoomAsset.js, line 6
Inherited from: adventurejs.Tangible#getRoomAsset
Returns:
String
Defined in: adventure/assets/tangible/getRoomId.js, line 6
Inherited from: adventurejs.Tangible#getRoomId
Returns:
String
Defined in: adventure/assets/tangible/getRopesThatBlockTravel.js, line 6
Inherited from: adventurejs.Tangible#getRopesThatBlockTravel
Returns:
Array
Defined in: adventure/assets/tangible/getSubstanceAt.js, line 6
Inherited from: adventurejs.Tangible#getSubstanceAt
Returns:
String
Defined in: adventure/assets/tangible/getThingThisIsTiedToPlayerBy.js, line 6
Inherited from: adventurejs.Tangible#getThingThisIsTiedToPlayerBy
Returns:
Object
Defined in: adventure/assets/tangible/getTiedThingsThatDragOnTravel.js, line 6
Inherited from: adventurejs.Tangible#getTiedThingsThatDragOnTravel
Returns:
Array
Defined in: adventure/assets/tangible/getVesselAt.js, line 6
Inherited from: adventurejs.Tangible#getVesselAt
Parameters:
-
aspect
string
The aspect to check.
Returns:
Object
|
Null
Defined in: adventure/assets/tangible/getYBottom.js, line 6
Inherited from: adventurejs.Tangible#getYBottom
Returns:
Float
Defined in: adventure/assets/tangible/getYRange.js, line 6
Inherited from: adventurejs.Tangible#getYRange
Returns:
Object
Defined in: adventure/assets/tangible/getYTop.js, line 6
Inherited from: adventurejs.Tangible#getYTop
Returns:
Float