Bluespace Light Replacer - Broken Bulbs Scanner (#93187)

## About The Pull Request
This PR adds a scanning functionality to the bluespace light replacer
that identifies broken light bulbs within visual range and highlights
them with temporary bluespace firefly markers (sorry for this sprite):


https://github.com/user-attachments/assets/a0f3b2cf-9dde-4888-9ce1-085ed18141d5
## Why It's Good For The Game
Makes finding broken lights in dark areas much less tedious, especially
during station-wide electrical storm.
By making broken light identification easier, this feature encourages
players to actually fix lighting issues rather than ignoring them.
## Changelog
🆑
add: Broken Bulbs Scanner for Bluespace Light Replacer
/🆑

---------

Co-authored-by: ArcaneMusic <41715314+ArcaneMusic@users.noreply.github.com>
This commit is contained in:
paganiy
2025-10-18 03:23:39 -04:00
committed by GitHub
co-authored by ArcaneMusic
parent ab9ddd73ac
commit 9243bcdd3a
2 changed files with 48 additions and 0 deletions
@@ -323,15 +323,63 @@
icon_state = "lightreplacer_high"
max_uses = 50
#define BLIGHTREPLACER_SPOT_COOLDOWN (BLIGHTREPLACER_SPOT_LIFE + 1 SECONDS)
#define BLIGHTREPLACER_SPOT_RANGE 7
#define BLIGHTREPLACER_SPOT_LIFE (5 SECONDS)
/obj/item/lightreplacer/blue
name = "bluespace light replacer"
desc = "A modified light replacer that zaps lights into place. Refill with broken or working lightbulbs, or sheets of glass."
icon_state = "lightreplacer_blue"
bluespace_toggle = TRUE
actions_types = list(/datum/action/item_action/lightreplacer_scan)
action_slots = ALL
COOLDOWN_DECLARE(lightreplacer_spot_cooldown)
/obj/item/lightreplacer/blue/emag_act()
return FALSE // balancing against longrange explosions
/obj/item/lightreplacer/blue/ui_action_click(mob/user, actiontype)
if(!COOLDOWN_FINISHED(src, lightreplacer_spot_cooldown))
balloon_alert(user, "on cooldown!")
return
COOLDOWN_START(src, lightreplacer_spot_cooldown, BLIGHTREPLACER_SPOT_COOLDOWN)
lightreplacer_scan()
/// Scans the area in search of fixtures with broken bulbs in the BLIGHTREPLACER_SPOT_RANGE range, and also marks them with the blue_firefly effect.
/obj/item/lightreplacer/blue/proc/lightreplacer_scan()
var/turf/source_turf = get_turf(src)
for(var/obj/machinery/light/broken_light in dview(BLIGHTREPLACER_SPOT_RANGE, source_turf))
if(broken_light.status == LIGHT_OK)
continue
var/obj/effect/temp_visual/blue_firefly/firefly = new(get_turf(broken_light))
animate(firefly, alpha = 0, time = BLIGHTREPLACER_SPOT_LIFE, easing = CIRCULAR_EASING | EASE_IN)
/datum/action/item_action/lightreplacer_scan
name = "Scan for broken lamps"
desc = "Scans the surrounding area for fixtures with broken light bulbs and marks them."
/obj/effect/temp_visual/blue_firefly
name = "bluespace firefly"
icon = 'icons/effects/effects.dmi'
icon_state = "bluespace_firefly"
light_power = 1
light_range = 2
light_color = LIGHT_COLOR_DARK_BLUE
duration = BLIGHTREPLACER_SPOT_LIFE
/obj/effect/temp_visual/blue_firefly/Initialize(mapload)
. = ..()
update_appearance(UPDATE_OVERLAYS)
/obj/effect/temp_visual/blue_firefly/update_overlays()
. = ..()
. += emissive_appearance(icon, icon_state, src, alpha = src.alpha)
#undef BLIGHTREPLACER_SPOT_COOLDOWN
#undef BLIGHTREPLACER_SPOT_RANGE
#undef BLIGHTREPLACER_SPOT_LIFE
#undef GLASS_SHEET_USES
#undef LIGHTBULB_COST
#undef BULB_SHARDS_REQUIRED
Binary file not shown.

Before

Width:  |  Height:  |  Size: 880 KiB

After

Width:  |  Height:  |  Size: 945 KiB