/tg/ Station 13 - 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

add_overlaysa very temporary list of overlays to add
age_restrictedWhether spessmen with an ID with an age below AGE_MINOR (20 by default) can buy this item
articleIf non-null, overrides a/an/some in all cases
atom_coloursused to store the different colors on an atom
buckle_message_cooldownCooldown tick timer for buckle messages
chat_colorLast color calculated for the the chatmessage overlays
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
custom_materialsThe custom materials this atom is made of, used by a lot of things like furniture, walls, and floors (if I finish the functionality, that is.) The list referenced by this var can be shared by multiple objects and should not be directly modified. Instead, use set_custom_materials.
custom_premium_priceEconomy cost of item in premium vendor
custom_priceEconomy cost of item
demo_last_appearanceLast appearance of the atom for demo saving purposes
explosion_blockValue used to increment ex_act() if reactionary_explosions is on
fingerprintslastLast fingerprints to touch this atom
flags_1First atom flags var
hud_listThis atom's HUD (med/sec, etc) images. Associative list.
hud_possibleHUD images that this atom can provide.
interaction_flags_atomIntearaction flags
managed_overlaysoverlays managed by update_overlays to prevent removing overlays that weren't added by the same proc
managed_vis_overlaysvis overlays managed by SSvis_overlays to automaticaly turn them like other overlays
material_flagsBitfield for how the atom handles materials.
material_modifierModifier that raises/lowers the effect of the amount of a material, prevents small and easy to get items from being death machines.
proximity_monitorProximity monitor associated with this atom
rad_flagsWill move to flags_1 when i can be arsed to (2019, has not done so)
rad_insulationRadiation insulation types
reagentsReagents holder
remove_overlaysa very temporary list of overlays to remove
ricochet_chance_modWhen a projectile tries to ricochet off this atom, the projectile ricochet chance is multiplied by this
ricochet_damage_modWhen a projectile ricochets off this atom, it deals the normal damage * this modifier to this atom
targeted_byMobs that are currently do_after'ing this atom, to be cleared from on Destroy()

Procs

AllowDropAre you allowed to drop this atom
AltClickNoInteractUse this instead of /mob/proc/AltClickOn where you only want turf content listing without additional atom alt-click interaction
CanAllowThroughReturns true or false to allow the mover to move through src
CanPassCan the mover object pass this atom, while heading for the target turf
CheckPartsEnsure a list of atoms/reagents exists inside this atom
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.
ComponentInitializePut your AddComponent calls here
DestroyTop level of the destroy chain for most atoms
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
GenerateTagGenerate a tag for this atom
HandleTurfChangecalled when the turf the atom resides on is ChangeTurfed
HasProximityIs this atom within 1 tile of another atom
InitializeThe primary method that objects are setup in SS13 with
IsObscuredIs the atom obscured by a PREVENT_CLICK_UNDER_1 object above it
LateInitializeSends a signal that the new atom src, has been created at loc Late Intialization, for code that should run after all atoms have run Intialization
NewCalled when an atom is created in byond (built in engine proc)
acid_actRespond to acid being used on our atom
add_atom_colourAdds an instance of colour_type to the atom's atom_colours list
add_mob_bloodto add blood from a mob onto something, and transfer their dna info
analyzer_actAnalyzer act
assume_airTake air from the passed in gas mixture datum
attack_handReturn TRUE to cancel other attack hand effects that respect it.
attack_hulkThis atom has been hit by a hulkified mob in hulk mode (user)
attackbyCalled on an object being hit by an item
audible_messageShow a message to all mobs in earshot of this atom
blob_actReact to a hit by a blob objecd
bullet_actReact to a hit by a projectile object
check_eyeCheck if this atoms eye is still alive (probably)
component_storage_contents_dump_actImplement the behaviour for when a user click drags another storage item to you
connect_to_shuttleConnect this atom to a shuttle
contents_explosionHandle what happens when your contents are exploded by a bomb
contents_ui_distancepublic
create_reagentsConvenience proc to create a reagents holder for an atom
crowbar_actCrowbar act
drop_locationWhere atoms should drop if taken from this atom
emag_actRespond to an emag being used on our atom
emp_actReact to an EMP of the given severity
ex_actReact to being hit by an explosion
examineCalled when a mob examines (shift click or verb) this atom
get_dumping_locationGet the best place to dump the items contained in the source storage item?
get_examine_nameGet the name of this object for examine
get_examine_stringGenerate the full examine string of this atom (including icon for goonchat)
get_remote_view_fullscreensthe vision impairment to give to the mob whose perspective is set to that atom
handle_atom_delThis proc is called when an atom in our contents has it's Destroy called
handle_fallUsed for making a sound when a mob involuntarily falls into the ground.
handle_slipHandle the atom being slipped over
has_gravityReturns true if this atom has gravity for the passed in turf
hitbyReact to being hit by a thrown object
hitby_reactWe have have actually hit the passed in atom
in_contents_ofReturn true if we're inside the passed in atom
is_drainableIs this atom drainable of reagents
is_drawableCan we draw from this atom with an injectable atom
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
isinspaceIs this atom in space
log_messageGeneric logging helper
log_talkHelper for logging chat messages or other logs with arbitrary inputs (e.g. announcements)
mat_update_descThis proc is called when a material updates an object's description
mech_melee_attackHandle melee attack by a mech
multitool_actMultitool act
multitool_check_bufferCheck if the multitool has an item in it's data buffer
narsie_actRespond to narsie eating our atom
onAwayMissionIs the atom in an away mission
onCentComIs this atom currently located on centcom
onSyndieBaseIs the atom in any of the centcom syndicate areas
on_logCalled when the atom log's in or out
prepare_hudsPrepare the huds for this atom
rad_actRespond to a radioactive wave hitting this atom
rcd_actRespond to an RCD acting on our item
rcd_valsReturn the values you get when an RCD eats you?
relaymoveAn atom we are buckled or is contained within us has tried to move
remove_airRemove air from this atom
remove_atom_colourRemoves an instance of colour_type from the atom's atom_colours list
return_airReturn the current air environment in this atom
return_analyzable_airReturn the air if we can analyze it
return_temperatureReturn atom temperature
screwdriver_actScrewdriver act
setDirHook for running code when a dir change occurs
set_custom_materialsSets the custom materials for an item.
shuttleRotateBase proc
singularity_actRespond to the singularity eating this atom
singularity_pullRespond to the singularity pulling on us
storage_contents_dump_actImplement the behaviour for when a user click drags a storage object to your atom
tool_actTool behavior procedure. Redirects to tool-specific procs by default.
transfer_mob_blood_dnato add a mob's dna info into an object's blood_dna list.
update_atom_colourResets the atom's color to null, and then sets it to the highest priority colour available
update_iconUpdates the icon of the atom
update_icon_stateUpdates the icon state of the atom
update_multizHook for multiz???
update_overlaysUpdates the overlays of the atom
update_remote_sightthe sight changes to give to the mob whose perspective is set to that atom
visible_messageGenerate a visible message from this atom
vv_get_dropdownReturn the markup to for the dropdown list for the VV panel for this atom
washedProc for being washed by a shower
welder_actWelder act
wirecutter_actWirecutter act
wrench_actWrench act
zap_actRespond to an electric bolt action on our item

Var Details

add_overlays

a very temporary list of overlays to add

age_restricted

Whether spessmen with an ID with an age below AGE_MINOR (20 by default) can buy this item

article

If non-null, overrides a/an/some in all cases

atom_colours

used to store the different colors on an atom

its inherent color, the colored paint applied on it, special color effect etc...

buckle_message_cooldown

Cooldown tick timer for buckle messages

chat_color

Last color calculated for the the chatmessage overlays

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

custom_materials

The custom materials this atom is made of, used by a lot of things like furniture, walls, and floors (if I finish the functionality, that is.) The list referenced by this var can be shared by multiple objects and should not be directly modified. Instead, use set_custom_materials.

custom_premium_price

Economy cost of item in premium vendor

custom_price

Economy cost of item

demo_last_appearance

Last appearance of the atom for demo saving purposes

explosion_block

Value used to increment ex_act() if reactionary_explosions is on

fingerprintslast

Last fingerprints to touch this atom

flags_1

First atom flags var

hud_list

This atom's HUD (med/sec, etc) images. Associative list.

hud_possible

HUD images that this atom can provide.

interaction_flags_atom

Intearaction flags

managed_overlays

overlays managed by update_overlays to prevent removing overlays that weren't added by the same proc

managed_vis_overlays

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

material_flags

Bitfield for how the atom handles materials.

material_modifier

Modifier that raises/lowers the effect of the amount of a material, prevents small and easy to get items from being death machines.

proximity_monitor

Proximity monitor associated with this atom

rad_flags

Will move to flags_1 when i can be arsed to (2019, has not done so)

rad_insulation

Radiation insulation types

reagents

Reagents holder

remove_overlays

a very temporary list of overlays to remove

ricochet_chance_mod

When a projectile tries to ricochet off this atom, the projectile ricochet chance is multiplied by this

ricochet_damage_mod

When a projectile ricochets off this atom, it deals the normal damage * this modifier to this atom

targeted_by

Mobs that are currently do_after'ing this atom, to be cleared from on Destroy()

Proc Details

AllowDrop

Are you allowed to drop this atom

AltClickNoInteract

Use this instead of /mob/proc/AltClickOn where you only want turf content listing without additional atom alt-click interaction

CanAllowThrough

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

CanPass

Can the mover object pass this atom, while heading for the target turf

CheckParts

Ensure a list of atoms/reagents exists inside this atom

Goes throught he list of passed in parts, if they're reagents, adds them to our reagent holder creating the reagent holder if it exists.

If the part is a moveable atom and the previous location of the item was a mob/living, it calls the inventory handler transferItemToLoc for that mob/living and transfers the part to this atom

Otherwise it simply forceMoves the atom into this atom

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.

ComponentInitialize

Put your AddComponent calls here

Destroy

Top level of the destroy chain for most atoms

Cleans up the following:

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

Return value should be set to FALSE if the moving atom is unable to leave, otherwise leave value the result of the parent call

Exited

An atom has exited this atom's contents

Default behaviour is to send the COMSIG_ATOM_EXITED

GenerateTag

Generate a tag for this atom

HandleTurfChange

called when the turf the atom resides on is ChangeTurfed

Default behaviour is to loop through atom contents and call their HandleTurfChange() proc

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 intialization in the base atom/New(), After the map has loaded, then Initalize is called on all atoms one by one. NB: this is also true for loading map templates as well, so they don't Initalize 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 intialized during the Atom subsystem intialization, 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 intialized then it's false.

You must always call the parent of this proc, otherwise failures will occur as the item will not be seen as initalized (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:

IsObscured

Is the atom obscured by a PREVENT_CLICK_UNDER_1 object above it

LateInitialize

Sends a signal that the new atom src, has been created at loc Late Intialization, for code that should run after all atoms have run Intialization

To have your LateIntialize proc be called, your atoms Initalization proc must return the hint INITIALIZE_HINT_LATELOAD otherwise you 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 Intialization code has been run

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 Intialization proc, mostly we run the preloader if the preloader is being used and then call InitAtom of which the ultimate result is that the Intialize proc is called.

We also generate a tag here if the DF_USE_TAG flag is set on the atom

acid_act

Respond to acid being used on our atom

Default behaviour is to send COMSIG_ATOM_ACID_ACT and return

add_atom_colour

Adds an instance of colour_type to the atom's atom_colours list

add_mob_blood

to add blood from a mob onto something, and transfer their dna info

analyzer_act

Analyzer act

assume_air

Take air from the passed in gas mixture datum

attack_hand

Return TRUE to cancel other attack hand effects that respect it.

attack_hulk

This atom has been hit by a hulkified mob in hulk mode (user)

attackby

Called on an object being hit by an item

Arguments:

See: /obj/item/proc/melee_attack_chain

audible_message

Show a message to all mobs in earshot of this atom

Use for objects performing audible actions

vars:

blob_act

React to a hit by a blob objecd

default behaviour is to send the COMSIG_ATOM_BLOB_ACT signal

bullet_act

React to a hit by a projectile object

Default behaviour is to send the COMSIG_ATOM_BULLET_ACT and then call on_hit on the projectile

check_eye

Check if this atoms eye is still alive (probably)

component_storage_contents_dump_act

Implement the behaviour for when a user click drags another storage item to you

In this case we get as many of the tiems from the target items compoent storage and then put everything into ourselves (or our storage component)

TODO these should be purely component items that intercept the atom clicks higher in the call chain

connect_to_shuttle

Connect this atom to a shuttle

contents_explosion

Handle what happens when your contents are exploded by a bomb

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.

create_reagents

Convenience proc to create a reagents holder for an atom

Arguments:

crowbar_act

Crowbar act

drop_location

Where atoms should drop if taken from this atom

emag_act

Respond to an emag being used on our atom

Default behaviour is to send COMSIG_ATOM_EMAG_ACT and return

emp_act

React to an EMP of the given severity

Default behaviour is to send the COMSIG_ATOM_EMP_ACT signal

If the signal does not return protection, and there are attached wires then we call emp_pulse on the wires

We then return the protection value

ex_act

React to being hit by an explosion

Default behaviour is to call contents_explosion and send the COMSIG_ATOM_EX_ACT signal

examine

Called when a mob examines (shift click or verb) this atom

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

Produces a signal COMSIG_PARENT_EXAMINE

get_dumping_location

Get the best place to dump the items contained in the source storage item?

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_examine_string

Generate the full examine string of this atom (including icon for goonchat)

get_remote_view_fullscreens

the vision impairment to give to the mob whose perspective is set to that atom

(e.g. an unfocused camera giving you an impaired vision when looking through it)

handle_atom_del

This proc is called when an atom in our contents has it's Destroy called

Default behaviour is to simply send COMSIG_ATOM_CONTENTS_DEL

handle_fall

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

handle_slip

Handle the atom being slipped over

has_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

Gravity situations:

hitby

React to being hit by a thrown object

Default behaviour is to call hitby_react on ourselves after 2 seconds if we are dense and under normal gravity.

Im not sure why this the case, maybe to prevent lots of hitby's if the thrown object is deleted shortly after hitting something (during explosions or other massive events that throw lots of items around - singularity being a notable example)

hitby_react

We have have actually hit the passed in atom

Default behaviour is to move back from the item that hit us

in_contents_of

Return true if we're inside the passed in atom

is_drainable

Is this atom drainable of reagents

is_drawable

Can we draw from this atom with an injectable atom

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

isinspace

Is this atom in space

log_message

Generic logging helper

log_talk

Helper for logging chat messages or other logs with arbitrary inputs (e.g. announcements)

mat_update_desc

This proc is called when a material updates an object's description

mech_melee_attack

Handle melee attack by a mech

multitool_act

Multitool act

multitool_check_buffer

Check if the multitool has an item in it's data buffer

narsie_act

Respond to narsie eating our atom

Default behaviour is to send COMSIG_ATOM_NARSIE_ACT and return

onAwayMission

Is the atom in an away mission

Must be in the away mission z-level to return TRUE

Also used in gamemode code for win conditions

onCentCom

Is this atom currently located on centcom

Specifically, is it on the z level and within the centcom areas

You can also be in a shuttleshuttle during endgame transit

Used in gamemode to identify mobs who have escaped and for some other areas of the code who don't want atoms where they shouldn't be

onSyndieBase

Is the atom in any of the centcom syndicate areas

Either in the syndie base on centcom, or any of their shuttles

Also used in gamemode code for win conditions

on_log

Called when the atom log's in or out

Default behaviour is to call on_log on the location this atom is in

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)

rad_act

Respond to a radioactive wave hitting this atom

Default behaviour is to send COMSIG_ATOM_RAD_ACT and return

rcd_act

Respond to an RCD acting on our item

Default behaviour is to send COMSIG_ATOM_RCD_ACT and return FALSE

rcd_vals

Return the values you get when an RCD eats you?

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 has expired (50 ticks)

remove_air

Remove air from this atom

remove_atom_colour

Removes an instance of colour_type from the atom's atom_colours list

return_air

Return the current air environment in this atom

return_analyzable_air

Return the air if we can analyze it

return_temperature

Return atom temperature

screwdriver_act

Screwdriver act

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_custom_materials

Sets the custom materials for an item.

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

storage_contents_dump_act

Implement the behaviour for when a user click drags a storage object to your atom

This behaviour is usually to mass transfer, but this is no longer a used proc as it just calls the underyling /datum/component/storage dump act if a component exists

TODO these should be purely component items that intercept the atom clicks higher in the call chain

tool_act

Tool behavior procedure. Redirects to tool-specific procs by default.

You can override it to catch all tool interactions, for use in complex deconstruction procs.

Must return parent proc ..() in the end if overridden

transfer_mob_blood_dna

to add a mob's dna info into an object's blood_dna list.

update_atom_colour

Resets the atom's color to null, and then sets it to the highest priority colour available

update_icon

Updates the icon of the atom

update_icon_state

Updates the icon state of the atom

update_multiz

Hook for multiz???

update_overlays

Updates the overlays of the atom

update_remote_sight

the sight changes to give to the mob whose perspective is set to that atom

(e.g. A mob with nightvision loses its nightvision while looking through a normal camera)

visible_message

Generate a visible message from this atom

Show a message to all player mobs who sees this atom

Show a message to the src mob (if the src is a mob)

Use for atoms performing visible actions

message is output to anyone who can see, e.g. "The [src] does something!"

Vars:

vv_get_dropdown

Return the markup to for the dropdown list for the VV panel for this atom

Override in subtypes to add custom VV handling in the VV panel

washed

Proc for being washed by a shower

welder_act

Welder act

wirecutter_act

Wirecutter act

wrench_act

Wrench act

zap_act

Respond to an electric bolt action on our item

Default behaviour is to return, we define here to allow for cleaner code later on