adds 'exterior' lights (#31695)

This commit is contained in:
warriorstar-orion
2026-03-13 19:38:23 +00:00
committed by GitHub
parent a470d925c0
commit e24c5f70ae
4 changed files with 53 additions and 25 deletions
@@ -284,12 +284,12 @@
/turf/simulated/floor/pod/dark,
/area/ruin/powered/snow_biodome)
"hA" = (
/obj/machinery/light/built{
/obj/effect/mapping_helpers/no_lava,
/obj/machinery/light/exterior/outdoors{
dir = 1
},
/obj/effect/mapping_helpers/no_lava,
/turf/simulated/floor/pod/dark/lavaland_air,
/area/ruin/powered/snow_biodome)
/turf/simulated/floor/plating/asteroid/basalt/lava_land_surface,
/area/lavaland/surface/outdoors/explored)
"jE" = (
/obj/effect/decal/cleanable/blood/drip,
/turf/simulated/floor/wood,
@@ -413,10 +413,8 @@
/turf/simulated/floor/mineral/plastitanium,
/area/ruin/space/powered/casino/security)
"kx" = (
/obj/machinery/light{
dir = 4;
brightness_color = "#FF0000";
color = "#FF0000"
/obj/machinery/light/exterior/warning{
dir = 4
},
/turf/template_noop,
/area/template_noop)
@@ -466,10 +464,8 @@
/turf/simulated/floor/plating,
/area/ruin/space/powered/casino/security)
"lZ" = (
/obj/machinery/light{
dir = 1;
brightness_color = "#FF0000";
color = "#FF0000"
/obj/machinery/light/exterior/warning{
dir = 1
},
/turf/template_noop,
/area/template_noop)
@@ -1036,10 +1032,7 @@
/turf/simulated/floor/plating,
/area/ruin/space/powered/casino/maints)
"DL" = (
/obj/machinery/light{
brightness_color = "#FF0000";
color = "#FF0000"
},
/obj/machinery/light/exterior/warning,
/turf/template_noop,
/area/template_noop)
"DM" = (
@@ -1514,10 +1507,8 @@
/turf/simulated/floor/plasteel/freezer,
/area/ruin/space/powered/casino/hall)
"TA" = (
/obj/machinery/light{
dir = 8;
brightness_color = "#FF0000";
color = "#FF0000"
/obj/machinery/light/exterior/warning{
dir = 8
},
/turf/template_noop,
/area/template_noop)
@@ -1695,15 +1686,13 @@
/turf/simulated/floor/plating,
/area/ruin/space/powered/casino/maints)
"Xe" = (
/obj/machinery/light{
dir = 8;
brightness_color = "#FF0000";
color = "#FF0000"
},
/obj/structure/lattice/catwalk,
/obj/structure/cable{
icon_state = "1-4"
},
/obj/machinery/light/exterior/warning{
dir = 8
},
/turf/template_noop,
/area/template_noop)
"Xo" = (
+38
View File
@@ -0,0 +1,38 @@
/// Exterior lights use the powernet of the wall they're installed on,
/// not the tile they're placed on. This allows them to be in a different
/// area than the area that powers them, making it possible to have a light
/// "outside" a structure that shares its power state.
/obj/machinery/light/exterior
/obj/machinery/light/exterior/Initialize(mapload)
. = ..()
reregister_machine()
/obj/machinery/light/exterior/reregister_machine()
var/turf/mounted = get_step(src, dir)
var/area/machine_area = get_area(mounted)
if(machine_powernet?.powernet_area != machine_area)
if(machine_area)
var/old_power_mode = power_state
change_power_mode(NO_POWER_USE) // Take away our current power from the old network
machine_powernet?.unregister_machine(src)
machine_powernet = machine_area.powernet
machine_powernet.register_machine(src)
change_power_mode(old_power_mode) // add it to the new network
/obj/machinery/light/exterior/power_change()
var/turf/mounted = get_step(src, dir)
var/area/machine_area = get_area(mounted)
if(machine_area)
seton(machine_area.lightswitch && machine_area.powernet.has_power(PW_CHANNEL_LIGHTING))
/obj/machinery/light/exterior/outdoors
brightness_color = "#facd7f"
nightshift_light_color = "#facd7f"
/obj/machinery/light/exterior/warning
brightness_color = COLOR_RED_LIGHT
nightshift_light_color = COLOR_RED_LIGHT
+1
View File
@@ -3085,6 +3085,7 @@
#include "code\modules\power\alien_cache.dm"
#include "code\modules\power\cell.dm"
#include "code\modules\power\electrolyzer.dm"
#include "code\modules\power\exterior_lights.dm"
#include "code\modules\power\gravitygenerator.dm"
#include "code\modules\power\laser_terminal.dm"
#include "code\modules\power\lights.dm"