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

Class:Nest

Extends: AdventureJS.Atom

Defined in: Adventure/Assets/Helpers/Nest.js, line 5

Description

Nest is a special class that adds the ability for Rooms and other Asset types Characters inside Aspects. The Nest stores a group of properties that determine how a character can interact with its container.

Private Constructor:

var foo = new Nest(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:

Properties:

Methods Collapse all  |  Expand all

getClassInheritance
getClassInheritance() → {Array}

Defined in: Adventure/Atom.js, line 200

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
hasClass
hasClass(prop) → {Boolean}

Defined in: Adventure/Atom.js, line 174

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
set
set(props) → {Object}

Defined in: Adventure/Atom.js, line 162

Overrides 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.)

Properties  | 

can.cling
can.cling :Boolean

Defined in: Adventure/Assets/Helpers/Nest.js, line 64

Default value: false

Nested property of Can

Nests can be set to permit or prevent players from assuming certain postures. For example:

MyGame.createAsset({
  class: "Tree",
  name: "redwood tree",
  descriptions: { look: "A giant redwood tree. " },
  aspects:
  {
    on: { nest: { can: { cling: true } } }
  }
});
can.feel
can.feel :Boolean

Defined in: Adventure/Assets/Helpers/Nest.js, line 192

Default value: true

Nested property of Can

Nests can be set to deprive players of sensations while they are in them. For example:

MyGame.createAsset({
  class: "Bed",
  name: "deprivation tank",
  descriptions: { look: "A deprivation tank. " },
  aspects:
  {
    on: { nest: { can: { feel: true } } }
  }
});
can.float
can.float :Boolean

Defined in: Adventure/Assets/Helpers/Nest.js, line 82

Default value: false

Nested property of Can

Nests can be set to permit or prevent players from assuming certain postures. For example:

MyGame.createAsset({
  class: "Ocean",
  name: "inland ocean",
  descriptions: { look: "A vast inland ocean. " },
  aspects:
  {
    in: { nest: { can: { float: true } } }
  }
});
can.hang
can.hang :Boolean

Defined in: Adventure/Assets/Helpers/Nest.js, line 100

Default value: false

Nested property of Can

Nests can be set to permit or prevent players from assuming certain postures. For example:

MyGame.createAsset({
  class: "Window",
  name: "tower window",
  descriptions: { look: "A high placed window. " },
  aspects:
  {
    on: { nest: { can: { hang: true } } }
  }
});
can.hear
can.hear :Boolean

Defined in: Adventure/Assets/Helpers/Nest.js, line 210

Default value: true

Nested property of Can

Nests can be set to deprive players of sensations while they are in them. For example:

MyGame.createAsset({
  class: "Bed",
  name: "deprivation tank",
  descriptions: { look: "A deprivation tank. " },
  aspects:
  {
    on: { nest: { can: { hear: true } } }
  }
});
can.kneel
can.kneel :Boolean

Defined in: Adventure/Assets/Helpers/Nest.js, line 118

Default value: false

Nested property of Can

Nests can be set to permit or prevent players from assuming certain postures. For example:

MyGame.createAsset({
  class: "Bed",
  name: "deprivation tank",
  descriptions: { look: "A deprivation tank. " },
  aspects:
  {
    on: { nest: { can: { kneel: true } } }
  }
});
can.lie
can.lie :Boolean

Defined in: Adventure/Assets/Helpers/Nest.js, line 136

Default value: false

Nested property of Can

Nests can be set to permit or prevent players from assuming certain postures. For example:

MyGame.createAsset({
  class: "Bed",
  name: "deprivation tank",
  descriptions: { look: "A deprivation tank. " },
  aspects:
  {
    on: { nest: { can: { lie: true } } }
  }
});
can.reach
can.reach :Array

Defined in: Adventure/Assets/Helpers/Nest.js, line 283

Default value: []

Nested property of Can

When player is nested within an aspect of an asset, other assets may not be reachable. reach enforces reachability of one asset from another. For example, if player is on a ladder, things on the ground might not be reachable. But, a player seated on a chair at a desk should be able to reach the desk and anything on it. Use this property to explicitly make some things reachable from other things. For example:

MyGame.createAsset({
  class: "Chair",
  name: "chair",
  descriptions: { look: "An office chair. " },
  aspects:
  {
    on: { nest: { can: { reach: [ 'desk' ] } } }
  }
});
can.see
can.see :Boolean

Defined in: Adventure/Assets/Helpers/Nest.js, line 228

Default value: true

Nested property of Can

Nests can be set to deprive players of sensations while they are in them. For example:

MyGame.createAsset({
  class: "Bed",
  name: "deprivation tank",
  descriptions: { look: "A deprivation tank. " },
  aspects:
  {
    on: { nest: { can: { see: true } } }
  }
});
can.sit
can.sit :Boolean

Defined in: Adventure/Assets/Helpers/Nest.js, line 154

Default value: false

Nested property of Can

Nests can be set to permit or prevent players from assuming certain postures. For example:

MyGame.createAsset({
  class: "Bed",
  name: "deprivation tank",
  descriptions: { look: "A deprivation tank. " },
  aspects:
  {
    on: { nest: { can: { sit: true } } }
  }
});
can.smell
can.smell :Boolean

Defined in: Adventure/Assets/Helpers/Nest.js, line 246

Default value: true

Nested property of Can

Nests can be set to deprive players of sensations while they are in them. For example:

MyGame.createAsset({
  class: "Bed",
  name: "deprivation tank",
  descriptions: { look: "A deprivation tank. " },
  aspects:
  {
    on: { nest: { can: { smell: true } } }
  }
});
can.stand
can.stand :Boolean

Defined in: Adventure/Assets/Helpers/Nest.js, line 172

Default value: false

Nested property of Can

Nests can be set to permit or prevent players from assuming certain postures. For example:

MyGame.createAsset({
  class: "Bed",
  name: "deprivation tank",
  descriptions: { look: "A deprivation tank. " },
  aspects:
  {
    on: { nest: { can: { stand: true } } }
  }
});
can.taste
can.taste :Boolean

Defined in: Adventure/Assets/Helpers/Nest.js, line 264

Default value: true

Nested property of Can

Nests can be set to deprive players of sensations while they are in them. For example:

MyGame.createAsset({
  class: "Bed",
  name: "deprivation tank",
  descriptions: { look: "A deprivation tank. " },
  aspects:
  {
    on: { nest: { can: { taste: true } } }
  }
});
game
game :Getter

Defined in: Adventure/Atom.js, line 141

Inherited from: AdventureJS.Atom#game

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

Defined in: Adventure/Atom.js, line 117

Inherited from: AdventureJS.Atom#id

id returns the id of the class instance.
name
name :String

Defined in: Adventure/Atom.js, line 62

Overrides from: AdventureJS.Atom#name

Class identifier to be provided in the asset definition. All game objects start as generic objects that get passed to createAsset, which uses an object's class field to specify a class constructor.
Name
Name :String

Defined in: Adventure/Atom.js, line 128

Inherited from: AdventureJS.Atom#Name

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