diff --git a/aurorastation.dme b/aurorastation.dme
index 4f87ab91b90..4b1b44dedf5 100644
--- a/aurorastation.dme
+++ b/aurorastation.dme
@@ -164,6 +164,7 @@
#include "code\__DEFINES\dcs\flags.dm"
#include "code\__DEFINES\dcs\helpers.dm"
#include "code\__DEFINES\dcs\signals.dm"
+#include "code\__DEFINES\dcs\signals\signals_area.dm"
#include "code\__DEFINES\dcs\signals\signals_datum.dm"
#include "code\__DEFINES\dcs\signals\signals_global.dm"
#include "code\__DEFINES\dcs\signals\signals_lore_radio.dm"
diff --git a/code/__DEFINES/dcs/signals/signals_area.dm b/code/__DEFINES/dcs/signals/signals_area.dm
new file mode 100644
index 00000000000..1f4a0c464ab
--- /dev/null
+++ b/code/__DEFINES/dcs/signals/signals_area.dm
@@ -0,0 +1,14 @@
+// Area signals. Format:
+// When the signal is called: (signal arguments)
+// All signals send the source datum of the signal as the first argument
+
+///from base of area/proc/power_change(): ()
+#define COMSIG_AREA_POWER_CHANGE "area_power_change"
+///from base of area/Entered(): (atom/movable/arrived, area/old_area)
+#define COMSIG_AREA_ENTERED "area_entered"
+///from base of area/Exited(): (atom/movable/gone, direction)
+#define COMSIG_AREA_EXITED "area_exited"
+///from base of area/Entered(): (area/new_area). Sent to "area-sensitive" movables, see __DEFINES/traits.dm for info.
+#define COMSIG_ENTER_AREA "enter_area"
+///from base of area/Exited(): (area). Sent to "area-sensitive" movables, see __DEFINES/traits.dm for info.
+#define COMSIG_EXIT_AREA "exit_area"
diff --git a/code/__DEFINES/dcs/signals/signals_atom/signals_atom_movable.dm b/code/__DEFINES/dcs/signals/signals_atom/signals_atom_movable.dm
index 3cd2409a5ac..181cb65f4b6 100644
--- a/code/__DEFINES/dcs/signals/signals_atom/signals_atom_movable.dm
+++ b/code/__DEFINES/dcs/signals/signals_atom/signals_atom_movable.dm
@@ -38,3 +38,6 @@
/// from base of atom/movable/Process_Spacemove(): (movement_dir, continuous_move)
#define COMSIG_MOVABLE_SPACEMOVE "spacemove"
#define COMSIG_MOVABLE_STOP_SPACEMOVE (1<<0)
+
+/// From base of area/Exited(): (area/left, direction)
+#define COMSIG_MOVABLE_EXITED_AREA "movable_exited_area"
diff --git a/code/__DEFINES/machinery.dm b/code/__DEFINES/machinery.dm
index 50cdea364ca..d008489bd59 100644
--- a/code/__DEFINES/machinery.dm
+++ b/code/__DEFINES/machinery.dm
@@ -14,10 +14,10 @@
// Channel numbers for power.
#define POWER_CHAN -1 // Use default
-#define EQUIP 1
-#define LIGHT 2
-#define ENVIRON 3
-#define TOTAL 4 // For total power used only.
+#define AREA_USAGE_EQUIP 1
+#define AREA_USAGE_LIGHT 2
+#define AREA_USAGE_ENVIRON 3
+#define AREA_USAGE_TOTAL 4 // For total power used only.
#define POWER_USE_OFF 0
#define POWER_USE_IDLE 1
diff --git a/code/__HELPERS/turfs.dm b/code/__HELPERS/turfs.dm
index c1adc3bba16..6e9502b16a1 100644
--- a/code/__HELPERS/turfs.dm
+++ b/code/__HELPERS/turfs.dm
@@ -155,9 +155,9 @@
if(target)
if(base_area)
- ChangeArea(target, get_area(source))
+ target.change_area(target.loc, get_area(source))
. += transport_turf_contents(source, target, ignore_background)
- ChangeArea(source, base_area)
+ source.change_area(source.loc, base_area)
else
. += transport_turf_contents(source, target, ignore_background)
//change the old turfs
diff --git a/code/game/area/area_power.dm b/code/game/area/area_power.dm
index 1209178c759..beb26e7c951 100644
--- a/code/game/area/area_power.dm
+++ b/code/game/area/area_power.dm
@@ -1,7 +1,7 @@
/*
-#define EQUIP 1
-#define LIGHT 2
-#define ENVIRON 3
+#define AREA_USAGE_EQUIP 1
+#define AREA_USAGE_LIGHT 2
+#define AREA_USAGE_ENVIRON 3
*/
/area/proc/powered(var/chan) // return true if the area has power to given channel
@@ -11,17 +11,20 @@
if(always_unpowered)
return FALSE
switch(chan)
- if(EQUIP)
+ if(AREA_USAGE_EQUIP)
return power_equip
- if(LIGHT)
+ if(AREA_USAGE_LIGHT)
return power_light
- if(ENVIRON)
+ if(AREA_USAGE_ENVIRON)
return power_environ
return FALSE
// called when power status changes
/area/proc/power_change()
+ SEND_SIGNAL(src, COMSIG_AREA_POWER_CHANGE)
+
+ //One day, this will only use the signal, but that day is not today
for(var/obj/machinery/M in src) // for each machine in the area
M.power_change() // reverify power status (to update icons etc.)
if (fire || eject || party)
@@ -29,14 +32,14 @@
/area/proc/usage(var/chan)
switch(chan)
- if(LIGHT)
+ if(AREA_USAGE_LIGHT)
return used_light + oneoff_light
- if(EQUIP)
+ if(AREA_USAGE_EQUIP)
return used_equip + oneoff_equip
- if(ENVIRON)
+ if(AREA_USAGE_ENVIRON)
return used_environ + oneoff_environ
- if(TOTAL)
- return .(LIGHT) + .(EQUIP) + .(ENVIRON)
+ if(AREA_USAGE_TOTAL)
+ return .(AREA_USAGE_LIGHT) + .(AREA_USAGE_EQUIP) + .(AREA_USAGE_ENVIRON)
/area/proc/clear_usage()
oneoff_equip = 0
@@ -50,11 +53,11 @@
*/
/area/proc/use_power(var/amount, var/chan)
switch(chan)
- if(EQUIP)
+ if(AREA_USAGE_EQUIP)
used_equip += amount
- if(LIGHT)
+ if(AREA_USAGE_LIGHT)
used_light += amount
- if(ENVIRON)
+ if(AREA_USAGE_ENVIRON)
used_environ += amount
// Used by machines to update the area of power changes.
@@ -64,11 +67,11 @@
// Use this for one-time power draws from the area, usually for non-machines.
/area/proc/use_power_oneoff(var/amount, var/chan)
switch(chan)
- if(EQUIP)
+ if(AREA_USAGE_EQUIP)
oneoff_equip += amount
- if(LIGHT)
+ if(AREA_USAGE_LIGHT)
oneoff_light += amount
- if(ENVIRON)
+ if(AREA_USAGE_ENVIRON)
oneoff_environ += amount
// This recomputes continued power usage; used for testing or error recovery.
@@ -79,9 +82,9 @@
for(var/obj/machinery/M in src)
switch(M.power_channel)
- if(EQUIP)
+ if(AREA_USAGE_EQUIP)
used_equip += M.get_power_usage()
- if(LIGHT)
+ if(AREA_USAGE_LIGHT)
used_light += M.get_power_usage()
- if(ENVIRON)
+ if(AREA_USAGE_ENVIRON)
used_environ += M.get_power_usage()
diff --git a/code/game/area/areas.dm b/code/game/area/areas.dm
index caeb16ddd2b..fb7459e6379 100644
--- a/code/game/area/areas.dm
+++ b/code/game/area/areas.dm
@@ -15,7 +15,10 @@ var/global/list/area_blurb_stated_to = list()
///Bitflag (Any of `AREA_FLAG_*`). See `code\__DEFINES\misc.dm`.
var/area_flags
var/holomap_color // Color of this area on the holomap. Must be a hex color (as string) or null.
- var/fire = null
+
+ ///Do we have an active fire alarm?
+ var/fire = FALSE
+
var/atmosalm = 0
var/poweralm = 1
var/party = null
@@ -27,6 +30,7 @@ var/global/list/area_blurb_stated_to = list()
layer = AREA_LAYER
luminosity = 0
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
+ invisibility = INVISIBILITY_LIGHTING
var/obj/machinery/power/apc/apc = null
var/turf/base_turf // The base turf type of the area, which can be used to override the z-level's base turf.
@@ -317,11 +321,26 @@ var/global/list/area_blurb_stated_to = list()
#undef DO_PARTY
-var/list/mob/living/forced_ambiance_list = new
+/**
+ * Call back when an atom enters an area
+ *
+ * Sends signals COMSIG_AREA_ENTERED and COMSIG_ENTER_AREA (to a list of atoms)
+ *
+ * If the area has ambience, then it plays some ambience music to the ambience channel
+ */
+/area/Entered(atom/movable/arrived, area/old_area)
+ SEND_SIGNAL(src, COMSIG_AREA_ENTERED, arrived, old_area)
-/area/Entered(mob/living/L)
- if(!istype(L, /mob/living) || !ROUND_IS_STARTED)
+ if(!arrived.important_recursive_contents?[RECURSIVE_CONTENTS_AREA_SENSITIVE])
return
+ for(var/atom/movable/recipient as anything in arrived.important_recursive_contents[RECURSIVE_CONTENTS_AREA_SENSITIVE])
+ SEND_SIGNAL(recipient, COMSIG_ENTER_AREA, src)
+
+ /* START aurora snowflake code */
+ if(!istype(arrived, /mob/living) || !ROUND_IS_STARTED)
+ return
+
+ var/mob/living/L = arrived
if(!L.ckey) return
@@ -362,6 +381,21 @@ var/list/mob/living/forced_ambiance_list = new
stop_music(L)
do_area_blurb(L)
+ /* END aurora snowflake code */
+
+/**
+ * Called when an atom exits an area
+ *
+ * Sends signals COMSIG_AREA_EXITED and COMSIG_EXIT_AREA (to a list of atoms)
+ */
+/area/Exited(atom/movable/gone, direction)
+ SEND_SIGNAL(src, COMSIG_AREA_EXITED, gone, direction)
+ SEND_SIGNAL(gone, COMSIG_MOVABLE_EXITED_AREA, src, direction)
+ if(!gone.important_recursive_contents?[RECURSIVE_CONTENTS_AREA_SENSITIVE])
+ return
+ for(var/atom/movable/recipient as anything in gone.important_recursive_contents[RECURSIVE_CONTENTS_AREA_SENSITIVE])
+ SEND_SIGNAL(recipient, COMSIG_EXIT_AREA, src)
+
// Play Ambience
/area/proc/play_ambience(var/mob/living/L)
if((world.time >= L.client.ambience_last_played_time + 5 MINUTES) && prob(20))
@@ -484,32 +518,6 @@ var/list/mob/living/forced_ambiance_list = new
return pick(turfs)
else return null
-// Changes the area of T to A. Do not do this manually.
-// Area is expected to be a non-null instance.
-/proc/ChangeArea(var/turf/T, var/area/A)
- if(!istype(A))
- CRASH("Area change attempt failed: invalid area supplied.")
- var/old_outside = T.is_outside()
- var/area/old_area = get_area(T)
- if(old_area == A)
- return
- A.contents.Add(T)
- if(old_area)
- old_area.Exited(T, A)
- for(var/atom/movable/AM in T)
- old_area.Exited(AM, A)
- A.Entered(T, old_area)
- for(var/atom/movable/AM in T)
- A.Entered(AM, old_area)
-
- for(var/obj/machinery/M in T)
- M.shuttle_move(T)
-
- T.last_outside_check = OUTSIDE_UNCERTAIN
- var/outside_changed = T.is_outside() != old_outside
- if(T.is_outside == OUTSIDE_AREA && outside_changed)
- T.update_weather()
-
/**
* Displays an area blurb on a mob's screen.
*
diff --git a/code/game/atoms.dm b/code/game/atoms.dm
index 333d3d1e2bf..52c7375a185 100644
--- a/code/game/atoms.dm
+++ b/code/game/atoms.dm
@@ -549,12 +549,6 @@
if(src.z == H.z && get_dist(src, H) <= range)
H.intent_listen(src, message)
-/atom/proc/change_area(var/area/oldarea, var/area/newarea)
- change_area_name(oldarea.name, newarea.name)
-
-/atom/proc/change_area_name(var/oldname, var/newname)
- name = replacetext(name,oldname,newname)
-
/atom/movable/proc/dropInto(var/atom/destination)
while(istype(destination))
var/atom/drop_destination = destination.onDropInto(src)
diff --git a/code/game/machinery/abstract/intercom_listener.dm b/code/game/machinery/abstract/intercom_listener.dm
index 2c12e82a5f4..4316a16a03a 100644
--- a/code/game/machinery/abstract/intercom_listener.dm
+++ b/code/game/machinery/abstract/intercom_listener.dm
@@ -1,7 +1,7 @@
/obj/machinery/abstract/intercom_listener
name = "intercom power interface"
desc = DESC_PARENT
- power_channel = EQUIP
+ power_channel = AREA_USAGE_EQUIP
var/obj/item/device/radio/intercom/master
diff --git a/code/game/machinery/alarm.dm b/code/game/machinery/alarm.dm
index 91630b2c50a..bbc55313f24 100644
--- a/code/game/machinery/alarm.dm
+++ b/code/game/machinery/alarm.dm
@@ -105,7 +105,7 @@ pixel_x = 10;
anchored = 1
idle_power_usage = 90
active_power_usage = 1500 //For heating/cooling rooms. 1000 joules equates to about 1 degree every 2 seconds for a single tile of air.
- power_channel = ENVIRON
+ power_channel = AREA_USAGE_ENVIRON
req_one_access = list(ACCESS_ATMOSPHERICS, ACCESS_ENGINE_EQUIP)
clicksound = /singleton/sound_category/button_sound
clickvol = 30
@@ -472,7 +472,7 @@ pixel_x = 10;
var/energy_used = min( gas.get_thermal_energy_change(target_temperature) , active_power_usage * seconds_per_tick)
gas.add_thermal_energy(energy_used)
- //use_power(energy_used, ENVIRON) //handle by update_use_power instead
+ //use_power(energy_used, AREA_USAGE_ENVIRON) //handle by update_use_power instead
else //gas cooling
var/heat_transfer = min(abs(gas.get_thermal_energy_change(target_temperature)), active_power_usage * seconds_per_tick)
@@ -485,7 +485,7 @@ pixel_x = 10;
heat_transfer = -gas.add_thermal_energy(-heat_transfer) //get the actual heat transfer
- //use_power(heat_transfer / cop, ENVIRON) //handle by update_use_power instead
+ //use_power(heat_transfer / cop, AREA_USAGE_ENVIRON) //handle by update_use_power instead
environment.merge(gas)
diff --git a/code/game/machinery/atmoalter/meter.dm b/code/game/machinery/atmoalter/meter.dm
index a124bd30baa..3bce6b5354a 100644
--- a/code/game/machinery/atmoalter/meter.dm
+++ b/code/game/machinery/atmoalter/meter.dm
@@ -6,7 +6,7 @@
icon_state = "meter_base"
var/obj/machinery/atmospherics/pipe/target = null
anchored = 1.0
- power_channel = ENVIRON
+ power_channel = AREA_USAGE_ENVIRON
var/frequency = 0
var/id
idle_power_usage = 15
diff --git a/code/game/machinery/case_button.dm b/code/game/machinery/case_button.dm
index 291f73f32ce..804114e401a 100644
--- a/code/game/machinery/case_button.dm
+++ b/code/game/machinery/case_button.dm
@@ -7,7 +7,7 @@
anchored = 1
idle_power_usage = 50 //50W because the forcefield is disabled
active_power_usage = 2000 //2kW because of the forcefield
- power_channel = EQUIP
+ power_channel = AREA_USAGE_EQUIP
req_access = list(ACCESS_KEYCARD_AUTH) //Access required to unlock the cover
//Style variables
var/case = 1 //What case to use - c value
diff --git a/code/game/machinery/cell_charger.dm b/code/game/machinery/cell_charger.dm
index e72a0667aa9..950232ed03a 100644
--- a/code/game/machinery/cell_charger.dm
+++ b/code/game/machinery/cell_charger.dm
@@ -7,7 +7,7 @@
anchored = TRUE
idle_power_usage = 5
active_power_usage = 90 KILO WATTS
- power_channel = EQUIP
+ power_channel = AREA_USAGE_EQUIP
update_icon_on_init = TRUE
var/obj/item/cell/charging = null
diff --git a/code/game/machinery/crusher_piston.dm b/code/game/machinery/crusher_piston.dm
index b07c69b16c9..65481df4431 100644
--- a/code/game/machinery/crusher_piston.dm
+++ b/code/game/machinery/crusher_piston.dm
@@ -159,7 +159,7 @@
var/image_overlay
var/emissive_overlay
- if(powered(EQUIP))
+ if(powered(AREA_USAGE_EQUIP))
if(blocked == 1)
image_overlay = image(icon, "[asmtype]-overlay-red")
emissive_overlay = emissive_appearance(icon, "[asmtype]-overlay-red")
@@ -193,7 +193,7 @@
if(action == "idle")
action_start_time = world.time
initial = 1
- else if(action == "extend" && blocked == 0 && powered(EQUIP))
+ else if(action == "extend" && blocked == 0 && powered(AREA_USAGE_EQUIP))
//If we are idle, flash the warning lights and then put us into pre_start once we are done
if(status == "idle")
if(initial)
@@ -271,7 +271,7 @@
update_icon()
//Retract the pistons
- else if(action == "retract" && blocked == 0 && powered(EQUIP)) //Only retract if unblocked
+ else if(action == "retract" && blocked == 0 && powered(AREA_USAGE_EQUIP)) //Only retract if unblocked
update_icon()
num_progress = 0
diff --git a/code/game/machinery/deployable.dm b/code/game/machinery/deployable.dm
index 88899349052..0419fe5ec7d 100644
--- a/code/game/machinery/deployable.dm
+++ b/code/game/machinery/deployable.dm
@@ -356,7 +356,7 @@ Deployable Kits
/obj/item/deployable_kit/remote_mech/attack_self(mob/user)
var/area/A = get_area(user)
- if(!A.powered(EQUIP))
+ if(!A.powered(AREA_USAGE_EQUIP))
to_chat(user, SPAN_WARNING("\The [src] can not be deployed in an unpowered area."))
return FALSE
..()
diff --git a/code/game/machinery/door_control.dm b/code/game/machinery/door_control.dm
index 9b7d74681ab..db3fb21c47f 100644
--- a/code/game/machinery/door_control.dm
+++ b/code/game/machinery/door_control.dm
@@ -2,7 +2,7 @@
name = "remote object control"
desc = "It controls objects, remotely."
icon_state = "doorctrl0"
- power_channel = ENVIRON
+ power_channel = AREA_USAGE_ENVIRON
var/desiredstate = 0
var/exposedwires = 0
var/wires = 3
diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm
index fb30f0bb2b8..a02cfce2691 100644
--- a/code/game/machinery/doors/airlock.dm
+++ b/code/game/machinery/doors/airlock.dm
@@ -25,7 +25,7 @@
name = "airlock"
icon = 'icons/obj/doors/basic/single/generic/door.dmi'
icon_state = "preview"
- power_channel = ENVIRON
+ power_channel = AREA_USAGE_ENVIRON
explosion_resistance = 10
autoclose = TRUE
diff --git a/code/game/machinery/doors/airlock_control.dm b/code/game/machinery/doors/airlock_control.dm
index 9fffcb66a1a..0370cb780bc 100644
--- a/code/game/machinery/doors/airlock_control.dm
+++ b/code/game/machinery/doors/airlock_control.dm
@@ -131,7 +131,7 @@
icon_state = "airlock_sensor_off"
anchored = 1
- power_channel = ENVIRON
+ power_channel = AREA_USAGE_ENVIRON
obj_flags = OBJ_FLAG_MOVES_UNSUPPORTED
var/id_tag
@@ -212,7 +212,7 @@
obj_flags = OBJ_FLAG_MOVES_UNSUPPORTED
anchored = 1
- power_channel = ENVIRON
+ power_channel = AREA_USAGE_ENVIRON
var/master_tag
var/frequency = 1449
diff --git a/code/game/machinery/doors/firedoor.dm b/code/game/machinery/doors/firedoor.dm
index bba1b0b6a7e..dd07c19b214 100644
--- a/code/game/machinery/doors/firedoor.dm
+++ b/code/game/machinery/doors/firedoor.dm
@@ -35,7 +35,7 @@
var/hatch_open = 0
- power_channel = ENVIRON
+ power_channel = AREA_USAGE_ENVIRON
idle_power_usage = 5
dir = SOUTH
diff --git a/code/game/machinery/embedded_controller/embedded_controller_base.dm b/code/game/machinery/embedded_controller/embedded_controller_base.dm
index 8f13b07ddec..f6a7767cf86 100644
--- a/code/game/machinery/embedded_controller/embedded_controller_base.dm
+++ b/code/game/machinery/embedded_controller/embedded_controller_base.dm
@@ -57,7 +57,7 @@
/obj/machinery/embedded_controller/radio
icon = 'icons/obj/airlock_machines.dmi'
icon_state = "airlock_control_standby"
- power_channel = ENVIRON
+ power_channel = AREA_USAGE_ENVIRON
density = 0
var/id_tag
diff --git a/code/game/machinery/firealarm.dm b/code/game/machinery/firealarm.dm
index b30d3f0e486..c0f73b35c9c 100644
--- a/code/game/machinery/firealarm.dm
+++ b/code/game/machinery/firealarm.dm
@@ -12,7 +12,7 @@
anchored = 1
idle_power_usage = 2
active_power_usage = 6
- power_channel = ENVIRON
+ power_channel = AREA_USAGE_ENVIRON
var/last_process = 0
var/wiresexposed = 0
var/buildstage = 2 // 2 = complete, 1 = no wires, 0 = circuit gone
diff --git a/code/game/machinery/floor_light.dm b/code/game/machinery/floor_light.dm
index a68d9acc780..d57ff190d7a 100644
--- a/code/game/machinery/floor_light.dm
+++ b/code/game/machinery/floor_light.dm
@@ -10,7 +10,7 @@ var/list/floor_light_cache = list()
use_power = POWER_USE_ACTIVE
idle_power_usage = 2
active_power_usage = 20
- power_channel = LIGHT
+ power_channel = AREA_USAGE_LIGHT
matter = list(DEFAULT_WALL_MATERIAL = 2500, MATERIAL_GLASS = 2750)
recyclable = TRUE
diff --git a/code/game/machinery/jukebox.dm b/code/game/machinery/jukebox.dm
index 57d13fcfc7a..6a2ae28ff48 100644
--- a/code/game/machinery/jukebox.dm
+++ b/code/game/machinery/jukebox.dm
@@ -13,7 +13,7 @@
var/state_base = "jukebox"
anchored = 0
density = 1
- power_channel = EQUIP
+ power_channel = AREA_USAGE_EQUIP
idle_power_usage = 10
active_power_usage = 100
clicksound = 'sound/machines/buttonbeep.ogg'
diff --git a/code/game/machinery/lightswitch.dm b/code/game/machinery/lightswitch.dm
index 9cab5951858..24e4e25aad9 100644
--- a/code/game/machinery/lightswitch.dm
+++ b/code/game/machinery/lightswitch.dm
@@ -11,7 +11,7 @@
var/on = 1
var/area/area = null
var/otherarea = null
- power_channel = LIGHT
+ power_channel = AREA_USAGE_LIGHT
z_flags = ZMM_MANGLE_PLANES
// luminosity = 1
diff --git a/code/game/machinery/machinery.dm b/code/game/machinery/machinery.dm
index 3756ea81cac..4f750e97c80 100644
--- a/code/game/machinery/machinery.dm
+++ b/code/game/machinery/machinery.dm
@@ -21,9 +21,9 @@ Class Variables:
power_channel (num)
What channel to draw from when drawing power for power mode
Possible Values:
- EQUIP:0 -- Equipment Channel
- LIGHT:2 -- Lighting Channel
- ENVIRON:3 -- Environment Channel
+ AREA_USAGE_EQUIP:0 -- Equipment Channel
+ AREA_USAGE_LIGHT:2 -- Lighting Channel
+ AREA_USAGE_ENVIRON:3 -- Environment Channel
component_parts (list)
A list of component parts of machine used by frame based machines.
@@ -51,11 +51,11 @@ Class Procs:
Destroy() 'game/machinery/machine.dm'
- powered(chan = EQUIP) 'modules/power/power_usage.dm'
+ powered(chan = AREA_USAGE_EQUIP) 'modules/power/power_usage.dm'
Checks to see if area that contains the object has power available for power
channel given in 'chan'.
- use_power_oneoff(amount, chan=EQUIP, autocalled) 'modules/power/power_usage.dm'
+ use_power_oneoff(amount, chan=AREA_USAGE_EQUIP, autocalled) 'modules/power/power_usage.dm'
Deducts 'amount' from the power channel 'chan' of the area that contains the object.
This is not a continuous draw, but rather will be cleared after one APC update.
@@ -95,7 +95,7 @@ Class Procs:
var/idle_power_usage = 0
var/active_power_usage = 0
var/power_init_complete = FALSE
- var/power_channel = EQUIP //EQUIP, ENVIRON or LIGHT
+ var/power_channel = AREA_USAGE_EQUIP //AREA_USAGE_EQUIP, AREA_USAGE_ENVIRON or AREA_USAGE_LIGHT
/* List of types that should be spawned as component_parts for this machine.
Structure:
type -> num_objects
diff --git a/code/game/machinery/portable_turret.dm b/code/game/machinery/portable_turret.dm
index 9a307b372bb..0db0ea759fe 100644
--- a/code/game/machinery/portable_turret.dm
+++ b/code/game/machinery/portable_turret.dm
@@ -17,7 +17,7 @@
density = 0
idle_power_usage = 50 //when inactive, this turret takes up constant 50 Equipment power
active_power_usage = 300 //when active, this turret takes up constant 300 Equipment power
- power_channel = EQUIP //drains power from the EQUIPMENT channel
+ power_channel = AREA_USAGE_EQUIP //drains power from the EQUIPMENT channel
req_one_access = list(ACCESS_SECURITY, ACCESS_HEADS)
diff --git a/code/game/objects/items/devices/lightreplacer.dm b/code/game/objects/items/devices/lightreplacer.dm
index f265ed4f789..82c10780ed6 100644
--- a/code/game/objects/items/devices/lightreplacer.dm
+++ b/code/game/objects/items/devices/lightreplacer.dm
@@ -95,7 +95,7 @@
if(istype(attacking_item, /obj/item/light))
var/obj/item/light/L = attacking_item
- if(L.status == 0) // LIGHT OKAY
+ if(L.status == 0) // AREA_USAGE_LIGHT OKAY
if(uses < max_uses)
AddUses(1)
to_chat(user, SPAN_NOTICE("You insert \the [L] into \the [src]. You have [uses] light\s remaining."))
diff --git a/code/game/objects/structures/vr/_remote_chair.dm b/code/game/objects/structures/vr/_remote_chair.dm
index 99a4da0d9ca..9351c4c6dd0 100644
--- a/code/game/objects/structures/vr/_remote_chair.dm
+++ b/code/game/objects/structures/vr/_remote_chair.dm
@@ -39,7 +39,7 @@
/obj/structure/bed/stool/chair/remote/user_buckle(mob/user)
..()
var/area/A = get_area(src)
- if(!A.powered(EQUIP))
+ if(!A.powered(AREA_USAGE_EQUIP))
to_chat(user, SPAN_WARNING("\The [src] is not powered."))
return FALSE
if(ishuman(user))
@@ -55,7 +55,7 @@
..()
if(buckled)
var/area/A = get_area(src)
- if(!A.powered(EQUIP))
+ if(!A.powered(AREA_USAGE_EQUIP))
user_unbuckle(buckled)
// Return to our body in the unfortunate event that we get unbuckled while plugged in
diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm
index 7f6310c55c3..e6661b99250 100644
--- a/code/game/turfs/turf.dm
+++ b/code/game/turfs/turf.dm
@@ -197,6 +197,44 @@
return TRUE
return TRUE
+/// Call to move a turf from its current area to a new one
+/turf/proc/change_area(area/old_area, area/new_area)
+ //don't waste our time
+ if(old_area == new_area)
+ return
+
+ //move the turf
+
+ new_area.contents += src
+
+ /* START AURORA SNOWFLAKE */
+ var/old_outside = is_outside()
+
+ var/is_old_area_valid = !QDELETED(old_area) && istype(old_area)
+ var/is_new_area_valid = !QDELETED(new_area) && istype(new_area)
+
+ for(var/atom/movable/AM in src)
+ if(is_old_area_valid)
+ old_area.Exited(AM)
+
+ if(is_new_area_valid)
+ new_area.Entered(AM)
+ if(istype(AM, /obj/machinery))
+ var/obj/machinery/M = AM
+ M.shuttle_move(src)
+
+ last_outside_check = OUTSIDE_UNCERTAIN
+ if(is_outside == OUTSIDE_AREA && (is_outside() != old_outside))
+ update_weather()
+ /* END AURORA SNOWFLAKE */
+
+ //changes to make after turf has moved
+ on_change_area(old_area, new_area)
+
+/// Allows for reactions to an area change without inherently requiring change_area() be called (I hate maploading)
+/turf/proc/on_change_area(area/old_area, area/new_area)
+ transfer_area_lighting(old_area, new_area)
+
/turf/proc/handle_hand_interception(var/mob/user)
var/datum/component/turf_hand/THE
for (var/atom/A in src)
diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm
index 0adb05a3834..acabc41d838 100644
--- a/code/modules/admin/verbs/debug.dm
+++ b/code/modules/admin/verbs/debug.dm
@@ -268,7 +268,7 @@
for(var/areatype in areas_without_light)
to_world("* [areatype]")
- to_world("AREAS WITHOUT A LIGHT SWITCH:")
+ to_world("AREAS WITHOUT A AREA_USAGE_LIGHT SWITCH:")
for(var/areatype in areas_without_LS)
to_world("* [areatype]")
diff --git a/code/modules/atmospherics/atmospherics.dm b/code/modules/atmospherics/atmospherics.dm
index b2e6b460528..772e0595013 100644
--- a/code/modules/atmospherics/atmospherics.dm
+++ b/code/modules/atmospherics/atmospherics.dm
@@ -13,7 +13,7 @@ Pipelines + Other Objects -> Pipe network
anchored = 1
idle_power_usage = 0
active_power_usage = 0
- power_channel = ENVIRON
+ power_channel = AREA_USAGE_ENVIRON
var/nodealert = 0
var/power_rating //the maximum amount of power the machine can use to do work, affects how powerful the machine is, in Watts
diff --git a/code/modules/atmospherics/components/unary/vent_pump.dm b/code/modules/atmospherics/components/unary/vent_pump.dm
index cdd957f0cec..748ee003b29 100644
--- a/code/modules/atmospherics/components/unary/vent_pump.dm
+++ b/code/modules/atmospherics/components/unary/vent_pump.dm
@@ -129,7 +129,7 @@
/obj/machinery/atmospherics/unary/vent_pump/high_volume
name = "Large Air Vent"
- power_channel = EQUIP
+ power_channel = AREA_USAGE_EQUIP
power_rating = 45000 //45 kW ~ 60 HP
/obj/machinery/atmospherics/unary/vent_pump/high_volume/Initialize()
@@ -143,7 +143,7 @@
/obj/machinery/atmospherics/unary/vent_pump/engine
name = "Reactor Core Vent"
- power_channel = ENVIRON
+ power_channel = AREA_USAGE_ENVIRON
power_rating = 30000 //30 kW ~ 40 HP
/obj/machinery/atmospherics/unary/vent_pump/engine/Initialize()
diff --git a/code/modules/integrated_electronics/passive/power.dm b/code/modules/integrated_electronics/passive/power.dm
index d47bb37c6ee..6ab46e41f1c 100644
--- a/code/modules/integrated_electronics/passive/power.dm
+++ b/code/modules/integrated_electronics/passive/power.dm
@@ -59,8 +59,8 @@
return
var/area/A = get_area(src)
if(A)
- if(A.powered(EQUIP) && assembly.give_power(power_amount))
- A.use_power_oneoff(power_amount, EQUIP)
+ if(A.powered(AREA_USAGE_EQUIP) && assembly.give_power(power_amount))
+ A.use_power_oneoff(power_amount, AREA_USAGE_EQUIP)
// give_power() handles CELLRATE on its own.
// For implants.
diff --git a/code/modules/lighting/lighting_turf.dm b/code/modules/lighting/lighting_turf.dm
index 8f6697ec749..ea6c460b230 100644
--- a/code/modules/lighting/lighting_turf.dm
+++ b/code/modules/lighting/lighting_turf.dm
@@ -145,7 +145,7 @@
recalc_atom_opacity() // Make sure to do this before reconsider_lights(), incase we're on instant updates.
reconsider_lights()
-/turf/change_area(area/old_area, area/new_area)
+/turf/proc/transfer_area_lighting(area/old_area, area/new_area)
if (new_area.dynamic_lighting != old_area.dynamic_lighting)
if (new_area.dynamic_lighting)
lighting_build_overlay()
diff --git a/code/modules/mob/abstract/freelook/blueprints/blueprints.dm b/code/modules/mob/abstract/freelook/blueprints/blueprints.dm
index 2e665ae5133..f64dd8b732d 100644
--- a/code/modules/mob/abstract/freelook/blueprints/blueprints.dm
+++ b/code/modules/mob/abstract/freelook/blueprints/blueprints.dm
@@ -67,7 +67,7 @@
var/area/A = finalize_area(area_name)
for(var/turf/T in selected_turfs)
- ChangeArea(T, A)
+ T.change_area(T.loc, A)
remove_selection() // Reset the selection for clarity.
/mob/abstract/eye/blueprints/proc/finalize_area(var/area_name)
@@ -99,7 +99,7 @@
if(SSodyssey.scenario && (GET_Z(owner) in SSodyssey.scenario_zlevels))
background_area = SSodyssey.scenario.base_area
for(var/turf/T in A.contents)
- ChangeArea(T, background_area)
+ T.change_area(T.loc, background_area)
if(!locate(/turf) in A)
qdel(A)
@@ -319,7 +319,7 @@
if(SSodyssey.scenario && (GET_Z(owner) in SSodyssey.scenario_zlevels))
background_area = SSodyssey.scenario.base_area
for(var/turf/T in A.contents)
- ChangeArea(T, background_area)
+ T.change_area(T.loc, background_area)
if(!(locate(/turf) in A))
qdel(A) // uh oh, is this safe?
diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm
index 2f06494b7bc..45802773865 100644
--- a/code/modules/mob/living/silicon/ai/ai.dm
+++ b/code/modules/mob/living/silicon/ai/ai.dm
@@ -318,7 +318,7 @@ var/list/ai_verbs_default = list(
name = "power supply"
active_power_usage = 50000 // Station AIs use significant amounts of power. This, when combined with charged SMES should mean AI lasts for 1hr without external power.
use_power = POWER_USE_ACTIVE
- power_channel = EQUIP
+ power_channel = AREA_USAGE_EQUIP
var/mob/living/silicon/ai/powered_ai
invisibility = 100
diff --git a/code/modules/modular_computers/computers/modular_computer/power.dm b/code/modules/modular_computers/computers/modular_computer/power.dm
index fb25e226004..f1bb90864d8 100644
--- a/code/modules/modular_computers/computers/modular_computer/power.dm
+++ b/code/modules/modular_computers/computers/modular_computer/power.dm
@@ -32,7 +32,7 @@
return FALSE
var/area/A = get_area(src)
- if(!istype(A) || !A.powered(EQUIP))
+ if(!istype(A) || !A.powered(AREA_USAGE_EQUIP))
return FALSE
// At this point, we know that APC can power us for this tick. Check if we also need to charge our battery, and then actually use the power.
@@ -44,7 +44,7 @@
power_usage += power_to_get
battery_module.battery.give(power_to_get * CELLRATE)
- A.use_power_oneoff(power_usage, EQUIP)
+ A.use_power_oneoff(power_usage, AREA_USAGE_EQUIP)
return TRUE
diff --git a/code/modules/overmap/exoplanets/decor/_turfs.dm b/code/modules/overmap/exoplanets/decor/_turfs.dm
index 83316d08d45..01ba4aa6526 100644
--- a/code/modules/overmap/exoplanets/decor/_turfs.dm
+++ b/code/modules/overmap/exoplanets/decor/_turfs.dm
@@ -31,7 +31,7 @@
//Must be done here, as light data is not fully carried over by ChangeTurf (but overlays are).
set_light(MINIMUM_USEFUL_LIGHT_RANGE, exoplanet.lightlevel, exoplanet.lightcolor)
if(exoplanet.planetary_area && istype(loc, world.area))
- ChangeArea(src, exoplanet.planetary_area)
+ change_area(loc, exoplanet.planetary_area)
// if away site
else if(istype(template, /datum/map_template/ruin/away_site))
var/datum/map_template/ruin/away_site/away_site = template
@@ -175,7 +175,7 @@
if(!istype(E))
return
if(E.planetary_area && istype(loc, world.area))
- ChangeArea(src, E.planetary_area)
+ change_area(loc, E.planetary_area)
var/new_x = bumped_atom.x
var/new_y = bumped_atom.y
if(x <= TRANSITIONEDGE)
diff --git a/code/modules/overmap/exoplanets/themes/_theme.dm b/code/modules/overmap/exoplanets/themes/_theme.dm
index 6adef7940f3..e91f2166949 100644
--- a/code/modules/overmap/exoplanets/themes/_theme.dm
+++ b/code/modules/overmap/exoplanets/themes/_theme.dm
@@ -331,7 +331,7 @@
/datum/exoplanet_theme/proc/on_turf_generation(turf/T, area/use_area)
if(use_area && istype(T.loc, world.area))
- ChangeArea(T, use_area) // Switch our generated turfs from world.area (space) to our chosen exoplanet area
+ T.change_area(T.loc, use_area) // Switch our generated turfs from world.area (space) to our chosen exoplanet area
if(surface_color && is_type_in_list(T, surface_turfs))
T.color = surface_color
diff --git a/code/modules/overmap/sectors.dm b/code/modules/overmap/sectors.dm
index 90d6d5f38f3..b3f6ddadf44 100644
--- a/code/modules/overmap/sectors.dm
+++ b/code/modules/overmap/sectors.dm
@@ -300,7 +300,7 @@ var/global/area/overmap/map_overmap
T = T.ChangeTurf(/turf/unsimulated/map/edge)
else
T = T.ChangeTurf(/turf/unsimulated/map)
- ChangeArea(T, A)
+ T.change_area(T.loc, A)
SSatlas.current_map.sealed_levels |= SSatlas.current_map.overmap_z
diff --git a/code/modules/overmap/ships/engines/gas_thruster.dm b/code/modules/overmap/ships/engines/gas_thruster.dm
index 139eede6429..ffa3a419b7f 100644
--- a/code/modules/overmap/ships/engines/gas_thruster.dm
+++ b/code/modules/overmap/ships/engines/gas_thruster.dm
@@ -63,7 +63,7 @@
connect_types = CONNECT_TYPE_REGULAR|CONNECT_TYPE_FUEL
use_power = POWER_USE_OFF
- power_channel = EQUIP
+ power_channel = AREA_USAGE_EQUIP
idle_power_usage = 21600 //6 Wh per tick for default 2 capacitor. Gives them a reason to turn it off, really to nerf backup battery
component_types = list(
diff --git a/code/modules/overmap/ships/engines/ion_thruster.dm b/code/modules/overmap/ships/engines/ion_thruster.dm
index 50d290f3474..83f8df3f1ed 100644
--- a/code/modules/overmap/ships/engines/ion_thruster.dm
+++ b/code/modules/overmap/ships/engines/ion_thruster.dm
@@ -40,7 +40,7 @@
desc = "An advanced ion propulsion device, using energy and a minute amount of gas to generate thrust."
icon = 'icons/obj/ship_engine.dmi'
icon_state = "nozzle"
- power_channel = ENVIRON
+ power_channel = AREA_USAGE_ENVIRON
idle_power_usage = 19600
anchored = TRUE
component_types = list(
diff --git a/code/modules/paperwork/photocopier.dm b/code/modules/paperwork/photocopier.dm
index 1f3b13341b3..b3727143fa1 100644
--- a/code/modules/paperwork/photocopier.dm
+++ b/code/modules/paperwork/photocopier.dm
@@ -6,7 +6,7 @@
density = 1
idle_power_usage = 30
active_power_usage = 200
- power_channel = EQUIP
+ power_channel = AREA_USAGE_EQUIP
/// Item to copy.
var/obj/item/copy_item
/// How much toner is left.
diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm
index 6c9a310d5c6..3ea31a47a30 100644
--- a/code/modules/power/apc.dm
+++ b/code/modules/power/apc.dm
@@ -1091,9 +1091,9 @@ ABSTRACT_TYPE(/obj/machinery/power/apc)
force_update = TRUE
return
- lastused_light = area.usage(LIGHT)
- lastused_equip = area.usage(EQUIP)
- lastused_environ = area.usage(ENVIRON)
+ lastused_light = area.usage(AREA_USAGE_LIGHT)
+ lastused_equip = area.usage(AREA_USAGE_EQUIP)
+ lastused_environ = area.usage(AREA_USAGE_ENVIRON)
area.clear_usage()
lastused_total = lastused_light + lastused_equip + lastused_environ
diff --git a/code/modules/power/gravitygenerator.dm b/code/modules/power/gravitygenerator.dm
index 6452156f549..e020cf77d4f 100644
--- a/code/modules/power/gravitygenerator.dm
+++ b/code/modules/power/gravitygenerator.dm
@@ -110,7 +110,7 @@
icon_state = "on_8"
idle_power_usage = 0
active_power_usage = 3000
- power_channel = ENVIRON
+ power_channel = AREA_USAGE_ENVIRON
sprite_number = 8
interact_offline = 1
var/on = 1
diff --git a/code/modules/power/lights/fixtures.dm b/code/modules/power/lights/fixtures.dm
index c2b087355a1..bf555b58226 100644
--- a/code/modules/power/lights/fixtures.dm
+++ b/code/modules/power/lights/fixtures.dm
@@ -16,7 +16,7 @@
use_power = POWER_USE_ACTIVE
idle_power_usage = 2
active_power_usage = 20
- power_channel = LIGHT //Lights are calc'd via area so they dont need to be in the machine list
+ power_channel = AREA_USAGE_LIGHT //Lights are calc'd via area so they dont need to be in the machine list
gfi_layer_rotation = GFI_ROTATION_DEFDIR
obj_flags = OBJ_FLAG_MOVES_UNSUPPORTED
var/brightness_range = 8 // luminosity when on, also used in power calculation
diff --git a/code/modules/power/sensors/powernet_sensor.dm b/code/modules/power/sensors/powernet_sensor.dm
index b0e075f52eb..1eb1e2da463 100644
--- a/code/modules/power/sensors/powernet_sensor.dm
+++ b/code/modules/power/sensors/powernet_sensor.dm
@@ -103,7 +103,7 @@
out = "No APCs located in connected powernet!"
else // APCs found. Create very ugly (but working!) HTML table.
- out += "
| Name | EQUIP | LIGHT | ENVIRON | CELL | LOAD"
+ out += "| Name | AREA_USAGE_EQUIP | AREA_USAGE_LIGHT | AREA_USAGE_ENVIRON | CELL | LOAD"
// These lists are used as replacement for number based APC settings
var/list/S = list("M-OFF","A-OFF","M-ON", "A-ON")
@@ -122,10 +122,10 @@
load = reading_to_text(load)
out += " | [load]"
- out += " TOTAL AVAILABLE: [reading_to_text(powernet.avail)]"
+ out += " AREA_USAGE_TOTAL AVAILABLE: [reading_to_text(powernet.avail)]"
out += " APC LOAD: [reading_to_text(total_apc_load)]"
out += " OTHER LOAD: [reading_to_text(max(powernet.load - total_apc_load, 0))]"
- out += " TOTAL GRID LOAD: [reading_to_text(powernet.viewload)] ([round((powernet.load / powernet.avail) * 100)]%)"
+ out += " AREA_USAGE_TOTAL GRID LOAD: [reading_to_text(powernet.viewload)] ([round((powernet.load / powernet.avail) * 100)]%)"
if(powernet.problem)
out += " WARNING: Abnormal grid activity detected!"
diff --git a/code/modules/random_map/random_map.dm b/code/modules/random_map/random_map.dm
index db35b78b8fd..118618103c9 100644
--- a/code/modules/random_map/random_map.dm
+++ b/code/modules/random_map/random_map.dm
@@ -192,7 +192,7 @@ GLOBAL_LIST_EMPTY(map_count)
T.spawn_roof()
get_additional_spawns(map[tmp_cell],T,get_spawn_dir(x, y))
if(use_area)
- ChangeArea(T, use_area)
+ T.change_area(T.loc, use_area)
return T
/datum/random_map/proc/get_spawn_dir()
diff --git a/code/modules/security levels/keycard authentication.dm b/code/modules/security levels/keycard authentication.dm
index 1cbd988b856..cbc962fea48 100644
--- a/code/modules/security levels/keycard authentication.dm
+++ b/code/modules/security levels/keycard authentication.dm
@@ -19,7 +19,7 @@
anchored = 1.0
idle_power_usage = 2
active_power_usage = 6
- power_channel = ENVIRON
+ power_channel = AREA_USAGE_ENVIRON
/obj/machinery/keycard_auth/Initialize(mapload, d, populate_components, is_internal)
..()
|
|---|
|
|---|