Refactors sound groups to use decls instead of a massive switch with dozens of global lists. (#9702)

This commit is contained in:
Matt Atlas
2020-08-28 20:47:00 +02:00
committed by GitHub
parent db1b0cece0
commit 0dd08df5b2
125 changed files with 629 additions and 557 deletions
+2 -2
View File
@@ -16,7 +16,7 @@
var/obj/item/projectile/BB = null //The loaded bullet - make it so that the projectiles are created only when needed?
var/spent_icon = "s-casing-spent"
drop_sound = "casing_drop"
drop_sound = /decl/sound_category/casing_drop_sound
pickup_sound = 'sound/items/pickup/ring.ogg'
var/reload_sound = 'sound/weapons/reload_bullet.ogg' //sound that plays when inserted into gun.
@@ -147,7 +147,7 @@
to_chat(user, "<span class='notice'>You empty [src].</span>")
for(var/obj/item/ammo_casing/C in stored_ammo)
C.forceMove(user.loc)
playsound(C, "casing_drop", 50, FALSE)
playsound(C, /decl/sound_category/casing_drop_sound, 50, FALSE)
C.set_dir(pick(alldirs))
stored_ammo.Cut()
update_icon()
+1 -1
View File
@@ -104,7 +104,7 @@
var/wielded = 0
var/needspin = TRUE
var/is_wieldable = FALSE
var/wield_sound = "wield_generic"
var/wield_sound = /decl/sound_category/generic_wield_sound
var/unwield_sound = null
//aiming system stuff
@@ -11,7 +11,7 @@
sharp = 1
edge = 0
drop_sound = 'sound/items/drop/sword.ogg'
pickup_sound = "pickup_sword"
pickup_sound = /decl/sound_category/sword_pickup_sound
/obj/item/arrow/proc/removed() //Helper for metal rods falling apart.
return
@@ -27,7 +27,7 @@
icon_state = "metal-rod"
item_state = "bolt"
drop_sound = 'sound/items/drop/sword.ogg'
pickup_sound = "pickup_sword"
pickup_sound = /decl/sound_category/sword_pickup_sound
/obj/item/arrow/quill
name = "vox quill"
+2 -2
View File
@@ -106,7 +106,7 @@
if(EJECT_CASINGS) //eject casing onto ground.
chambered.forceMove(get_turf(src))
chambered.throw_at(get_ranged_target_turf(get_turf(src),turn(loc.dir,270),1), rand(0,1), 5)
playsound(chambered, "casing_drop", 50, FALSE)
playsound(chambered, /decl/sound_category/casing_drop_sound, 50, FALSE)
if(CYCLE_CASINGS) //cycle the casing back to the end.
if(ammo_magazine)
ammo_magazine.stored_ammo += chambered
@@ -188,7 +188,7 @@
if(T)
for(var/obj/item/ammo_casing/C in loaded)
C.forceMove(T)
playsound(C, "casing_drop", 50, FALSE)
playsound(C, /decl/sound_category/casing_drop_sound, 50, FALSE)
count++
loaded.Cut()
if(count)
@@ -236,7 +236,7 @@
item_state = "gauss_thumper"
caliber = "gauss"
origin_tech = list(TECH_COMBAT = 3, TECH_MATERIAL = 2)
fire_sound = "gauss_fire"
fire_sound = /decl/sound_category/gauss_fire_sound
load_method = MAGAZINE
handle_casings = DELETE_CASINGS
@@ -265,7 +265,7 @@
desc = "An outdated and power hungry gauss cannon, modified to deliver high explosive rounds at high velocities."
icon = 'icons/obj/guns/gauss_thumper.dmi'
icon_state = "gauss_thumper"
fire_sound = "gauss_fire"
fire_sound = /decl/sound_category/gauss_fire_sound
fire_delay = 30
charge_meter = 0
max_shots = 3
+1 -1
View File
@@ -182,7 +182,7 @@
if(result == PROJECTILE_FORCE_MISS && (can_miss == 0)) //if you're shooting at point blank you can't miss.
if(!silenced)
target_mob.visible_message("<span class='notice'>\The [src] misses [target_mob] narrowly!</span>")
playsound(target_mob, "bulletflyby", rand(10, 50), 1)
playsound(target_mob, /decl/sound_category/bulletflyby_sound, 50, 1)
return FALSE
//hit messages
@@ -267,7 +267,7 @@
/obj/item/projectile/magic/teleport/on_hit(var/atom/hit_atom)
var/turf/T = get_turf(hit_atom)
single_spark(T)
playsound(src.loc, "sparks", 50, 1)
playsound(src.loc, /decl/sound_category/spark_sound, 50, 1)
if(isliving(hit_atom))
blink_mob(hit_atom)
return ..()