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
@@ -234,7 +234,7 @@
/obj/item/device/lightreplacer/emag_act(var/remaining_charges, var/mob/user)
emagged = !emagged
playsound(src.loc, "sparks", 100, 1)
playsound(src.loc, /decl/sound_category/spark_sound, 100, 1)
update_icon()
return 1
@@ -48,7 +48,7 @@ var/global/list/default_medbay_channels = list(
matter = list(DEFAULT_WALL_MATERIAL = 75, MATERIAL_GLASS = 25)
var/const/FREQ_LISTENING = TRUE
var/list/internal_channels
var/clicksound = "button" //played sound on usage
var/clicksound = /decl/sound_category/button_sound //played sound on usage
var/clickvol = 10 //volume
+2 -2
View File
@@ -306,8 +306,8 @@
icon_state = "katana"
item_state = "katana"
drop_sound = 'sound/items/drop/gun.ogg'
pickup_sound = "pickup_sword"
equip_sound = "equip_sword"
pickup_sound = /decl/sound_category/sword_pickup_sound
equip_sound = /decl/sound_category/sword_equip_sound
flags = CONDUCT
slot_flags = SLOT_BELT | SLOT_BACK
force = 5
@@ -6,5 +6,5 @@
/obj/item/grenade/fake/prime()
active = 0
playsound(src.loc, get_sfx("explosion"), 50, 1, 30)
playsound(src.loc, get_sfx(/decl/sound_category/explosion_sound), 50, 1, 30)
icon_state = "frag"
@@ -17,8 +17,8 @@
can_embed = 0
var/parry_chance = 40
drop_sound = 'sound/items/drop/sword.ogg'
pickup_sound = "pickup_sword"
equip_sound = "equip_sword"
pickup_sound = /decl/sound_category/sword_pickup_sound
equip_sound = /decl/sound_category/sword_equip_sound
/obj/item/material/sword/handle_shield(mob/user, var/on_back, var/damage, atom/damage_source = null, mob/attacker = null, var/def_zone = null, var/attack_text = "the attack")
var/parry_bonus = 1
@@ -21,7 +21,7 @@
var/wielded = 0
var/force_wielded = 0
var/force_unwielded
var/wield_sound = "wield_generic"
var/wield_sound = /decl/sound_category/generic_wield_sound
var/unwield_sound = null
var/base_icon
var/base_name
@@ -34,8 +34,8 @@
slot_r_hand_str = 'icons/mob/items/weapons/righthand_twohanded.dmi'
)
drop_sound = 'sound/items/drop/sword.ogg'
pickup_sound = "pickup_sword"
equip_sound = "equip_sword"
pickup_sound = /decl/sound_category/sword_pickup_sound
equip_sound = /decl/sound_category/sword_equip_sound
hitsound = 'sound/weapons/bladeslice.ogg'
/obj/item/material/twohanded/proc/wield()
@@ -88,7 +88,7 @@
/obj/item/material/twohanded/handle_shield(mob/user, var/on_back, var/damage, atom/damage_source = null, mob/attacker = null, var/def_zone = null, var/attack_text = "the attack")
if(wielded && default_parry_check(user, attacker, damage_source) && prob(parry_chance))
user.visible_message("<span class='danger'>\The [user] parries [attack_text] with \the [src]!</span>")
playsound(user.loc, "punchmiss", 50, 1)
playsound(user.loc, /decl/sound_category/punchmiss_sound, 50, 1)
return 1
return 0
@@ -324,8 +324,8 @@
active_w_class = 3
w_class = 3
drop_sound = 'sound/items/drop/sword.ogg'
pickup_sound = "pickup_sword"
equip_sound = "equip_sword"
pickup_sound = /decl/sound_category/sword_pickup_sound
equip_sound = /decl/sound_category/sword_equip_sound
/obj/item/melee/energy/sword/powersword/activate(mob/living/user)
..()
@@ -42,7 +42,7 @@
var/obj/item/melee/energy/blade/blade = W
blade.spark_system.queue()
playsound(src.loc, 'sound/weapons/blade.ogg', 50, 1)
playsound(src.loc, "sparks", 50, 1)
playsound(src.loc, /decl/sound_category/spark_sound, 50, 1)
if(!locked)
..()
else
@@ -3,7 +3,7 @@
desc = "It's a small container with dice inside."
icon = 'icons/obj/dice.dmi'
icon_state = "dicebag"
use_sound = "rustle"
use_sound = /decl/sound_category/rustle_sound
drop_sound = 'sound/items/drop/hat.ogg'
pickup_sound = 'sound/items/pickup/hat.ogg'
starts_with = list(
@@ -29,8 +29,8 @@
icon_state = "card_holder_empty"
can_hold = list(/obj/item/deck, /obj/item/battle_monsters/deck, /obj/item/hand, /obj/item/pack/, /obj/item/card) //sneaky folks can hide ID and other cards
storage_slots = 1 //can hold one deck
use_sound = "sound/items/drop/shoes.ogg"
drop_sound = "sound/items/drop/hat.ogg"
use_sound = 'sound/items/drop/shoes.ogg'
drop_sound = 'sound/items/drop/hat.ogg'
/obj/item/storage/card/update_icon()
if(contents.len)
@@ -38,7 +38,7 @@
var/obj/item/melee/energy/blade/blade = W
blade.spark_system.queue()
playsound(src.loc, 'sound/weapons/blade.ogg', 50, 1)
playsound(src.loc, "sparks", 50, 1)
playsound(src.loc, /decl/sound_category/spark_sound, 50, 1)
return
if (W.isscrewdriver())
@@ -37,7 +37,7 @@
var/allow_quick_empty //Set this variable to allow the object to have the 'empty' verb, which dumps all the contents on the floor.
var/allow_quick_gather //Set this variable to allow the object to have the 'toggle mode' verb, which quickly collects all items from a tile.
var/collection_mode = 1 //0 = pick one at a time, 1 = pick all on tile
var/use_sound = "rustle" //sound played when used. null for no sound.
var/use_sound = /decl/sound_category/rustle_sound //sound played when used. null for no sound.
var/list/starts_with // for pre-filled items
var/empty_delay = 0 SECOND // time it takes to empty bag. this is multiplies by number of objects stored
+1 -1
View File
@@ -94,7 +94,7 @@
if(bcell && bcell.charge > hitcost)
status = !status
to_chat(user, "<span class='notice'>[src] is now [status ? "on" : "off"].</span>")
playsound(loc, "sparks", 75, 1, -1)
playsound(loc, /decl/sound_category/spark_sound, 75, 1, -1)
update_icon()
else
status = 0
@@ -66,7 +66,7 @@
desc = "You can drill using this item. You dig?"
icon_state = "drill"
item_state = "drill"
hitsound = "drillhit"
hitsound = /decl/sound_category/drillhit_sound
matter = list(DEFAULT_WALL_MATERIAL = 15000, MATERIAL_GLASS = 10000)
flags = CONDUCT
force = 15.0
+1 -1
View File
@@ -602,7 +602,7 @@
w_class = ITEMSIZE_SMALL
drop_sound = 'sound/items/drop/crowbar.ogg'
pickup_sound = 'sound/items/pickup/crowbar.ogg'
usesound = "crowbar"
usesound = /decl/sound_category/crowbar_sound
origin_tech = list(TECH_ENGINEERING = 1)
matter = list(DEFAULT_WALL_MATERIAL = 50)
attack_verb = list("attacked", "bashed", "battered", "bludgeoned", "whacked")
@@ -385,7 +385,7 @@
icon = 'icons/obj/vaurca_items.dmi'
icon_state = "gaussrifle"
item_state = "gaussrifle"
fire_sound = "gauss_fire"
fire_sound = /decl/sound_category/gauss_fire_sound
fire_sound_text = "a subdued boom"
fire_delay = 12
slot_flags = SLOT_BACK
+2 -2
View File
@@ -163,8 +163,8 @@
hitsound = 'sound/weapons/bladeslice.ogg'
contained_sprite = TRUE
drop_sound = 'sound/items/drop/sword.ogg'
pickup_sound = "pickup_sword"
equip_sound = "equip_sword"
pickup_sound = /decl/sound_category/sword_pickup_sound
equip_sound = /decl/sound_category/sword_equip_sound
/obj/item/sord
name = "\improper SORD"