Adds sound effects to the tape recorder (#55908)

Adds sound effects to the tape recorder.

Doesn't add the sound of the tape being inserted or removed or the playing/recording hum. Maybe another day. Would also like to add handling sounds to tapes like other objects have.
Why It's Good For The Game

Tape recorders make satisfying sounds. Makes the object feel more real.
Changelog

🆑 cacogen
soundadd: The tape recorder makes sounds when you interact with it
/🆑
This commit is contained in:
cacogen
2021-01-04 19:12:10 +13:00
committed by GitHub
parent 4be59bcc44
commit ccf53acbe4
6 changed files with 7 additions and 0 deletions
@@ -65,11 +65,13 @@
return
mytape = I
to_chat(user, "<span class='notice'>You insert [I] into [src].</span>")
playsound(src, 'sound/items/taperecorder/taperecorder_close.ogg', 50, FALSE)
update_icon()
/obj/item/taperecorder/proc/eject(mob/user)
if(mytape)
playsound(src, 'sound/items/taperecorder/taperecorder_open.ogg', 50, FALSE)
to_chat(user, "<span class='notice'>You remove [mytape] from [src].</span>")
stop()
user.put_in_hands(mytape)
@@ -137,6 +139,7 @@
if(mytape.used_capacity < mytape.max_capacity)
to_chat(usr, "<span class='notice'>Recording started.</span>")
playsound(src, 'sound/items/taperecorder/taperecorder_play.ogg', 50, FALSE)
recording = 1
update_icon()
mytape.timestamp += mytape.used_capacity
@@ -164,11 +167,13 @@
recording = FALSE
mytape.timestamp += mytape.used_capacity
mytape.storedinfo += "\[[time2text(mytape.used_capacity * 10,"mm:ss")]\] Recording stopped."
playsound(src, 'sound/items/taperecorder/taperecorder_stop.ogg', 50, FALSE)
to_chat(usr, "<span class='notice'>Recording stopped.</span>")
return
else if(playing)
playing = FALSE
var/turf/T = get_turf(src)
playsound(src, 'sound/items/taperecorder/taperecorder_stop.ogg', 50, FALSE)
T.visible_message("<font color=Maroon><B>Tape Recorder</B>: Playback stopped.</font>")
update_icon()
@@ -189,6 +194,7 @@
playing = 1
update_icon()
to_chat(usr, "<span class='notice'>Playing started.</span>")
playsound(src, 'sound/items/taperecorder/taperecorder_play.ogg', 50, FALSE)
var/used = mytape.used_capacity //to stop runtimes when you eject the tape
var/max = mytape.max_capacity
for(var/i = 1, used <= max, sleep(10 * playsleepseconds))
@@ -257,6 +263,7 @@
return
to_chat(usr, "<span class='notice'>Transcript printed.</span>")
playsound(src, 'sound/items/taperecorder/taperecorder_print.ogg', 50, FALSE)
var/obj/item/paper/P = new /obj/item/paper(get_turf(src))
var/t1 = "<B>Transcript:</B><BR><BR>"
for(var/i = 1, mytape.storedinfo.len >= i, i++)
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.