mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-30 16:47:13 +01:00
Refactors use_sound and changes the way tools play sounds (#35521)
* Adds list support to usesound, ports drills to usesound * Adds more tool sounds, changes usesound usage to play_tool_sound * fix
This commit is contained in:
committed by
vuonojenmustaturska
parent
6389825e39
commit
c6e607dc17
@@ -38,18 +38,18 @@
|
||||
var/obj/item/crusher_trophy/T = t
|
||||
to_chat(user, "<span class='notice'>It has \a [T] attached, which causes [T.effect_desc()].</span>")
|
||||
|
||||
/obj/item/twohanded/required/kinetic_crusher/attackby(obj/item/A, mob/living/user)
|
||||
if(istype(A, /obj/item/crowbar))
|
||||
/obj/item/twohanded/required/kinetic_crusher/attackby(obj/item/I, mob/living/user)
|
||||
if(istype(I, /obj/item/crowbar))
|
||||
if(LAZYLEN(trophies))
|
||||
to_chat(user, "<span class='notice'>You remove [src]'s trophies.</span>")
|
||||
playsound(loc, A.usesound, 100, 1)
|
||||
I.play_tool_sound(src)
|
||||
for(var/t in trophies)
|
||||
var/obj/item/crusher_trophy/T = t
|
||||
T.remove_from(src, user)
|
||||
else
|
||||
to_chat(user, "<span class='warning'>There are no trophies on [src].</span>")
|
||||
else if(istype(A, /obj/item/crusher_trophy))
|
||||
var/obj/item/crusher_trophy/T = A
|
||||
else if(istype(I, /obj/item/crusher_trophy))
|
||||
var/obj/item/crusher_trophy/T = I
|
||||
T.add_to(src, user)
|
||||
else
|
||||
return ..()
|
||||
|
||||
@@ -13,13 +13,13 @@
|
||||
w_class = WEIGHT_CLASS_BULKY
|
||||
materials = list(MAT_METAL=2000) //one sheet, but where can you make them?
|
||||
var/digspeed = 40
|
||||
var/list/digsound = list('sound/effects/picaxe1.ogg','sound/effects/picaxe2.ogg','sound/effects/picaxe3.ogg')
|
||||
usesound = list('sound/effects/picaxe1.ogg', 'sound/effects/picaxe2.ogg', 'sound/effects/picaxe3.ogg')
|
||||
attack_verb = list("hit", "pierced", "sliced", "attacked")
|
||||
|
||||
/obj/item/pickaxe/suicide_act(mob/living/user)
|
||||
user.visible_message("<span class='suicide'>[user] begins digging into their chest! It looks like [user.p_theyre()] trying to commit suicide!</span>")
|
||||
if(do_after(user,30, target = user))
|
||||
playDigSound()
|
||||
play_tool_sound(user)
|
||||
return BRUTELOSS
|
||||
user.visible_message("<span class='suicide'>[user] couldn't do it!</span>")
|
||||
return SHAME
|
||||
@@ -34,9 +34,6 @@
|
||||
w_class = WEIGHT_CLASS_NORMAL
|
||||
materials = list(MAT_METAL=1000)
|
||||
|
||||
/obj/item/pickaxe/proc/playDigSound()
|
||||
playsound(src, pick(digsound),50,1)
|
||||
|
||||
/obj/item/pickaxe/silver
|
||||
name = "silver-plated pickaxe"
|
||||
icon_state = "spickaxe"
|
||||
@@ -59,7 +56,7 @@
|
||||
item_state = "jackhammer"
|
||||
slot_flags = SLOT_BELT
|
||||
digspeed = 25 //available from roundstart, faster than a pickaxe.
|
||||
digsound = list('sound/weapons/drill.ogg')
|
||||
usesound = 'sound/weapons/drill.ogg'
|
||||
hitsound = 'sound/weapons/drill.ogg'
|
||||
desc = "An electric mining drill for the especially scrawny."
|
||||
|
||||
@@ -84,7 +81,7 @@
|
||||
icon_state = "jackhammer"
|
||||
item_state = "jackhammer"
|
||||
digspeed = 5 //the epitome of powertools. extremely fast mining, laughs at puny walls
|
||||
digsound = list('sound/weapons/sonic_jackhammer.ogg')
|
||||
usesound = 'sound/weapons/sonic_jackhammer.ogg'
|
||||
hitsound = 'sound/weapons/sonic_jackhammer.ogg'
|
||||
desc = "Cracks rocks with sonic blasts, and doubles as a demolition power tool for smashing walls."
|
||||
|
||||
@@ -99,6 +96,7 @@
|
||||
slot_flags = SLOT_BELT
|
||||
force = 8
|
||||
var/digspeed = 20
|
||||
usesound = 'sound/effects/shovel_dig.ogg'
|
||||
throwforce = 4
|
||||
item_state = "shovel"
|
||||
w_class = WEIGHT_CLASS_NORMAL
|
||||
@@ -109,7 +107,7 @@
|
||||
/obj/item/shovel/suicide_act(mob/living/user)
|
||||
user.visible_message("<span class='suicide'>[user] begins digging their own grave! It looks like [user.p_theyre()] trying to commit suicide!</span>")
|
||||
if(do_after(user,30, target = user))
|
||||
playsound(src, 'sound/effects/shovel_dig.ogg', 50, 1)
|
||||
play_tool_sound(user)
|
||||
return BRUTELOSS
|
||||
user.visible_message("<span class='suicide'>[user] couldn't do it!</span>")
|
||||
return SHAME
|
||||
|
||||
Reference in New Issue
Block a user