SS1984 - Modules - TypesVar Details - Proc Details

atom

The base type for nearly all physical objects in SS13

Lots and lots of functionality lives here, although in general we are striving to move as much as possible to the components/elements system

Vars

active_hud_listall of this atom's HUD images which can actually be seen by players with that hud
ai_controllerAI controller that controls this atom. type on init, then turned into an instance during runtime
alternate_appearancesThe alternate appearances we own
base_icon_stateUsed for changing icon states for different base sprites.
base_pixel_wDefault pixel w shifting for the atom's icon.
base_pixel_xDefault pixel x shifting for the atom's icon.
base_pixel_yDefault pixel y shifting for the atom's icon.
base_pixel_zDefault pixel z shifting for the atom's icon.
bubble_iconWhat icon the mob uses for speechbubbles
buckle_message_cdCooldown tick timer for buckle messages
cached_color_filterCurrently used color filter - cached because its applied to all of our overlays because BYOND is horrific
canSmoothWithList of smoothing groups this atom can smooth with. If this is null and atom is smooth, it smooths only with itself. Must be sorted.
can_astar_passHow this atom should react to having its astar blocking checked
cares_about_temperatureDo we care about temperature at all? Saves us a ton of proc calls during big fires.
chat_colorLast color calculated for the the chatmessage overlays. Used for caching.
chat_color_darkenedA luminescence-shifted value of the last color calculated for chatmessage overlays
chat_color_nameLast name used to calculate a color for the chatmessage overlays. Used for caching.
container_typeChemistry.
demo_last_appearanceLast appearance of the atom for demo saving purposes
examine_thatsText that appears preceding the name in /atom/proc/examine_title
gravity_sourcesSources that changes gravity of object. Treated as lazy list.
greyscale_colorsA string of hex format colors to be used by greyscale sprites, ex: "#0054aa#badcff"
greyscale_configThe config type to use for greyscaled sprites. Both this and greyscale_colors must be assigned to work.
hud_listall of this atom's HUD (med/sec, etc) images. Associative list of the form: list(hud category = hud image or images for that category). most of the time hud category is associated with a single image, sometimes its associated with a list of images. not every hud in this list is actually used. for ones available for others to see, look at active_hud_list.
hud_possibleHUD images that this atom can provide.
ignored_gravity_sourcesSources that 100% won't changes gravity of object. Treated as lazy list.
interaction_flags_atomIntearaction flags
interaction_flags_clickFlags to check for in can_perform_action. Used in alt-click & ctrl-click checks
interaction_flags_mouse_dropFlags to check for in can_perform_action for mouse drag & drop checks. To bypass checks see interaction_flags_atom mouse drop flags
lightOur light source. Don't fuck with this directly unless you have a good reason!
light_colorHexadecimal RGB string representing the colour of the light. White by default.
light_flagsBitflags to determine lighting-related atom properties.
light_onBoolean variable for toggleable lights. Has no effect without the proper light_system, light_range and light_power values.
light_powerIntensity of the light. The stronger, the less shadows you will see on the lit area.
light_rangeRange of the light in tiles. Zero means no light.
light_sourcesAny light sources that are "inside" of us, for example, if src here was a mob that's carrying a flashlight, that flashlight's light source would be part of this list.
light_systemLight systems, both shouldn't be active at the same time.
managed_overlaysoverlays managed by update_overlays to prevent removing overlays that weren't added by the same proc. Single items are stored on their own, not in a list.
managed_vis_overlaysvis overlays managed by SSvis_overlays to automaticaly turn them like other overlays.
map_json_dataThis var isn't actually used for anything, but is present so that DM's map reader doesn't forfeit on reading a JSON-serialized map
pass_flagsThings we can pass through while moving. If any of this matches the thing we're trying to pass's [pass_flags_self], then we can pass through.
pass_flags_selfpass_flags that we are. If any of this matches a pass_flag on a moving thing, by default, we let them through.
post_init_icon_stateThe icon state that will be switched to during initialization. Mostly intended for things that have a special map icon.
proximity_monitorProximity monitor associated with this atom, needed for proximity checks.
rad_insulationRadiation insulation types
realized_overlaysList of overlay "keys" (info about the appearance) -> mutable versions of static appearances Drawn from the overlays list
realized_underlaysList of underlay "keys" (info about the appearance) -> mutable versions of static appearances Drawn from the underlays list
resistance_flagsFlags that make this object harder to destroy, e.g. ACID_PROOF, FIRE_PROOF, INDESTRUCTIBLE.
ru_namesСписок склонений русского названия атома в разных грамматических падежах. Формат: list(CASE_ID = "name_in_case", ...)
smoothing_groupsWhat smoothing groups does this atom belongs to, to match canSmoothWith. If null, nobody can smooth with it. Must be sorted.
smoothing_junctionWhat directions this is currently smoothing with. IMPORTANT: This uses the smoothing direction flags as defined in icon_smoothing.dm, instead of the BYOND flags.
suit_fibersList of fibers that this atom has
update_on_zLazylist of all images (hopefully attached to us) to update when we change z levels You will need to manage adding/removing from this yourself, but I'll do the updating for you
update_overlays_on_zLazylist of all overlays attached to us to update when we change z levels You will need to manage adding/removing from this yourself, but I'll do the updating for you Oh and note, if order of addition is important this WILL break that. so mind yourself

Procs

AdjacentAdjacency proc for determining touch range
AllowDropAre you allowed to drop stuff inside this atom
BeamThis is what you use to start a beam. Example: origin.Beam(target, args). Store the return of this proc if you don't set maxdist or time, you need it to delete the beam.
CanAStarPassThis proc is used for telling whether something can pass by this atom in a given direction, for use by the pathfinding system.
CanAllowThroughReturns true or false to allow the mover to move through src
CanPassWhether the mover object can avoid being blocked by this atom, while arriving from (or leaving through) the border_dir.
ClickBefore anything else, defer these calls to a per-mobtype handler. This allows us to remove istype() spaghetti code, but requires the addition of other handler procs to simplify it.
EnteredAn atom has entered this atom's contents
ExitAn atom is attempting to exit this atom's contents
ExitedAn atom has exited this atom's contents
GetTotalContentsWeightSearches contents of the atom and returns the sum of all w_class of obj/item within
HasProximityIs this atom within 1 tile of another atom
InitializeThe primary method that objects are setup in SS13 with
InitializeAIControllerInstantiates the AI controller of this atom. Override this if you want to assign variables first.
IsContainedAtomAccessibleReturns TRUE if an atom contained within our contents is reachable.
IsReachableByReturns TRUE if a movable can "Reach" this atom. This is defined as adjacency
LateInitializeLate Initialization, for code that should run after all atoms have run Initialization
MouseDropMouseDrop:
MouseEnteredUpdate the screentip to reflect what we're hovering over
NewCalled when an atom is created in byond (built in engine proc)
ShakePerform a shake on an atom, resets its position afterwards
TopicPasses Stat Browser Panel clicks to the game and calls client click on an atom
_Clickstupid workaround for byond not recognizing the /atom/Click typepath for the queued click callbacks
acid_actRespond to acid being used on our atom
add_contextCreates a "Type-B" contextual screentip interaction. When a user hovers over this, this proc will be called in order to provide context for contextual screentips. You must call register_context() in order for this to be registered. A screentip context list is a list that has context keys (SCREENTIP_CONTEXT_*, from __DEFINES/screentips.dm) that map to the action as text. If you mutate the list in this signal, you must return CONTEXTUAL_SCREENTIP_SET. source can, in all cases, be replaced with src, and only exists because this proc directly connects to a signal.
add_debris_elementAdds the debris element for projectile impacts.
add_fibersclient/New() client/Del() turf/setDir() atom/movable/setDir(newdir, forced = FALSE)
add_persistent_overlayAdds a special overlay to any atom. This overlay will always persist even when an atom is updating its overlays.
add_shared_particlesAdds (or creates and adds) a shared particle holder Shared particle holders are held in nullspace and added to vis_contents of all atoms using it in order to save clientside performance by making clients only render 3-5 particle holders for 400 objects using them. This should be prioritized over normal particles when possible if it is known that there will be a lot of objects using certain particles. custom_key can be used to create a new pool of already existing particle type in case you're planning to edit holder's color or properties pool_size controls how many particle holders per type are created. Any objects over this cap will pick an existing holder from the pool.
apply_message_emphasisScans the input sentence for message emphasis modifiers, notably |italics|, +bold+, and underline -mothblocks
attack_ai_secondaryWhat happens when the AI holds right-click on an item. Returns a SECONDARY_ATTACK_* value.
attack_alien_secondaryCalled when an alien right clicks an atom. Returns a SECONDARY_ATTACK_* value.
attack_animal_secondaryCalled when a simple animal or basic mob right clicks an atom. Returns a SECONDARY_ATTACK_* value.
attack_hand_secondaryWhen the user uses their hand on an item while holding right-click Returns a SECONDARY_ATTACK_* value.
attack_larva_secondaryCalled when an alien larva right clicks an atom. Returns a SECONDARY_ATTACK_* value.
attack_pai_secondaryCalled when a pAI right clicks an atom. Returns a SECONDARY_ATTACK_* value.
attack_robot_secondaryWhat happens when the cyborg without active module holds right-click on an item. Returns a SECONDARY_ATTACK_* value.
attackbyCalled on an object being hit by an item
attackby_secondaryCalled on an object being right-clicked on by an item
attempt_initThis is distinct from /tg/ because of our space management system This is overriden in /atom/movable and the parent isn't called if the SMS wants to deal with it's init
balloon_alertCreates text that will float from the atom upwards to the viewer. When you add new balloons, make sure to use as little text as possible, starting with a small letter
balloon_alert_performDo not use. MeasureText blocks. I have no idea for how long. I would've made the maptext_height update on its own, but I don't know if this would look bad on laggy clients.
balloon_alert_to_viewersCreate balloon alerts (text that floats up) to everything within range. Will only display to people who can see.
base_item_interaction
base_mouse_drop_handlerCalled when all sanity checks for mouse dropping have passed. Handles adjacency & other sanity checks before delegating the event down to lower level handlers. Do not override unless you are trying to create hud & screen elements which do not require proximity or other checks
base_ranged_item_interaction
blob_actReact to a hit by a blob object
can_seeStep-towards method of determining whether one atom can see another. Similar to viewers() note: this is a line of sight algorithm, view() does not do any sort of raycasting and cannot be emulated by it accurately
change_from_station_traitUsed by station traits to damage/destroy atoms when round starts
click_alt
click_alt_secondary
collect_all_atoms_of_typeProc that collects all atoms of passed path in our atom contents and returns it in a list()
container_resist_actCalled when something resists while this atom is its loc
containsReturns true if the src countain the atom target
contents_ui_distancepublic
copy_overlayscopys our_overlays from another atom
crowbar_actCalled on an object when a tool with crowbar capabilities is used to left click an object
crowbar_act_secondaryCalled on an object when a tool with crowbar capabilities is used to right click an object
declent_ruВозвращает русское название атома, склоненное для указанного падежа.
drop_locationWhere atoms should drop if taken from this atom
drop_ungibbable_itemsForces atom to drop all the important items while dereferencing them from their containers both ways. To be used to preserve important items before mob gib/self-gib. Returns a list with all saved items.
examineCalled when a mob examines this atom: [/mob/verb/examinate]
examine_descriptorWhat this atom should be called in examine tags
examine_descriptor_genderGender of the examine descriptor word For example, "объект" is "male", while "машинерия" is "female"
examine_moreCalled when a mob examines (shift click or verb) this atom twice (or more) within EXAMINE_MORE_WINDOW (default 1 second)
examine_post_descriptorReturns a list of strings to be displayed after the descriptor TODO: имплементировать тута custom_materials
examine_tagsA list of "tags" displayed after atom's description in examine. This should return an assoc list of tags -> tooltips for them. If item is null, then no tooltip is assigned.
examine_titleFormats the atom's name into a string for use in examine (as the "title" of the atom)
fart_actSpecial treatment of /datum/emote/living/carbon/human/fart. Returning TRUE will stop emote execution.
find_all_cells_containingdebug proc for checking if a movable is in multiple cells when it shouldnt be (ie always unless multitile entering is implemented)
find_grid_statistics_for_z_leveldebug proc for finding how full the cells of src's z level are
flick_overlay_staticFlickers an overlay on an atom
flick_overlay_viewTakes the passed in MA/icon_state, mirrors it onto ourselves, and displays that in world for duration seconds Returns the displayed object, you can animate it and all, but you don't own it, we'll delete it after the duration
genderize_examine_descriptorReturns the correct form of the examine descriptor based on provided gender
get_all_adjacent_turfsProc which gets all adjacent turfs to src, including the turf that src is on.
get_all_contentsReturns the src and all recursive contents as a list.
get_all_contents_ignoringLike get_all_contents_type, but uses a typecache list as argument.
get_all_contents_typeIdentical to get_all_contents but returns a list of atoms of the type passed in the argument.
get_emissive_blockUpdates atom's emissive block if present.
get_examine_iconIcon displayed in examine
get_examine_nameGet the name of this object for examine
get_explosion_blockreturns how much the object blocks an explosion. Used by subtypes.
get_gravityReturns TRUE if this atom has gravity for the passed in turf
get_name_chaserUsed to insert text after the name but before the description in examine()
get_oversized_icon_offsetsReturns an x and y value require to reverse the transformations made to center an oversized icon
get_ru_namesПолучить варианты русского названия в грамматических падежах.
get_ru_names_cachedПолучить кешированные русские названия для данного типа атомов.
get_runechat_colorProc to allow atoms to set their own runechat colour
get_type_in_all_contentsRecursively searches through all contents of the atom for the first instance of a specific type.
get_visible_nameUsed by mobs to determine the name for someone wearing a mask, or with a disfigured or missing face. By default just returns the atom's name.
grab_attackCalled when living mob clicks on this atom with pulled movable. Adjacency and correct pull hand is already checked.
handle_fallUsed for making a sound when a mob involuntarily falls into the ground.
handle_slipHandle the atom being slipped over
has_printsProc thats checks if mobs can leave fingerprints and fibers on the atom
hit_by_thrown_mobThis proc applies special effects of a mob hitting something, be it a wall, structure, or window. You can set mob_hurt to false to avoid double dipping through subtypes if returning ..()
is_drainableIs this atom drainable of reagents
is_drawableCan we draw from this atom with an injectable atom
is_found_withinChecks if the atom or any of its containing atoms (up to the area) are of the specified type
is_injectableIs this atom injectable into other atoms
is_open_containerConvenience proc to see if a container is open for chemistry handling
is_refillableCan this atoms reagents be refilled
item_interactionCalled when this atom has an item used on it. IE, a mob is clicking on this atom with an item.
item_interaction_secondaryCalled when this atom has an item used on it WITH RIGHT CLICK, IE, a mob is right clicking on this atom with an item. Default behavior has it run the same code as left click.
mech_melee_attackHandle melee attack by a mech
mouse_drop_draggedThe proc that should be overridden by subtypes to handle mouse drop. Called on the atom being dragged
mouse_drop_receiveThe proc that should be overridden by subtypes to handle mouse drop. Called on the atom receiving a dragged object
multitool_actCalled on an object when a tool with multitool capabilities is used to left click an object
multitool_act_secondaryCalled on an object when a tool with multitool capabilities is used to right click an object
ninjadrain_actAtom level proc for space ninja's glove interactions.
on_mouse_enterFired whenever this atom is the most recent to be hovered over in the tick. Preferred over MouseEntered if you do not need information such as the position of the mouse. Especially because this is deferred over a tick, do not trust that client is not null.
persistent_loadAtom Persistent Loader
persistent_saveAtom Persistent Saver
prepare_hudsPrepare the huds for this atom
propagate_radiation_pulseA common proc used to send COMSIG_ATOM_PROPAGATE_RAD_PULSE to adjacent atoms Only used for uranium (false/tram)walls to spread their radiation pulses
ranged_item_interactionCalled when this atom has an item used on it from a distance. IE, a mob is clicking on this atom with an item and is not adjacent.
ranged_item_interaction_secondaryCalled when this atom has an item used on it from a distance WITH RIGHT CLICK, IE, a mob is right clicking on this atom with an item and is not adjacent.
ray_filter_helperUsed to create rays on an item. Make sure to "remove_filter("rays")" when done with it
realize_overlaysTakes the atoms's existing overlays and underlays, and makes them mutable so they can be properly vv'd in the realized_overlays/underlays list
register_contextCreate a "Type-B" contextual screentip interaction, registering to add_context(). This will run add_context() when the atom is hovered over by an item for context. add_context() will not be called unless this is run. This is not necessary for Type-B interactions, as you can just apply the flag and register to the signal yourself.
relaydriveA special case of relaymove() in which the person relaying the move may be "driving" this atom
relaymoveAn atom we are buckled or is contained within us has tried to move
remove_persistent_overlayRemoves a persistent overlay from an atom if it exists.
remove_shared_particlesRemoves shared particles from object's vis_contents and disposes of it if nothing uses that type/key of particle particle_key can be either a type (if no custom_key was passed) or said custom_key
rename_interactive
return_analyzable_airReturn the air if we can analyze it
screwdriver_actCalled on an object when a tool with screwdriver capabilities is used to left click an object
screwdriver_act_secondaryCalled on an object when a tool with screwdriver capabilities is used to right click an object
setDirHook for running code when a dir change occurs
set_base_pixel_xSetter for the base_pixel_x variable to append behavior related to its changing.
set_base_pixel_ySetter for the base_pixel_y variable to append behavior related to its changing.
set_closedUsed to set something as 'closed' if it's being used as a supplypod
set_densitySetter for the density variable to append behavior related to its changing.
set_greyscale_colorsChecks if the colors given are different and if so causes a greyscale icon update
set_greyscale_configChecks if the greyscale config given is different and if so causes a greyscale icon update
set_hud_image_activeset every hud image in the given category active so other people with the given hud can see it. Arguments:
set_hud_image_inactiveSets every hud image in the given category inactive so no one can see it
set_light_colorSetter for the light color of this atom.
set_light_flagsSetter for the light flags of this atom.
set_light_onSetter for whether or not this atom's light is on.
set_light_powerSetter for the light power of this atom.
set_light_rangeSetter for the light range of this atom.
set_opacityUpdates the atom's opacity value.
set_openedUsed to set something as 'open' if it's being used as a supplypod
shuttleRotateBase proc
singularity_actRespond to the singularity eating this atom
singularity_pullRespond to the singularity pulling on us
spasm_animationSimilar to shake but more spasm-y and jerk-y
update_appearanceUpdates the appearence of the icon
update_descUpdates the description of the atom
update_greyscaleChecks if this atom uses the GAS system and if so updates the icon
update_iconUpdates the icon of the atom
update_icon_stateUpdates the icon state of the atom
update_nameUpdates the name of the atom
update_overlaysUpdates the overlays of the atom. It has to return a list of overlays if it can't call the parent to create one. The list can contain anything that would be valid for the add_overlay proc: Images, mutable appearances, icon states... WARNING: if you provide external list to this proc, IT MUST BE A COPY, since ref to this list is saved in var/managed_overlays.
vv_edit_varcall back when a var is edited on this atom
wash_tgWash this atom
welder_actCalled on an object when a tool with welder capabilities is used to left click an object
welder_act_secondaryCalled on an object when a tool with welder capabilities is used to right click an object
wirecutter_actCalled on an object when a tool with wirecutter capabilities is used to left click an object
wirecutter_act_secondaryCalled on an object when a tool with wirecutter capabilities is used to right click an object
wrench_actCalled on an object when a tool with wrench capabilities is used to left click an object
wrench_act_secondaryCalled on an object when a tool with wrench capabilities is used to right click an object

Var Details

active_hud_list

all of this atom's HUD images which can actually be seen by players with that hud

ai_controller

AI controller that controls this atom. type on init, then turned into an instance during runtime

alternate_appearances

The alternate appearances we own

base_icon_state

Used for changing icon states for different base sprites.

base_pixel_w

Default pixel w shifting for the atom's icon.

base_pixel_x

Default pixel x shifting for the atom's icon.

base_pixel_y

Default pixel y shifting for the atom's icon.

base_pixel_z

Default pixel z shifting for the atom's icon.

bubble_icon

What icon the mob uses for speechbubbles

buckle_message_cd

Cooldown tick timer for buckle messages

cached_color_filter

Currently used color filter - cached because its applied to all of our overlays because BYOND is horrific

canSmoothWith

List of smoothing groups this atom can smooth with. If this is null and atom is smooth, it smooths only with itself. Must be sorted.

can_astar_pass

How this atom should react to having its astar blocking checked

cares_about_temperature

Do we care about temperature at all? Saves us a ton of proc calls during big fires.

chat_color

Last color calculated for the the chatmessage overlays. Used for caching.

chat_color_darkened

A luminescence-shifted value of the last color calculated for chatmessage overlays

chat_color_name

Last name used to calculate a color for the chatmessage overlays. Used for caching.

container_type

Chemistry.

demo_last_appearance

Last appearance of the atom for demo saving purposes

examine_thats

Text that appears preceding the name in /atom/proc/examine_title

gravity_sources

Sources that changes gravity of object. Treated as lazy list.

greyscale_colors

A string of hex format colors to be used by greyscale sprites, ex: "#0054aa#badcff"

greyscale_config

The config type to use for greyscaled sprites. Both this and greyscale_colors must be assigned to work.

hud_list

all of this atom's HUD (med/sec, etc) images. Associative list of the form: list(hud category = hud image or images for that category). most of the time hud category is associated with a single image, sometimes its associated with a list of images. not every hud in this list is actually used. for ones available for others to see, look at active_hud_list.

hud_possible

HUD images that this atom can provide.

ignored_gravity_sources

Sources that 100% won't changes gravity of object. Treated as lazy list.

interaction_flags_atom

Intearaction flags

interaction_flags_click

Flags to check for in can_perform_action. Used in alt-click & ctrl-click checks

interaction_flags_mouse_drop

Flags to check for in can_perform_action for mouse drag & drop checks. To bypass checks see interaction_flags_atom mouse drop flags

light

Our light source. Don't fuck with this directly unless you have a good reason!

light_color

Hexadecimal RGB string representing the colour of the light. White by default.

light_flags

Bitflags to determine lighting-related atom properties.

light_on

Boolean variable for toggleable lights. Has no effect without the proper light_system, light_range and light_power values.

light_power

Intensity of the light. The stronger, the less shadows you will see on the lit area.

light_range

Range of the light in tiles. Zero means no light.

light_sources

Any light sources that are "inside" of us, for example, if src here was a mob that's carrying a flashlight, that flashlight's light source would be part of this list.

light_system

Light systems, both shouldn't be active at the same time.

managed_overlays

overlays managed by update_overlays to prevent removing overlays that weren't added by the same proc. Single items are stored on their own, not in a list.

managed_vis_overlays

vis overlays managed by SSvis_overlays to automaticaly turn them like other overlays.

map_json_data

This var isn't actually used for anything, but is present so that DM's map reader doesn't forfeit on reading a JSON-serialized map

pass_flags

Things we can pass through while moving. If any of this matches the thing we're trying to pass's [pass_flags_self], then we can pass through.

pass_flags_self

pass_flags that we are. If any of this matches a pass_flag on a moving thing, by default, we let them through.

post_init_icon_state

The icon state that will be switched to during initialization. Mostly intended for things that have a special map icon.

proximity_monitor

Proximity monitor associated with this atom, needed for proximity checks.

rad_insulation

Radiation insulation types

realized_overlays

List of overlay "keys" (info about the appearance) -> mutable versions of static appearances Drawn from the overlays list

realized_underlays

List of underlay "keys" (info about the appearance) -> mutable versions of static appearances Drawn from the underlays list

resistance_flags

Flags that make this object harder to destroy, e.g. ACID_PROOF, FIRE_PROOF, INDESTRUCTIBLE.

ru_names

Список склонений русского названия атома в разных грамматических падежах. Формат: list(CASE_ID = "name_in_case", ...)

smoothing_groups

What smoothing groups does this atom belongs to, to match canSmoothWith. If null, nobody can smooth with it. Must be sorted.

smoothing_junction

What directions this is currently smoothing with. IMPORTANT: This uses the smoothing direction flags as defined in icon_smoothing.dm, instead of the BYOND flags.

suit_fibers

List of fibers that this atom has

update_on_z

Lazylist of all images (hopefully attached to us) to update when we change z levels You will need to manage adding/removing from this yourself, but I'll do the updating for you

update_overlays_on_z

Lazylist of all overlays attached to us to update when we change z levels You will need to manage adding/removing from this yourself, but I'll do the updating for you Oh and note, if order of addition is important this WILL break that. so mind yourself

Proc Details

Adjacent

Adjacency proc for determining touch range

This is mostly to determine if a user can enter a square for the purposes of touching something. Examples include reaching a square diagonally or reaching something on the other side of a glass window.

This is calculated by looking for border items, or in the case of clicking diagonally from yourself, dense items. This proc will NOT notice if you are trying to attack a window on the other side of a dense object in its turf. There is a window helper for that.

Note that in all cases the neighbor is handled simply; this is usually the user's mob, in which case it is up to you to check that the mob is not inside of something

AllowDrop

Are you allowed to drop stuff inside this atom

Beam

This is what you use to start a beam. Example: origin.Beam(target, args). Store the return of this proc if you don't set maxdist or time, you need it to delete the beam.

Unless you're making a custom beam effect (see the beam_type argument), you won't actually have to mess with any other procs. Make sure you store the return of this Proc, you'll need it to kill the beam.

Arguments:

CanAStarPass

This proc is used for telling whether something can pass by this atom in a given direction, for use by the pathfinding system.

Trying to generate one long path across the station will call this proc on every single object on every single tile that we're seeing if we can move through, likely multiple times per tile since we're likely checking if we can access said tile from multiple directions, so keep these as lightweight as possible.

For turfs this will only be used if pathing_pass_method is TURF_PATHING_PASS_PROC

Arguments:

IMPORTANT NOTE: /turf/proc/LinkBlockedWithAccess assumes that overrides of CanAStarPass will always return true if density is FALSE If this is NOT you, ensure you edit your can_astar_pass variable. Check __DEFINES/path.dm

CanAllowThrough

Returns true or false to allow the mover to move through src

CanPass

Whether the mover object can avoid being blocked by this atom, while arriving from (or leaving through) the border_dir.

Click

Before anything else, defer these calls to a per-mobtype handler. This allows us to remove istype() spaghetti code, but requires the addition of other handler procs to simplify it.

Alternately, you could hardcode every mob's variation in a flat /mob/proc/ClickOn proc; however, that's a lot of code duplication and is hard to maintain.

Note that this proc can be overridden, and is in the case of screen objects.

Entered

An atom has entered this atom's contents

Default behaviour is to send the COMSIG_ATOM_ENTERED

Exit

An atom is attempting to exit this atom's contents

Default behaviour is to send the COMSIG_ATOM_EXIT

Exited

An atom has exited this atom's contents

Default behaviour is to send the COMSIG_ATOM_EXITED

GetTotalContentsWeight

Searches contents of the atom and returns the sum of all w_class of obj/item within

HasProximity

Is this atom within 1 tile of another atom

Initialize

The primary method that objects are setup in SS13 with

we don't use New as we have better control over when this is called and we can choose to delay calls or hook other logic in and so forth

During roundstart map parsing, atoms are queued for initialization in the base atom/New(), After the map has loaded, then Initialize is called on all atoms one by one. NB: this is also true for loading map templates as well, so they don't Initialize until all objects in the map file are parsed and present in the world

If you're creating an object at any point after SSInit has run then this proc will be immediately be called from New.

mapload: This parameter is true if the atom being loaded is either being initialized during the Atom subsystem initialization, or if the atom is being loaded from the map template. If the item is being created at runtime any time after the Atom subsystem is initialized then it's false.

The mapload argument occupies the same position as loc when Initialize() is called by New(). loc will no longer be needed after it passed New(), and thus it is being overwritten with mapload at the end of atom/New() before this proc (atom/Initialize()) is called.

You must always call the parent of this proc, otherwise failures will occur as the item will not be seen as initialized (this can lead to all sorts of strange behaviour, like the item being completely unclickable)

You must not sleep in this proc, or any subprocs

Any parameters from new are passed through (excluding loc), naturally if you're loading from a map there are no other arguments

Must return an initialization hint or a runtime will occur.

Note: the following functions don't call the base for optimization and must copypasta handling:

InitializeAIController

Instantiates the AI controller of this atom. Override this if you want to assign variables first.

This will work fine without manually passing arguments.

IsContainedAtomAccessible

Returns TRUE if an atom contained within our contents is reachable.

IsReachableBy

Returns TRUE if a movable can "Reach" this atom. This is defined as adjacency

Args:

LateInitialize

Late Initialization, for code that should run after all atoms have run Initialization

To have your LateIntialize proc be called, your atoms Initialization proc must return the hint INITIALIZE_HINT_LATELOAD otherwise it will never be called.

useful for doing things like finding other machines on GLOB.machines because you can guarantee that all atoms will actually exist in the "WORLD" at this time and that all their Initialization code has been run

MouseDrop

MouseDrop:

Called on the atom you're dragging. In a lot of circumstances we want to use the receiving object instead, so that's the default action. This allows you to drag almost anything into a trash can.

MouseEntered

Update the screentip to reflect what we're hovering over

New

Called when an atom is created in byond (built in engine proc)

Not a lot happens here in SS13 code, as we offload most of the work to the Initialization proc, mostly we run the preloader if the preloader is being used and then call [InitAtom][/datum/controller/subsystem/atoms/proc/InitAtom] of which the ultimate result is that the Initialize proc is called.

Shake

Perform a shake on an atom, resets its position afterwards

Topic

Passes Stat Browser Panel clicks to the game and calls client click on an atom

_Click

stupid workaround for byond not recognizing the /atom/Click typepath for the queued click callbacks

acid_act

Respond to acid being used on our atom

Default behaviour is to send COMSIG_ATOM_ACID_ACT and return

add_context

Creates a "Type-B" contextual screentip interaction. When a user hovers over this, this proc will be called in order to provide context for contextual screentips. You must call register_context() in order for this to be registered. A screentip context list is a list that has context keys (SCREENTIP_CONTEXT_*, from __DEFINES/screentips.dm) that map to the action as text. If you mutate the list in this signal, you must return CONTEXTUAL_SCREENTIP_SET. source can, in all cases, be replaced with src, and only exists because this proc directly connects to a signal.

add_debris_element

Adds the debris element for projectile impacts.

add_fibers

client/New() client/Del() turf/setDir() atom/movable/setDir(newdir, forced = FALSE)

add_persistent_overlay

Adds a special overlay to any atom. This overlay will always persist even when an atom is updating its overlays.

Arguments:

add_shared_particles

Adds (or creates and adds) a shared particle holder Shared particle holders are held in nullspace and added to vis_contents of all atoms using it in order to save clientside performance by making clients only render 3-5 particle holders for 400 objects using them. This should be prioritized over normal particles when possible if it is known that there will be a lot of objects using certain particles. custom_key can be used to create a new pool of already existing particle type in case you're planning to edit holder's color or properties pool_size controls how many particle holders per type are created. Any objects over this cap will pick an existing holder from the pool.

Now, this code seems fucked up, that's because this is meant to support both objects (and mobs) and turfs, however areas are special and don't have vis_contents, so to avoid copypaste code we do this weirdness

apply_message_emphasis

Scans the input sentence for message emphasis modifiers, notably |italics|, +bold+, and underline -mothblocks

attack_ai_secondary

What happens when the AI holds right-click on an item. Returns a SECONDARY_ATTACK_* value.

Arguments:

attack_alien_secondary

Called when an alien right clicks an atom. Returns a SECONDARY_ATTACK_* value.

attack_animal_secondary

Called when a simple animal or basic mob right clicks an atom. Returns a SECONDARY_ATTACK_* value.

attack_hand_secondary

When the user uses their hand on an item while holding right-click Returns a SECONDARY_ATTACK_* value.

attack_larva_secondary

Called when an alien larva right clicks an atom. Returns a SECONDARY_ATTACK_* value.

attack_pai_secondary

Called when a pAI right clicks an atom. Returns a SECONDARY_ATTACK_* value.

attack_robot_secondary

What happens when the cyborg without active module holds right-click on an item. Returns a SECONDARY_ATTACK_* value.

Arguments:

attackby

Called on an object being hit by an item

Arguments:

See: /obj/item/proc/melee_attack_chain

attackby_secondary

Called on an object being right-clicked on by an item

Arguments:

See: /obj/item/proc/melee_attack_chain

attempt_init

This is distinct from /tg/ because of our space management system This is overriden in /atom/movable and the parent isn't called if the SMS wants to deal with it's init

balloon_alert

Creates text that will float from the atom upwards to the viewer. When you add new balloons, make sure to use as little text as possible, starting with a small letter

Arguments:

balloon_alert_perform

Do not use. MeasureText blocks. I have no idea for how long. I would've made the maptext_height update on its own, but I don't know if this would look bad on laggy clients.

balloon_alert_to_viewers

Create balloon alerts (text that floats up) to everything within range. Will only display to people who can see.

Arguments:

base_item_interaction

Item interaction

Handles non-combat interactions of a tool on this atom, such as using a tool on a wall to deconstruct it, or scanning someone with a health analyzer

base_mouse_drop_handler

Called when all sanity checks for mouse dropping have passed. Handles adjacency & other sanity checks before delegating the event down to lower level handlers. Do not override unless you are trying to create hud & screen elements which do not require proximity or other checks

base_ranged_item_interaction

Ranged item interaction

Handles non-combat ranged interactions of a tool on this atom, such as shooting a gun in the direction of someone*, having a scanner you can point at someone to scan them at any distance, or pointing a laser pointer at something.

*While this intuitively sounds combat related, it is not, because a "combat use" of a gun is gun-butting.

blob_act

React to a hit by a blob object

default behaviour is to send the COMSIG_ATOM_BLOB_ACT signal

can_see

Step-towards method of determining whether one atom can see another. Similar to viewers() note: this is a line of sight algorithm, view() does not do any sort of raycasting and cannot be emulated by it accurately

change_from_station_trait

Used by station traits to damage/destroy atoms when round starts

click_alt

Custom alt click interaction

Override this to change default alt click behavior. Return CLICK_ACTION_SUCCESS, CLICK_ACTION_BLOCKING or NONE.

Guard clauses

Consider adding interaction_flags_click before adding unique guard clauses.

Return flags

Forgetting your return will cause the default alt click behavior to occur thereafter.

The difference between NONE and BLOCKING can get hazy, but I like to keep NONE limited to guard clauses and "never" cases.

A good usage for BLOCKING over NONE is when it's situational for the item and there's some feedback indicating this.

Examples:

User is a ghost, alt clicks on item with special disk eject: NONE

Machine broken, no feedback: NONE

Alt click a pipe to max output but its already max: BLOCKING

Alt click a gun that normally works, but is out of ammo: BLOCKING

User unauthorized, machine beeps: BLOCKING

@param {mob} user - The person doing the alt clicking.

click_alt_secondary

Custom alt click secondary interaction

Override this to change default alt right click behavior.

Guard clauses

Consider adding interaction_flags_click before adding unique guard clauses.

collect_all_atoms_of_type

Proc that collects all atoms of passed path in our atom contents and returns it in a list()

container_resist_act

Called when something resists while this atom is its loc

contains

Returns true if the src countain the atom target

contents_ui_distance

public

Check the distance for a living mob. Really only used for checks outside the context of a mob. Otherwise, use shared_living_ui_distance().

required src_object The object which owns the UI. required user mob The mob who opened/is using the UI.

return UI_state The state of the UI.

copy_overlays

copys our_overlays from another atom

crowbar_act

Called on an object when a tool with crowbar capabilities is used to left click an object

crowbar_act_secondary

Called on an object when a tool with crowbar capabilities is used to right click an object

declent_ru

Возвращает русское название атома, склоненное для указанного падежа.

Эта процедура обрабатывает склонение русских названий атомов по падежам. Поиск подходящего склоненного имени выполняется в следующем порядке:

  1. Предопределенные русские названия атома (ru_names)
  2. Кэшированные русские названия из get_ru_names_cached()

Если склоненная форма для указанного падежа не найдена (null), возвращает имя по умолчанию.

Аргументы:

drop_location

Where atoms should drop if taken from this atom

drop_ungibbable_items

Forces atom to drop all the important items while dereferencing them from their containers both ways. To be used to preserve important items before mob gib/self-gib. Returns a list with all saved items.

examine

Called when a mob examines this atom: [/mob/verb/examinate]

Default behaviour is to get the name and icon of the object and its reagents where the [TRANSPARENT] flag is set on the reagents holder

Produces a signal COMSIG_ATOM_EXAMINE, for modifying the list returned from this proc

examine_descriptor

What this atom should be called in examine tags

examine_descriptor_gender

Gender of the examine descriptor word For example, "объект" is "male", while "машинерия" is "female"

examine_more

Called when a mob examines (shift click or verb) this atom twice (or more) within EXAMINE_MORE_WINDOW (default 1 second)

This is where you can put extra information on something that may be superfluous or not important in critical gameplay moments, while allowing people to manually double-examine to take a closer look

Produces a signal COMSIG_ATOM_EXAMINE_MORE

examine_post_descriptor

Returns a list of strings to be displayed after the descriptor TODO: имплементировать тута custom_materials

examine_tags

A list of "tags" displayed after atom's description in examine. This should return an assoc list of tags -> tooltips for them. If item is null, then no tooltip is assigned.

For example:

. = list()
.["small"] = "It is a small item."
.["fireproof"] = "It is made of fire-retardant materials."
.["and conductive"] = "It's made of conductive materials and whatnot. Blah blah blah." // having "and " in the end tag's main text/key works too!

will result in

It is a small, fireproof and conductive item.

where "item" is pulled from /atom/proc/examine_descriptor

examine_title

Formats the atom's name into a string for use in examine (as the "title" of the atom)

fart_act

Special treatment of /datum/emote/living/carbon/human/fart. Returning TRUE will stop emote execution.

Arguments:

find_all_cells_containing

debug proc for checking if a movable is in multiple cells when it shouldnt be (ie always unless multitile entering is implemented)

find_grid_statistics_for_z_level

debug proc for finding how full the cells of src's z level are

flick_overlay_static

Flickers an overlay on an atom

flick_overlay_view

Takes the passed in MA/icon_state, mirrors it onto ourselves, and displays that in world for duration seconds Returns the displayed object, you can animate it and all, but you don't own it, we'll delete it after the duration

genderize_examine_descriptor

Returns the correct form of the examine descriptor based on provided gender

get_all_adjacent_turfs

Proc which gets all adjacent turfs to src, including the turf that src is on.

This is similar to doing for(var/turf/T in range(1, src)). However it is slightly more performant. Additionally, the above proc becomes more costly the more atoms there are nearby. This proc does not care about that.

get_all_contents

Returns the src and all recursive contents as a list.

get_all_contents_ignoring

Like get_all_contents_type, but uses a typecache list as argument.

get_all_contents_type

Identical to get_all_contents but returns a list of atoms of the type passed in the argument.

get_emissive_block

Updates atom's emissive block if present.

get_examine_icon

Icon displayed in examine

get_examine_name

Get the name of this object for examine

You can override what is returned from this proc by registering to listen for the COMSIG_ATOM_GET_EXAMINE_NAME signal

get_explosion_block

returns how much the object blocks an explosion. Used by subtypes.

get_gravity

Returns TRUE if this atom has gravity for the passed in turf

Sends signals COMSIG_ATOM_HAS_GRAVITY and COMSIG_TURF_HAS_GRAVITY, both can force gravity with the forced gravity var.

micro-optimized to hell because this proc is very hot, being called several times per movement every movement.

HEY JACKASS, LISTEN IF YOU ADD SOMETHING TO THIS PROC, MAKE SURE /mob/living ACCOUNTS FOR IT Living mobs treat gravity in an event based manner. We've decomposed this proc into different checks for them to use. If you add more to it, make sure you do that, or things will behave strangely

Gravity situations:

get_name_chaser

Used to insert text after the name but before the description in examine()

get_oversized_icon_offsets

Returns an x and y value require to reverse the transformations made to center an oversized icon

get_ru_names

Получить варианты русского названия в грамматических падежах.

Переопределите этот метод, чтобы вернуть ассоциативный список с идентификаторами падежей и соответствующими русскими названиями. Используется функцией declent_ru() для поиска названий по падежам.

get_ru_names_cached

Получить кешированные русские названия для данного типа атомов.

Сначала проверяет глобальный кеш на наличие русских названий для данного типа. Если не найдено, вызывает get_ru_names() и кеширует результат для последующих вызовов.

get_runechat_color

Proc to allow atoms to set their own runechat colour

This is a proc designed to be overridden in places if you want a specific atom to use a specific runechat colour Exampls include consoles using a colour based on their screen colour, and mobs using a colour based off of a customisation property

get_type_in_all_contents

Recursively searches through all contents of the atom for the first instance of a specific type.

get_visible_name

Used by mobs to determine the name for someone wearing a mask, or with a disfigured or missing face. By default just returns the atom's name.

grab_attack

Called when living mob clicks on this atom with pulled movable. Adjacency and correct pull hand is already checked.

Arguments:

Return TRUE to skip further actions in unarmed attack chain.

handle_fall

Used for making a sound when a mob involuntarily falls into the ground.

handle_slip

Handle the atom being slipped over

has_prints

Proc thats checks if mobs can leave fingerprints and fibers on the atom

hit_by_thrown_mob

This proc applies special effects of a mob hitting something, be it a wall, structure, or window. You can set mob_hurt to false to avoid double dipping through subtypes if returning ..()

is_drainable

Is this atom drainable of reagents

is_drawable

Can we draw from this atom with an injectable atom

is_found_within

Checks if the atom or any of its containing atoms (up to the area) are of the specified type

Arguments:

is_injectable

Is this atom injectable into other atoms

is_open_container

Convenience proc to see if a container is open for chemistry handling

is_refillable

Can this atoms reagents be refilled

item_interaction

Called when this atom has an item used on it. IE, a mob is clicking on this atom with an item.

Return an ITEM_INTERACT_ flag in the event the interaction was handled, to cancel further interaction code. Return NONE to allow default interaction / tool handling.

item_interaction_secondary

Called when this atom has an item used on it WITH RIGHT CLICK, IE, a mob is right clicking on this atom with an item. Default behavior has it run the same code as left click.

Return an ITEM_INTERACT_ flag in the event the interaction was handled, to cancel further interaction code. Return NONE to allow default interaction / tool handling.

mech_melee_attack

Handle melee attack by a mech

mouse_drop_dragged

The proc that should be overridden by subtypes to handle mouse drop. Called on the atom being dragged

mouse_drop_receive

The proc that should be overridden by subtypes to handle mouse drop. Called on the atom receiving a dragged object

multitool_act

Called on an object when a tool with multitool capabilities is used to left click an object

multitool_act_secondary

Called on an object when a tool with multitool capabilities is used to right click an object

ninjadrain_act

Atom level proc for space ninja's glove interactions.

Proc which only occurs when space ninja uses his gloves on an atom. Does nothing by default, but effects will vary. Arguments:

on_mouse_enter

Fired whenever this atom is the most recent to be hovered over in the tick. Preferred over MouseEntered if you do not need information such as the position of the mouse. Especially because this is deferred over a tick, do not trust that client is not null.

persistent_load

Atom Persistent Loader

Overridden on every atom which needs to load persistent data

persistent_save

Atom Persistent Saver

Overridden on every atom which needs to save persistent data

prepare_huds

Prepare the huds for this atom

Goes through hud_possible list and adds the images to the hud_list variable (if not already cached)

propagate_radiation_pulse

A common proc used to send COMSIG_ATOM_PROPAGATE_RAD_PULSE to adjacent atoms Only used for uranium (false/tram)walls to spread their radiation pulses

ranged_item_interaction

Called when this atom has an item used on it from a distance. IE, a mob is clicking on this atom with an item and is not adjacent.

Does NOT include Telekinesis users, they are considered adjacent generally.

Return an ITEM_INTERACT_ flag in the event the interaction was handled, to cancel further interaction code.

ranged_item_interaction_secondary

Called when this atom has an item used on it from a distance WITH RIGHT CLICK, IE, a mob is right clicking on this atom with an item and is not adjacent.

Default behavior has it run the same code as left click.

Return an ITEM_INTERACT_ flag in the event the interaction was handled, to cancel further interaction code.

ray_filter_helper

Used to create rays on an item. Make sure to "remove_filter("rays")" when done with it

realize_overlays

Takes the atoms's existing overlays and underlays, and makes them mutable so they can be properly vv'd in the realized_overlays/underlays list

register_context

Create a "Type-B" contextual screentip interaction, registering to add_context(). This will run add_context() when the atom is hovered over by an item for context. add_context() will not be called unless this is run. This is not necessary for Type-B interactions, as you can just apply the flag and register to the signal yourself.

relaydrive

A special case of relaymove() in which the person relaying the move may be "driving" this atom

This is a special case for vehicles and ridden animals where the relayed movement may be handled by the riding component attached to this atom. Returns TRUE as long as there's nothing blocking the movement, or FALSE if the signal gets a reply that specifically blocks the movement

relaymove

An atom we are buckled or is contained within us has tried to move

Default behaviour is to send a warning that the user can't move while buckled as long as the [buckle_message_cooldown][/atom/var/buckle_message_cooldown] has expired (50 ticks)

remove_persistent_overlay

Removes a persistent overlay from an atom if it exists.

Arguments:

remove_shared_particles

Removes shared particles from object's vis_contents and disposes of it if nothing uses that type/key of particle particle_key can be either a type (if no custom_key was passed) or said custom_key

rename_interactive

return_analyzable_air

Return the air if we can analyze it

screwdriver_act

Called on an object when a tool with screwdriver capabilities is used to left click an object

screwdriver_act_secondary

Called on an object when a tool with screwdriver capabilities is used to right click an object

setDir

Hook for running code when a dir change occurs

Not recommended to use, listen for the COMSIG_ATOM_DIR_CHANGE signal instead (sent by this proc)

set_base_pixel_x

Setter for the base_pixel_x variable to append behavior related to its changing.

set_base_pixel_y

Setter for the base_pixel_y variable to append behavior related to its changing.

set_closed

Used to set something as 'closed' if it's being used as a supplypod

Override this if you want an atom to be usable as a supplypod.

set_density

Setter for the density variable to append behavior related to its changing.

set_greyscale_colors

Checks if the colors given are different and if so causes a greyscale icon update

set_greyscale_config

Checks if the greyscale config given is different and if so causes a greyscale icon update

set_hud_image_active

set every hud image in the given category active so other people with the given hud can see it. Arguments:

set_hud_image_inactive

Sets every hud image in the given category inactive so no one can see it

set_light_color

Setter for the light color of this atom.

set_light_flags

Setter for the light flags of this atom.

set_light_on

Setter for whether or not this atom's light is on.

set_light_power

Setter for the light power of this atom.

set_light_range

Setter for the light range of this atom.

set_opacity

Updates the atom's opacity value.

This exists to act as a hook for associated behavior. It notifies (potentially) affected light sources so they can update (if needed).

set_opened

Used to set something as 'open' if it's being used as a supplypod

Override this if you want an atom to be usable as a supplypod.

shuttleRotate

Base proc

singularity_act

Respond to the singularity eating this atom

singularity_pull

Respond to the singularity pulling on us

Default behaviour is to send COMSIG_ATOM_SING_PULL and return

spasm_animation

Similar to shake but more spasm-y and jerk-y

update_appearance

Updates the appearence of the icon

Mostly delegates to update_name, update_desc, and update_icon

Arguments:

update_desc

Updates the description of the atom

update_greyscale

Checks if this atom uses the GAS system and if so updates the icon

update_icon

Updates the icon of the atom

update_icon_state

Updates the icon state of the atom

update_name

Updates the name of the atom

update_overlays

Updates the overlays of the atom. It has to return a list of overlays if it can't call the parent to create one. The list can contain anything that would be valid for the add_overlay proc: Images, mutable appearances, icon states... WARNING: if you provide external list to this proc, IT MUST BE A COPY, since ref to this list is saved in var/managed_overlays.

vv_edit_var

call back when a var is edited on this atom

Can be used to implement special handling of vars

At the atom level, if you edit a var named "color" it will add the atom colour with admin level priority to the atom colours list

Also, if GLOB.debugging_enabled is FALSE, it sets the [ADMIN_SPAWNED_1] flag on [flags_1][/atom/var/flags_1], which signifies the object has been admin edited

wash_tg

Wash this atom

This will clean it off any temporary stuff like blood. Override this in your item to add custom cleaning behavior. Returns true if any washing was necessary and thus performed Arguments:

welder_act

Called on an object when a tool with welder capabilities is used to left click an object

welder_act_secondary

Called on an object when a tool with welder capabilities is used to right click an object

wirecutter_act

Called on an object when a tool with wirecutter capabilities is used to left click an object

wirecutter_act_secondary

Called on an object when a tool with wirecutter capabilities is used to right click an object

wrench_act

Called on an object when a tool with wrench capabilities is used to left click an object

wrench_act_secondary

Called on an object when a tool with wrench capabilities is used to right click an object