Adds Floor Lights (and makes lights not have random ranges) (#26923)

* Adds Floor Lights

* undef

* remove TECHNICAL DEBT™

* remove more technical debt™

* mapping changes
This commit is contained in:
Contrabang
2024-10-06 05:33:31 -04:00
committed by GitHub
parent b6f51c1f49
commit 413ddc8b73
15 changed files with 204 additions and 131 deletions
@@ -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
@@ -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
@@ -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, "<span class='warning'>You need to be standing next to a wall to place \the [src].</span>")
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, "<span class='warning'>You need to be standing next to [on_wall] to place [src].</span>")
return
if(gotwallitem(get_turf(user), get_dir(on_wall,user)))
to_chat(user, "<span class='warning'>There's already an item on this wall!</span>")
return
if(gotwallitem(get_turf(user), get_dir(on_wall, user)))
to_chat(user, "<span class='warning'>There's already an item on this wall!</span>")
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
@@ -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),