area
Vars | |
air_doors_activated | Boolean. Whether or not the area's firedoors are activated (closed). Tied to area alarm processing. Do not modify directly; Use air_doors_close() or air_doors_open() instead. |
---|---|
air_scrub_info | List (string (id_tag) => /datum/signal/data ). List of radio signal data received from scrubbers in the area, indexed by the scrubber's id_tag . Do not modify directly; See ./receive_signal() and ./send_signal() . |
air_scrub_names | List (string (id_tag) => string ). List of 'long names' for scrubbers within the area. Also serves as a list of all scrubbers registered with the area. Set by ./register_env_machine() . |
air_vent_info | List (string (id_tag) => /datum/signal/data ). List of radio signal data received from vents in the area, indexed by the vent's id_tag . Do not modify directly; See ./receive_signal() and ./send_signal() . |
air_vent_names | List (string (id_tag) => string ). List of 'long names' for vents within the area. Also serves as a list of all vents registered with the area. Set by ./register_env_machine() . |
all_doors | LAZYLIST (/obj/machinery/door/firedoor ). Contains a list of all firedoors within and adjacent to this area. Updated during a firedoor's Initialize() and Destroy() calls. Do not modify directly. |
always_unpowered | Boolean. Whether or not the area is always considered to be unpowered, bypassing all other area checks if TRUE . |
ambience | List (file (sounds) ). List of sounds that can be played to mobs in the area as ambience. See ./play_ambience() . |
apc | Direct reference to the APC installed in the area, if it exists. Automatically updated during the APC's Initialize() and Destroy() calls. |
area_flags | Bitflag (Any of AREA_FLAG_* ). See code\__defines\misc.dm . |
atmosalm | Integer (0 , 1 , or 2 ). Whether or not the area has an active atmosphere alarm and the level of the atmosphere alarm. Do not modify directly; Use ./atmosalert() instead. |
base_turf | The base turf type of the area, which can be used to override the z-level's base_turf for floor deconstruction. |
base_turf_special_handling | Boolean. Some base_turfs might cause issues with changing turfs, this flags it as a special case. See /proc/get_base_turf_by_area() . |
eject | Boolean. Whether or not the area is in the 'Evacuation' alert state. Do not modify directly; Use ./readyalert() or ./readyreset() instead. |
fire | Boolean. Whether or not the area has an active fire alarm. Do not modify directly; Use ./fire_alert() and ./fire_reset() instead. |
forced_ambience | LAZYLIST (file (sounds) ). Additional ambience files. These are always played instead of only on probability, are set to loop, and are slightly louder than ambience sound files. See ./play_ambience() . |
global_uid | Integer. Global counter for uid values assigned to areas. Increments by one for each new area. |
has_gravity | Boolean. Whether or not the area has gravity. Do not set directly; Use ./gravitychange() instead. |
holomap_color | String (Color HEX code). Color of this area on the holomap. Can be one of HOLOMAP_AREACOLOR_* . |
lightswitch | Boolean. Whether or not the area's lightswitch is switched to 'On' or 'Off'. Used to synchronize lightswitch buttons. Do not modify directly; Use ./set_lightswitch() instead. |
oneoff_environ | Integer. Amount of power to drain from the ENVIRON channel on the next power tick. Do not modify directly; Use ./use_power_oneoff() instead. This is reset to 0 every power tick after processing power use. |
oneoff_equip | Integer. Amount of power to drain from the EQUIP channel on the next power tick. Do not modify directly; Use ./use_power_oneoff() instead. This is reset to 0 every power tick after processing power use. |
oneoff_light | Integer. Amount of power to drain from the LIGHT channel on the next power tick. Do not modify directly; Use ./use_power_oneoff() instead. This is reset to 0 every power tick after processing power use. |
party | Boolean. Whether or not the area is in 'party light' mode. Do not modify directly; Use ./partyalert() or ./partyreset() instead. |
planetary_surface | Boolean. Whether or not the area belongs to a planet. |
power_environ | Boolean. Whether or not the ENVIRON power channel is enabled for the area. Updated and used by APCs. |
power_equip | Boolean. Whether or not the EQUIP power channel is enabled for the area. Updated and used by APCs. |
power_light | Boolean. Whether or not the LIGHT power channel is enabled for the area. Updated and used by APCs. |
req_access | List (string (access_*) ). Access requirements for the area. Used for autosetting access on doors, etc. |
requires_power | Boolean. Whether or not the area requires power to be considered powered, bypassing all other checks if TRUE . This takes priority over always_unpowered . |
secure | Boolean. Whether or not the area is considered 'secure'. Unsecure areas will have doors between them use access diff; secure ones use union. |
sound_env | Integer (One of the environments defined in code\game\sound.dm ). Sound environment used for modification of sounds played to mobs in the area. |
turf_initializer | Type path (Types of /singleton/turf_initializer ). If set, uses the provided singleton to modify all turfs in the area during Initialize() . |
turfs_airless | Boolean (Default FALSE ) - If set, floor turfs in the area will be set to airless when they initialize. This is unset during LateInitialize() to avoid interfering with player-placed tiles. |
turret_controls | List (/obj/machinery/turretid ). A list of all turret control panels in the area. Turrets use this list to see if individual power/lethal settings are allowed. Updated during Initialize() and Destroy() calls on the controllers. |
uid | Integer. The area's unique ID number. set to the value of global_uid + 1 when the area is created. |
used_environ | Integer. Amount of constant use power drain from the ENVIRON power channel. Do not modify; Use ./power_use_change() instead. |
used_equip | Integer. Amount of constant use power drain from the EQUIP power channel. Do not modify; Use ./power_use_change() instead. |
used_light | Integer. Amount of constant use power drain from the LIGHT power channel. Do not modify; Use ./power_use_change() instead. |
vent_pumps | A lazy list of vent pumps currently in the area |
Procs | |
air_doors_close | Sets air_doors_activated and sets all firedoors in all_doors to the closed state. Does nothing if air_doors_activated is already set. |
air_doors_open | Clears air_doors_activated and sets all firedoors in all_doors to the open state. Does nothing if air_doors_activated is already cleared. |
atmosalert | Defines the area's atmosphere alert level. |
can_modify_area | Returns boolean. Whether or not the area can be modified by player actions. |
clear_usage | Sets all oneoff_* vars to 0 . Helper for APCs. Called every machinery process tick. |
copy_contents_to | Attempts to move the contents, including turfs, of one area to another area.
Positioning is based on the lower left corner of both areas.
Tiles that do not fit into the new area will not be copied.
Source atoms are not modified or deleted.
Turfs are created using ChangeTurf() .
dir , icon , and icon_state are copied. All other vars use the default value for the copied atom.
Primarily used for holodecks. |
fire_alert | Sets a fire alarm in the area, if one is not already active. |
fire_reset | Clears an active fire alarm from the area. |
get_cameras | Returns list (/obj/machinery/camera ). A list of all cameras in the area. |
get_dimensions | Returns List (axis => Integer). The width and height, in tiles, of the area, indexed by axis. Axis is "x" or "y" . |
gravitychange | Sets the area's has_gravity state. |
has_gravity | Returns boolean. Whether or not the area is considered to have gravity. |
has_turfs | Returns boolean. Whether or not there are any turfs (/turf ) in src. |
partyalert | Sets a party alarm in the area, if one is not already active. |
partyreset | Clears an active party alarm from the area. |
play_ambience | Handles playing ambient sounds to a given mob, including ship hum. |
power_change | Called whenever the area's power or power usage state should change. |
power_use_change | Updates the area's continuous power use (See the used_* vars) for the given channel.
This is used by machines to properly update the area of power use changes. |
powered | Returns boolean. Whether or not the area is considered to have power for the given power channel. See requires_power and always_unpowered for some area-level overrides. |
prison_break | Trigger for the prison break event. Causes lighting to overload and dooes to open. Has no effect if the area lacks an APC or the APC is turned off. |
readyalert | Sets an active evacuation alarm in the area, if one is not already active. |
readyreset | Clears an active evacuation alarm from the area. |
retally_power | Recomputes the continued power usage; can be used for testing or error recovery, but is not called under normal conditions. |
set_emergency_lighting | Calls set_emergency_lighting(enable) on all /obj/machinery/light in src. |
set_lightswitch | Sets the area's light switch state to on or off, in turn turning all lights in the area on or off. |
thunk | Causes the provided mob to 'slam' down to the floor if certain conditions are not met. Primarily used for gravity changes. |
usage | Returns Integer. The total amount of power usage queued for the area from both used_* and oneoff_* for the given power channel, or all channels if TOTAL is passed instead. |
use_power | Adds the given amount of power to the used_* var for the given power channel, effectively increasing continuous power usage. |
use_power_oneoff | Adds the given amount of power to the oneoff_* var for the given power channel. This results in a single spike in power usage that is reset on the next power tick.
Use this for a one-time power draw from the area, typically for non-machines. |
Var Details
air_doors_activated
Boolean. Whether or not the area's firedoors are activated (closed). Tied to area alarm processing. Do not modify directly; Use air_doors_close()
or air_doors_open()
instead.
air_scrub_info
List (string (id_tag)
=> /datum/signal/data
). List of radio signal data received from scrubbers in the area, indexed by the scrubber's id_tag
. Do not modify directly; See ./receive_signal()
and ./send_signal()
.
air_scrub_names
List (string (id_tag)
=> string
). List of 'long names' for scrubbers within the area. Also serves as a list of all scrubbers registered with the area. Set by ./register_env_machine()
.
air_vent_info
List (string (id_tag)
=> /datum/signal/data
). List of radio signal data received from vents in the area, indexed by the vent's id_tag
. Do not modify directly; See ./receive_signal()
and ./send_signal()
.
air_vent_names
List (string (id_tag)
=> string
). List of 'long names' for vents within the area. Also serves as a list of all vents registered with the area. Set by ./register_env_machine()
.
all_doors
LAZYLIST (/obj/machinery/door/firedoor
). Contains a list of all firedoors within and adjacent to this area. Updated during a firedoor's Initialize()
and Destroy()
calls. Do not modify directly.
always_unpowered
Boolean. Whether or not the area is always considered to be unpowered, bypassing all other area checks if TRUE
.
ambience
List (file (sounds)
). List of sounds that can be played to mobs in the area as ambience. See ./play_ambience()
.
apc
Direct reference to the APC installed in the area, if it exists. Automatically updated during the APC's Initialize()
and Destroy()
calls.
area_flags
Bitflag (Any of AREA_FLAG_*
). See code\__defines\misc.dm
.
atmosalm
Integer (0
, 1
, or 2
). Whether or not the area has an active atmosphere alarm and the level of the atmosphere alarm. Do not modify directly; Use ./atmosalert()
instead.
base_turf
The base turf type of the area, which can be used to override the z-level's base_turf
for floor deconstruction.
base_turf_special_handling
Boolean. Some base_turfs might cause issues with changing turfs, this flags it as a special case. See /proc/get_base_turf_by_area()
.
eject
Boolean. Whether or not the area is in the 'Evacuation' alert state. Do not modify directly; Use ./readyalert()
or ./readyreset()
instead.
fire
Boolean. Whether or not the area has an active fire alarm. Do not modify directly; Use ./fire_alert()
and ./fire_reset()
instead.
forced_ambience
LAZYLIST (file (sounds)
). Additional ambience files. These are always played instead of only on probability, are set to loop, and are slightly louder than ambience
sound files. See ./play_ambience()
.
global_uid
Integer. Global counter for uid
values assigned to areas. Increments by one for each new area.
has_gravity
Boolean. Whether or not the area has gravity. Do not set directly; Use ./gravitychange()
instead.
holomap_color
String (Color HEX code). Color of this area on the holomap. Can be one of HOLOMAP_AREACOLOR_*
.
lightswitch
Boolean. Whether or not the area's lightswitch is switched to 'On' or 'Off'. Used to synchronize lightswitch buttons. Do not modify directly; Use ./set_lightswitch()
instead.
oneoff_environ
Integer. Amount of power to drain from the ENVIRON
channel on the next power tick. Do not modify directly; Use ./use_power_oneoff()
instead. This is reset to 0
every power tick after processing power use.
oneoff_equip
Integer. Amount of power to drain from the EQUIP
channel on the next power tick. Do not modify directly; Use ./use_power_oneoff()
instead. This is reset to 0
every power tick after processing power use.
oneoff_light
Integer. Amount of power to drain from the LIGHT
channel on the next power tick. Do not modify directly; Use ./use_power_oneoff()
instead. This is reset to 0
every power tick after processing power use.
party
Boolean. Whether or not the area is in 'party light' mode. Do not modify directly; Use ./partyalert()
or ./partyreset()
instead.
planetary_surface
Boolean. Whether or not the area belongs to a planet.
power_environ
Boolean. Whether or not the ENVIRON
power channel is enabled for the area. Updated and used by APCs.
power_equip
Boolean. Whether or not the EQUIP
power channel is enabled for the area. Updated and used by APCs.
power_light
Boolean. Whether or not the LIGHT
power channel is enabled for the area. Updated and used by APCs.
req_access
List (string (access_*)
). Access requirements for the area. Used for autosetting access on doors, etc.
requires_power
Boolean. Whether or not the area requires power to be considered powered, bypassing all other checks if TRUE
. This takes priority over always_unpowered
.
secure
Boolean. Whether or not the area is considered 'secure'. Unsecure areas will have doors between them use access diff; secure ones use union.
sound_env
Integer (One of the environments defined in code\game\sound.dm
). Sound environment used for modification of sounds played to mobs in the area.
turf_initializer
Type path (Types of /singleton/turf_initializer
). If set, uses the provided singleton to modify all turfs in the area during Initialize()
.
turfs_airless
Boolean (Default FALSE
) - If set, floor turfs in the area will be set to airless when they initialize. This is unset during LateInitialize()
to avoid interfering with player-placed tiles.
turret_controls
List (/obj/machinery/turretid
). A list of all turret control panels in the area. Turrets use this list to see if individual power/lethal settings are allowed. Updated during Initialize()
and Destroy()
calls on the controllers.
uid
Integer. The area's unique ID number. set to the value of global_uid
+ 1 when the area is created.
used_environ
Integer. Amount of constant use power drain from the ENVIRON
power channel. Do not modify; Use ./power_use_change()
instead.
used_equip
Integer. Amount of constant use power drain from the EQUIP
power channel. Do not modify; Use ./power_use_change()
instead.
used_light
Integer. Amount of constant use power drain from the LIGHT
power channel. Do not modify; Use ./power_use_change()
instead.
vent_pumps
A lazy list of vent pumps currently in the area
Proc Details
air_doors_close
Sets air_doors_activated
and sets all firedoors in all_doors
to the closed state. Does nothing if air_doors_activated
is already set.
air_doors_open
Clears air_doors_activated
and sets all firedoors in all_doors
to the open state. Does nothing if air_doors_activated
is already cleared.
atmosalert
Defines the area's atmosphere alert level.
Parameters:
danger_level
Integer. The new alert danger level to set.alarm_source
Atom. The source that's triggering the alert change.
Returns boolean. TRUE
if the atmosphere alarm level was changed, FALSE
otherwise.
can_modify_area
Returns boolean. Whether or not the area can be modified by player actions.
clear_usage
Sets all oneoff_*
vars to 0
. Helper for APCs. Called every machinery process tick.
copy_contents_to
Attempts to move the contents, including turfs, of one area to another area.
Positioning is based on the lower left corner of both areas.
Tiles that do not fit into the new area will not be copied.
Source atoms are not modified or deleted.
Turfs are created using ChangeTurf()
.
dir
, icon
, and icon_state
are copied. All other vars use the default value for the copied atom.
Primarily used for holodecks.
Parameters:
target
/area
. The area to copy src's contents to.plating_required
Boolean, defaultFALSE
. If set, contents will only be copied to destination tiles that are not the same type asget_base_area_by_turf()
before callingChangeTurf()
.
Returns List (/atom
). A list containing all atoms that were created at the target area during the process.
fire_alert
Sets a fire alarm in the area, if one is not already active.
fire_reset
Clears an active fire alarm from the area.
get_cameras
Returns list (/obj/machinery/camera
). A list of all cameras in the area.
get_dimensions
Returns List (axis => Integer). The width and height, in tiles, of the area, indexed by axis. Axis is "x"
or "y"
.
gravitychange
Sets the area's has_gravity
state.
Parameters:
gravitystate
Boolean, defaultFALSE
. The new state to sethas_gravity
to.
has_gravity
Returns boolean. Whether or not the area is considered to have gravity.
has_turfs
Returns boolean. Whether or not there are any turfs (/turf
) in src.
partyalert
Sets a party alarm in the area, if one is not already active.
partyreset
Clears an active party alarm from the area.
play_ambience
Handles playing ambient sounds to a given mob, including ship hum.
power_change
Called whenever the area's power or power usage state should change.
power_use_change
Updates the area's continuous power use (See the used_*
vars) for the given channel.
This is used by machines to properly update the area of power use changes.
If calling this from a /obj/machine
, you should probably use REPORT_POWER_CONSUMPTION_CHANGE()
instead.
Parameters:
old_amount
Integer. The amount of power being used before the change.new_amount
Integer. The amount of power being used after the change.chan
Integer (ENVIRON
,EQUIP
, orLIGHT
). The channel to update.
powered
Returns boolean. Whether or not the area is considered to have power for the given power channel. See requires_power
and always_unpowered
for some area-level overrides.
prison_break
Trigger for the prison break event. Causes lighting to overload and dooes to open. Has no effect if the area lacks an APC or the APC is turned off.
readyalert
Sets an active evacuation alarm in the area, if one is not already active.
readyreset
Clears an active evacuation alarm from the area.
retally_power
Recomputes the continued power usage; can be used for testing or error recovery, but is not called under normal conditions.
set_emergency_lighting
Calls set_emergency_lighting(enable)
on all /obj/machinery/light
in src.
set_lightswitch
Sets the area's light switch state to on or off, in turn turning all lights in the area on or off.
thunk
Causes the provided mob to 'slam' down to the floor if certain conditions are not met. Primarily used for gravity changes.
usage
Returns Integer. The total amount of power usage queued for the area from both used_*
and oneoff_*
for the given power channel, or all channels if TOTAL
is passed instead.
use_power
Adds the given amount of power to the used_*
var for the given power channel, effectively increasing continuous power usage.
Generally, you probably do not want to use this directly. See power_use_change()
and use_power_oneoff()
instead.
Parameters:
amount
Integer. The amount of power to add to the given channel. Use negative numbers to subtract instead.chan
Integer (EQUIP
,LIGHT
, orENVIRON
). The power channel to add the power to.
use_power_oneoff
Adds the given amount of power to the oneoff_*
var for the given power channel. This results in a single spike in power usage that is reset on the next power tick.
Use this for a one-time power draw from the area, typically for non-machines.
Parameters:
amount
Integer. The amount of power to add to the given channel. Use negative numbers to subtract instead.chan
Integer (EQUIP
,LIGHT
, orENVIRON
). The power channel to add the power to.