Skip to content

Commit

Permalink
Converts SFX keys into DEFINES (tgstation#65146)
Browse files Browse the repository at this point in the history
About The Pull Request

Simply converts all instances of soundkeys that use get_sfx from strings into defines.

E.g. "sparks" is now SFX_SPARKS
Why It's Good For The Game

It makes life a lot easier when you're looking for a sound effect. You just type SFX_ and you get suggestions in VSC. Plus, it looks better.

image
Changelog

Not player facing.
  • Loading branch information
Gandalf2k15 authored Mar 10, 2022
1 parent 76ff3a5 commit 684eab3
Show file tree
Hide file tree
Showing 143 changed files with 265 additions and 236 deletions.
29 changes: 29 additions & 0 deletions code/__DEFINES/sound.dm
Original file line number Diff line number Diff line change
Expand Up @@ -133,3 +133,32 @@ GLOBAL_LIST_INIT(announcer_keys, list(
ANNOUNCER_SHUTTLERECALLED,
ANNOUNCER_SPANOMALIES,
))

/// List of all of our sound keys.
#define SFX_BODYFALL "bodyfall"
#define SFX_BULLET_MISS "bullet_miss"
#define SFX_CAN_OPEN "can_open"
#define SFX_CLOWN_STEP "clown_step"
#define SFX_DESECRATION "desecration"
#define SFX_EXPLOSION "explosion"
#define SFX_EXPLOSION_CREAKING "explosion_creaking"
#define SFX_HISS "hiss"
#define SFX_HONKBOT_E "honkbot_e"
#define SFX_HULL_CREAKING "hull_creaking"
#define SFX_HYPERTORUS_CALM "hypertorus_calm"
#define SFX_HYPERTORUS_MELTING "hypertorus_melting"
#define SFX_IM_HERE "im_here"
#define SFX_LAW "law"
#define SFX_PAGE_TURN "page_turn"
#define SFX_PUNCH "punch"
#define SFX_REVOLVER_SPIN "revolver_spin"
#define SFX_RICOCHET "ricochet"
#define SFX_RUSTLE "rustle"
#define SFX_SHATTER "shatter"
#define SFX_SM_CALM "sm_calm"
#define SFX_SM_DELAM "sm_delam"
#define SFX_SPARKS "sparks"
#define SFX_SUIT_STEP "suit_step"
#define SFX_SWING_HIT "swing_hit"
#define SFX_TERMINAL_TYPE "terminal_type"
#define SFX_WARPSPEED "warpspeed"
2 changes: 1 addition & 1 deletion code/controllers/subsystem/explosions.dm
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ SUBSYSTEM_DEF(explosions)
* - [creaking_sound][/sound]: The sound that plays when the station creaks during the explosion.
* - [hull_creaking_sound][/sound]: The sound that plays when the station creaks after the explosion.
*/
/datum/controller/subsystem/explosions/proc/shake_the_room(turf/epicenter, near_distance, far_distance, quake_factor, echo_factor, creaking, sound/near_sound = sound(get_sfx("explosion")), sound/far_sound = sound('sound/effects/explosionfar.ogg'), sound/echo_sound = sound('sound/effects/explosion_distant.ogg'), sound/creaking_sound = sound(get_sfx("explosion_creaking")), hull_creaking_sound = sound(get_sfx("hull_creaking")))
/datum/controller/subsystem/explosions/proc/shake_the_room(turf/epicenter, near_distance, far_distance, quake_factor, echo_factor, creaking, sound/near_sound = sound(get_sfx(SFX_SHATTER)), sound/far_sound = sound('sound/effects/explosionfar.ogg'), sound/echo_sound = sound('sound/effects/explosion_distant.ogg'), sound/creaking_sound = sound(get_sfx(SFX_EXPLOSION_CREAKING)), hull_creaking_sound = sound(get_sfx(SFX_HULL_CREAKING)))
var/frequency = get_rand_frequency()
var/blast_z = epicenter.z
if(isnull(creaking)) // Autoset creaking.
Expand Down
10 changes: 5 additions & 5 deletions code/datums/components/storage/storage.dm
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ GLOBAL_LIST_EMPTY(cached_storage_typecaches)
to_chat(M, span_warning("[parent] seems to be locked!"))
return FALSE
if(dump_destination.storage_contents_dump_act(src, M))
playsound(A, "rustle", 50, TRUE, -5)
playsound(A, SFX_RUSTLE, 50, TRUE, -5)
return TRUE
return FALSE

Expand Down Expand Up @@ -610,7 +610,7 @@ GLOBAL_LIST_EMPTY(cached_storage_typecaches)
return
if(A.loc != M)
return
playsound(A, "rustle", 50, TRUE, -5)
playsound(A, SFX_RUSTLE, 50, TRUE, -5)
if(istype(over_object, /atom/movable/screen/inventory/hand))
var/atom/movable/screen/inventory/hand/H = over_object
M.putItemFromInventoryInHandIfPossible(A, H.held_index)
Expand Down Expand Up @@ -721,7 +721,7 @@ GLOBAL_LIST_EMPTY(cached_storage_typecaches)
if(silent && !override)
return
if(rustle_sound)
playsound(parent, "rustle", 50, TRUE, -5)
playsound(parent, SFX_RUSTLE, 50, TRUE, -5)
for(var/mob/viewing in viewers(user, null))
if(M == viewing)
to_chat(usr, span_notice("You put [I] [insert_preposition]to [parent]."))
Expand Down Expand Up @@ -817,7 +817,7 @@ GLOBAL_LIST_EMPTY(cached_storage_typecaches)
return

if(rustle_sound)
playsound(A, "rustle", 50, TRUE, -5)
playsound(A, SFX_RUSTLE, 50, TRUE, -5)

if(ishuman(user))
var/mob/living/carbon/human/H = user
Expand Down Expand Up @@ -880,7 +880,7 @@ GLOBAL_LIST_EMPTY(cached_storage_typecaches)
if(!quickdraw)
A.add_fingerprint(user)
user_show_to_mob(user)
playsound(A, "rustle", 50, TRUE, -5)
playsound(A, SFX_RUSTLE, 50, TRUE, -5)
return

var/obj/item/to_remove = locate() in real_location()
Expand Down
2 changes: 1 addition & 1 deletion code/datums/components/tackle.dm
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@
/datum/component/tackler/proc/delayedSmash(obj/structure/window/W)
if(W)
W.atom_destruction()
playsound(W, "shatter", 70, TRUE)
playsound(W, SFX_SHATTER, 70, TRUE)

///Check to see if we hit a table, and if so, make a big mess!
/datum/component/tackler/proc/checkObstacle(mob/living/carbon/owner)
Expand Down
2 changes: 1 addition & 1 deletion code/datums/components/vacuum.dm
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@

// if we did indeed suck up something, play a funny noise
if (sucked)
playsound(parent, "rustle", 50, TRUE, -5)
playsound(parent, SFX_RUSTLE, 50, TRUE, -5)

/**
* Handler for when a new trash bag is attached
Expand Down
2 changes: 1 addition & 1 deletion code/datums/elements/deliver_first.dm
Original file line number Diff line number Diff line change
Expand Up @@ -93,5 +93,5 @@
var/datum/effect_system/spark_spread/spark_system = new /datum/effect_system/spark_spread()
spark_system.set_up(4, 0, target.loc)
spark_system.start()
playsound(src, "sparks", 50, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
playsound(src, SFX_SPARKS, 50, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
target.RemoveElement(/datum/element/deliver_first, goal_area_type, payment)
10 changes: 5 additions & 5 deletions code/datums/martial/wrestling.dm
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ If you make a derivative work from this code, you must include this notification
D.visible_message(span_danger("[A] throws [D]!"), \
span_userdanger("You're thrown by [A]!"), span_hear("You hear aggressive shuffling and a loud thud!"), null, A)
to_chat(A, span_danger("You throw [D]!"))
playsound(A.loc, "swing_hit", 50, TRUE)
playsound(A.loc, SFX_SWING_HIT, 50, TRUE)
var/turf/T = get_edge_target_turf(A, A.dir)
if (T && isturf(T))
if (!D.stat)
Expand Down Expand Up @@ -296,7 +296,7 @@ If you make a derivative work from this code, you must include this notification
D.visible_message(span_danger("[A] [fluff] [D]!"), \
span_userdanger("You're [fluff]ed by [A]!"), span_hear("You hear a sickening sound of flesh hitting flesh!"), COMBAT_MESSAGE_RANGE, A)
to_chat(A, span_danger("You [fluff] [D]!"))
playsound(A.loc, "swing_hit", 50, TRUE)
playsound(A.loc, SFX_SWING_HIT, 50, TRUE)
if (!D.stat)
D.emote("scream")
D.Paralyze(40)
Expand Down Expand Up @@ -342,7 +342,7 @@ If you make a derivative work from this code, you must include this notification
span_userdanger("You're headbutted by [A]!"), span_hear("You hear a sickening sound of flesh hitting flesh!"), COMBAT_MESSAGE_RANGE, A)
to_chat(A, span_danger("You headbutt [D]!"))
D.adjustBruteLoss(rand(10,20))
playsound(A.loc, "swing_hit", 50, TRUE)
playsound(A.loc, SFX_SWING_HIT, 50, TRUE)
D.Unconscious(20)
log_combat(A, D, "headbutted")

Expand All @@ -356,7 +356,7 @@ If you make a derivative work from this code, you must include this notification
D.visible_message(span_danger("[A] roundhouse-kicks [D]!"), \
span_userdanger("You're roundhouse-kicked by [A]!"), span_hear("You hear a sickening sound of flesh hitting flesh!"), COMBAT_MESSAGE_RANGE, A)
to_chat(A, span_danger("You roundhouse-kick [D]!"))
playsound(A.loc, "swing_hit", 50, TRUE)
playsound(A.loc, SFX_SWING_HIT, 50, TRUE)
D.adjustBruteLoss(rand(10,20))

var/turf/T = get_edge_target_turf(A, get_dir(A, get_step_away(D, A)))
Expand Down Expand Up @@ -422,7 +422,7 @@ If you make a derivative work from this code, you must include this notification
D.visible_message(span_danger("[A] leg-drops [D]!"), \
span_userdanger("You're leg-dropped by [A]!"), span_hear("You hear a sickening sound of flesh hitting flesh!"), null, A)
to_chat(A, span_danger("You leg-drop [D]!"))
playsound(A.loc, "swing_hit", 50, TRUE)
playsound(A.loc, SFX_SWING_HIT, 50, TRUE)
A.emote("scream")

if (falling == 1)
Expand Down
2 changes: 1 addition & 1 deletion code/datums/mutations/hulk.dm
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@
yeeted_person.visible_message(span_danger("[the_hulk] throws [yeeted_person]!"), \
span_userdanger("You're thrown by [the_hulk]!"), span_hear("You hear aggressive shuffling and a loud thud!"), null, the_hulk)
to_chat(the_hulk, span_danger("You throw [yeeted_person]!"))
playsound(the_hulk.loc, "swing_hit", 50, TRUE)
playsound(the_hulk.loc, SFX_SWING_HIT, 50, TRUE)
var/turf/T = get_edge_target_turf(the_hulk, the_hulk.dir)
if(!isturf(T))
return
Expand Down
2 changes: 1 addition & 1 deletion code/datums/status_effects/debuffs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@
new /obj/effect/temp_visual/bleed/explode(T)
for(var/d in GLOB.alldirs)
new /obj/effect/temp_visual/dir_setting/bloodsplatter(T, d)
playsound(T, "desecration", 100, TRUE, -1)
playsound(T, SFX_DESECRATION, 100, TRUE, -1)

/datum/status_effect/stacking/saw_bleed/bloodletting
id = "bloodletting"
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/buttons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
return
req_access = list()
req_one_access = list()
playsound(src, "sparks", 100, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
playsound(src, SFX_SPARKS, 100, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
obj_flags |= EMAGGED

/obj/machinery/button/attack_ai(mob/user)
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/civilian_bounties.dm
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@
addtimer(CALLBACK(src, .proc/launch_payload), 1 SECONDS)

/obj/item/civ_bounty_beacon/proc/launch_payload()
playsound(src, "sparks", 80, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
playsound(src, SFX_SPARKS, 80, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
switch(uses)
if(2)
new /obj/machinery/piratepad/civilian(drop_location())
Expand Down
4 changes: 2 additions & 2 deletions code/game/machinery/computer/apc_control.dm
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
addtimer(CALLBACK(src, .proc/restore_comp), rand(3,5) * 9)
if("access-apc")
var/ref = params["ref"]
playsound(src, "terminal_type", 50, FALSE)
playsound(src, SFX_TERMINAL_TYPE, 50, FALSE)
var/obj/machinery/power/apc/APC = locate(ref) in GLOB.apcs_list
if(!APC)
return
Expand Down Expand Up @@ -191,7 +191,7 @@
return
obj_flags |= EMAGGED
log_game("[key_name(user)] emagged [src] at [AREACOORD(src)]")
playsound(src, "sparks", 50, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
playsound(src, SFX_SPARKS, 50, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)

/obj/machinery/computer/apc_control/proc/log_activity(log_text)
if(!should_log)
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/computer/camera.dm
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
var/list/cameras = get_available_cameras()
var/obj/machinery/camera/selected_camera = cameras[c_tag]
active_camera = selected_camera
playsound(src, get_sfx("terminal_type"), 25, FALSE)
playsound(src, get_sfx(SFX_TERMINAL_TYPE), 25, FALSE)

if(!selected_camera)
return TRUE
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/computer/camera_advanced.dm
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@
if(isnull(T[camera]))
return
var/obj/machinery/camera/final = T[camera]
playsound(src, "terminal_type", 25, FALSE)
playsound(src, SFX_TERMINAL_TYPE, 25, FALSE)
if(final)
playsound(origin, 'sound/machines/terminal_prompt_confirm.ogg', 25, FALSE)
remote_eye.setLoc(get_turf(final))
Expand Down
6 changes: 3 additions & 3 deletions code/game/machinery/computer/communications.dm
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@
if (state == STATE_BUYING_SHUTTLE && can_buy_shuttles(usr) != TRUE)
return
set_state(usr, params["state"])
playsound(src, "terminal_type", 50, FALSE)
playsound(src, SFX_TERMINAL_TYPE, 50, FALSE)
if ("setStatusMessage")
if (!authenticated(usr))
return
Expand All @@ -360,7 +360,7 @@
post_status("alert", "blank")
post_status("message", line_one, line_two)
last_status_display = list(line_one, line_two)
playsound(src, "terminal_type", 50, FALSE)
playsound(src, SFX_TERMINAL_TYPE, 50, FALSE)
if ("setStatusPicture")
if (!authenticated(usr))
return
Expand All @@ -371,7 +371,7 @@
post_status(picture)
else
post_status("alert", picture)
playsound(src, "terminal_type", 50, FALSE)
playsound(src, SFX_TERMINAL_TYPE, 50, FALSE)
if ("toggleAuthentication")
// Log out if we're logged in
if (authorize_name)
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/computer/prisoner/gulag_teleporter.dm
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
prisoner.Paralyze(40) // small travel dizziness
to_chat(prisoner, span_warning("The teleportation makes you a little dizzy."))
new /obj/effect/particle_effect/sparks(get_turf(prisoner))
playsound(src, "sparks", 50, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
playsound(src, SFX_SPARKS, 50, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
if(teleporter.locked)
teleporter.locked = FALSE
teleporter.toggle_open()
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/computer/security.dm
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ What a mess.*/
to_chat(usr, span_notice("The fine has been paid in full."))
SSblackbox.ReportCitation(text2num(href_list["cdataid"]),"","","","", 0, pay)
qdel(C)
playsound(src, "terminal_type", 25, FALSE)
playsound(src, SFX_TERMINAL_TYPE, 25, FALSE)
else
to_chat(usr, span_warning("Fines can only be paid with holochips!"))

Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/computer/warrant.dm
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
to_chat(M, span_notice("The fine has been paid in full."))
SSblackbox.ReportCitation(text2num(href_list["cdataid"]),"","","","", 0, pay)
qdel(C)
playsound(src, "terminal_type", 25, FALSE)
playsound(src, SFX_TERMINAL_TYPE, 25, FALSE)
else
to_chat(M, span_warning("Fines can only be paid with holochips!"))
updateUsrDialog()
Expand Down
4 changes: 2 additions & 2 deletions code/game/machinery/doors/windowdoor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
set_density(FALSE)
QDEL_LIST(debris)
if(atom_integrity == 0)
playsound(src, "shatter", 70, TRUE)
playsound(src, SFX_SHATTER, 70, TRUE)
electronics = null
var/turf/floor = get_turf(src)
floor.air_update_turf(TRUE, FALSE)
Expand Down Expand Up @@ -274,7 +274,7 @@
obj_flags |= EMAGGED
operating = TRUE
flick("[base_state]spark", src)
playsound(src, "sparks", 75, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
playsound(src, SFX_SPARKS, 75, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
sleep(6)
operating = FALSE
desc += "<BR>[span_warning("Its access panel is smoking slightly.")]"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
obj_flags |= EMAGGED
req_access = list()
req_one_access = list()
playsound(src, "sparks", 100, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
playsound(src, SFX_SPARKS, 100, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
to_chat(user, span_warning("You short out the access controller."))

/obj/machinery/door_buttons/proc/removeMe()
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/firealarm.dm
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
if(user)
user.visible_message(span_warning("Sparks fly out of [src]!"),
span_notice("You override [src], disabling the speaker."))
playsound(src, "sparks", 50, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
playsound(src, SFX_SPARKS, 50, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
set_status()

/**
Expand Down
4 changes: 2 additions & 2 deletions code/game/machinery/newscaster.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1014,7 +1014,7 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/newscaster/security_unit, 30)
if(curr_page == 0) //We're at the start, get to the middle
screen=1
curr_page++
playsound(loc, "pageturn", 50, TRUE)
playsound(loc, SFX_PAGE_TURN, 50, TRUE)
else if(href_list["prev_page"])
if(curr_page == 0)
return
Expand All @@ -1024,7 +1024,7 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/newscaster/security_unit, 30)
if(curr_page == pages+1) //we're at the end, let's go back to the middle.
screen = 1
curr_page--
playsound(loc, "pageturn", 50, TRUE)
playsound(loc, SFX_PAGE_TURN, 50, TRUE)
if(ismob(loc))
attack_self(loc)

Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/recycler.dm
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
if(safety_mode)
safety_mode = FALSE
update_appearance()
playsound(src, "sparks", 75, TRUE, SILENCED_SOUND_EXTRARANGE)
playsound(src, SFX_SPARKS, 75, TRUE, SILENCED_SOUND_EXTRARANGE)
to_chat(user, span_notice("You use the cryptographic sequencer on [src]."))

/obj/machinery/recycler/update_icon_state()
Expand Down
4 changes: 2 additions & 2 deletions code/game/machinery/shieldgen.dm
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@
return
obj_flags |= EMAGGED
locked = FALSE
playsound(src, "sparks", 100, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
playsound(src, SFX_SPARKS, 100, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
to_chat(user, span_warning("You short out the access controller."))

/obj/machinery/shieldgen/update_icon_state()
Expand Down Expand Up @@ -450,7 +450,7 @@
return
obj_flags |= EMAGGED
locked = FALSE
playsound(src, "sparks", 100, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
playsound(src, SFX_SPARKS, 100, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
to_chat(user, span_warning("You short out the access controller."))

//////////////Containment Field START
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/slotmachine.dm
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
var/datum/effect_system/spark_spread/spark_system = new /datum/effect_system/spark_spread()
spark_system.set_up(4, 0, src.loc)
spark_system.start()
playsound(src, "sparks", 50, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
playsound(src, SFX_SPARKS, 50, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)

/obj/machinery/computer/slot_machine/ui_interact(mob/living/user)
. = ..()
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/effects/effect_system/effects_sparks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

/obj/effect/particle_effect/sparks/LateInitialize()
flick(icon_state, src)
playsound(src, "sparks", 100, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
playsound(src, SFX_SPARKS, 100, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
var/turf/T = loc
if(isturf(T))
T.hotspot_expose(1000,100)
Expand Down
Loading

0 comments on commit 684eab3

Please sign in to comment.