diff --git a/_maps/map_files/stations/boxstation.dmm b/_maps/map_files/stations/boxstation.dmm
index 3800ea6dc96..33e69861416 100644
--- a/_maps/map_files/stations/boxstation.dmm
+++ b/_maps/map_files/stations/boxstation.dmm
@@ -92878,8 +92878,10 @@
"xUY" = (
/obj/structure/table/glass,
/obj/item/clothing/mask/cigarette/cigar,
-/turf/simulated/floor/light{
- color = "#fff"
+/obj/machinery/light/floor,
+/turf/simulated/floor/plasteel{
+ dir = 1;
+ icon_state = "bluered"
},
/area/station/command/bridge)
"xVe" = (
diff --git a/_maps/map_files/stations/deltastation.dmm b/_maps/map_files/stations/deltastation.dmm
index f472f6bc374..dd9cb4ba898 100644
--- a/_maps/map_files/stations/deltastation.dmm
+++ b/_maps/map_files/stations/deltastation.dmm
@@ -57051,7 +57051,13 @@
},
/area/station/science/genetics)
"dnW" = (
-/turf/simulated/floor/light,
+/obj/machinery/atmospherics/pipe/simple/visible{
+ dir = 4
+ },
+/obj/machinery/light/floor,
+/turf/simulated/floor/plasteel{
+ icon_state = "neutralfull"
+ },
/area/station/engineering/atmos)
"dnX" = (
/obj/structure/chair/sofa/left{
@@ -85188,6 +85194,12 @@
/obj/effect/mapping_helpers/airlock/access/all/engineering/maintenance,
/turf/simulated/floor/plating,
/area/station/maintenance/port)
+"pXV" = (
+/obj/machinery/light/floor,
+/turf/simulated/floor/plasteel{
+ icon_state = "neutralfull"
+ },
+/area/station/engineering/atmos)
"pYb" = (
/obj/structure/flora/grass/jungle,
/turf/simulated/floor/plating,
@@ -88507,10 +88519,11 @@
/turf/simulated/floor/carpet,
/area/station/science/robotics/showroom)
"rUU" = (
-/obj/machinery/atmospherics/pipe/simple/visible{
- dir = 4
+/obj/machinery/atmospherics/pipe/simple/visible,
+/obj/machinery/light/floor,
+/turf/simulated/floor/plasteel{
+ icon_state = "neutralfull"
},
-/turf/simulated/floor/light,
/area/station/engineering/atmos)
"rVB" = (
/obj/structure/table/reinforced,
@@ -124154,11 +124167,11 @@ aSD
iYX
aVF
ban
-dnW
+ban
tNx
lth
fgF
-dnW
+ban
wKG
lfU
aYt
@@ -124668,12 +124681,12 @@ aSD
aUc
aVF
ban
+pXV
ban
ban
ban
ban
-ban
-jgG
+dnW
ban
biQ
bkC
@@ -125953,11 +125966,11 @@ aSD
aUc
aVF
jgG
-rUU
+jgG
iUf
iUf
iUf
-dnW
+ban
nae
ban
aZm
@@ -126467,12 +126480,12 @@ aSH
aUd
aVF
jVW
+rUU
beJ
beJ
beJ
beJ
-beJ
-beJ
+rUU
bhk
biU
bkJ
diff --git a/code/__DEFINES/layers.dm b/code/__DEFINES/layers.dm
index 5b460ff9340..cfe41cb599e 100644
--- a/code/__DEFINES/layers.dm
+++ b/code/__DEFINES/layers.dm
@@ -9,8 +9,14 @@
#define PLANE_SPACE -95
#define PLANE_SPACE_PARALLAX -90
-#define FLOOR_PLANE -2
-#define FLOOR_OVERLAY_PLANE -1.5
+#define FLOOR_PLANE -6
+#define FLOOR_OVERLAY_PLANE -5
+
+#define FLOOR_LIGHTING_LAMPS_GLARE -4
+#define FLOOR_LIGHTING_LAMPS_SELFGLOW -3
+#define FLOOR_LIGHTING_LAMPS_PLANE -2
+#define FLOOR_LIGHTING_LAMPS_RENDER_TARGET "*FLOOR_LIGHTING_LAMPS_RENDER_TARGET"
+
#define GAME_PLANE -1
#define BLACKNESS_PLANE 0 //To keep from conflicts with SEE_BLACKNESS internals
diff --git a/code/_onclick/hud/plane_master.dm b/code/_onclick/hud/plane_master.dm
index 4ac17efb7f9..c28d7efb270 100644
--- a/code/_onclick/hud/plane_master.dm
+++ b/code/_onclick/hud/plane_master.dm
@@ -118,6 +118,11 @@
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
render_target = LIGHTING_LAMPS_RENDER_TARGET
+/atom/movable/screen/plane_master/lamps/floor
+ name = "floor lamps plane master"
+ plane = FLOOR_LIGHTING_LAMPS_PLANE
+ render_target = FLOOR_LIGHTING_LAMPS_RENDER_TARGET
+
/atom/movable/screen/plane_master/exposure
name = "exposure plane master"
plane = LIGHTING_EXPOSURE_PLANE
@@ -143,6 +148,12 @@
appearance_flags = PLANE_MASTER //should use client color
blend_mode = BLEND_ADD
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
+ var/target_rendering = LIGHTING_LAMPS_RENDER_TARGET
+
+/atom/movable/screen/plane_master/lamps_selfglow/floor
+ name = "floor lamps selfglow plane master"
+ plane = FLOOR_LIGHTING_LAMPS_SELFGLOW
+ target_rendering = FLOOR_LIGHTING_LAMPS_RENDER_TARGET
/atom/movable/screen/plane_master/lamps_selfglow/backdrop(mob/mymob)
remove_filter("add_lamps_to_selfglow")
@@ -169,13 +180,19 @@
else
return
- add_filter("add_lamps_to_selfglow", 1, layering_filter(render_source = LIGHTING_LAMPS_RENDER_TARGET, blend_mode = BLEND_OVERLAY))
+ add_filter("add_lamps_to_selfglow", 1, layering_filter(render_source = target_rendering, blend_mode = BLEND_OVERLAY))
add_filter("lamps_selfglow_bloom", 1, bloom_filter(threshold = "#777777", size = bloomsize, offset = bloomoffset, alpha = 80))
/atom/movable/screen/plane_master/lamps_glare
name = "lamps glare plane master"
plane = LIGHTING_LAMPS_GLARE
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
+ var/target_rendering = LIGHTING_LAMPS_RENDER_TARGET
+
+/atom/movable/screen/plane_master/lamps_glare/floor
+ name = "floor lamps glare plane master"
+ plane = FLOOR_LIGHTING_LAMPS_GLARE
+ target_rendering = FLOOR_LIGHTING_LAMPS_RENDER_TARGET
/atom/movable/screen/plane_master/lamps_glare/backdrop(mob/mymob)
remove_filter("add_lamps_to_glare")
@@ -187,5 +204,5 @@
var/enabled = mymob?.client?.prefs?.light & LIGHT_GLARE
if(enabled)
- add_filter("add_lamps_to_glare", 1, layering_filter(render_source = LIGHTING_LAMPS_RENDER_TARGET, blend_mode = BLEND_ADD))
+ add_filter("add_lamps_to_glare", 1, layering_filter(render_source = target_rendering, blend_mode = BLEND_ADD))
add_filter("lamps_glare", 1, radial_blur_filter(size = 0.035))
diff --git a/code/_onclick/hud/plane_master_controller.dm b/code/_onclick/hud/plane_master_controller.dm
index 1e3d317fc1a..d16e2da744e 100644
--- a/code/_onclick/hud/plane_master_controller.dm
+++ b/code/_onclick/hud/plane_master_controller.dm
@@ -76,6 +76,9 @@
name = PLANE_MASTERS_GAME
controlled_planes = list(
FLOOR_PLANE,
+ FLOOR_LIGHTING_LAMPS_SELFGLOW,
+ FLOOR_LIGHTING_LAMPS_PLANE,
+ FLOOR_LIGHTING_LAMPS_GLARE,
GAME_PLANE,
LIGHTING_PLANE,
PLANE_SPACE_PARALLAX,
diff --git a/code/game/objects/items/devices/flashlight.dm b/code/game/objects/items/devices/flashlight.dm
index 8ac39ab3c0e..604a8f0e13d 100644
--- a/code/game/objects/items/devices/flashlight.dm
+++ b/code/game/objects/items/devices/flashlight.dm
@@ -345,7 +345,7 @@
name = "glowing slime extract"
desc = "A glowing ball of what appears to be amber."
icon = 'icons/obj/lighting.dmi'
- icon_state = "floor1" //not a slime extract sprite but... something close enough!
+ icon_state = "slime-on"
item_state = "slime"
w_class = WEIGHT_CLASS_TINY
brightness_on = 6
diff --git a/code/game/objects/items/mountable_frames/light_frames.dm b/code/game/objects/items/mountable_frames/light_frames.dm
index 7d31cf49a24..ab59c8c2952 100644
--- a/code/game/objects/items/mountable_frames/light_frames.dm
+++ b/code/game/objects/items/mountable_frames/light_frames.dm
@@ -22,6 +22,8 @@
newlight = new /obj/machinery/light_construct/small(constrloc)
if("tube")
newlight = new /obj/machinery/light_construct(constrloc)
+ if("floor")
+ newlight = new /obj/machinery/light_construct/floor(on_wall)
else
newlight = new /obj/machinery/light_construct/small(constrloc)
newlight.dir = constrdir
@@ -40,3 +42,13 @@
icon_state = "bulb-construct-item"
fixture_type = "bulb"
metal_sheets_refunded = 1
+
+/obj/item/mounted/frame/light_fixture/floor
+ name = "floor light fixture frame"
+ desc = "Used for building floor lights."
+ icon = 'icons/obj/lighting.dmi'
+ icon_state = "floor-construct-item"
+ fixture_type = "floor"
+ metal_sheets_refunded = 3
+ buildon_types = list(/turf/simulated/floor)
+ allow_floor_mounting = TRUE
diff --git a/code/game/objects/items/mountable_frames/mountables.dm b/code/game/objects/items/mountable_frames/mountables.dm
index c850bb5b6e9..4047cbd94a5 100644
--- a/code/game/objects/items/mountable_frames/mountables.dm
+++ b/code/game/objects/items/mountable_frames/mountables.dm
@@ -3,35 +3,30 @@
/turf/simulated/mineral/ancient,
/turf/simulated/wall
)
+ var/allow_floor_mounting = FALSE
/obj/item/mounted/afterattack(atom/A, mob/user, proximity_flag)
- var/found_type = 0
- for(var/turf_type in src.buildon_types)
- if(istype(A, turf_type))
- found_type = 1
- break
-
- if(found_type)
+ if(is_type_in_list(A, buildon_types))
if(try_build(A, user, proximity_flag))
return do_build(A, user)
- else
- ..()
+ ..()
/obj/item/mounted/proc/try_build(turf/on_wall, mob/user, proximity_flag) //checks
if(!on_wall || !user)
return
- if(proximity_flag != 1) //if we aren't next to the wall
- return
- if(!( get_dir(on_wall,user) in GLOB.cardinal))
- to_chat(user, "You need to be standing next to a wall to place \the [src].")
+ if(!proximity_flag) //if we aren't next to the turf
return
+ if(!allow_floor_mounting)
+ if(!(get_dir(on_wall, user) in GLOB.cardinal))
+ to_chat(user, "You need to be standing next to [on_wall] to place [src].")
+ return
- if(gotwallitem(get_turf(user), get_dir(on_wall,user)))
- to_chat(user, "There's already an item on this wall!")
- return
+ if(gotwallitem(get_turf(user), get_dir(on_wall, user)))
+ to_chat(user, "There's already an item on this wall!")
+ return
- return 1
+ return TRUE
/obj/item/mounted/proc/do_build(turf/on_wall, mob/user) //the buildy bit after we pass the checks
return
diff --git a/code/game/objects/items/stacks/sheets/sheet_types.dm b/code/game/objects/items/stacks/sheets/sheet_types.dm
index fe49e58b540..9510c01b033 100644
--- a/code/game/objects/items/stacks/sheets/sheet_types.dm
+++ b/code/game/objects/items/stacks/sheets/sheet_types.dm
@@ -112,6 +112,7 @@ GLOBAL_LIST_INIT(metal_recipes, list(
new /datum/stack_recipe("grenade casing", /obj/item/grenade/chem_grenade),
new /datum/stack_recipe("light fixture frame", /obj/item/mounted/frame/light_fixture, 2),
new /datum/stack_recipe("small light fixture frame", /obj/item/mounted/frame/light_fixture/small, 1),
+ new /datum/stack_recipe("floor light fixture frame", /obj/item/mounted/frame/light_fixture/floor, 3),
null,
new /datum/stack_recipe("apc frame", /obj/item/mounted/frame/apc_frame, 2),
new /datum/stack_recipe("air alarm frame", /obj/item/mounted/frame/alarm_frame, 2),
diff --git a/code/modules/client/preference/preferences_toggles.dm b/code/modules/client/preference/preferences_toggles.dm
index 4d552c9322a..9f4adb3e96d 100644
--- a/code/modules/client/preference/preferences_toggles.dm
+++ b/code/modules/client/preference/preferences_toggles.dm
@@ -564,13 +564,16 @@
. = ..()
if(length(user.screen))
var/atom/movable/screen/plane_master/exposure/exposure_master = locate() in user.screen
- var/atom/movable/screen/plane_master/lamps_selfglow/glow_master = locate() in user.screen
- var/atom/movable/screen/plane_master/lamps_glare/glare_master = locate() in user.screen
exposure_master.alpha = user.prefs.light & LIGHT_NEW_LIGHTING ? 255 : 0
exposure_master.backdrop(user.mob)
- glow_master.backdrop(user.mob)
- glare_master.backdrop(user.mob)
+
+ for(var/atom/movable/screen/plane_master/lamps_selfglow/glow_master in user.screen)
+ glow_master.backdrop(user.mob)
+
+ for(var/atom/movable/screen/plane_master/lamps_glare/glare_master in user.screen)
+ glare_master.backdrop(user.mob)
+
/datum/preference_toggle/special_toggle/set_glow_level
name = "Set Glow Level"
@@ -591,8 +594,8 @@
user.prefs.glowlevel = glow_levels[new_level]
to_chat(usr, "Glow level: [new_level].")
if(length(user.screen))
- var/atom/movable/screen/plane_master/lamps_selfglow/glow_master = locate() in user.screen
- glow_master.backdrop(user.mob)
+ for(var/atom/movable/screen/plane_master/lamps_selfglow/glow_master in user.screen)
+ glow_master.backdrop(user.mob)
return ..()
/datum/preference_toggle/toggle_lamp_exposure
@@ -623,6 +626,7 @@
/datum/preference_toggle/toggle_lamps_glare/set_toggles(client/user)
. = ..()
- if(length(user.screen))
- var/atom/movable/screen/plane_master/lamps_glare/glare_master = locate() in user.screen
+ if(!length(user.screen))
+ return
+ for(var/atom/movable/screen/plane_master/lamps_glare/glare_master in user.screen)
glare_master.backdrop(user.mob)
diff --git a/code/modules/lighting/lighting_atom.dm b/code/modules/lighting/lighting_atom.dm
index 89757f89d5e..b3578178ab3 100644
--- a/code/modules/lighting/lighting_atom.dm
+++ b/code/modules/lighting/lighting_atom.dm
@@ -99,8 +99,11 @@
cut_overlay(exposure_overlay)
if(glow_icon && glow_icon_state)
- glow_overlay = image(icon = glow_icon, icon_state = glow_icon_state, dir = dir, layer = 1)
- glow_overlay.plane = LIGHTING_LAMPS_PLANE
+ glow_overlay = image(icon = glow_icon, icon_state = glow_icon_state, dir = dir, layer = -2)
+ if(layer <= LOW_OBJ_LAYER)
+ glow_overlay.plane = FLOOR_LIGHTING_LAMPS_PLANE // Yeah this sucks
+ else
+ glow_overlay.plane = LIGHTING_LAMPS_PLANE
glow_overlay.blend_mode = BLEND_ADD
if(glow_colored)
diff --git a/code/modules/power/lights.dm b/code/modules/power/lights.dm
index 04de3076a22..f0590e08844 100644
--- a/code/modules/power/lights.dm
+++ b/code/modules/power/lights.dm
@@ -14,6 +14,10 @@
#define MAXIMUM_SAFE_BACKUP_CHARGE 600
#define EMERGENCY_LIGHT_POWER_USE 0.5
+#define LIGHT_CONSTRUCT_EMPTY_FRAME 1
+#define LIGHT_CONSTRUCT_WIRED 2
+#define LIGHT_CONSTRUCT_COMPLETED 3
+
/**
* # Light fixture frame
*
@@ -27,84 +31,73 @@
icon = 'icons/obj/lighting.dmi'
icon_state = "tube-construct-stage1"
anchored = TRUE
- layer = 5
+ layer = FLY_LAYER
max_integrity = 200
armor = list(MELEE = 50, BULLET = 10, LASER = 10, ENERGY = 0, BOMB = 0, RAD = 0, FIRE = 80, ACID = 50)
- /// Construction stage (1 = Empty frame | 2 = Wired frame | 3 = Completed frame)
- var/stage = 1
+ /// Construction stage
+ var/stage = LIGHT_CONSTRUCT_EMPTY_FRAME
/// Light bulb type
var/fixture_type = "tube"
/// How many metal sheets get given after deconstruction
var/sheets_refunded = 2
/// Holder for the completed fixture
- var/obj/machinery/light/newlight = null
+ var/obj/machinery/light/construct_type = /obj/machinery/light/built
/obj/machinery/light_construct/Initialize(mapload, ndir, building)
. = ..()
- if(fixture_type == "bulb")
- icon_state = "bulb-construct-stage1"
+ update_icon(UPDATE_ICON_STATE)
/obj/machinery/light_construct/examine(mob/user)
. = ..()
if(get_dist(user, src) <= 2)
switch(stage)
- if(1)
+ if(LIGHT_CONSTRUCT_EMPTY_FRAME)
. += "It's an empty frame bolted to the wall. It needs to be wired."
- if(2)
+ if(LIGHT_CONSTRUCT_WIRED)
. += "The frame is wired, but the casing's cover is unscrewed."
- if(3)
+ if(LIGHT_CONSTRUCT_COMPLETED)
. += "The casing is screwed shut."
/obj/machinery/light_construct/wrench_act(mob/living/user, obj/item/I)
. = TRUE
switch(stage)
- if(1)
+ if(LIGHT_CONSTRUCT_EMPTY_FRAME)
to_chat(user, "You begin to dismantle [src].")
if(!I.use_tool(src, user, 30, volume = I.tool_volume))
return
new /obj/item/stack/sheet/metal(get_turf(loc), sheets_refunded)
TOOL_DISMANTLE_SUCCESS_MESSAGE
qdel(src)
- if(2)
+ if(LIGHT_CONSTRUCT_WIRED)
to_chat(user, "You have to remove the wires first.")
- if(3)
+ if(LIGHT_CONSTRUCT_COMPLETED)
to_chat(user, "You have to unscrew the case first.")
/obj/machinery/light_construct/wirecutter_act(mob/living/user, obj/item/I)
- if(stage != 2)
+ if(stage != LIGHT_CONSTRUCT_WIRED)
return
if(!I.use_tool(src, user, 0, volume = I.tool_volume))
return
. = TRUE
- stage = 1
- switch(fixture_type)
- if("tube")
- icon_state = "tube-construct-stage1"
- if("bulb")
- icon_state = "bulb-construct-stage1"
+
+ stage = LIGHT_CONSTRUCT_EMPTY_FRAME
+ update_icon(UPDATE_ICON_STATE)
new /obj/item/stack/cable_coil(get_turf(loc), 1, paramcolor = COLOR_RED)
WIRECUTTER_SNIP_MESSAGE
/obj/machinery/light_construct/screwdriver_act(mob/living/user, obj/item/I)
- if(stage != 2)
+ if(stage != LIGHT_CONSTRUCT_WIRED)
return
. = TRUE
if(!I.use_tool(src, user, 0, volume = I.tool_volume))
return
- switch(fixture_type)
- if("tube")
- icon_state = "tube-empty"
- if("bulb")
- icon_state = "bulb-empty"
- stage = 3
+
+ stage = LIGHT_CONSTRUCT_COMPLETED
+ update_icon(UPDATE_ICON_STATE)
user.visible_message("[user] closes [src]'s casing.", \
"You close [src]'s casing.", "You hear a screwdriver.")
- switch(fixture_type)
- if("tube")
- newlight = new /obj/machinery/light/built(loc)
- if("bulb")
- newlight = new /obj/machinery/light/small/built(loc)
+ var/obj/machinery/light/newlight = new construct_type(loc)
newlight.setDir(dir)
transfer_fingerprints_to(newlight)
qdel(src)
@@ -112,16 +105,12 @@
/obj/machinery/light_construct/attackby(obj/item/W, mob/living/user, params)
add_fingerprint(user)
if(istype(W, /obj/item/stack/cable_coil))
- if(stage != 1)
+ if(stage != LIGHT_CONSTRUCT_EMPTY_FRAME)
return
var/obj/item/stack/cable_coil/coil = W
coil.use(1)
- switch(fixture_type)
- if("tube")
- icon_state = "tube-construct-stage2"
- if("bulb")
- icon_state = "bulb-construct-stage2"
- stage = 2
+ stage = LIGHT_CONSTRUCT_WIRED
+ update_icon(UPDATE_ICON_STATE)
playsound(loc, coil.usesound, 50, 1)
user.visible_message("[user.name] adds wires to [src].", \
"You add wires to [src].", "You hear a noise.")
@@ -138,6 +127,13 @@
new /obj/item/stack/sheet/metal(loc, sheets_refunded)
qdel(src)
+/obj/machinery/light_construct/update_icon_state()
+ . = ..()
+ if(stage == LIGHT_CONSTRUCT_COMPLETED)
+ icon_state = "[fixture_type]-empty"
+ return
+ icon_state = "[fixture_type]-construct-stage[stage]"
+
/**
* # Small light fixture frame
*
@@ -148,13 +144,28 @@
/obj/machinery/light_construct/small
name = "small light fixture frame"
desc = "A small light fixture under construction."
- icon = 'icons/obj/lighting.dmi'
icon_state = "bulb-construct-stage1"
anchored = TRUE
- layer = 5
- stage = 1
+ layer = FLY_LAYER
fixture_type = "bulb"
sheets_refunded = 1
+ construct_type = /obj/machinery/light/small/built
+
+/obj/machinery/light_construct/floor
+ name = "floor light fixture frame"
+ desc = "A floor light fixture under construction."
+ icon_state = "floor-construct-stage1"
+ anchored = TRUE
+ layer = ABOVE_OPEN_TURF_LAYER
+ plane = FLOOR_PLANE
+ fixture_type = "floor"
+ sheets_refunded = 3
+ construct_type = /obj/machinery/light/floor/built
+
+
+#undef LIGHT_CONSTRUCT_EMPTY_FRAME
+#undef LIGHT_CONSTRUCT_WIRED
+#undef LIGHT_CONSTRUCT_COMPLETED
/**
@@ -170,7 +181,7 @@
glow_icon_state = "tube"
exposure_icon_state = "cone"
anchored = TRUE
- layer = 5
+ layer = FLY_LAYER
max_integrity = 100
power_state = ACTIVE_POWER_USE
idle_power_consumption = 2 //when in low power mode
@@ -198,6 +209,8 @@
var/light_type = /obj/item/light/tube
/// Type of light bulb that goes into the fixture
var/fitting = "tube"
+ /// What light construct type to turn into when we are deconstructed
+ var/obj/machinery/light_construct/deconstruct_type = /obj/machinery/light_construct
/// How many times has the light been switched on/off? (This is used to calc the probability the light burns out)
var/switchcount = 0
/// Is the light rigged to explode?
@@ -238,6 +251,7 @@
brightness_color = "#a0a080"
nightshift_light_range = 4
light_type = /obj/item/light/bulb
+ deconstruct_type = /obj/machinery/light_construct/small
/obj/machinery/light/spot
name = "spotlight"
@@ -245,13 +259,30 @@
brightness_range = 12
brightness_power = 4
-/obj/machinery/light/built/Initialize(mapload)
- status = LIGHT_EMPTY
- return ..()
+/obj/machinery/light/floor
+ name = "floor light"
+ desc = "A lightbulb you can walk on without breaking it, amazing."
+ icon_state = "floor1"
+ glow_icon_state = "floor"
+ exposure_icon_state = "floor_circle"
+ base_state = "floor"
+ fitting = "bulb"
+ light_type = /obj/item/light/bulb
+ deconstruct_type = /obj/machinery/light_construct/floor
+ brightness_range = 6
+ nightshift_light_range = 6
+ layer = ABOVE_OPEN_TURF_LAYER
+ plane = FLOOR_PLANE
-/obj/machinery/light/small/built/Initialize(mapload)
+/obj/machinery/light/built
status = LIGHT_EMPTY
- return ..()
+
+/obj/machinery/light/small/built
+ status = LIGHT_EMPTY
+
+/obj/machinery/light/floor/built
+ status = LIGHT_EMPTY
+
// create a new lighting fixture
/obj/machinery/light/Initialize(mapload)
@@ -265,7 +296,7 @@
if(A && !A.requires_power)
on = TRUE
- switch(fitting)
+ switch(base_state)
if("tube")
brightness_range = 8
if(prob(2))
@@ -275,6 +306,11 @@
brightness_color = "#a0a080"
if(prob(5))
break_light_tube(TRUE)
+ if("floor")
+ brightness_range = 6
+ brightness_color = "#a0a080"
+ if(prob(3))
+ break_light_tube(TRUE)
update(FALSE, TRUE, FALSE)
/obj/machinery/light/proc/on_security_level_change_planned(datum/source, previous_level_number, new_level_number)
@@ -557,18 +593,10 @@
/obj/machinery/light/deconstruct(disassembled = TRUE)
if(!(flags & NODECONSTRUCT))
- var/obj/machinery/light_construct/newlight = null
var/cur_stage = 2
if(!disassembled)
cur_stage = 1
- switch(fitting)
- if("tube")
- newlight = new /obj/machinery/light_construct(loc)
- newlight.icon_state = "tube-construct-stage2"
-
- if("bulb")
- newlight = new /obj/machinery/light_construct/small(loc)
- newlight.icon_state = "bulb-construct-stage2"
+ var/obj/machinery/light_construct/newlight = new deconstruct_type(loc)
newlight.setDir(dir)
newlight.stage = cur_stage
if(!disassembled)
@@ -578,6 +606,7 @@
if(status != LIGHT_EMPTY)
drop_light_tube()
new /obj/item/stack/cable_coil(loc, 1, "red")
+ newlight.update_icon(UPDATE_ICON_STATE)
transfer_fingerprints_to(newlight)
qdel(src)
@@ -822,6 +851,22 @@
explosion(T, 0, 0, 2, 2)
qdel(src)
+/obj/machinery/light/extinguish_light(force = FALSE)
+ on = FALSE
+ extinguished = TRUE
+ emergency_mode = FALSE
+ no_emergency = TRUE
+ addtimer(CALLBACK(src, PROC_REF(enable_emergency_lighting)), 5 MINUTES, TIMER_UNIQUE|TIMER_OVERRIDE)
+ visible_message("[src] flickers and falls dark.")
+ update(FALSE)
+
+/obj/machinery/light/proc/enable_emergency_lighting()
+ visible_message("[src]'s emergency lighting flickers back to life.")
+ extinguished = FALSE
+ no_emergency = FALSE
+ update(FALSE)
+
+
/**
* MARK: Light item
*
@@ -908,14 +953,6 @@
..()
shatter()
-/obj/item/light/bulb/fire
- name = "fire bulb"
- desc = "A replacement fire bulb."
- icon_state = "fbulb"
- base_state = "fbulb"
- item_state = "egg4"
- brightness_range = 5
-
// update the icon state and description of the light
/obj/item/light/proc/update()
@@ -933,11 +970,6 @@
/obj/item/light/New()
..()
- switch(name)
- if("light tube")
- brightness_range = rand(6,9)
- if("light bulb")
- brightness_range = rand(4,6)
update()
@@ -990,21 +1022,6 @@
limb.droplimb(0, DROPLIMB_BURN)
return FIRELOSS
-/obj/machinery/light/extinguish_light(force = FALSE)
- on = FALSE
- extinguished = TRUE
- emergency_mode = FALSE
- no_emergency = TRUE
- addtimer(CALLBACK(src, PROC_REF(enable_emergency_lighting)), 5 MINUTES, TIMER_UNIQUE|TIMER_OVERRIDE)
- visible_message("[src] flickers and falls dark.")
- update(FALSE)
-
-/obj/machinery/light/proc/enable_emergency_lighting()
- visible_message("[src]'s emergency lighting flickers back to life.")
- extinguished = FALSE
- no_emergency = FALSE
- update(FALSE)
-
#undef MAXIMUM_SAFE_BACKUP_CHARGE
#undef EMERGENCY_LIGHT_POWER_USE
#undef LIGHT_OK
diff --git a/icons/effects/exposures.dmi b/icons/effects/exposures.dmi
index 13f976ceb9d..1560835049e 100644
Binary files a/icons/effects/exposures.dmi and b/icons/effects/exposures.dmi differ
diff --git a/icons/obj/lamps.dmi b/icons/obj/lamps.dmi
index e3f9fabb845..29d8e21bc40 100644
Binary files a/icons/obj/lamps.dmi and b/icons/obj/lamps.dmi differ
diff --git a/icons/obj/lighting.dmi b/icons/obj/lighting.dmi
index a934d0a1df0..6d887c8114d 100644
Binary files a/icons/obj/lighting.dmi and b/icons/obj/lighting.dmi differ