Atom

Bluespess. Atom

The quintessential object class, the type of every object.

Constructor

new Atom(server, template, location)

Source:
Parameters:
Name Type Description
server Bluespess The server object
template template The template
location Location | Bluespess.Atom | null The starting location. You can also add 3 arguments x,y,z alternatively

Members

alpha :number|null

Source:
The transparency of this atom.
Type:
  • number | null

base_loc :Location|Null

Source:
The Location object up the tree.
Type:

base_mover :Bluespess.Atom|Null

Source:
The Atom up the tree whos loc is a Location.
Type:

bounds_height :number

Source:
Default Value:
  • 1
Type:
  • number

bounds_width :number

Source:
Default Value:
  • 1
Type:
  • number

bounds_x :number

Source:
Default Value:
  • 0
Type:
  • number

bounds_y :number

Source:
Default Value:
  • 0
Type:
  • number

c

Source:
See:
Alias for components

color :string|null

Source:
The color of this, in CSS color format.
Type:
  • string | null

components :Object.<string, Bluespess.Component>

Source:
See:
The components for this object.
Type:

contents :Array.<Bluespess.Atom>

Source:
A list of atoms whos loc is this atom.
Type:

density :number

Source:
Whether it's dense or not. 1 means that it can't be crossed, 0 means that it can be crossed, -1 means that it passes through everything, even with density 1.
Type:
  • number

destroyed :boolean

Source:
Default Value:
  • false
See:
Type:
  • boolean

dir :number

Source:
The direction this atom points
Type:
  • number

fine_loc :Object

Source:
Properties:
Name Type Default Description
x number
y number
z number
loc Bluespess.Atom | Location | null
is_fine_loc boolean true
Type:
  • Object

flick :Object

Source:
Properties:
Name Type Attributes Description
icon string <optional>
Bluespess.Atom#icon
icon_state string <optional>
Bluespess.Atom#icon_state
dir number <optional>
Bluespess.Atom#dir
overlays Object <optional>
Bluespess.Atom#overlays
time_begin number <optional>
A temporary animation that is shown on this atom.
Type:
  • Object

gender :string

Source:
Default Value:
  • "neutral"
Can be "neutral", "male", "female", or "plural".
Type:
  • string

glide_size :number

Source:
How fast this atom's position is interpolated on the client, in tiles per second
Type:
  • number

icon :string

Source:
The path to the icon file of this atom
Type:
  • string

icon_state :string

Source:
The icon to pick from the icon file
Type:
  • string

layer :number

Source:
The layer this atom is on. Used to control which atoms show up above which other atoms.
Type:
  • number

let_pass_flags :number

Source:
A bitfield for ability of other objects to pass through this one.
Type:
  • number

loc :Bluespess.Atom|Location|null

Source:
Type:

mouse_opacity :number

Source:
Controls how this atom responds to mouse events. 2 means use the whole bounding box, 1 means where the icon has a nonzero alpha, and 0 means never receive mouse events.
Type:
  • number

name :string

Source:
Type:
  • string

opacity :boolean

Source:
Whether this atom blocks visibility.
Type:
  • boolean

overlays :Object

Source:
Properties:
Name Type Description
Object
Properties
Name Type Attributes Default Description
icon string <optional>
Bluespess.Atom#icon
icon_state string <optional>
Bluespess.Atom#icon_state The string [parent] gets replaced with this atom's icon_state by the client, or the current flick's.
dir number <optional>
Bluespess.Atom#dir
color string <optional>
Bluespess.Atom#color
alpha string <optional>
Bluespess.Atom#alpha
overlay_layer number <optional>
0 set negative to display below the atom, and 0 or greater for above the atom. Also use to control which overlays show in front.
The overlays of this object. They are named, unlike BYOND where it's just a list.
Type:
  • Object

pass_flags :number

Source:
A bitfield for ability to pass through other objects.
Type:
  • number

screen_loc_x :number|null

Source:
Overrides the x position on the screen of this atom. Used for hud elements.
Type:
  • number | null

screen_loc_y :number|null

Source:
Overrides the y position on the screen of this atom. Used for hud elements.
Type:
  • number | null

server :Bluespess

Source:
The server object
Type:

template :template

Source:
The template this atom was constructed with. Useful to get the initial values of variables.
Type:
  • template

visible :boolean

Source:
Whether this atom gets sent to clients or not.
Type:
  • boolean

walk_delay :number

Source:
Default Value:
  • 150
See:
Type:
  • number

walk_dir :number

Source:
See:
Type:
  • number

walk_reason :number

Source:
Default Value:
  • "walking"
See:
Type:
  • number

walk_size :number

Source:
Default Value:
  • 1
See:
Type:
  • number

walking :boolean

Source:
Whether this atom should walk. This calls Bluespess.Atom.move. It automatically sets Bluespess.Atom.glide_size to the correct value to ensure that the movement does not appear jerky. The Bluespess.Atom.walk_delay property can be updated in an overrided Bluespess.Atom.move and it will still look correct.
Type:
  • boolean

x :number

Source:
Type:
  • number

y :number

Source:
Type:
  • number

z :number

Source:
Type:
  • number

Methods

(abstract) can_be_crossed(crosser, offsetx, offsety, reason)

Source:
Whether this atom can be crossed by the given atom. By default performs checks using the densities and the pass flags
Parameters:
Name Type Description
crosser Bluespess.Atom
offsetx number
offsety number
reason number

(abstract) can_be_uncrossed(uncrosser, offsetx, offsety, reason)

Source:
Whether this atom can be uncrossed by the given atom.
Parameters:
Name Type Description
uncrosser Bluespess.Atom
offsetx number
offsety number
reason number

(abstract) can_cross(crossing, offsetx, offsety, reason)

Source:
Whether this atom can cross the given atom. Calls Bluespess.Atom.can_be_crossed crosser by default
Parameters:
Name Type Description
crossing Bluespess.Atom
offsetx number
offsety number
reason number

(abstract) can_move(offsetx, offsety, reason)

Source:
Whether this atom can move the given amount
Parameters:
Name Type Description
offsetx number
offsety number
reason number

(abstract) can_uncross(uncrossing, offsetx, offsety, reason)

Source:
Whether this atom can cross the given atom. Calls Bluespess.Atom.can_be_uncrossed on the uncrosser by default
Parameters:
Name Type Description
uncrossing Bluespes.Atom
offsetx number
offsety number
reason number

(generator) crosses()

Source:
Returns an iterator with the atoms this atom is intersecting.

destroy()

Source:
Deletes this object from the world.

does_cross(atom, overrides)

Source:
Checks if this atom crosses the target atom
Parameters:
Name Type Description
atom Bluespess.Atom
overrides Object Overrides for the location and bounding box parameters to use for this atom

does_enclose_tile(tile) → {boolean}

Source:
Checks if this atom encloses the given location.
Parameters:
Name Type Description
tile Location
Returns:
Type
boolean

(generator) marginal_locs()

Source:
Returns an iterator with all the Locations this intersects, even by an edge.

move(offsetx, offsety, reason)

Source:
Moves this atom the given amount
Parameters:
Name Type Description
offsetx number
offsety number
reason string

(generator) partial_locs()

Source:
Returns an iterator with all the Locations this intersects

(generator) recursive_contents()

Source:

test_move(newX, newY) → {Object}

Source:
Properties:
Name Type Description
gained_crossers Array.<Bluespess.Atom>
lost_crossers Array.<Bluespess.Atom>
common_crossers Array.<Bluespess.Atom>
Parameters:
Name Type Description
newX number
newY number
Returns:
Type
Object

Events

before_enter

Source:
Fires before another atom enters this atom's contents list
Type:

before_exit

Source:
Fires before another atom leaves this atom's contents list
Type:

before_move

Source:
Fires before any type of movement occurs. This cannot be used to prevent the movement from occuring.
Type:

clicked

Source:
Event name is prepended with, if applicable: ctrl_, alt_, shift_, middle_ in that order.
Type:

crossed

Source:
Fires when this atom moves and begins intersecting another atom
Parameters:
Name Type Description
crossing Bluespess.Atom
movement movement

crossed_by

Source:
Fires when another atom moves and begins intersecting this atom
Parameters:
Name Type Description
crosser Bluespess.Atom
movement movement

entered

Source:
Fires when another atom enters this atom's contents list
Type:

exited

Source:
Fires when another atom leaves this atom's contents list
Type:

mouse_dragged_to

Source:
Properties:
Name Type Description
from mouse_event
to mouse_event
client Client
mob Bluespess.Atom.<Mob>
Type:
  • Object

mouse_dropped_by

Source:
Properties:
Name Type Description
from mouse_event
to mouse_event
client Client
mob Bluespess.Atom.<Mob>
Type:
  • Object

moved

Source:
Fires when this atom moves.
Type:

parent_moved

Source:
Fires when an atom that contains this atom moves, recursively..
Type:

uncrossed

Source:
Fires when this atom moves and stops intersecting another atom
Parameters:
Name Type Description
uncrossing Bluespess.Atom
movement movement

uncrossed_by

Source:
Fires when another atom moves and stops intersecting this atom
Parameters:
Name Type Description
uncrosser Bluespess.Atom
movement movement