mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-07-12 15:47:04 +01:00
Upports fridge, tcomm, and shield_gen soundloops (#19405)
* Soundloops * emp fix * Update tools.dm * Update tools.dm * hum
This commit is contained in:
@@ -19,6 +19,9 @@
|
||||
var/dos_capacity = 500 // Amount of DoS "packets" in buffer required to crash the relay
|
||||
var/dos_dissipate = 1 // Amount of DoS "packets" dissipated over time.
|
||||
|
||||
var/datum/looping_sound/tcomms/soundloop
|
||||
var/noisy = TRUE
|
||||
|
||||
|
||||
// TODO: Implement more logic here. For now it's only a placeholder.
|
||||
/obj/machinery/ntnet_relay/operable()
|
||||
@@ -33,8 +36,13 @@
|
||||
/obj/machinery/ntnet_relay/update_icon()
|
||||
if(operable())
|
||||
icon_state = initial(icon_state)
|
||||
if(!noisy)
|
||||
soundloop.start()
|
||||
noisy = TRUE
|
||||
else
|
||||
icon_state = "[initial(icon_state)]_off"
|
||||
soundloop.stop()
|
||||
noisy = FALSE
|
||||
|
||||
/obj/machinery/ntnet_relay/process()
|
||||
if(operable())
|
||||
@@ -106,6 +114,18 @@
|
||||
GLOB.ntnet_global.relays.Add(src)
|
||||
NTNet = GLOB.ntnet_global
|
||||
GLOB.ntnet_global.add_log("New quantum relay activated. Current amount of linked relays: [NTNet.relays.len]")
|
||||
soundloop = new(list(src), FALSE)
|
||||
if(prob(60)) // 60% chance to change the midloop
|
||||
if(prob(40))
|
||||
soundloop.mid_sounds = list('sound/machines/tcomms/tcomms_02.ogg' = 1)
|
||||
soundloop.mid_length = 40
|
||||
else if(prob(20))
|
||||
soundloop.mid_sounds = list('sound/machines/tcomms/tcomms_03.ogg' = 1)
|
||||
soundloop.mid_length = 10
|
||||
else
|
||||
soundloop.mid_sounds = list('sound/machines/tcomms/tcomms_04.ogg' = 1)
|
||||
soundloop.mid_length = 30
|
||||
soundloop.start() // Have to do this here bc it starts on
|
||||
|
||||
/obj/machinery/ntnet_relay/Destroy()
|
||||
if(GLOB.ntnet_global)
|
||||
@@ -115,6 +135,7 @@
|
||||
for(var/datum/computer_file/program/ntnet_dos/D in dos_sources)
|
||||
D.target = null
|
||||
D.error = "Connection to quantum relay severed"
|
||||
QDEL_NULL(soundloop)
|
||||
. = ..()
|
||||
|
||||
/obj/machinery/ntnet_relay/attackby(var/obj/item/W as obj, var/mob/user as mob)
|
||||
|
||||
Reference in New Issue
Block a user