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
@@ -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