atom
Vars | |
atom_flags | Bitflag (Any of ATOM_FLAG_* ). General atom level flags. See code\__defines\flags.dm . |
---|---|
atom_overlay_cache | This atom's cache of non-protected overlays, used for normal icon additions. Do not manipulate directly- See SSoverlays. |
atom_protected_overlay_cache | This atom's cache of overlays that can only be removed explicitly, like C4. Do not manipulate directly- See SSoverlays. |
blood_DNA | LAZYLIST of all DNA strings present on the atom from blood. Do not modify directly. See add_blood() and clean_blood() . |
blood_color | Color. The color of the blood overlay effect, if present. |
climb_speed_mult | Float. The multiplier applied to the do_after() timer when a mob climbs the atom. |
climbers | LAZYLIST of mobs currently climbing the atom. |
damage_hitsound | Sound effect played when hit |
do_unique_target_user | The mob currently interacting with the atom during a do_after timer. Used to validate DO_TARGET_UNIQUE_ACT flag checks. |
explosion_resistance | Float. The atom's explosion resistance value. Used to calculate how much of an explosion is 'absorbed' and not passed on to tiles on the other side of the atom's turf. See /proc/explosion_rec() . |
fingerprints | LAZYLIST of fingerprints present on the atom. Index is the full print, value is either the full print or a starred version of the full print as a partial. Do not modify directly. See add_fingerprint() , add_partial_print() , and transfer_fingerprints_to() . |
fingerprintshidden | LAZYLIST of mobs that have touched/used the atom. Used for staff investigation. Each entry includes a timestamp and name of the mob that generated the fingerprint. Do not modify directly. See add_hiddenprint() . |
fingerprintslast | String. The last ckey to generate fingerprints on this atom. Used to reduce the number of duplicate fingerprintshidden entries. |
fluorescent | Integer (One of ATOM_FLOURESCENCE_* ). Whether or not the atom is visible under a UV light. If set to 2 , the atom is actively highlighted by a light. See code\__defines\misc.dm . |
germ_level | Integer. The atom's current germ level. The higher the germ level, the more germ on the atom. |
gunshot_residue | LAZYLIST of gunshot residue present on the atom. Each entry contains the caliber of ammunition that generated the residue. Updated by /obj/item/ammo_casing/proc/put_residue_on() . |
health_current | Current health for health processing. Use get_current_health() , damage_health() , or restore_health() for general health references. |
health_flags | Bitflag (Any of HEALTH_FLAG_* ). Various health-related config flags for the atom. See code\__defines\health.dm for details. |
health_max | Maximum health for simple health processing. Use get_max_health() or set_max_health() to reference/modify. |
health_min_damage | Minimum damage required to actually affect health in can_damage_health() . |
health_resistances | LAZY List of damage type resistance or weakness multipliers, decimal form. Only applied to health reduction. Use set_damage_resistance() , remove_damage_resistance() , and get_damage_resistance() to reference/modify. |
health_status | Bitflag (Any of HEALTH_STATUS_* ). Various health-related status flags for the atom. See code\__defines\health.dm for details. |
init_flags | Bitflag (Any of INIT_* ). Flags for special/additional handling of the Initialize() chain. See code\__defines\misc.dm . |
last_bumped | Integer. The world.time the atom was last bumped into. Only used by some subtypes to prevent bump spamming. |
level | Integer. The atom's layering level. Primarily used for determining whether the atom is visible or not on certain tile/flooring types/layers (I.e. plating and non-plating). |
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. |
light_offset_x | |
light_power | Intensity of the light. |
light_range | Range in tiles of the light. |
light_source_multi | 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_source_solo | Same as above - this is a shortcut to avoid allocating the above list if we can |
light_wedge | The angle that the light's emission should be restricted to. null for omnidirectional. |
pass_flags | Bitflag (Any of PASS_FLAG_* ). Flags indicating the types of dense objects this atom is able to pass through/over. |
plane | Integer (One of *_PLANE ). The atom's rendering plane. See code\__defines\__renderer.dm for a list of valid planes. Also see the DM Reference for plane var (atom) . |
reagents | The reagents contained within the atom. Handles all reagent interactions and processing. |
simulated | Boolean. Whether or not the atom is considered simulated. If FALSE , blocks a majority of interactions, processes, etc. |
suit_fibers | LAZYLIST of clothing fibers persent on the atom. Do not modify directly. See add_fibers() and transfer_fingerprints_to() . |
temperature | Float. The atom's current temperature. |
temperature_coefficient | Float. Multiplier used to determine how much temperature can change/transfer to this atom when a temperature change proc is called. See ProcessAtomTemperature() and /obj/proc/HandleObjectHeating() . Should be a value between MIN_TEMPERATURE_COEFFICIENT and MAX_TEMPERATURE_COEFFICIENT . |
tf_offset_x | The atom's base transform scale for horizontal offset. |
tf_offset_y | The atom's base transform scale for vertical offset. |
tf_rotation | The atom's base transform scale for rotation. |
tf_scale_x | The atom's base transform scale for width. |
tf_scale_y | The atom's base transform scale for height. |
throwpass | Boolean. Whether or not thrown objects can pass through/over the atom. |
use_weapon_hitsound | Boolean. If set, uses the item's hit sound file instead of the source atom's when attacked. |
was_bloodied | Boolean. Whether or not the atom was bloodied at any point. This remains TRUE even when is_bloodied is set to FALSE, except in very specific circumstances. Used for luminol handling to detect cleaned blood. |
Procs | |
AddLabel | Convenience shortcut for user labelling attempts. Overrides provide behavior. |
AddOverlays | Adds specific overlay(s) to the atom. It is designed so any of the types allowed to be added to /atom/overlays can be added here too. More details below. |
Adjacent | Adjacency proc for determining touch range |
AltClick | Called when a mob alt+clicks the atom. By default, this creates and populates the Turf panel, displaying all objects on the atom's turf. |
AltShiftClick | Called when a mob alt+shift+clicks on the 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. |
Bumped | Called when an object 'bumps' into the atom, typically by entering or attempting to enter the same tile. |
CanFluidPass | Whether or not fluids can pass through this atom. |
CanMouseDrop | Whether or not an atom can be dropped onto this atom. Called when a user click+drag's src onto over . |
CanMoveOnto | Whether or not an atom can move through or onto the same tile as this atom. Primarily used for z-level transitioning in multi-z areas. |
CanPass | Whether or not an atom can move through or onto the same tile as this atom. |
CheckExit | Used to check if this atom blocks another atom's movement to the target turf. Called on all atom's in mover 's current location. |
ClearOverlays | Clears the atom's overlay cache(s) and queues an update if needed. Use CLEAR_TARGET_* flags. |
ClearTransform | Clear the atom's tf_* variables and the current transform state. |
CopyOverlays | Copy the overlays from another atom. |
CouldNotUseTopic | Called if the CanUseTopic() call fails in Topic() . |
CouldUseTopic | Called if the CanUseTopic() call succeeds in Topic() . |
CtrlAltClick | Called when a mob ctrl+alt+clicks on the atom. |
CtrlAltShiftClick | Called when a mob ctrl+alt+shift+clicks on the atom. |
CtrlClick | Called when a mob ctrl+clicks on the atom. By default, this starts pulling a movable atom if adjacent. |
CtrlShiftClick | Called when a mob ctrl+shift+clicks on the atom. |
CutCacheBehavior | Shared behavior for CutOverlays & CutUnderlays. Do not use directly. null: nothing changed, do nothing FALSE: update should be queued TRUE: update should be queued, cache should be nulled |
CutOverlays | Removes specific overlay(s) from the atom's normal or protected overlay cache and queue an update. |
DefaultTopicState | The atom's default topic state. Used in various Topic related proc calls and defines to validate interactions. |
Entered | Movement Handling |
Exited | Exited Handling |
GetAllContents | Retrieves the contents of this atom and all atoms contained within, recursively. |
HasProximity | Called when an atom moves into 'proximity' (Currently, range(1) ) of src. Only called on atoms that have the MOVABLE_FLAG_PROXMOVE flag in movable_flags . |
ImmediateOverlayUpdate | Immediately runs an overlay update. |
Initialize | Initialization handler for atoms. It is preferred to use this over New() . |
InsertedContents | Returns a list of contents that can be inserted and/or removed. By default, this simply returns contents . |
IsCoil | True when this atom can be used as a cable coil. |
IsCrowbar | True when this atom can be used as a crowbar. |
IsFlameSource | True when this atom can be used as a flame source. This is for open flames. |
IsHatchet | True when this atom can be used as a hatchet. |
IsHeatSource | Returns an integer value of temperature when this atom can be used as a heat source. This is for hot objects. |
IsMultitool | True when this atom can be used as a multitool. |
IsScrewdriver | True when this atom can be used as a screwdriver. |
IsWelder | True when this atom can be used as a Welder. |
IsWirecutter | True when this atom can be used as a wirecutter. |
IsWrench | True when this atom can be used as a wrench. |
LateExamine | Works same as /atom/proc/Examine(), only this output comes immediately after any and all made by /atom/proc/Examine() |
LateInitialize | Late initialization handler.
Called after the Initialize() chain for any atoms that returned INITIALIZE_HINT_LATELOAD .
Primarily used for atoms that rely on initialized values from other atoms. |
MayZoom | Whether or not the atom is permitted to 'zoom' - I.e., binocular or scope handlers. |
OnTopic | Called when a user successfully interacts with a topic interaction window. |
ProcessAtomTemperature | Temperature subsystem process. |
QueueOverlayUpdate | Enqueues the atom for an overlay update if not already queued |
RelayMouseDrag | Called by /mob/proc/OnMouseDrag() when a mob within this atom's contents performs a mouse drag operation. Used to provide alternative handling to mouse dragging within certain atoms. |
RemoveLabel | Removes a labeller label from the atom. |
SetName | Name Set Handling |
SetOverlays | AddOverlays with ClearOverlays first. See AddOverlays for behavior. |
SetTransform | Sets the atom's tf_* variables and the current transform state, also applying others if supplied. |
ShiftClick | Called when a mob shift+clicks on the atom. By default, this calls the examine proc chain. |
SpinAnimation | Performs a spin/rotation animation on the atom's sprite. |
UpdateOverlays | Builds the atom's overlay state from caches |
add_blood | Adds blood effects and DNA to the atom. |
add_fibers | Adds forensics fibers to the atom from clothing worn by a mob. |
add_fingerprint | Adds fingerprints to an atom from a mob. |
add_hiddenprint | Adds fingerprint logs to the atom's hidden prints. |
add_partial_print | Adds a partial print to the atom's fingerprints list. |
additional_see_invisible | Retrieves see invisible values the atom may provide. Called on atoms contained in a mob's additional_vision_handlers list. See /mob/proc/get_accumulated_vision_handlers() . |
additional_sight_flags | Retrieves additional sight flags the atom may provide. Called on atoms contained in a mob's additional_vision_handlers list. See /mob/proc/get_accumulated_vision_handlers() . |
allow_click_through | Whether or not the atom should allow a mob to click things while inside it's contents. |
assume_air | Handler for receiving gas. |
attack_ai | Called when an AI mob clicks on an atom. |
attack_animal | Called when a simple_animal mob clicks on the atom with an 'empty hand.' |
attack_generic | Generic attack and damage proc, called on the attacked atom. |
attack_ghost | Called when a ghost mob clicks on an atom. |
attack_robot | Called when a silicon robot mob clicks on an atom. |
audible_message | Shows a message to all mobs and objects within earshot of this atom. Use for objects performing audible actions. |
auto_turn | Automatically sets the atom's direction based on nearby walls. Used for atoms that should appear 'attached' to walls. |
bullet_act | Called when a projectile impacts the atom. |
can_climb | Whether or not a mob can climb this atom. |
can_damage_health | Checks if the atom's health can be damaged.
Should be called before damage_health() in most cases. |
can_restore_health | Checks if the atom's health can be restored.
Should be called before restore_health() in most cases.
NOTE: Does not include a check for death state by default, to allow repairing/healing atoms back to life. |
can_touch | Checks if a mob can perform certain physical interactions with the atom. Primarily used for climbing and flipping tables. |
can_use_item | Whether or not an item interaction is possible. Checked before any use calls. |
check_eye | Determines sight flags that should be added to user's sight var. |
check_fluid_depth | Determines whether the atom's current fluid depth meets the provided value or not. Generally used by turfs. |
checkpass | Whether or not the atom allows the given passflag to pass through it. |
choose_from_pronouns | Retrieves the atom's pronouns. Generally this is just based on gender but some factors may mask or change this. |
clean_blood | Removes all blood, DNA, residue, germs, etc from the atom. |
climb_on | Verb to allow climbing onto an object. Passes directly to /atom/proc/do_climb(usr) . |
contains | Recursively checks if this atom contains another atom in its contents, or contents of its contents. |
contents_nano_distance | Handles additional special checks for whether or not NanoUI interactions are valid. Some atoms such as vehicles might have special rules for how mobs inside them interact with NanoUI. |
create_reagents | Creates a reagent holder for the atom. This shouldn't be used if a reagents holder already exists, but it will partially function by increasing the existing holder's maximum volume instead of creating a new one. If the existing holder's maximum already exceeded the given value, however, this will not reduce the volume. |
damage_health | Damage's the atom's health by the given value. Returns TRUE if the damage resulted in a death state change.
Resistance and weakness modifiers are applied here. |
disrupts_psionics | Whether or not this atom or its contents will disrupt psionics. Top-level proc recursively checks all contents. |
do_climb | Handles climbing atoms for mobs. This proc includes a do_after() timer. |
drain_power | Returns an amount of power drawn from the atom or -1 if it's not viable. |
emag_act | Handler for the effects of being emagged by a cryptographic sequencer. Other situations may also call this for certain atoms, such as EMP'd or hacked machinery, or antagonist robots. |
emp_act | Called when the atom is affected by an EMP. |
ex_act | Called when an explosion affects the atom. |
examine_damage_state | Handles sending damage state to users on examine() .
Overrideable to allow for different messages, or restricting when the messages can or cannot appear. |
fire_act | Called when fire affects the atom. |
fluid_update | Handler for fluid updates. Mirrors to the atom's turf. |
get_alarm_area | Retrieves the atom's area for alarms. |
get_alarm_cameras | Retrieves a list of cameras from the atom's area. |
get_alarm_name | Retrieves the name to use for alarms. For mobs, this is the mob's name. For everything else, this is the arom's area's name. |
get_alarm_origin | Retrieves the 'origin' point for any alarms the atom declares. For turfs, this will be the area. For any other atom, this is itself. |
get_alarm_z | Assisting procs |
get_antag_info | Handler for displaying information in the Antagonist section of the atom's codex entry. |
get_antag_interactions_info | Handler for displaying information on tool interations in the Antagonist section of the atom's codex entry. |
get_cell | Retrieves the atom's power cell, if it has one. |
get_codex_value | The codex entry name to use for this atom. By default, itself. Used for items that should direct to a codex entry other than itself, such as Fleet lore. |
get_color | Returns the atom's current color or white if it has no color. |
get_construction_info | Handler for displaying construction steps in the Mechanics section of the atom's codex entry. Separated to allow overriding without duplication of parent steps, or removal of parent mechanics information. |
get_container | Recursively searches containers for a given path, and returns the first match. |
get_current_health | Retrieves the atom's current health, or null if not using health |
get_damage_percentage | Retrieves the atom's current damage as a percentage where 100% is 100 . |
get_damage_resistance | Fetches the atom's current resistance value for the given damage type. |
get_damage_value | Retrieves the atom's current damage, or null if not using health. |
get_explosion_resistance | Retrieves the atom's explosion resistance. Generally, this is explosion_resistance for simulated atoms. |
get_fluid_depth | Determines the atom's current fluid depth. Currently only used by turfs. |
get_global_map_pos | Retrieves the atom's x and y coordinates from the global map. |
get_holsters | Retrieves all holsters contained within the atom, including itself. Generally, this is any atom that has the
/datum/extension/holster extension. |
get_interactions_info | Handler for displaying information on tool interations in the Mechanics section of the atom's codex entry. |
get_light_and_color | Sets the atom's color and light values to those of origin . |
get_lore_info | Handler for displaying information in the Lore section of the atom's codex entry. |
get_material_melting_point | Returns the material's melting point, or T100C if there is no material. Overrideable for special cases, such as
atoms that allow material reinforcement or that by nature should have a higher or lower melting point. |
get_max_health | Retrieves the atom's maximum health. |
get_mechanics_info | Handler for displaying information in the Mechanics section of the atom's codex entry. |
get_rads | Retrieves the atom's current radiation level. By default, this will return loc.get_rads() . |
get_rig | Retrieves the rig the atom is located inside of, recursively checking parent locs until it find one. |
get_source_name | Retrieves an alarm's origin name. Generally this is the atom's name or, for cameras, c_tag . |
get_specific_codex_entry | Retrieves the atom's codex entry, generating a new one if not already cached. |
health_broken | Whether or not the atom is currently broken. Does not consider death as broken, to minimize on recursive proc calls. |
health_damaged | Whether or not the atom's health is damaged. |
health_dead | Whether or not the atom is currently dead. |
hitby | Called when the atom is hit by a thrown object. |
in_contents_of | Determines whether or not the atom is in the contents of the container or an instance of container if provided as a path. |
is_damage_immune | Determines whether or not the atom has full immunity to the given damage type. |
is_open_container | Whether or not the atom is considered an open container for chemistry handling. |
isinspace | Whether or not the atom is in space. |
kill_health | Immediately sets health to 0 then updates death_state , bypassing all other checks and processes. |
lava_act | Called when lava affects the atom. By default, this melts and deletes the atom. |
melt | Handler for melting from heat or other sources. Called by terrain generation and some instances of fire_act() or
lava_act() . |
mod_health | Health modification for the health system. Applies health_mod directly to simple_health via addition and calls handle_death_change as needed.
Has no pre-modification checks, you should be using damage_health() or restore_health() instead of this.
skip_death_state_change will skip calling handle_death_change() when applicable. Used for when the originally calling proc needs handle it in a unique way.
Returns TRUE if the death state changes, FALSE otherwise. |
move_camera_by_click | Handles moving an AI's 'eye' to a location on click. |
object_shaken | Handler for atoms being moved, shaken, or otherwise interacted with in a manner that would affect atoms on top of if. |
onDropInto | Handler for items being dropped onto or into the atom. Called by dropInto() . |
on_broken | Proc called when the atom transitions from unbroken to broken. Only used if HEALTH_FLAG_BREAKABLE is set. |
on_color_transfer_reagent_change | Handler for color changes related to transferred reagents. For atoms whos color is based on the contents of
reagents . |
on_death | Proc called when the atom transitions from alive to dead. |
on_reagent_change | Called whenever the contents of the atom's reagents changes. |
on_revive | Proc called when the atom transitions from dead to alive. |
on_unbroken | Proc called when the atom transitions from broken to unbroken. Only used if HEALTH_FLAG_BREAKABLE is set. |
on_update_icon | Handler for updating the atom's icon and overlay states. Generally, all changes to overlays , underlays , icon ,
icon_state , item_state , etc should be contained in here. |
post_health_change | Proc called after any health changes made by the system |
post_use_item | Handler for operations to occur after running the chain of use_* procs. Always called. |
pre_use_item | Handler for operations to occur before running the chain of use_* procs. Always called. |
queue_icon_update | Adds the atom to the icon_update subsystem to be queued for icon updates. Use this if you're going to be pushing a lot of icon updates at once. |
rad_act | Called when radiation affects the atom. |
recursive_dir_set | Handler for setting an atom's dir when mimicking movements. Calls set_dir() . |
relaymove | Called when a mob with this atom as their machine, pulledby, loc, buckled, or other relevant var atom attempts to move. |
remove_air | Removes air from the atom. |
remove_damage_resistance | Removes the atom's resistance/weakness to the given damage type. |
restore_health | Restore's the atom's health by the given value. Returns TRUE if the restoration resulted in a death state change. |
return_air | Retrieves the atom's air contents. Used for subtypes that implement their own forms of air contents. |
return_air_for_internal_lifeform | Alternative to return_air() used for internal organ and lung checks. |
return_fluid | Retrieves the atom's fluid effect, if present. Generally, this only returns a value for turfs, and for said turfs, the fluid effect present in the turf's contents. |
reveal_blood | Called when the atom is affected by luminol. Reveals blood present on the atom, or blood decal atoms. |
revive_health | Returns health to full, resetting the death state as well. |
search_contents_for | Recursively searches all atom contents for a given path. |
set_color | Handler for setting the atom's color. |
set_damage_resistance | Sets the atom's resistance/weakness to the given damage type.
Value should be a multiplier that is applied against damage. Values below 1 are a resistance, above 1 are a weakness.
Value of 0 is considered immunity. |
set_density | Sets the atom's density, raises the density set event, and updates turfs for dense atom checks. |
set_dir | Sets the atom's direction and raises the dir set event. |
set_health | Sets health_current to the new value, clamped between 0 and health_max .
Has no pre-modification checks.
Returns TRUE if the death state changes, null if the atom is not using health, FALSE otherwise. |
set_icon_state | Sets the atom's icon state, also updating the base icon state extension if present. You should only use this proc if you intend to permanently alter the base state. |
set_invisibility | Invisibility Set Handling |
set_light | Sets the atom's light values and color. May call update_light() . |
set_max_health | Sets the atoms maximum health to the new value.
If set_current_health is TRUE , also sets the current health to the new value. |
shake_animation | Performs a shaking animation on the atom's sprite. |
singularity_act | Called when a singularity interacts with the atom. |
singularity_pull | Called when a singularity attempts to pull the atom toward it. |
singuloCanEat | Nar-Sie Act/Pull |
slam_into | Called when a mob walks into the atom while confused. |
storage_depth | Determines the storage depth of an atom. This is the number of storage items (/obj/item/storage ) the atom is
contained in before reaching container . |
storage_depth_turf | Determines the storage depth of an atom. This is the number of storage items (/obj/item/storage ) the atom is
contained in before reaching the turf. |
submerged | Whether or not the atom is considered submerged in fluid. |
transfer_fingerprints_to | Transfers this atom's fingerprints, fibres, DNA, etc to the target atom. |
turf_is_crowded | Whether or not dense atoms exist on the same turf. |
update_above | Updates whatever openspace components may be mimicing us. On turfs this queues an openturf update on the above
openturf, on movables this updates their bound movable (if present). Meaningless on any type other than /turf or
/atom/movable (incl. children). |
update_icon | Updates the atom's icon. You should call this to trigger icon updates, but should not override it. Override
on_update_icon() instead. |
update_light | Will update the light (duh). |
use_grab | Interaction handler for being clicked on with a grab. This is called regardless of user intent. |
use_tool | Interaction handler for using an item on this atom with a non-harm intent, or if use_weapon() did not resolve an
action. Generally, this is for any standard interactions with items. |
use_weapon | Interaction handler for using an item on this atom with harm intent. Generally, this is for attacking the atom. |
visible_message | Shows a message to all atoms in sight of this item. Use for objects performing visible actions. |
water_act | Called when fluids affect the atom. |
Var Details
atom_flags
Bitflag (Any of ATOM_FLAG_*
). General atom level flags. See code\__defines\flags.dm
.
atom_overlay_cache
This atom's cache of non-protected overlays, used for normal icon additions. Do not manipulate directly- See SSoverlays.
atom_protected_overlay_cache
This atom's cache of overlays that can only be removed explicitly, like C4. Do not manipulate directly- See SSoverlays.
blood_DNA
LAZYLIST of all DNA strings present on the atom from blood. Do not modify directly. See add_blood()
and clean_blood()
.
blood_color
Color. The color of the blood overlay effect, if present.
climb_speed_mult
Float. The multiplier applied to the do_after()
timer when a mob climbs the atom.
climbers
LAZYLIST of mobs currently climbing the atom.
damage_hitsound
Sound effect played when hit
do_unique_target_user
The mob currently interacting with the atom during a do_after
timer. Used to validate DO_TARGET_UNIQUE_ACT
flag checks.
explosion_resistance
Float. The atom's explosion resistance value. Used to calculate how much of an explosion is 'absorbed' and not passed on to tiles on the other side of the atom's turf. See /proc/explosion_rec()
.
fingerprints
LAZYLIST of fingerprints present on the atom. Index is the full print, value is either the full print or a starred version of the full print as a partial. Do not modify directly. See add_fingerprint()
, add_partial_print()
, and transfer_fingerprints_to()
.
fingerprintshidden
LAZYLIST of mobs that have touched/used the atom. Used for staff investigation. Each entry includes a timestamp and name of the mob that generated the fingerprint. Do not modify directly. See add_hiddenprint()
.
fingerprintslast
String. The last ckey to generate fingerprints on this atom. Used to reduce the number of duplicate fingerprintshidden
entries.
fluorescent
Integer (One of ATOM_FLOURESCENCE_*
). Whether or not the atom is visible under a UV light. If set to 2
, the atom is actively highlighted by a light. See code\__defines\misc.dm
.
germ_level
Integer. The atom's current germ level. The higher the germ level, the more germ on the atom.
gunshot_residue
LAZYLIST of gunshot residue present on the atom. Each entry contains the caliber of ammunition that generated the residue. Updated by /obj/item/ammo_casing/proc/put_residue_on()
.
health_current
Current health for health processing. Use get_current_health()
, damage_health()
, or restore_health()
for general health references.
health_flags
Bitflag (Any of HEALTH_FLAG_*
). Various health-related config flags for the atom. See code\__defines\health.dm
for details.
health_max
Maximum health for simple health processing. Use get_max_health()
or set_max_health()
to reference/modify.
health_min_damage
Minimum damage required to actually affect health in can_damage_health()
.
health_resistances
LAZY List of damage type resistance or weakness multipliers, decimal form. Only applied to health reduction. Use set_damage_resistance()
, remove_damage_resistance()
, and get_damage_resistance()
to reference/modify.
Index should be one of the DAMAGE_
flags.
Value should be a multiplier that is applied against damage. Values below 1 are a resistance, above 1 are a weakness.
Value of 0
is considered immunity.
health_status
Bitflag (Any of HEALTH_STATUS_*
). Various health-related status flags for the atom. See code\__defines\health.dm
for details.
init_flags
Bitflag (Any of INIT_*
). Flags for special/additional handling of the Initialize()
chain. See code\__defines\misc.dm
.
last_bumped
Integer. The world.time
the atom was last bumped into. Only used by some subtypes to prevent bump spamming.
level
Integer. The atom's layering level. Primarily used for determining whether the atom is visible or not on certain tile/flooring types/layers (I.e. plating and non-plating).
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.
light_offset_x
- These two vars let you override the default light offset detection (pixel_x/y).
- Useful for objects like light fixtures that aren't visually in the middle of the turf, but aren't offset either.
light_power
Intensity of the light.
light_range
Range in tiles of the light.
light_source_multi
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_source_solo
Same as above - this is a shortcut to avoid allocating the above list if we can
light_wedge
The angle that the light's emission should be restricted to. null for omnidirectional.
pass_flags
Bitflag (Any of PASS_FLAG_*
). Flags indicating the types of dense objects this atom is able to pass through/over.
plane
Integer (One of *_PLANE
). The atom's rendering plane. See code\__defines\__renderer.dm
for a list of valid planes. Also see the DM Reference for plane var (atom)
.
reagents
The reagents contained within the atom. Handles all reagent interactions and processing.
simulated
Boolean. Whether or not the atom is considered simulated. If FALSE
, blocks a majority of interactions, processes, etc.
suit_fibers
LAZYLIST of clothing fibers persent on the atom. Do not modify directly. See add_fibers()
and transfer_fingerprints_to()
.
temperature
Float. The atom's current temperature.
temperature_coefficient
Float. Multiplier used to determine how much temperature can change/transfer to this atom when a temperature change proc is called. See ProcessAtomTemperature()
and /obj/proc/HandleObjectHeating()
. Should be a value between MIN_TEMPERATURE_COEFFICIENT
and MAX_TEMPERATURE_COEFFICIENT
.
tf_offset_x
The atom's base transform scale for horizontal offset.
tf_offset_y
The atom's base transform scale for vertical offset.
tf_rotation
The atom's base transform scale for rotation.
tf_scale_x
The atom's base transform scale for width.
tf_scale_y
The atom's base transform scale for height.
throwpass
Boolean. Whether or not thrown objects can pass through/over the atom.
use_weapon_hitsound
Boolean. If set, uses the item's hit sound file instead of the source atom's when attacked.
was_bloodied
Boolean. Whether or not the atom was bloodied at any point. This remains TRUE even when is_bloodied
is set to FALSE, except in very specific circumstances. Used for luminol handling to detect cleaned blood.
Proc Details
AddLabel
Convenience shortcut for user labelling attempts. Overrides provide behavior.
AddOverlays
Adds specific overlay(s) to the atom. It is designed so any of the types allowed to be added to /atom/overlays can be added here too. More details below.
@param sources The overlay(s) to add. These may be - A string: In which case it is treated as an icon_state of the atom's icon. - An icon: It is treated as an icon. - An atom: Its own overlays are compiled and then it's appearance is added. (Meaning its current apperance is frozen). - An image: Image's apperance is added (i.e. subsequently editing the image will not edit the overlay) - A type path: Added to overlays as is. Does whatever it is BYOND does when you add paths to overlays. - Or a list containing any of the above. @param cache_target If ATOM_ICON_CACHE_PROTECTED, add to the protected cache instead of normal.
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
AltClick
Called when a mob alt+clicks the atom. By default, this creates and populates the Turf panel, displaying all objects on the atom's turf.
Parameters:
user
- The mob that clicked on the atom.
Returns boolean - Whether or not the action was handled.
AltShiftClick
Called when a mob alt+shift+clicks on the atom.
Parameters:
user
- The mob that clicked on the atom.
Returns boolean - Whether or not the interaction was handled.
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.
Bumped
Called when an object 'bumps' into the atom, typically by entering or attempting to enter the same tile.
Parameters:
AM
- The atom that bumped into src.
CanFluidPass
Whether or not fluids can pass through this atom.
Parameters:
coming_from
(Bitflag/direction) - The direction the fluid is attempting to pass from.
Returns boolean.
CanMouseDrop
Whether or not an atom can be dropped onto this atom. Called when a user click+drag's src
onto over
.
Parameters:
over
- The atom thatsrc
was dropped onto.user
- The mob click+draggingsrc
.incapacitation_flags
(Bitflag - Any ofINCAPACITATION_*
) - Additional incapacitation flags that should be checked. Used to verifyuser
can perform the action. Passed directly touser.incapacitated()
.
Returns boolean.
CanMoveOnto
Whether or not an atom can move through or onto the same tile as this atom. Primarily used for z-level transitioning in multi-z areas.
By default, passes directly to CanPass()
and also checks upward movement with climbable atoms.
Parameters:
mover
- The atom attempting to move ontotarget
.target
- The originally targeted turf thatsrc
may be blocking.height
(float) -direction
(bitflag/direction) - The direction of movement. This should only ever beDOWN
orUP
.
Returns boolean.
CanPass
Whether or not an atom can move through or onto the same tile as this atom.
Generally called by movement and airflow procs.
Parameters:
mover
- The atom attempting to move ontotarget
.target
- The originally targeted turf thatsrc
may be blocking.height
(float) -air_group
(boolean) - Intended use unknown - No references to this proc actually set this.
Returns boolean.
CheckExit
Used to check if this atom blocks another atom's movement to the target turf. Called on all atom's in mover
's current location.
Parameters:
mover
- The atom that's attempting to move.target
- The detination turfmover
is attempting to move to.
Returns boolean. If FALSE
, blocks movement and calls mover.Bump(src, TRUE)
.
ClearOverlays
Clears the atom's overlay cache(s) and queues an update if needed. Use CLEAR_TARGET_* flags.
ClearTransform
Clear the atom's tf_* variables and the current transform state.
CopyOverlays
Copy the overlays from another atom.
@param other The atom to copy overlays from. @param clear If TRUE, clear before adding other's overlays. @param cache_target A mask of ICON_CACHE_TARGET_* indicating what to copy.
CouldNotUseTopic
Called if the CanUseTopic()
call fails in Topic()
.
Parameters:
user
- The Topic chain's user.
CouldUseTopic
Called if the CanUseTopic()
call succeeds in Topic()
.
Parameters:
user
- The Topic chain's user.
CtrlAltClick
Called when a mob ctrl+alt+clicks on the atom.
Parameters:
user
- The mob that clicked on the atom.
Returns boolean - Whather or not the interaction was handled.
CtrlAltShiftClick
Called when a mob ctrl+alt+shift+clicks on the atom.
Parameters:
user
- The mob that clicked on the atom.
Returns boolean - Whether or not the interaction was handled.
CtrlClick
Called when a mob ctrl+clicks on the atom. By default, this starts pulling a movable atom if adjacent.
Parameters:
user
- The mob that clicked on the atom.
Returns boolean - Whether or not the action was handled.
CtrlShiftClick
Called when a mob ctrl+shift+clicks on the atom.
Parameters:
user
- The mob that clicked on the atom.
Returns boolean. Whether or not the interaction was handled.
CutCacheBehavior
Shared behavior for CutOverlays & CutUnderlays. Do not use directly. null: nothing changed, do nothing FALSE: update should be queued TRUE: update should be queued, cache should be nulled
CutOverlays
Removes specific overlay(s) from the atom's normal or protected overlay cache and queue an update.
@param overlays The overlays to removed. See AddOverlays for legal source types. @param cache_target A mask of ICON_CACHE_TARGET_*.
DefaultTopicState
The atom's default topic state. Used in various Topic related proc calls and defines to validate interactions.
Returns GLOB.default_state
by default, or a subtype of /datum/topic_state
.
Entered
Movement Handling
Exited
Exited Handling
GetAllContents
Retrieves the contents of this atom and all atoms contained within, recursively.
Parameters:
searchDepth
(int) - The depth to recursively retrieve contents for.
Returns a list of atoms.
HasProximity
Called when an atom moves into 'proximity' (Currently, range(1)
) of src. Only called on atoms that have the MOVABLE_FLAG_PROXMOVE
flag in movable_flags
.
Parameters:
AM
- The movable atom triggering the call.
ImmediateOverlayUpdate
Immediately runs an overlay update.
Initialize
Initialization handler for atoms. It is preferred to use this over New()
.
This is called after New()
if the map is being loaded (mapload
is TRUE
), or called from the base of New()
otherwise.
All overrides should call parent or set the ATOM_FLAG_INITIALIZED
flag and return a valid INITIALIZE_HINT_*
value. All overrides must not sleep.
Parameters:
mapload
- Whether or not the initialization was called while the map was being loaded.- All parameters except
loc
are passed directly fromNew()
.
Returns int (One of INITIALIZE_HINT_*
). Return hint indicates what should be done with the atom once the initialization process is finished. See code\__defines\__initialization.dm
.
InsertedContents
Returns a list of contents that can be inserted and/or removed. By default, this simply returns contents
.
IsCoil
True when this atom can be used as a cable coil.
IsCrowbar
True when this atom can be used as a crowbar.
IsFlameSource
True when this atom can be used as a flame source. This is for open flames.
IsHatchet
True when this atom can be used as a hatchet.
IsHeatSource
Returns an integer value of temperature when this atom can be used as a heat source. This is for hot objects.
Defaults to 1000
if IsFlameSource()
returns TRUE
, otherwise 0
.
IsMultitool
True when this atom can be used as a multitool.
IsScrewdriver
True when this atom can be used as a screwdriver.
IsWelder
True when this atom can be used as a Welder.
IsWirecutter
True when this atom can be used as a wirecutter.
IsWrench
True when this atom can be used as a wrench.
LateExamine
Works same as /atom/proc/Examine(), only this output comes immediately after any and all made by /atom/proc/Examine()
LateInitialize
Late initialization handler.
Called after the Initialize()
chain for any atoms that returned INITIALIZE_HINT_LATELOAD
.
Primarily used for atoms that rely on initialized values from other atoms.
Parameters:
mapload
- Whether or not the initialization was called while the map was being loaded.- All parameters except
loc
are passed directly fromNew()
.
Has no return value.
MayZoom
Whether or not the atom is permitted to 'zoom' - I.e., binocular or scope handlers.
Returns boolean.
OnTopic
Called when a user successfully interacts with a topic interaction window.
Parameters:
user
- The mob interacting with the atom.href_list
- An associative list of parameters passed by the topic call.state
- The topic chain's state.
Returns int (One of TOPIC_*
). The return value determines what happens to the topic UI window upon completion of the interaction. See code\__defines\topic.dm
.
ProcessAtomTemperature
Temperature subsystem process.
Returns void or PROCESS_KILL
.
QueueOverlayUpdate
Enqueues the atom for an overlay update if not already queued
RelayMouseDrag
Called by /mob/proc/OnMouseDrag()
when a mob within this atom's contents performs a mouse drag operation. Used to provide alternative handling to mouse dragging within certain atoms.
Parameters:
src_object
- The atom being dragged.over_object
- The atom under the mouse pointer.src_location
- The turf, stat panel, grid cell, etc from wheresrc_object
was dragged.over_location
- The turf, stat panel, grid cell, etc. containing the object under the mouse pointer.src_control
- The id of the skin control the object was dragged fromover_control
- The id of the skin control the object was dragged overparams
- Click and keyboard parameters.user
- The mob performing the mouse drag operation.
Returns boolean. TRUE if the mouse drag operation was intercepted, FALSE otherwise.
RemoveLabel
Removes a labeller label from the atom.
Parameters:
label
- The label to remove.
SetName
Name Set Handling
Sets the atom's name to the provided value, allowing for any additional processing required that name = new_value
alone cannot perform. It is preferred to use this over modifying the name
var directly.
This proc will also raise name_set_event
.
Parameters:
new_name
(string) - The new name to set.
SetOverlays
AddOverlays with ClearOverlays first. See AddOverlays for behavior.
SetTransform
Sets the atom's tf_* variables and the current transform state, also applying others if supplied.
ShiftClick
Called when a mob shift+clicks on the atom. By default, this calls the examine proc chain.
Parameters:
user
- The mob that clicked on the atom.
Returns boolean. Whether or not the interaction was handled.
SpinAnimation
Performs a spin/rotation animation on the atom's sprite.
Parameters:
speed
(int) - How quickly the atom should rotate.loops
(int) - How many times the spin animation should occur. Set to-1
for infinite looping.
UpdateOverlays
Builds the atom's overlay state from caches
add_blood
Adds blood effects and DNA to the atom.
Parameters:
M
- The mob the blood and DNA originated from.
Returns boolean - TRUE
if the atom was bloodied, FALSE
otherwise.
add_fibers
Adds forensics fibers to the atom from clothing worn by a mob.
Parameters:
M
- The mob to pull fibers from.
add_fingerprint
Adds fingerprints to an atom from a mob.
Parameters:
M
- The mob to add fingerprints from.ignoregloves
(boolean) - Whether or not the proc should ignore the presence of gloves on the mob.tool
- The tool in the mob's active hand. Used to check if the tool should prevent fingerprints.
Returns boolean. TRUE
if fingerprints were added, FALSE
otherwise.
add_hiddenprint
Adds fingerprint logs to the atom's hidden prints.
Parameters:
M
- The mob to add fingerprints from.
Returns boolean.
add_partial_print
Adds a partial print to the atom's fingerprints list.
Parameters:
full_print
(string) - The full fingerprint to be converted to a partial.bonus
(int) - Additional bonus to the chance of a more complete print.
additional_see_invisible
Retrieves see invisible values the atom may provide. Called on atoms contained in a mob's additional_vision_handlers
list. See /mob/proc/get_accumulated_vision_handlers()
.
Returns int.
additional_sight_flags
Retrieves additional sight flags the atom may provide. Called on atoms contained in a mob's additional_vision_handlers
list. See /mob/proc/get_accumulated_vision_handlers()
.
Returns bitflag (Any valid flag for sight
- See DM reference).
allow_click_through
Whether or not the atom should allow a mob to click things while inside it's contents.
Parameters:
A
- The atom being clicked on.params
(list) - The click parametersuser
- The mob performing the click action.
Returns boolean.
assume_air
Handler for receiving gas.
Parameters:
giver
- The gas mixture to receive gas from.
attack_ai
Called when an AI mob clicks on an atom.
Parameters:
user
- The mob clicking on the atom.
attack_animal
Called when a simple_animal
mob clicks on the atom with an 'empty hand.'
Parameters:
user
- The mob clicking on the atom.
attack_generic
Generic attack and damage proc, called on the attacked atom.
Parameters:
user
- The attacking mob.damage
(int) - The damage value.attack_verb
(string) - The verb/string used for attack messages.wallbreaker
(boolean) - Whether or not the attack is considered a 'wallbreaker' attack.damtype
(string, one ofDAMAGE_*
) - The attack's damage type.armorcheck
(string) - TODO: Unused. Remove.dam_flags
(bitfield, any ofDAMAGE_FLAG_*
) - Damage flags associated with the attack.
Returns boolean.
attack_ghost
Called when a ghost mob clicks on an atom.
Parameters:
user
- The mob clicking on the atom.
attack_robot
Called when a silicon robot mob clicks on an atom.
Parameters:
user
- The mob clicking on the atom.
audible_message
Shows a message to all mobs and objects within earshot of this atom. Use for objects performing audible actions.
Calls show_message()
on all valid mobs and objects in range.
Parameters:
message
(string) - The message output to anyone who can hear.deaf_message
(string) - The message output to anyone who is deaf.hearing_distance
(int) - The range of the message in tiles.checkghosts
(null or/datum/client_preference/ghost_sight
) - If set, will also display to any ghosts with global ears turned on.exclude_objs
- List of objects to not display the message to.exclude_mobs
- List of mobs to not display the message to.
auto_turn
Automatically sets the atom's direction based on nearby walls. Used for atoms that should appear 'attached' to walls.
bullet_act
Called when a projectile impacts the atom.
Parameters:
P
- The projectile impacting the atom.def_zone
(string) - The targeting zone the projectile is hitting.
Returns boolean. Whether or not the projectile should pass through the atom.
can_climb
Whether or not a mob can climb this atom.
If this check fails, it generally also sends a feedback message to user
.
Parameters:
user
- The mob attempting the climb check.post_climb_check
boolean defaultFALSE
- If set, skips checking theclimbers
list for if the mob is already attempting to climb.check_silicon
boolean defaultTRUE
- If set, blocks silicon mobs. Passed directly tocan_touch()
.
Returns boolean.
can_damage_health
Checks if the atom's health can be damaged.
Should be called before damage_health()
in most cases.
can_restore_health
Checks if the atom's health can be restored.
Should be called before restore_health()
in most cases.
NOTE: Does not include a check for death state by default, to allow repairing/healing atoms back to life.
can_touch
Checks if a mob can perform certain physical interactions with the atom. Primarily used for climbing and flipping tables.
If this check fails, it generally also sends a feedback mesage to user
.
Parameters:
user
- The mob attempting the interaction check.check_silicon
boolean defaultTRUE
- If set, blocks silicon mobs.
Returns boolean.
can_use_item
Whether or not an item interaction is possible. Checked before any use calls.
check_eye
Determines sight flags that should be added to user's sight var.
Returns bitflag or -1
to indicate the view should be cancelled.
check_fluid_depth
Determines whether the atom's current fluid depth meets the provided value or not. Generally used by turfs.
See /atom/proc/get_fluid_fepth()
.
Parameters:
min
(integer) - The minimum fluid depth value to meet or exceed.
Returns boolean.
checkpass
Whether or not the atom allows the given passflag to pass through it.
Parameters
passflag
bitfield (Any of PASS_FLAG_*
) - The passflag(s) to check.
Returns bitfield (Any of PASS_FLAG_*
). All matching bitflags provided in passflag
that the atom allows to pass through, or 0
if the atom does not allow them.
choose_from_pronouns
Retrieves the atom's pronouns. Generally this is just based on gender
but some factors may mask or change this.
Returns instance of /datum/pronouns
.
clean_blood
Removes all blood, DNA, residue, germs, etc from the atom.
Returns boolean. If TRUE
, blood DNA was present and removed.
climb_on
Verb to allow climbing onto an object. Passes directly to /atom/proc/do_climb(usr)
.
contains
Recursively checks if this atom contains another atom in its contents, or contents of its contents.
Parameters:
location
- The atom to check for in contents.
Returns boolean.
contents_nano_distance
Handles additional special checks for whether or not NanoUI interactions are valid. Some atoms such as vehicles might have special rules for how mobs inside them interact with NanoUI.
Parameters:
src_object
- The original object being interacted with.user
- The mob attempting the interaction.
Returns int (One of STATUS_*
).
create_reagents
Creates a reagent holder for the atom. This shouldn't be used if a reagents holder already exists, but it will partially function by increasing the existing holder's maximum volume instead of creating a new one. If the existing holder's maximum already exceeded the given value, however, this will not reduce the volume.
Parameters:
max_vol
integer - The maximum volume of the new reagents holder.
Returns instance of /datum/reagents
. The newly created reagents holder or, if the atom already had a holder, the
pre-existing holder.
damage_health
Damage's the atom's health by the given value. Returns TRUE
if the damage resulted in a death state change.
Resistance and weakness modifiers are applied here.
damage_type
should be one of theDAMAGE_*
damage types, ornull
. Defining a damage type is preferable over not.damage_flags
is a bitfield ofDAMAGE_FLAG_*
values.severity
should be a passthrough ofseverity
fromex_act()
andemp_act()
forDAMAGE_EXPLODE
andDAMAGE_EMP
types respectively.skip_can_damage_check
(boolean) - IfTRUE
skips checkingcan_damage_health()
. Intended for cases where this was already checked.
disrupts_psionics
Whether or not this atom or its contents will disrupt psionics. Top-level proc recursively checks all contents.
Returns instance of /atom/movable
or FALSE
. Either the atom that can disrupt psionics, or FALSE
if nothing will
disrupt.
do_climb
Handles climbing atoms for mobs. This proc includes a do_after()
timer.
Parameters:
user
- The mob attempting to climb the atom.check_silicon
boolean (defaultTRUE
) - Passed directly to/atom/proc/can_climb()
- If set, will block silicon mobs.
Returns boolean. Whether or not the mob successfully completed the climb action.
drain_power
Returns an amount of power drawn from the atom or -1
if it's not viable.
Parameters:
drain_check
Boolean - If set, does not actually drain power, only returns an amount.surge
Boolean - If set, this will damage the recipient and not return any power.amount
- The amount of power to attempt to drain.
Returns integer.
emag_act
Handler for the effects of being emagged by a cryptographic sequencer. Other situations may also call this for certain atoms, such as EMP'd or hacked machinery, or antagonist robots.
Parameters:
remaining_charges
- The number of emag charges left on the atom used to perform the emag.user
- The user performing the emag.emag_source
- The atom used to perform the emag.
Returns integer. The amount of emag charges to expend. If NO_EMAG_ACT
, then emag interactions are skipped and the
emag will be passed on to other interaction checks.
emp_act
Called when the atom is affected by an EMP.
Parameters:
severity
Integer. The strength of the EMP, ranging from 1 to 3. NOTE: Lower numbers are stronger.
ex_act
Called when an explosion affects the atom.
Parameters:
severity
Integer (One ofEX_ACT_*
) - The strength of the explosion affecting the atom. NOTE: Lower numbers are stronger.
examine_damage_state
Handles sending damage state to users on examine()
.
Overrideable to allow for different messages, or restricting when the messages can or cannot appear.
fire_act
Called when fire affects the atom.
Parameters:
air
- Air contents of the turf that's on fire and affecting this atom. It could be from the current atom's turf or an adjacent one.exposed_temperature
- The temperature of the fire affecting the atom. Usually, this isair.temperature
.exposed_volume
- The volume of the air for the fire affecting the atom. Usually, this isair.volume
.
fluid_update
Handler for fluid updates. Mirrors to the atom's turf.
get_alarm_area
Retrieves the atom's area for alarms.
TODO: Redundant. Replace with get_area()
.
Returns instance of /area
.
get_alarm_cameras
Retrieves a list of cameras from the atom's area.
TODO: Redundant. Replace with get_area()
and get_cameras()
.
Returns list (Instances of /obj/machinery/camera
). All cameras in the atom's area.
get_alarm_name
Retrieves the name to use for alarms. For mobs, this is the mob's name. For everything else, this is the arom's area's name.
Returns string.
get_alarm_origin
Retrieves the 'origin' point for any alarms the atom declares. For turfs, this will be the area. For any other atom, this is itself.
Returns instance of /atom
.
get_alarm_z
Assisting procs
Determines the alarm's z-level.
TODO: Possibly redundant. Check how areas respond to get_z()
and potentially just replace this call with that.
Returns integer.
get_antag_info
Handler for displaying information in the Antagonist section of the atom's codex entry.
Returns string.
get_antag_interactions_info
Handler for displaying information on tool interations in the Antagonist section of the atom's codex entry.
Returns associative list of strings. Best practice is to append information to existing entries with +=
, if present (This is null safe), i.e.:
. = ..()
.["Screwdriver"] += "<p>Toggles the maintenance panel open and closed.</p>"
get_cell
Retrieves the atom's power cell, if it has one.
Returns instance of /obj/item/cell
or null
.
get_codex_value
The codex entry name to use for this atom. By default, itself. Used for items that should direct to a codex entry other than itself, such as Fleet lore.
Returns instance of /atom
or string.
get_color
Returns the atom's current color or white if it has no color.
get_construction_info
Handler for displaying construction steps in the Mechanics section of the atom's codex entry. Separated to allow overriding without duplication of parent steps, or removal of parent mechanics information.
Returns list of strings.
get_container
Recursively searches containers for a given path, and returns the first match.
get_current_health
Retrieves the atom's current health, or null
if not using health
get_damage_percentage
Retrieves the atom's current damage as a percentage where 100%
is 100
.
get_damage_resistance
Fetches the atom's current resistance value for the given damage type.
get_damage_value
Retrieves the atom's current damage, or null
if not using health.
get_explosion_resistance
Retrieves the atom's explosion resistance. Generally, this is explosion_resistance
for simulated atoms.
get_fluid_depth
Determines the atom's current fluid depth. Currently only used by turfs.
Returns integer.
get_global_map_pos
Retrieves the atom's x and y coordinates from the global map.
TODO: Unused. Remove.
Returns list ("x" and "y" values as integers), null
if there is no global map, or 0
if the atom has no position
within the global map..
get_holsters
Retrieves all holsters contained within the atom, including itself. Generally, this is any atom that has the
/datum/extension/holster
extension.
Returns associative list (name = instance of /datum/extension/holster
)
get_interactions_info
Handler for displaying information on tool interations in the Mechanics section of the atom's codex entry.
Returns associative list of strings. Best practice is to append information to existing entries with +=
, if present (This is null safe), i.e.:
. = ..()
.["Screwdriver"] += "<p>Toggles the maintenance panel open and closed.</p>"
get_light_and_color
Sets the atom's color and light values to those of origin
.
TODO: Update this to use set_color()
and get_color()
.
Parameters:
origin
- The atom to copy light and color values from.
get_lore_info
Handler for displaying information in the Lore section of the atom's codex entry.
Returns string.
get_material_melting_point
Returns the material's melting point, or T100C
if there is no material. Overrideable for special cases, such as
atoms that allow material reinforcement or that by nature should have a higher or lower melting point.
get_max_health
Retrieves the atom's maximum health.
get_mechanics_info
Handler for displaying information in the Mechanics section of the atom's codex entry.
Returns string.
get_rads
Retrieves the atom's current radiation level. By default, this will return loc.get_rads()
.
Returns integer.
get_rig
Retrieves the rig the atom is located inside of, recursively checking parent locs until it find one.
Returns instead of /obj/item/rig
.
get_source_name
Retrieves an alarm's origin name. Generally this is the atom's name or, for cameras, c_tag
.
Returns string.
get_specific_codex_entry
Retrieves the atom's codex entry, generating a new one if not already cached.
Returns instance of /datum/codex_entry
or FALSE
if there's no codex data to generate.
health_broken
Whether or not the atom is currently broken. Does not consider death as broken, to minimize on recursive proc calls.
Returns boolean.
health_damaged
Whether or not the atom's health is damaged.
health_dead
Whether or not the atom is currently dead.
Returns boolean.
hitby
Called when the atom is hit by a thrown object.
Parameters:
AM
- The atom impactingsrc
.TT
- The thrownthing datum associated with the impact.
in_contents_of
Determines whether or not the atom is in the contents of the container or an instance of container if provided as a path.
TODO: Only used once, and the usage is redundant. Replace with istype(loc)
check.
Parameters:
container
instance or path of/atom
Returns boolean.
is_damage_immune
Determines whether or not the atom has full immunity to the given damage type.
is_open_container
Whether or not the atom is considered an open container for chemistry handling.
TODO: Redundant. Replace with flat bit check.
Returns int (ATOM_FLAG_OPEN_CONTAINER
or 0
).
isinspace
Whether or not the atom is in space.
TODO: Redundant.
Returns boolean.
kill_health
Immediately sets health to 0
then updates death_state
, bypassing all other checks and processes.
lava_act
Called when lava affects the atom. By default, this melts and deletes the atom.
Returns boolean. Whether or not the atom was destroyed.
melt
Handler for melting from heat or other sources. Called by terrain generation and some instances of fire_act()
or
lava_act()
.
mod_health
Health modification for the health system. Applies health_mod
directly to simple_health
via addition and calls handle_death_change
as needed.
Has no pre-modification checks, you should be using damage_health()
or restore_health()
instead of this.
skip_death_state_change
will skip calling handle_death_change()
when applicable. Used for when the originally calling proc needs handle it in a unique way.
Returns TRUE
if the death state changes, FALSE
otherwise.
move_camera_by_click
Handles moving an AI's 'eye' to a location on click.
object_shaken
Handler for atoms being moved, shaken, or otherwise interacted with in a manner that would affect atoms on top of if.
onDropInto
Handler for items being dropped onto or into the atom. Called by dropInto()
.
Parameters:
AM
- The atom being dragged and dropped.
Returns instance of /atom
or null
. The atom to forceMove()
AM
into. If null
, assumes src
.
on_broken
Proc called when the atom transitions from unbroken to broken. Only used if HEALTH_FLAG_BREAKABLE
is set.
on_color_transfer_reagent_change
Handler for color changes related to transferred reagents. For atoms whos color is based on the contents of
reagents
.
on_death
Proc called when the atom transitions from alive to dead.
on_reagent_change
Called whenever the contents of the atom's reagents
changes.
on_revive
Proc called when the atom transitions from dead to alive.
on_unbroken
Proc called when the atom transitions from broken to unbroken. Only used if HEALTH_FLAG_BREAKABLE
is set.
on_update_icon
Handler for updating the atom's icon and overlay states. Generally, all changes to overlays
, underlays
, icon
,
icon_state
, item_state
, etc should be contained in here.
Do not call this directly. Use update_icon()
or queue_icon_update()
instead.
post_health_change
Proc called after any health changes made by the system
post_use_item
Handler for operations to occur after running the chain of use_* procs. Always called.
By default, this adds fingerprints to the atom and tool.
Parameters:
tool
- The item being used.user
- The mob performing the interaction.interaction_handled
(boolean) - Whether or not the use call was handled.use_call
(string) - The use call proc that handled the interaction, or null.click_params
- List of click parameters.
Has no return value.
pre_use_item
Handler for operations to occur before running the chain of use_* procs. Always called.
By default, this does nothing.
Parameters:
tool
- The item being used.user
- The mob performing the interaction.click_params
- List of click parameters.
Has no return value.
queue_icon_update
Adds the atom to the icon_update subsystem to be queued for icon updates. Use this if you're going to be pushing a lot of icon updates at once.
rad_act
Called when radiation affects the atom.
Parameters:
severity
- The amount of radiation being applied. Also seeRAD_LEVEL_*
.
Returns boolean
recursive_dir_set
Handler for setting an atom's dir when mimicking movements. Calls set_dir()
.
Parameters:
a
- The atom triggering the event.old_dir
- The atom's priordir
.new_dir
- The newdir
to set.
relaymove
Called when a mob with this atom as their machine, pulledby, loc, buckled, or other relevant var atom attempts to move.
remove_air
Removes air from the atom.
Parameters:
amount
integer - The number of moles to remove.
Returns instance of /datum/gas_mixture
. The air that was removed from the atom.
remove_damage_resistance
Removes the atom's resistance/weakness to the given damage type.
restore_health
Restore's the atom's health by the given value. Returns TRUE
if the restoration resulted in a death state change.
return_air
Retrieves the atom's air contents. Used for subtypes that implement their own forms of air contents.
Returns instance of /datum/gas_mixture
.
return_air_for_internal_lifeform
Alternative to return_air()
used for internal organ and lung checks.
Returns instance of /datum/gas_mixture
.
return_fluid
Retrieves the atom's fluid effect, if present. Generally, this only returns a value for turfs, and for said turfs, the fluid effect present in the turf's contents.
Returns instance of /obj/fluid
.
reveal_blood
Called when the atom is affected by luminol. Reveals blood present on the atom, or blood decal atoms.
revive_health
Returns health to full, resetting the death state as well.
search_contents_for
Recursively searches all atom contents for a given path.
Parameters:
path
type path - The type path to search for.filter_path
list (type paths) - Any paths provided here will not be searched if found during the recursive search.
Returns list (Instances of /atom
). All found matches.
set_color
Handler for setting the atom's color.
set_damage_resistance
Sets the atom's resistance/weakness to the given damage type.
Value should be a multiplier that is applied against damage. Values below 1 are a resistance, above 1 are a weakness.
Value of 0
is considered immunity.
set_density
Sets the atom's density, raises the density set event, and updates turfs for dense atom checks.
Parameters:
new_density
boolean - The new density value to set.
set_dir
Sets the atom's direction and raises the dir set event.
Parameters:
- new_dir direction - The new direction to set.
Returns boolean. Whether or not the direction was changed.
set_health
Sets health_current
to the new value, clamped between 0
and health_max
.
Has no pre-modification checks.
Returns TRUE
if the death state changes, null
if the atom is not using health, FALSE
otherwise.
set_icon_state
Sets the atom's icon state, also updating the base icon state extension if present. You should only use this proc if you intend to permanently alter the base state.
Parameters:
new_icon_state
icon state.
set_invisibility
Invisibility Set Handling
Sets the atom's invisibility and raises the invisibility set event.
Parameters:
new_invisibility
integer (Default0
) - The new invisibility to set.
set_light
Sets the atom's light values and color. May call update_light()
.
Parameters:
l_range
integer - Range in tiles of the light (Must be aboveMINIMUM_USEFUL_LIGHT_RANGE
), light brightness will decay to 0 at this range. Applied tolight_range
. WARNING: Values over 32 are bound to cause lagl_power
float - The power (intensity) of the light. Generally should be 1 or lower but may be higher. Applied tolight_power
. Optionall_color
color (DefaultNONSENSICAL_VALUE
) - The color of the light. Applied tolight_color
. Optionalangle
integer (DefaultNONSENSICAL_VALUE
) - The angle of the cone that the light should shine at (directional lighting). Behavior of lights over 180 degrees is undefined. Best to stick to using the LIGHT_ defines for this. Optional.no_update
boolean (DefaultFALSE
) -if TRUE,update_light()
will not be called. Useful for when making several of these calls to the same object. Optional.
Returns null
set_max_health
Sets the atoms maximum health to the new value.
If set_current_health
is TRUE
, also sets the current health to the new value.
shake_animation
Performs a shaking animation on the atom's sprite.
Parameters:
intensity
integer - The intensity of the shaking.
singularity_act
Called when a singularity interacts with the atom.
singularity_pull
Called when a singularity attempts to pull the atom toward it.
singuloCanEat
Nar-Sie Act/Pull
Whether or not a singularity can consume the atom.
Returns boolean.
slam_into
Called when a mob walks into the atom while confused.
Parameters:
L
- The mob that walked into the atom.
storage_depth
Determines the storage depth of an atom. This is the number of storage items (/obj/item/storage
) the atom is
contained in before reaching container
.
Parameters:
container
- The top level container to stop at. If this is never encountered during the loop, the proc will return-1
.
Returns integer or -1
if the atom was not found in the container.
storage_depth_turf
Determines the storage depth of an atom. This is the number of storage items (/obj/item/storage
) the atom is
contained in before reaching the turf.
Returns integer or -1
if the atom was not found in a turf.
submerged
Whether or not the atom is considered submerged in fluid.
Parameters:
depth
integer - The depth level used for the check. If not set, fetches the turf'sget_fluid_depth()
.
Returns boolean.
transfer_fingerprints_to
Transfers this atom's fingerprints, fibres, DNA, etc to the target atom.
Parameters:
A
- The atom to transfer data to.
turf_is_crowded
Whether or not dense atoms exist on the same turf.
Parameters:
ignore
- If set, this atom will be ignored during checks.
Returns instance of /atom
(The atom with density found on the turf) or FALSE
(No dense atoms were found).
update_above
Updates whatever openspace components may be mimicing us. On turfs this queues an openturf update on the above
openturf, on movables this updates their bound movable (if present). Meaningless on any type other than /turf
or
/atom/movable
(incl. children).
update_icon
Updates the atom's icon. You should call this to trigger icon updates, but should not override it. Override
on_update_icon()
instead.
If you're expecting to be calling a lot of icon updates at once, use queue_icon_update()
instead.
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...
use_grab
Interaction handler for being clicked on with a grab. This is called regardless of user intent.
Parameters:
grab
- The grab item being used.click_params
- List of click parameters.
Returns boolean to indicate whether the attack call was handled or not. If FALSE
, the next use_*
proc in the
resolve chain will be called.
use_tool
Interaction handler for using an item on this atom with a non-harm intent, or if use_weapon()
did not resolve an
action. Generally, this is for any standard interactions with items.
Parameters:
tool
- The item being used on this atom.user
- The mob interacting with this atom.click_params
- List of click parameters.
Returns boolean to indicate whether the attack call was handled or not. If FALSE
, the next use_*
proc in the
resolve chain will be called.
use_weapon
Interaction handler for using an item on this atom with harm intent. Generally, this is for attacking the atom.
Parameters:
weapon
- The item being used on this atom.user
- The mob interacting with this atom.click_params
- List of click parameters.
Returns boolean to indicate whether the attack call was handled or not. If FALSE
, the next use_*
proc in the
resolve chain will be called.
visible_message
Shows a message to all atoms in sight of this item. Use for objects performing visible actions.
Parameters:
message
string - The message to display.blind_message
string - If set, this message is displayed to blind mobs in range.range
int (Defaultworld.view
) - The range, in tiles, the message should display.checkghosts
path (/datum/client_preference
) - If set, will also display for ghosts with the provided preference enabled. Typically,ghost_sight
.exclude_objs
LAZYLIST of instances of/obj
- If provided, objects in this list will not be displayed the message.exclude_mobs
LAZYLIST of instances of/mob
- Ig provided, mobs in this list will not be displayed the message.
water_act
Called when fluids affect the atom.
Parameters:
depth
integer - The depth of the fluid effect calling this proc.