atmospherics
Vars | |
can_unwrench | Check if the object can be unwrenched |
---|---|
cap_overlay | Cap overlay that is being added to turf's vis_contents , null if pipe was never hidden or has no valid connections |
construction_type | The path of the pipe/device that will spawn after unwrenching it (such as pipe fittings) |
device_type | The type of the device (UNARY, BINARY, TRINARY, QUATERNARY) |
has_cap_visuals | Whether it will generate cap sprites when hidden |
hide | This only works on pipes, because they have 1000 subtypes which need to be visible and invisible under tiles, so we track this here |
init_processing | If we should init and immediately start processing |
initialize_directions | Bitflag of the initialized directions (NORTH | SOUTH | EAST | WEST) |
nodes | The lists of nodes that a pipe/device has, depends on the device_type var (from 1 to 4) |
on | Check if the device should be on or off (mostly used in processing for machines) |
override_naming | keeps the name of the object from being overridden if it's vareditted. |
paintable | Whether it can be painted |
pipe_color | The color of the pipe |
pipe_flags | The flags of the pipe/component (PIPING_ALL_LAYER | PIPING_ONE_PER_TURF | PIPING_DEFAULT_LAYER_ONLY | PIPING_CARDINAL_AUTONORMALIZE) |
pipe_state | icon_state as a pipe item |
pipe_vision_img | The image of the pipe/device used for ventcrawling |
piping_layer | What layer the pipe is in (from 1 to 5, default 3) |
rebuilding | Is the thing being rebuilt by SSair or not. Prevents list bloat |
vent_movement | The bitflag that's being checked on ventcrawling. Default is to allow ventcrawling and seeing pipes. |
Procs | |
atmos_init | Initialize for atmos devices |
can_be_node | Check if a node can actually exists by connecting to another machine called on atmos_init() Arguments: |
can_see_pipes | Used for certain children of obj/machinery/atmospherics to not show pipe vision when mob is inside it. |
can_unwrench | Getter for can_unwrench |
connection_check | Check the connection between two nodes |
destroy_network | Called by the machinery disconnect(), custom for each type |
disconnect | Disconnects the nodes |
find_connecting | Find a connecting /obj/machinery/atmospherics in specified direction, called by relaymove() used by ventcrawling mobs to check if they can move inside a pipe in a specific direction Arguments: |
get_init_directions | Getter of initial directions |
get_node_connects | Getter for node_connects |
get_pipe_image | Getter for piping layer shifted, pipe colored overlays |
get_rebuild_targets | Returns a list of new pipelines that need to be built up |
is_connectable | check if the piping layer and color are the same on both sides (grey can connect to all colors) returns TRUE or FALSE if the connection is possible or not Arguments: |
normalize_cardinal_directions | Setter for device direction |
nullify_node | Called on destroy(mostly deconstruction) and when moving nodes around, disconnect the nodes from the network Arguments: |
on_deconstruction | Pipe deconstruction |
on_hide | Signal handler. Updates both our pipe cap visuals and those of adjacent nodes. We update adjacent nodes as their pipe caps are based partially on our state, so they need updating as well. |
paint | Called by the RPD.dm pre_attack() Arguments: |
pipeline_expansion | Called on construction and when expanding the datum_pipeline, returns the nodes of the device |
portable_device_connected | Return TRUE if there is device connected to portables_connector |
rebuild_pipes | This should only be called by SSair as part of the rebuild queue. Handles rebuilding pipelines after init or they've been changed. |
replace_pipenet | Replaces the connection to the old_pipenet with the new_pipenet |
return_pipenet | Called by add_member() in datum_pipeline.dm, returns the parent network the device is connected to |
return_pipenet_airs | Called by add_machinery_member() in datum_pipeline.dm, returns a list of gas_mixtures and assigns them into other_airs (by addMachineryMember) to allow pressure redistribution for the machineries. |
return_pipenets | Getter of a list of pipenets |
set_init_directions | Set the initial directions of the device (NORTH || SOUTH || EAST || WEST), called on New() |
set_pipe_color | Setter for pipe color, so we can ensure it's all uniform and save cpu time |
set_pipenet | Called by build_pipeline() and add_member() in datum_pipeline.dm, set the network the device is connected to, to the datum pipeline it has reference |
set_piping_layer | setter for pipe layers |
setup_hiding | Sets up our pipe hiding logic, consolidated in one place so subtypes may override it. This lets subtypes implement their own hiding logic without needing to worry about conflicts with the parent hiding logic. |
shuttleRotate | Machine rotate procs |
unsafe_pressure_release | Pipe pressure release calculations |
update_cap_visuals | Handles cap overlay addition and removal, won't do anything if has_cap_visuals is set to FALSE |
update_layer | Update the layer in which the pipe/device is in, that way pipes have consistent layer depending on piping_layer |
Var Details
can_unwrench
Check if the object can be unwrenched
cap_overlay
Cap overlay that is being added to turf's vis_contents
, null
if pipe was never hidden or has no valid connections
construction_type
The path of the pipe/device that will spawn after unwrenching it (such as pipe fittings)
device_type
The type of the device (UNARY, BINARY, TRINARY, QUATERNARY)
has_cap_visuals
Whether it will generate cap sprites when hidden
hide
This only works on pipes, because they have 1000 subtypes which need to be visible and invisible under tiles, so we track this here
init_processing
If we should init and immediately start processing
initialize_directions
Bitflag of the initialized directions (NORTH | SOUTH | EAST | WEST)
nodes
The lists of nodes that a pipe/device has, depends on the device_type var (from 1 to 4)
on
Check if the device should be on or off (mostly used in processing for machines)
override_naming
keeps the name of the object from being overridden if it's vareditted.
paintable
Whether it can be painted
pipe_color
The color of the pipe
pipe_flags
The flags of the pipe/component (PIPING_ALL_LAYER | PIPING_ONE_PER_TURF | PIPING_DEFAULT_LAYER_ONLY | PIPING_CARDINAL_AUTONORMALIZE)
pipe_state
icon_state as a pipe item
pipe_vision_img
The image of the pipe/device used for ventcrawling
piping_layer
What layer the pipe is in (from 1 to 5, default 3)
rebuilding
Is the thing being rebuilt by SSair or not. Prevents list bloat
vent_movement
The bitflag that's being checked on ventcrawling. Default is to allow ventcrawling and seeing pipes.
Proc Details
atmos_init
Initialize for atmos devices
initialize the nodes for each pipe/device, this is called just after the air controller sets up turfs Arguments:
- list/node_connects - a list of the nodes on the device that can make a connection to other machines
can_be_node
Check if a node can actually exists by connecting to another machine called on atmos_init() Arguments:
- obj/machinery/atmospherics/target - the machine we are connecting to
can_see_pipes
Used for certain children of obj/machinery/atmospherics to not show pipe vision when mob is inside it.
can_unwrench
Getter for can_unwrench
Called by wrench_act() to check if the device can be unwrenched, each device override this with custom code (like if on/operating can't unwrench) Arguments:
- mob/user - the mob doing the act
connection_check
Check the connection between two nodes
Check if our machine and the target machine are connectable by both calling isConnectable and by checking that the directions and piping_layer are compatible called by can_be_node() (for building a network) and find_connecting() (for ventcrawling) Arguments:
- obj/machinery/atmospherics/target - the machinery we want to connect to
- given_layer - the piping_layer we are checking
destroy_network
Called by the machinery disconnect(), custom for each type
disconnect
Disconnects the nodes
Called by nullify_node(), it disconnects two nodes by removing the reference id from the node itself that called this proc Arguments:
- obj/machinery/atmospherics/reference - the machinery we are removing from the node connection
find_connecting
Find a connecting /obj/machinery/atmospherics in specified direction, called by relaymove() used by ventcrawling mobs to check if they can move inside a pipe in a specific direction Arguments:
- direction - the direction we are checking against
- prompted_layer - the piping_layer we are inside
get_init_directions
Getter of initial directions
get_node_connects
Getter for node_connects
Return a list of the nodes that can connect to other machines, get called by atmos_init()
get_pipe_image
Getter for piping layer shifted, pipe colored overlays
Creates the image for the pipe underlay that all components use, called by get_pipe_underlay() in components_base.dm Arguments:
- iconfile - path of the iconstate we are using (ex: 'icons/obj/machines/atmospherics/thermomachine.dmi')
- iconstate - the image we are using inside the file
- direction - the direction of our device
- color - the color (in hex value, like #559900) that the pipe should have
- piping_layer - the piping_layer the device is in, used inside PIPING_LAYER_SHIFT
- trinary - if TRUE we also use PIPING_FORWARD_SHIFT on layer 1 and 5 for trinary devices (filters and mixers)
get_rebuild_targets
Returns a list of new pipelines that need to be built up
is_connectable
check if the piping layer and color are the same on both sides (grey can connect to all colors) returns TRUE or FALSE if the connection is possible or not Arguments:
- obj/machinery/atmospherics/target - the machinery we want to connect to
- given_layer - the piping_layer we are connecting to
normalize_cardinal_directions
Setter for device direction
Set the direction to either SOUTH or WEST if the pipe_flag is set to PIPING_CARDINAL_AUTONORMALIZE, called in New(), used mostly by layer manifolds
nullify_node
Called on destroy(mostly deconstruction) and when moving nodes around, disconnect the nodes from the network Arguments:
- i - is the current iteration of the node, based on the device_type (from 1 to 4)
on_deconstruction
Pipe deconstruction
Called by wrench_act(), create a pipe fitting and remove the pipe
on_hide
Signal handler. Updates both our pipe cap visuals and those of adjacent nodes. We update adjacent nodes as their pipe caps are based partially on our state, so they need updating as well.
paint
Called by the RPD.dm pre_attack() Arguments:
- paint_color - color that the pipe will be painted in (colors in hex like #4f4f4f)
pipeline_expansion
Called on construction and when expanding the datum_pipeline, returns the nodes of the device
portable_device_connected
Return TRUE if there is device connected to portables_connector
rebuild_pipes
This should only be called by SSair as part of the rebuild queue. Handles rebuilding pipelines after init or they've been changed.
replace_pipenet
Replaces the connection to the old_pipenet with the new_pipenet
return_pipenet
Called by add_member() in datum_pipeline.dm, returns the parent network the device is connected to
return_pipenet_airs
Called by add_machinery_member() in datum_pipeline.dm, returns a list of gas_mixtures and assigns them into other_airs (by addMachineryMember) to allow pressure redistribution for the machineries.
return_pipenets
Getter of a list of pipenets
called in relaymove() to create the image for vent crawling
set_init_directions
Set the initial directions of the device (NORTH || SOUTH || EAST || WEST), called on New()
set_pipe_color
Setter for pipe color, so we can ensure it's all uniform and save cpu time
set_pipenet
Called by build_pipeline() and add_member() in datum_pipeline.dm, set the network the device is connected to, to the datum pipeline it has reference
set_piping_layer
setter for pipe layers
Set the layer of the pipe that the device has to a new_layer Arguments:
- new_layer - the layer at which we want the piping_layer to be (1 to 5)
setup_hiding
Sets up our pipe hiding logic, consolidated in one place so subtypes may override it. This lets subtypes implement their own hiding logic without needing to worry about conflicts with the parent hiding logic.
shuttleRotate
Machine rotate procs
unsafe_pressure_release
Pipe pressure release calculations
Throws the user when they unwrench a pipe with a major difference between the internal and environmental pressure. Called by wrench_act() before deconstruct() Arguments:
- mob_user - the mob doing the act
- pressures - it can be passed on from wrench_act(), it's the pressure difference between the environment pressure and the pipe internal pressure
update_cap_visuals
Handles cap overlay addition and removal, won't do anything if has_cap_visuals
is set to FALSE
update_layer
Update the layer in which the pipe/device is in, that way pipes have consistent layer depending on piping_layer