Upports fridge, tcomm, and shield_gen soundloops (#19405)

* Soundloops

* emp fix

* Update tools.dm

* Update tools.dm

* hum
This commit is contained in:
Cameron Lennox
2026-04-23 22:58:32 -04:00
committed by GitHub
parent a881fe3bd6
commit a5739a5a99
19 changed files with 214 additions and 9 deletions
+18
View File
@@ -25,6 +25,7 @@
use_power = USE_POWER_OFF //doesn't use APC power
interact_offline = TRUE // don't check stat & NOPOWER|BROKEN for our UI. We check BROKEN ourselves.
var/id //for button usage
var/datum/looping_sound/shield_generator/shield_hum
/obj/machinery/shield_gen/advanced
name = "advanced bubble shield generator"
@@ -41,11 +42,13 @@
if(get_dir(cap, src) == cap.dir)
capacitors |= cap
cap.owned_gen = src
shield_hum = new(list(src), FALSE)
. = ..()
AddElement(/datum/element/climbable)
/obj/machinery/shield_gen/Destroy()
QDEL_LIST_NULL(field)
QDEL_NULL(shield_hum)
return ..()
/obj/machinery/shield_gen/emag_act(var/remaining_charges, var/mob/user)
@@ -243,6 +246,7 @@
to_chat(M, "[icon2html(src, M.client)] You hear heavy droning start up.")
for(var/obj/effect/energy_field/E in field) // Update the icons here to ensure all the shields have been made already.
E.update_icon()
shield_hum.start()
else
for(var/obj/effect/energy_field/D in field)
field.Remove(D)
@@ -251,11 +255,25 @@
for(var/mob/M in view(5,src))
to_chat(M, "[icon2html(src, M.client)] You hear heavy droning fade out.")
shield_hum.stop()
/obj/machinery/shield_gen/proc/fill_diffused()
if(active)
var/list/covered_turfs = get_shielded_turfs()
var/turf/T = get_turf(src)
var/obj/effect/energy_field/E
if(T in covered_turfs)
covered_turfs.Remove(T)
for(var/turf/O in covered_turfs)
if(locate(/obj/effect/energy_field, O) || locate(/obj/machinery/pointdefense, orange(2, O)))
continue
E = new(O, src)
/obj/machinery/shield_gen/update_icon()
if(stat & BROKEN)
icon_state = "broke"
set_light(0)
shield_hum.stop()
else
if (src.active)
icon_state = "generator1"