mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-28 23:58:07 +01:00
Resprites all mineral overlays (from mining scanners) (#92725)
This commit is contained in:
@@ -70,15 +70,12 @@
|
||||
var/turf/t = get_turf(src)
|
||||
mineral_scan_pulse(t, range, src)
|
||||
|
||||
/proc/mineral_scan_pulse(turf/T, range = world.view, obj/item/scanner)
|
||||
var/list/minerals = list()
|
||||
/proc/mineral_scan_pulse(turf/start_turf, range = world.view, obj/item/scanner)
|
||||
var/vents_nearby = FALSE
|
||||
var/undiscovered = FALSE
|
||||
var/radar_volume = 30
|
||||
for(var/turf/closed/mineral/mineral in RANGE_TURFS(range, T))
|
||||
if(mineral.scan_state)
|
||||
minerals += mineral
|
||||
for(var/obj/structure/ore_vent/vent in range(range, T))
|
||||
|
||||
for(var/obj/structure/ore_vent/vent in range(range, start_turf))
|
||||
if(!vents_nearby && (!vent.discovered || !vent.tapped))
|
||||
vents_nearby = TRUE
|
||||
if(vent.discovered)
|
||||
@@ -87,27 +84,33 @@
|
||||
radar_volume = max(potential_volume, radar_volume)
|
||||
vent.add_mineral_overlays()
|
||||
|
||||
if(LAZYLEN(minerals))
|
||||
for(var/turf/closed/mineral/M in minerals)
|
||||
var/obj/effect/temp_visual/mining_overlay/oldC = locate(/obj/effect/temp_visual/mining_overlay) in M
|
||||
if(oldC)
|
||||
qdel(oldC)
|
||||
var/obj/effect/temp_visual/mining_overlay/C = new /obj/effect/temp_visual/mining_overlay(M)
|
||||
C.icon_state = M.scan_state
|
||||
for(var/turf/closed/mineral/mineral in RANGE_TURFS(range, start_turf))
|
||||
if(!mineral.scan_state)
|
||||
continue
|
||||
|
||||
var/obj/effect/temp_visual/mining_overlay/scan_overlay = locate(/obj/effect/temp_visual/mining_overlay) in mineral
|
||||
if(!scan_overlay)
|
||||
scan_overlay = new(mineral)
|
||||
scan_overlay.icon_state = mineral.scan_state
|
||||
continue
|
||||
|
||||
deltimer(scan_overlay.timerid)
|
||||
scan_overlay.timerid = QDEL_IN_STOPPABLE(scan_overlay, scan_overlay.duration)
|
||||
animate(scan_overlay, alpha = 0, time = scan_overlay.duration, easing = scan_overlay.easing_style)
|
||||
|
||||
if(vents_nearby && scanner)
|
||||
if(undiscovered)
|
||||
playsound(scanner, 'sound/machines/radar-ping.ogg', radar_volume, FALSE)
|
||||
scanner.balloon_alert_to_viewers("ore vent nearby")
|
||||
else
|
||||
playsound(scanner, 'sound/machines/sonar-ping.ogg', radar_volume, FALSE)
|
||||
scanner.balloon_alert_to_viewers("ore vent nearby")
|
||||
scanner.spasm_animation(1.5 SECONDS)
|
||||
|
||||
/obj/effect/temp_visual/mining_overlay
|
||||
plane = HIGH_GAME_PLANE
|
||||
layer = FLASH_LAYER
|
||||
icon = 'icons/effects/ore_visuals.dmi'
|
||||
appearance_flags = 0 //to avoid having TILE_BOUND in the flags, so that the 480x480 icon states let you see it no matter where you are
|
||||
appearance_flags = NONE // to avoid having TILE_BOUND in the flags, so that the 480x480 icon states let you see it no matter where you are
|
||||
duration = 35
|
||||
pixel_x = -224
|
||||
pixel_y = -224
|
||||
|
||||
Reference in New Issue
Block a user