mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-20 04:26:03 +01:00
Add constructable floor lights + mapping subtypes (#93537)
## About The Pull Request Features: - Floor lights can be constructed using a small light fixture on the turf you are standing on - Floor light construction sprites - `/burned` subtypes for lights - Convert `/build` subtypes to `/empty` subtypes with `UpdatePaths` script ## Why It's Good For The Game Floor lights can now be constructed in game using the same mechanics as other lights. The `/burned` and `/empty` subtypes might be useful for mapping. ## Changelog 🆑 add: Add constructable floor lights by using a small light fixture on the floor. They are constructed the same way as other lights. qol: Add `/burned` subtype to `/obj/machinery/light` for mapping shenanigans image: Add floor light construction sprites map: Converted the `/built` subtype for `/obj/machinery/light` to be `/empty` and added an UpdatePaths script. /🆑 --------- Co-authored-by: SyncIt21 <110812394+SyncIt21@users.noreply.github.com>
This commit is contained in:
@@ -424,6 +424,8 @@
|
||||
frame = new /obj/item/wallframe/light_fixture(drop_point)
|
||||
if("bulb")
|
||||
frame = new /obj/item/wallframe/light_fixture/small(drop_point)
|
||||
if("floor bulb")
|
||||
frame = new /obj/item/wallframe/light_fixture/small(drop_point)
|
||||
if(!disassembled)
|
||||
frame.take_damage(frame.max_integrity * 0.5, sound_effect = FALSE)
|
||||
if(status != LIGHT_BROKEN)
|
||||
@@ -728,7 +730,7 @@
|
||||
layer = BELOW_CATWALK_LAYER
|
||||
plane = FLOOR_PLANE
|
||||
light_type = /obj/item/light/bulb
|
||||
fitting = "bulb"
|
||||
fitting = "floor bulb"
|
||||
nightshift_brightness = 4
|
||||
fire_brightness = 4.5
|
||||
|
||||
@@ -739,6 +741,15 @@
|
||||
status = LIGHT_BROKEN
|
||||
icon_state = "floor-broken"
|
||||
|
||||
/obj/machinery/light/floor/burned
|
||||
status = LIGHT_BURNED
|
||||
icon_state = "floor-burned"
|
||||
|
||||
/obj/machinery/light/floor/empty
|
||||
icon_state = "floor-empty"
|
||||
start_with_cell = FALSE
|
||||
status = LIGHT_EMPTY
|
||||
|
||||
/obj/machinery/light/floor/transport
|
||||
name = "transport light"
|
||||
break_if_moved = FALSE
|
||||
|
||||
@@ -141,9 +141,11 @@
|
||||
tool.play_tool_sound(src, 75)
|
||||
switch(fixture_type)
|
||||
if("tube")
|
||||
new_light = new /obj/machinery/light/built(loc)
|
||||
new_light = new /obj/machinery/light/empty(loc)
|
||||
if("bulb")
|
||||
new_light = new /obj/machinery/light/small/built(loc)
|
||||
new_light = new /obj/machinery/light/small/empty(loc)
|
||||
if("floor")
|
||||
new_light = new /obj/machinery/light/floor/empty(loc)
|
||||
new_light.setDir(dir)
|
||||
new_light.find_and_hang_on_wall()
|
||||
transfer_fingerprints_to(new_light)
|
||||
@@ -169,3 +171,9 @@
|
||||
icon_state = "bulb-construct-stage1"
|
||||
fixture_type = "bulb"
|
||||
sheets_refunded = 1
|
||||
|
||||
/obj/structure/light_construct/floor
|
||||
name = "floor light fixture frame"
|
||||
icon_state = "floor-construct-stage1"
|
||||
fixture_type = "floor"
|
||||
sheets_refunded = 1
|
||||
|
||||
@@ -2,7 +2,11 @@
|
||||
status = LIGHT_BROKEN
|
||||
icon_state = "tube-broken"
|
||||
|
||||
/obj/machinery/light/built
|
||||
/obj/machinery/light/burned
|
||||
status = LIGHT_BURNED
|
||||
icon_state = "tube-burned"
|
||||
|
||||
/obj/machinery/light/empty
|
||||
icon_state = "tube-empty"
|
||||
start_with_cell = FALSE
|
||||
status = LIGHT_EMPTY
|
||||
@@ -68,7 +72,11 @@
|
||||
status = LIGHT_BROKEN
|
||||
icon_state = "bulb-broken"
|
||||
|
||||
/obj/machinery/light/small/built
|
||||
/obj/machinery/light/small/burned
|
||||
status = LIGHT_BURNED
|
||||
icon_state = "bulb-burned"
|
||||
|
||||
/obj/machinery/light/small/empty
|
||||
icon_state = "bulb-empty"
|
||||
start_with_cell = FALSE
|
||||
status = LIGHT_EMPTY
|
||||
@@ -105,7 +113,7 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/light/broken, 0)
|
||||
MAPPING_DIRECTIONAL_HELPERS(/obj/structure/light_construct, 0)
|
||||
|
||||
// ---- Tube frames
|
||||
MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/light/built, 0)
|
||||
MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/light/empty, 0)
|
||||
|
||||
// ---- No nightlight tubes
|
||||
MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/light/no_nightlight, 0)
|
||||
@@ -148,7 +156,7 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/light/small, 0)
|
||||
MAPPING_DIRECTIONAL_HELPERS(/obj/structure/light_construct/small, 0)
|
||||
|
||||
// ---- Bulb frames
|
||||
MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/light/small/built, 0)
|
||||
MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/light/small/empty, 0)
|
||||
|
||||
// ---- Broken bulbs
|
||||
MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/light/small/broken, 0)
|
||||
|
||||
@@ -20,3 +20,35 @@
|
||||
to_chat(user, span_warning("You cannot place [src] in this area!"))
|
||||
return
|
||||
return TRUE
|
||||
|
||||
/obj/item/wallframe/light_fixture/small/attack_self(mob/user)
|
||||
var/turf/local_turf = get_turf(user)
|
||||
var/area/local_area = get_area(user)
|
||||
if(!isturf(user.loc) || !isfloorturf(local_turf))
|
||||
balloon_alert(user, "cannot place here!")
|
||||
return
|
||||
if(local_area.always_unpowered || !local_area.static_lighting)
|
||||
balloon_alert(user, "cannot place in this area!")
|
||||
return
|
||||
for(var/obj/object in local_turf)
|
||||
if(object.density && !(object.obj_flags & IGNORE_DENSITY) || object.obj_flags & BLOCKS_CONSTRUCTION)
|
||||
balloon_alert(user, "something is in the way!")
|
||||
return
|
||||
if(local_turf.underfloor_accessibility < UNDERFLOOR_INTERACTABLE)
|
||||
balloon_alert(user, "remove the floor plating!")
|
||||
return
|
||||
if(locate(/obj/structure/light_construct/floor) in local_turf)
|
||||
balloon_alert(user, "already has a light!")
|
||||
return
|
||||
if(locate(/obj/machinery/light/floor) in local_turf)
|
||||
balloon_alert(user, "already has a light!")
|
||||
return
|
||||
|
||||
playsound(src.loc, 'sound/machines/click.ogg', 75, TRUE)
|
||||
user.visible_message(span_notice("[user.name] attaches [src] to the floor."),
|
||||
span_notice("You attach [src] to the floor."),
|
||||
span_hear("You hear clicking."))
|
||||
|
||||
new /obj/structure/light_construct/floor(local_turf)
|
||||
qdel(src)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user