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 09:33:31 +00:00
committed by GitHub
parent b6f51c1f49
commit 413ddc8b73
15 changed files with 204 additions and 131 deletions
@@ -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