mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-30 16:38:22 +01:00
Area tweaks (#20391)
Reworked area changes and power define channels No player visible changes (hopefully)
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
@@ -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"
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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()
|
||||
|
||||
+38
-30
@@ -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.
|
||||
*
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
..()
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
|
||||
var/hatch_open = 0
|
||||
|
||||
power_channel = ENVIRON
|
||||
power_channel = AREA_USAGE_ENVIRON
|
||||
idle_power_usage = 5
|
||||
dir = SOUTH
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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."))
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -268,7 +268,7 @@
|
||||
for(var/areatype in areas_without_light)
|
||||
to_world("* [areatype]")
|
||||
|
||||
to_world("<b>AREAS WITHOUT A LIGHT SWITCH:</b>")
|
||||
to_world("<b>AREAS WITHOUT A AREA_USAGE_LIGHT SWITCH:</b>")
|
||||
for(var/areatype in areas_without_LS)
|
||||
to_world("* [areatype]")
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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?
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -103,7 +103,7 @@
|
||||
out = "<b>No APCs located in connected powernet!</b>"
|
||||
else // APCs found. Create very ugly (but working!) HTML table.
|
||||
|
||||
out += "<table><tr><th>Name<th>EQUIP<th>LIGHT<th>ENVIRON<th>CELL<th>LOAD"
|
||||
out += "<table><tr><th>Name<th>AREA_USAGE_EQUIP<th>AREA_USAGE_LIGHT<th>AREA_USAGE_ENVIRON<th>CELL<th>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 += "<td>[load]"
|
||||
|
||||
out += "<br><b>TOTAL AVAILABLE: [reading_to_text(powernet.avail)]</b>"
|
||||
out += "<br><b>AREA_USAGE_TOTAL AVAILABLE: [reading_to_text(powernet.avail)]</b>"
|
||||
out += "<br><b>APC LOAD: [reading_to_text(total_apc_load)]</b>"
|
||||
out += "<br><b>OTHER LOAD: [reading_to_text(max(powernet.load - total_apc_load, 0))]</b>"
|
||||
out += "<br><b>TOTAL GRID LOAD: [reading_to_text(powernet.viewload)] ([round((powernet.load / powernet.avail) * 100)]%)</b>"
|
||||
out += "<br><b>AREA_USAGE_TOTAL GRID LOAD: [reading_to_text(powernet.viewload)] ([round((powernet.load / powernet.avail) * 100)]%)</b>"
|
||||
|
||||
if(powernet.problem)
|
||||
out += "<br><b>WARNING: Abnormal grid activity detected!</b>"
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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)
|
||||
..()
|
||||
|
||||
Reference in New Issue
Block a user