/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_list | all of this atom's HUD images which can actually be seen by players with that hud |
---|---|
age_restricted | Whether spessmen with an ID with an age below AGE_MINOR (21 by default) can buy this item |
armor | Armor datum used by the atom |
article | If non-null, overrides a/an/some in all cases |
atom_colours | used to store the different colors on an atom |
atom_integrity | Current integrity, defaults to max_integrity on init |
base_icon_state | the base icon state used for anything that changes their icon state. |
base_pixel_x | Default pixel x shifting for the atom's icon. |
base_pixel_y | Default pixel y shifting for the atom's icon. |
bottom_left_corner | Smoothing variable |
bottom_right_corner | Smoothing variable |
buckle_message_cooldown | Cooldown tick timer for buckle messages |
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_atmos_pass | Check if atmos can pass in this atom (ATMOS_PASS_YES, ATMOS_PASS_NO, ATMOS_PASS_DENSITY, ATMOS_PASS_PROC) |
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.) |
custom_premium_price | Economy cost of item in premium vendor |
custom_price | Economy cost of item |
damage_deflection | Damage under this value will be completely ignored |
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 |
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. |
integrity_failure | Integrity level when this atom will "break" (whatever that means) 0 if we have no special broken behavior, otherwise is a percentage of at what point the atom breaks. 0.5 being 50% |
interaction_flags_atom | Intearaction flags |
light | Our light source. Don't fuck with this directly unless you have a good reason! |
light_angle | Angle of light to show in light_dir 360 is a circle, 90 is a cone, etc. |
light_color | Hexadecimal RGB string representing the colour of the light. White by default. |
light_dir | What angle to project light in |
light_flags | Bitflags to determine lighting-related atom properties. |
light_height | How many tiles "up" this light is. 1 is typical, should only really change this if it's a floor light |
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 |
material_flags | Bitfield for how the atom handles materials. |
max_integrity | Maximum integrity |
proximity_monitor | Proximity monitor associated with this atom |
rad_insulation | Radiation insulation types |
reagents | Reagents holder |
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 |
smoothing_flags | Icon-smoothing behavior. |
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. |
targeted_by | Mobs that are currently do_after'ing this atom, to be cleared from on Destroy() |
top_left_corner | Smoothing variable |
top_right_corner | Smoothing variable |
update_on_z | Lazylist of all images (or atoms, I'm sorry) (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 |
uses_integrity | any atom that uses integrity and can be damaged must set this to true, otherwise the integrity procs will throw an error |
Procs | |
AllowDrop | Are you allowed to drop 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. |
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 |
CheckExit | Are you allowed to pass a sided object of the same dir |
CheckParts | Ensure a list of atoms/reagents exists inside this atom |
Destroy | Top level of the destroy chain for most atoms |
Entered | An atom has entered this atom's contents |
Exit | An atom is attempting to exit this atom's contents |
Exited | An atom has exited this atom's contents |
HandleTurfChange | called when the turf the atom resides on is ChangeTurfed |
HasProximity | Is this atom within 1 tile of another atom |
Initialize | The primary method that objects are setup in SS13 with |
LateInitialize | Late Intialization, for code that should run after all atoms have run Intialization |
New | Sends a signal that the new atom src , has been created at loc
Called when an atom is created in byond (built in engine proc) |
RemoveInvisibility | Removes the specified invisibility source from the tracker |
SetInvisibility | Sets invisibility according to priority. If you want to be able to undo the value you set back to what it would be otherwise, you should provide an id here and remove it using RemoveInvisibility(id) |
SpinAnimation | Proc called when you want the atom to spin around the center of its icon (or where it would be if its transform var is translated) By default, it makes the atom spin forever and ever at a speed of 60 rpm. |
Topic | Passes Stat Browser Panel clicks to the game and calls client click on an atom |
acid_act | Respond to acid being used on our atom |
add_atom_colour | Adds an instance of colour_type to the atom's atom_colours list |
add_emitter | ATOM PROCS priority is in descending order so 10 is the highest 1 is the lowest |
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 |
atom_break | Called after the atom takes damage and integrity is below integrity_failure level |
atom_destruction | what happens when the atom's integrity reaches zero. |
atom_fix | Called when integrity is repaired above the breaking point having been broken before |
attack_hand_secondary | When the user uses their hand on an item while holding right-click Returns a SECONDARY_ATTACK_* value. |
attack_hulk | This atom has been hit by a hulkified mob in hulk mode (user) |
audible_message | Show a message to all mobs in earshot of this atom |
balloon_alert | Creates text that will float from the atom upwards to the viewer. |
balloon_alert_to_viewers | Create balloon alerts (text that floats up) to everything within range. Will only display to people who can see. |
balloon_or_message | Creates a balloon alert, or sends a chat message dependant on client preferences. Args: viewer - mob that gets message/alert, alert - balloon alert text, message - text message that the mob gets if the preference is toggled, equals to alert message if not passed in the proc |
bitmask_smooth | Basic smoothing proc. The atom checks for adjacent directions to smooth with and changes the icon_state based on that. |
blob_act | React to a hit by a blob objecd |
bullet_act | React to a hit by a projectile object |
calculate_adjacencies | Scans all adjacent turfs to find targets to smooth with. |
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 |
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 |
create_reagents | Convenience proc to create a reagents holder for an atom |
crowbar_act | Crowbar act |
do_alert_animation | Does the MGS ! animation |
do_spin_animation | Animates source spinning around itself. For docmentation on the args, check atom/proc/SpinAnimation() |
drop_location | Where atoms should drop if taken from this atom |
emag_act | Respond to an emag being used on our atom |
emp_act | React to an EMP of the given severity |
ex_act | React to being hit by an explosion |
examine | Called when a mob examines (shift click or verb) this atom |
examine_more | Called when a mob examines (shift click or verb) this atom twice (or more) within EXAMINE_MORE_WINDOW (default 1.5 seconds) |
find_type_in_direction | Scans direction to find targets to smooth with. |
flick_overlay | Flicks a certain overlay onto an atom, handling icon_state strings |
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 |
get_all_orbiters | Recursive getter method to return a list of all ghosts orbitting this atom |
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 |
get_examine_string | Generate the full examine string of this atom (including icon for goonchat) |
get_integrity | This mostly exists to keep atom_integrity private. Might be useful in the future. |
get_material_composition | *Returns the material composition of the atom. |
get_remote_view_fullscreens | the vision impairment to give to the mob whose perspective is set to that atom |
handle_atom_del | This proc is called when an atom in our contents has it's Destroy() called |
handle_fall | Called when gravity returns after floating I think |
handle_slip | Handle the atom being slipped over |
has_gravity | Returns true if this atom has gravity for the passed in turf |
hitby | React to being hit by a thrown object |
hitby_react | We have have actually hit the passed in atom |
honk_act | Respond to honkmother eating our atom |
hulk_damage | Called to get the damage that hulks will deal to the atom. |
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 |
is_spillable | Can this atom spill its reagents |
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 |
modify_max_integrity | changes max_integrity while retaining current health percentage, returns TRUE if the atom got broken. |
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 |
onCentCom | Is this atom currently located on centcom |
onSyndieBase | Is the atom in any of the centcom syndicate areas |
on_log | Called when the atom log's in or out |
play_attack_sound | the sound played when the atom is damaged. |
prepare_huds | Prepare the huds for this atom |
rad_act | Respond to a radioactive wave hitting this atom |
ratvar_act | Respond to ratvar eating our atom |
rcd_act | Respond to an RCD acting on our item |
rcd_vals | Return the values you get when an RCD eats you? |
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 |
relaymove | An atom we are buckled or is contained within us has tried to move |
remove_air | Remove air from this atom |
remove_atom_colour | Removes an instance of colour_type from the atom's atom_colours list |
repair_damage | Proc for recovering atom_integrity. Returns the amount repaired by |
replace_smooth_overlays | Internal: Takes icon states as text to replace smoothing corner overlays |
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 |
run_atom_armor | returns the damage value of the attack after processing the atom's various armor protections |
runechat_prefs_check | Returns the client runechat visible messages preference according to the message type. |
rust_heretic_act | Causes effects when the atom gets hit by a rust effect from heretics |
screwdriver_act | Screwdriver act |
setClosed | Used to set something as 'closed' if it's being used as a supplypod |
setDir | Hook for running code when a dir change occurs |
setOpened | Used to set something as 'open' if it's being used as a supplypod |
setShift | Used to change the pixel shift of an atom |
set_custom_materials | Sets the custom materials for an item. |
set_density | Setter for the density variable to append behavior related to its changing. |
set_greyscale | Handles updates to greyscale value updates. The colors argument can be either a list or the full color string. Child procs should call parent last so the update happens after all changes. |
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_angle | Setter for the light angle of this atom |
set_light_color | Setter for the light color of this atom. |
set_light_dir | Setter for the light direction of this atom |
set_light_flags | Setter for the light flags of this atom. |
set_light_height | Setter for the height of our light |
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. |
set_smoothed_icon_state | Changes the icon state based on the new junction bitmask |
shuttleRotate | Base proc |
singularity_act | Respond to the singularity eating this atom |
singularity_pull | Respond to the singularity pulling on us |
smooth_icon | do not use, use QUEUE_SMOOTH(atom) |
spasm_animation | Similar to shake but more spasm-y and jerk-y |
storage_contents_dump_act | Implement the behaviour for when a user click drags a storage object to your atom |
swarmer_act | Determines what happens to an atom when a swarmer interacts with it |
take_damage | The essential proc to call when an atom must receive damage of any kind. |
tool_act | Tool behavior procedure. Redirects to tool-specific procs by default. |
transfer_mob_blood_dna | to add a mob's dna info into an object's blood_dna list. |
update_appearance | Updates the appearence of the icon |
update_desc | Updates the description of the atom |
update_greyscale | Checks if this atom uses the GAGS 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_integrity | Handles the integrity of an atom changing. This must be called instead of changing integrity directly. |
update_light | Will update the light (duh). Creates or destroys it if needed, makes it update values, makes sure it's got the correct source turf... |
update_name | Updates the name of the atom |
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 |
visible_message | Generate a visible message from this atom |
vv_edit_var | Resets the atom's color to null, and then sets it to the highest priority colour available call back when a var is edited on this atom |
vv_get_dropdown | Return the markup to for the dropdown list for the VV panel for this atom |
wash | Wash this atom |
wash_cream | wash cream off this object |
welder_act | Welder act |
wirecutter_act | Wirecutter act |
wrench_act | Wrench act |
Var Details
active_hud_list
all of this atom's HUD images which can actually be seen by players with that hud
age_restricted
Whether spessmen with an ID with an age below AGE_MINOR (21 by default) can buy this item
armor
Armor datum used by the atom
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...
atom_integrity
Current integrity, defaults to max_integrity on init
base_icon_state
the base icon state used for anything that changes their icon state.
base_pixel_x
Default pixel x shifting for the atom's icon.
base_pixel_y
Default pixel y shifting for the atom's icon.
bottom_left_corner
Smoothing variable
bottom_right_corner
Smoothing variable
buckle_message_cooldown
Cooldown tick timer for buckle messages
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_atmos_pass
Check if atmos can pass in this atom (ATMOS_PASS_YES, ATMOS_PASS_NO, ATMOS_PASS_DENSITY, ATMOS_PASS_PROC)
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.)
custom_premium_price
Economy cost of item in premium vendor
custom_price
Economy cost of item
damage_deflection
Damage under this value will be completely ignored
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
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.
integrity_failure
Integrity level when this atom will "break" (whatever that means) 0 if we have no special broken behavior, otherwise is a percentage of at what point the atom breaks. 0.5 being 50%
interaction_flags_atom
Intearaction flags
light
Our light source. Don't fuck with this directly unless you have a good reason!
light_angle
Angle of light to show in light_dir 360 is a circle, 90 is a cone, etc.
light_color
Hexadecimal RGB string representing the colour of the light. White by default.
light_dir
What angle to project light in
light_flags
Bitflags to determine lighting-related atom properties.
light_height
How many tiles "up" this light is. 1 is typical, should only really change this if it's a floor light
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
material_flags
Bitfield for how the atom handles materials.
max_integrity
Maximum integrity
proximity_monitor
Proximity monitor associated with this atom
rad_insulation
Radiation insulation types
reagents
Reagents holder
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
smoothing_flags
Icon-smoothing behavior.
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.
targeted_by
Mobs that are currently do_after'ing this atom, to be cleared from on Destroy()
top_left_corner
Smoothing variable
top_right_corner
Smoothing variable
update_on_z
Lazylist of all images (or atoms, I'm sorry) (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
uses_integrity
any atom that uses integrity and can be damaged must set this to true, otherwise the integrity procs will throw an error
Proc Details
AllowDrop
Are you allowed to drop 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: BeamTarget: Where you're beaming from. Where do you get origin? You didn't read the docs, fuck you. icon_state: What the beam's icon_state is. The datum effect isn't the ebeam object, it doesn't hold any icon and isn't type dependent. icon: What the beam's icon file is. Don't change this, man. All beam icons should be in beam.dmi anyways. maxdistance: how far the beam will go before stopping itself. Used mainly for two things: preventing lag if the beam may go in that direction and setting a range to abilities that use beams. beam_type: The type of your custom beam. This is for adding other wacky stuff for your beam only. Most likely, you won't (and shouldn't) change it.
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
CheckExit
Are you allowed to pass a sided object of the same dir
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
Destroy
Top level of the destroy chain for most atoms
Cleans up the following:
- Removes alternate apperances from huds that see them
- qdels the reagent holder from atoms if it exists
- clears the orbiters list
- clears overlays and priority overlays
- clears the light object
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
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.
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 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:
- [/turf/proc/Initialize]
- /turf/open/space/proc/Initialize
LateInitialize
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 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 Intialization code has been run
New
Sends a signal that the new atom src
, has been created at loc
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.
RemoveInvisibility
Removes the specified invisibility source from the tracker
SetInvisibility
Sets invisibility according to priority. If you want to be able to undo the value you set back to what it would be otherwise, you should provide an id here and remove it using RemoveInvisibility(id)
SpinAnimation
Proc called when you want the atom to spin around the center of its icon (or where it would be if its transform var is translated) By default, it makes the atom spin forever and ever at a speed of 60 rpm.
Arguments:
- speed: how much it takes for the atom to complete one 360° rotation
- loops: how many times do we want the atom to rotate
- clockwise: whether the atom ought to spin clockwise or counter-clockwise
- segments: in how many animate calls the rotation is split. Probably unnecessary, but you shouldn't set it lower than 3 anyway.
- parallel: whether the animation calls have the ANIMATION_PARALLEL flag, necessary for it to run alongside concurrent animations.
Topic
Passes Stat Browser Panel clicks to the game and calls client click on an 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_emitter
ATOM PROCS priority is in descending order so 10 is the highest 1 is the lowest
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
atom_break
Called after the atom takes damage and integrity is below integrity_failure level
atom_destruction
what happens when the atom's integrity reaches zero.
atom_fix
Called when integrity is repaired above the breaking point having been broken before
attack_hand_secondary
When the user uses their hand on an item while holding right-click Returns a SECONDARY_ATTACK_* value.
attack_hulk
This atom has been hit by a hulkified mob in hulk mode (user)
audible_message
Show a message to all mobs in earshot of this atom
Use for objects performing audible actions
vars:
- message is the message output to anyone who can hear.
- deaf_message (optional) is what deaf people will see.
- hearing_distance (optional) is the range, how many tiles away the message can be heard.
balloon_alert
Creates text that will float from the atom upwards to the viewer.
balloon_alert_to_viewers
Create balloon alerts (text that floats up) to everything within range. Will only display to people who can see.
balloon_or_message
Creates a balloon alert, or sends a chat message dependant on client preferences. Args: viewer - mob that gets message/alert, alert - balloon alert text, message - text message that the mob gets if the preference is toggled, equals to alert message if not passed in the proc
bitmask_smooth
Basic smoothing proc. The atom checks for adjacent directions to smooth with and changes the icon_state based on that.
Returns the previous smoothing_junction state so the previous state can be compared with the new one after the proc ends, and see the changes, if any.
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
calculate_adjacencies
Scans all adjacent turfs to find targets to smooth with.
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:
- max_vol - maximum volume of holder
- flags - flags to pass to the holder
crowbar_act
Crowbar act
do_alert_animation
Does the MGS ! animation
do_spin_animation
Animates source spinning around itself. For docmentation on the args, check atom/proc/SpinAnimation()
drop_location
Where atoms should drop if taken from this atom
emag_act
Respond to an emag being used on our atom
Args:
- mob/user: The mob that used the emag. Nullable.
- obj/item/card/emag/emag_card: The emag that was used. Nullable.
Returns: TRUE if the emag had any effect, falsey otherwise.
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_ATOM_EXAMINE
examine_more
Called when a mob examines (shift click or verb) this atom twice (or more) within EXAMINE_MORE_WINDOW (default 1.5 seconds)
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
find_type_in_direction
Scans direction to find targets to smooth with.
flick_overlay
Flicks a certain overlay onto an atom, handling icon_state strings
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
get_all_orbiters
Recursive getter method to return a list of all ghosts orbitting this atom
This will work fine without manually passing arguments.
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_integrity
This mostly exists to keep atom_integrity private. Might be useful in the future.
get_material_composition
*Returns the material composition of the atom.
-
Used when recycling items, specifically to turn alloys back into their component mats.
-
Exists because I'd need to add a way to un-alloy alloys or otherwise deal
-
with people converting the entire stations material supply into alloys.
-
Arguments:
-
- flags: A set of flags determining how exactly the materials are broken down.
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
Called when gravity returns after floating I think
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:
- No gravity if you're not in a turf
- No gravity if this atom is in is a space turf
- Gravity if the area it's in always has gravity
- Gravity if there's a gravity generator on the z level
- Gravity if the Z level has an SSMappingTrait for ZTRAIT_GRAVITY
- otherwise no gravity
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
honk_act
Respond to honkmother eating our atom
Default behaviour is to send COMSIG_ATOM_HONK_ACT and return
hulk_damage
Called to get the damage that hulks will deal to the atom.
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
is_spillable
Can this atom spill its reagents
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
modify_max_integrity
changes max_integrity while retaining current health percentage, returns TRUE if the atom got broken.
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
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
play_attack_sound
the sound played when the atom is damaged.
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
ratvar_act
Respond to ratvar eating our atom
Default behaviour is to send COMSIG_ATOM_RATVAR_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?
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
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
repair_damage
Proc for recovering atom_integrity. Returns the amount repaired by
replace_smooth_overlays
Internal: Takes icon states as text to replace smoothing corner overlays
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
run_atom_armor
returns the damage value of the attack after processing the atom's various armor protections
runechat_prefs_check
Returns the client runechat visible messages preference according to the message type.
rust_heretic_act
Causes effects when the atom gets hit by a rust effect from heretics
Override this if you want custom behaviour in whatever gets hit by the rust
screwdriver_act
Screwdriver act
setClosed
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.
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)
setOpened
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.
setShift
Used to change the pixel shift of an atom
set_custom_materials
Sets the custom materials for an item.
set_density
Setter for the density
variable to append behavior related to its changing.
set_greyscale
Handles updates to greyscale value updates. The colors argument can be either a list or the full color string. Child procs should call parent last so the update happens after all changes.
set_hud_image_active
set every hud image in the given category active so other people with the given hud can see it. Arguments:
- hud_category - the index in our active_hud_list corresponding to an image now being shown.
- update_huds - if FALSE we will just put the hud_category into active_hud_list without actually updating the atom_hud datums subscribed to it
- exclusive_hud - if given a reference to an atom_hud, will just update that hud instead of all global ones attached to that category. This is because some atom_hud subtypes arent supposed to work via global categories, updating normally would affect all of these which we dont want.
set_hud_image_inactive
sets every hud image in the given category inactive so no one can see it
set_light_angle
Setter for the light angle of this atom
set_light_color
Setter for the light color of this atom.
set_light_dir
Setter for the light direction of this atom
set_light_flags
Setter for the light flags of this atom.
set_light_height
Setter for the height of our light
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_smoothed_icon_state
Changes the icon state based on the new junction bitmask
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
smooth_icon
do not use, use QUEUE_SMOOTH(atom)
spasm_animation
Similar to shake but more spasm-y and jerk-y
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
swarmer_act
Determines what happens to an atom when a swarmer interacts with it
Determines behavior upon being interacted on by a swarmer. Arguments:
- S - A reference to the swarmer doing the interaction
take_damage
The essential proc to call when an atom must receive damage of any kind.
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_appearance
Updates the appearence of the icon
Mostly delegates to update_name, update_desc, and update_icon
Arguments:
- updates: A set of bitflags dictating what should be updated. Defaults to [ALL]
update_desc
Updates the description of the atom
update_greyscale
Checks if this atom uses the GAGS 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_integrity
Handles the integrity of an atom changing. This must be called instead of changing integrity directly.
update_light
Will update the light (duh). Creates or destroys it if needed, makes it update values, makes sure it's got the correct source turf...
update_name
Updates the name of the atom
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:
- self_message (optional) is what the src mob sees e.g. "You do something!"
- blind_message (optional) is what blind people will hear e.g. "You hear something!"
- vision_distance (optional) define how many tiles away the message can be seen.
- ignored_mob (optional) doesn't show any message to a given mob if TRUE.
vv_edit_var
Resets the atom's color to null, and then sets it to the highest priority colour available 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.Debug2 is FALSE, it sets the ADMIN_SPAWNED_1 flag on flags_1, which signifies the object has been admin edited
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
wash
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:
- clean_types: any of the CLEAN_ constants
wash_cream
wash cream off this object
(for the love of space jesus please make this a component)
welder_act
Welder act
wirecutter_act
Wirecutter act
wrench_act
Wrench act