mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-19 11:05:03 +01:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user