Ports the Bluespace Light Replacer from BeeStation (#20545)

* Ports the Bluespace Light Replacer from BeeStation

* advanced replacer for janitor ERT

* wrong place

* Preventing it from being used over cameras

* Update code/game/objects/items/devices/lightreplacer.dm

Co-authored-by: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com>

* bluespace replacer only for gamma

---------

Co-authored-by: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com>
This commit is contained in:
Henri215
2023-03-22 22:22:19 -05:00
committed by GitHub
co-authored by AffectedArc07
parent 21414960aa
commit 5c9d20f65f
5 changed files with 35 additions and 13 deletions
@@ -39,10 +39,8 @@
/obj/item/lightreplacer
name = "light replacer"
desc = "A device to automatically replace lights. Refill with broken or working light bulbs, or sheets of glass."
icon = 'icons/obj/janitor.dmi'
icon_state = "lightreplacer0"
item_state = "electronic"
@@ -52,20 +50,19 @@
slot_flags = SLOT_BELT
origin_tech = "magnets=3;engineering=4"
force = 8
var/max_uses = 20
var/uses = 10
// How much to increase per each glass?
/// How much to increase per each glass?
var/increment = 5
// How much to take from the glass?
/// How much to take from the glass?
var/decrement = 1
var/charge = 1
// Eating used bulbs gives us bulb shards
/// Eating used bulbs gives us bulb shards
var/bulb_shards = 0
// when we get this many shards, we get a free bulb.
/// when we get this many shards, we get a free bulb.
var/shards_required = 4
/// It can replace lights at a distance?
var/bluespace_toggle = FALSE
/obj/item/lightreplacer/examine(mob/user)
. = ..()
@@ -232,10 +229,12 @@
/obj/item/lightreplacer/afterattack(atom/T, mob/U, proximity)
. = ..()
if(!proximity)
if(!proximity && !bluespace_toggle)
return
if(!isturf(T))
return
if(get_dist(src, T) >= (U.client.view + 2)) // To prevent people from using it over cameras
return
var/used = FALSE
for(var/atom/A in T)
@@ -243,6 +242,9 @@
break
used = TRUE
if(istype(A, /obj/machinery/light))
if(!proximity) // only beams if at a distance
U.Beam(A, icon_state = "rped_upgrade", icon = 'icons/effects/effects.dmi', time = 5)
playsound(src, 'sound/items/pshoom.ogg', 40, 1)
ReplaceLight(A, U)
if(!used)
@@ -259,6 +261,15 @@
for(var/I in 1 to coeff)
Charge()
/obj/item/lightreplacer/bluespace
name = "bluespace light replacer"
desc = "A modified light replacer that zaps lights into place. Refill with broken or working light bulbs, or sheets of glass."
icon_state = "lightreplacer_blue0"
bluespace_toggle = TRUE
/obj/item/lightreplacer/bluespace/emag_act()
return // long range explosions are stupid
#undef LIGHT_OK
#undef LIGHT_EMPTY
#undef LIGHT_BROKEN
@@ -422,6 +422,7 @@
new /obj/item/ammo_box/magazine/m45(src)
new /obj/item/ammo_box/magazine/m45(src)
update_icon()
/obj/item/storage/belt/janitor
name = "janibelt"
desc = "A belt used to hold most janitorial supplies."
@@ -443,9 +444,9 @@
)
/obj/item/storage/belt/janitor/full/populate_contents()
new /obj/item/lightreplacer(src)
new /obj/item/holosign_creator/janitor(src)
new /obj/item/reagent_containers/spray/cleaner/advanced(src)
new /obj/item/reagent_containers/spray/cleaner/advanced(src)
new /obj/item/soap/deluxe(src)
new /obj/item/grenade/chem_grenade/cleaner(src)
new /obj/item/grenade/chem_grenade/cleaner(src)