Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Phone sounds update #6789

Merged
merged 4 commits into from
Aug 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions code/datums/looping_sounds/misc_sounds.dm
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
/datum/looping_sound/looping_launch_announcement_alarm
mid_sounds = list('sound/vehicles/Dropships/single_alarm_brr_dropship_1.ogg' = 1)
start_sound = list('sound/vehicles/Dropships/single_alarm_brr_dropship_1.ogg' = 1)

/datum/looping_sound/telephone/ring
start_sound = 'sound/machines/telephone/dial.ogg'
start_length = 3.2 SECONDS
mid_sounds = 'sound/machines/telephone/ring_outgoing.ogg'
mid_length = 2.1 SECONDS
volume = 10

/datum/looping_sound/telephone/busy
start_sound = 'sound/voice/callstation_unavailable.ogg'
start_length = 5.7 SECONDS
mid_sounds = 'sound/machines/telephone/phone_busy.ogg'
mid_length = 5 SECONDS
volume = 15

/datum/looping_sound/telephone/hangup
start_sound = 'sound/machines/telephone/remote_hangup.ogg'
start_length = 0.6 SECONDS
mid_sounds = 'sound/machines/telephone/phone_busy.ogg'
mid_length = 5 SECONDS
volume = 15
2 changes: 2 additions & 0 deletions code/game/sound.dm
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,8 @@
S = pick('sound/voice/upp_warcry/warcry_female_1.ogg', 'sound/voice/upp_warcry/warcry_female_2.ogg')
if("rtb_handset")
S = pick('sound/machines/telephone/rtb_handset_1.ogg', 'sound/machines/telephone/rtb_handset_2.ogg', 'sound/machines/telephone/rtb_handset_3.ogg', 'sound/machines/telephone/rtb_handset_4.ogg', 'sound/machines/telephone/rtb_handset_5.ogg')
if("talk_phone")
S = pick('sound/machines/telephone/talk_phone1.ogg', 'sound/machines/telephone/talk_phone2.ogg', 'sound/machines/telephone/talk_phone3.ogg', 'sound/machines/telephone/talk_phone4.ogg', 'sound/machines/telephone/talk_phone5.ogg', 'sound/machines/telephone/talk_phone6.ogg', 'sound/machines/telephone/talk_phone7.ogg')
if("bone_break")
S = pick('sound/effects/bone_break1.ogg','sound/effects/bone_break2.ogg','sound/effects/bone_break3.ogg','sound/effects/bone_break4.ogg','sound/effects/bone_break5.ogg','sound/effects/bone_break6.ogg','sound/effects/bone_break7.ogg')
if("plush")
Expand Down
22 changes: 21 additions & 1 deletion code/modules/cm_phone/phone.dm
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ GLOBAL_LIST_EMPTY_TYPED(transmitters, /obj/structure/transmitter)
var/list/networks_receive = list(FACTION_MARINE)
var/list/networks_transmit = list(FACTION_MARINE)

var/datum/looping_sound/telephone/busy/busy_loop
var/datum/looping_sound/telephone/hangup/hangup_loop
var/datum/looping_sound/telephone/ring/outring_loop

/obj/structure/transmitter/hidden
do_not_disturb = PHONE_DND_FORCED

Expand All @@ -51,6 +55,10 @@ GLOBAL_LIST_EMPTY_TYPED(transmitters, /obj/structure/transmitter)
if(!get_turf(src))
return

outring_loop = new(attached_to)
busy_loop = new(attached_to)
hangup_loop = new(attached_to)

GLOB.transmitters += src

/obj/structure/transmitter/update_icon()
Expand Down Expand Up @@ -184,6 +192,7 @@ GLOBAL_LIST_EMPTY_TYPED(transmitters, /obj/structure/transmitter)
to_chat(user, SPAN_PURPLE("[icon2html(src, user)] Dialing [calling_phone_id].."))
playsound(get_turf(user), "rtb_handset")
timeout_timer_id = addtimer(CALLBACK(src, PROC_REF(reset_call), TRUE), timeout_duration, TIMER_UNIQUE|TIMER_OVERRIDE|TIMER_STOPPABLE)
outring_loop.start()

START_PROCESSING(SSobj, src)
START_PROCESSING(SSobj, T)
Expand Down Expand Up @@ -223,13 +232,15 @@ GLOBAL_LIST_EMPTY_TYPED(transmitters, /obj/structure/transmitter)
if(T.attached_to && ismob(T.attached_to.loc))
var/mob/M = T.attached_to.loc
to_chat(M, SPAN_PURPLE("[icon2html(src, M)] [phone_id] has picked up."))
playsound(T.attached_to.loc, 'sound/machines/telephone/remote_pickup.ogg', 20)
if(T.timeout_timer_id)
deltimer(T.timeout_timer_id)
T.timeout_timer_id = null

to_chat(user, SPAN_PURPLE("[icon2html(src, user)] Picked up a call from [T.phone_id]."))
playsound(get_turf(user), "rtb_handset")

T.outring_loop.stop()
user.put_in_active_hand(attached_to)
update_icon()

Expand All @@ -254,11 +265,14 @@ GLOBAL_LIST_EMPTY_TYPED(transmitters, /obj/structure/transmitter)
if(T.attached_to && ismob(T.attached_to.loc))
var/mob/M = T.attached_to.loc
to_chat(M, SPAN_PURPLE("[icon2html(src, M)] [phone_id] has hung up on you."))
T.hangup_loop.start()

if(attached_to && ismob(attached_to.loc))
var/mob/M = attached_to.loc
if(timeout)
to_chat(M, SPAN_PURPLE("[icon2html(src, M)] Your call to [T.phone_id] has reached voicemail, you immediately disconnect the line."))
to_chat(M, SPAN_PURPLE("[icon2html(src, M)] Your call to [T.phone_id] has reached voicemail, nobody picked up the phone."))
busy_loop.start()
outring_loop.stop()
else
to_chat(M, SPAN_PURPLE("[icon2html(src, M)] You have hung up on [T.phone_id]."))

Expand All @@ -282,6 +296,8 @@ GLOBAL_LIST_EMPTY_TYPED(transmitters, /obj/structure/transmitter)
T.update_icon()
STOP_PROCESSING(SSobj, T)

outring_loop.stop()

STOP_PROCESSING(SSobj, src)

/obj/structure/transmitter/process()
Expand Down Expand Up @@ -319,9 +335,12 @@ GLOBAL_LIST_EMPTY_TYPED(transmitters, /obj/structure/transmitter)
var/mob/M = attached_to.loc
M.drop_held_item(attached_to)
playsound(get_turf(M), "rtb_handset", 100, FALSE, 7)
hangup_loop.stop()

attached_to.forceMove(src)
reset_call()
busy_loop.stop()
outring_loop.stop()

update_icon()

Expand All @@ -347,6 +366,7 @@ GLOBAL_LIST_EMPTY_TYPED(transmitters, /obj/structure/transmitter)

P.handle_hear(message, L, speaking)
attached_to.handle_hear(message, L, speaking)
playsound(P, "talk_phone", 5)
log_say("TELEPHONE: [key_name(speaking)] on Phone '[phone_id]' to '[T.phone_id]' said '[message]'")

/obj/structure/transmitter/attackby(obj/item/W, mob/user)
Expand Down
Binary file added sound/machines/telephone/dial.ogg
Binary file not shown.
Binary file added sound/machines/telephone/phone_busy.ogg
Binary file not shown.
Binary file added sound/machines/telephone/remote_hangup.ogg
Binary file not shown.
Binary file added sound/machines/telephone/remote_pickup.ogg
Binary file not shown.
Binary file added sound/machines/telephone/ring_outgoing.ogg
Binary file not shown.
Binary file added sound/machines/telephone/talk_phone1.ogg
Binary file not shown.
Binary file added sound/machines/telephone/talk_phone2.ogg
Binary file not shown.
Binary file added sound/machines/telephone/talk_phone3.ogg
Binary file not shown.
Binary file added sound/machines/telephone/talk_phone4.ogg
Binary file not shown.
Binary file added sound/machines/telephone/talk_phone5.ogg
Binary file not shown.
Binary file added sound/machines/telephone/talk_phone6.ogg
Binary file not shown.
Binary file added sound/machines/telephone/talk_phone7.ogg
Binary file not shown.
Binary file added sound/voice/callstation_unavailable.ogg
Binary file not shown.
Loading