mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-23 12:07:27 +01:00
Refactors inventory items code to allow to play custom sounds, adds custom sounds to pill bottles and patch packs (#21634)
* Removed dupe playsound, sound now uses var * pill bottles now have sounds * Patch packs also have sounds * Increased patch packs volume by 4db * Moved sounds to folder, added licence and credits. * Fixed invalid sound paths
This commit is contained in:
@@ -255,6 +255,7 @@
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
item_state = "contsolid"
|
||||
belt_icon = "pill_bottle"
|
||||
use_sound = "pillbottle"
|
||||
w_class = WEIGHT_CLASS_SMALL
|
||||
can_hold = list(/obj/item/reagent_containers/food/pill)
|
||||
cant_hold = list(/obj/item/reagent_containers/food/pill/patch)
|
||||
@@ -361,6 +362,7 @@
|
||||
desc = "It's a container for storing medical patches."
|
||||
icon_state = "patch_pack"
|
||||
belt_icon = "patch_pack"
|
||||
use_sound = "patchpack"
|
||||
can_hold = list(/obj/item/reagent_containers/food/pill/patch)
|
||||
cant_hold = list()
|
||||
rapid_intake_message = "flips the lid of the patch pack open and begins rapidly stamping patches on themselves!"
|
||||
|
||||
@@ -41,7 +41,6 @@
|
||||
var/pickup_all_on_tile = TRUE
|
||||
/// Sound played when used. `null` for no sound.
|
||||
var/use_sound = "rustle"
|
||||
|
||||
/// What kind of [/obj/item/stack] can this be folded into. (e.g. Boxes and cardboard)
|
||||
var/foldable = null
|
||||
/// How much of the stack item do you get.
|
||||
@@ -141,7 +140,6 @@
|
||||
return ..()
|
||||
if(!(loc == M) || (loc && loc.loc == M))
|
||||
return
|
||||
playsound(loc, "rustle", 50, 1, -5)
|
||||
if(!M.restrained() && !M.stat)
|
||||
switch(over_object.name)
|
||||
if("r_hand")
|
||||
@@ -163,7 +161,7 @@
|
||||
. = ..()
|
||||
if(ishuman(user) && Adjacent(user) && !user.incapacitated(FALSE, TRUE))
|
||||
show_to(user)
|
||||
playsound(loc, "rustle", 50, TRUE, -5)
|
||||
playsound(loc, use_sound, 50, TRUE, -5)
|
||||
add_fingerprint(user)
|
||||
else if(isobserver(user))
|
||||
show_to(user)
|
||||
@@ -549,7 +547,7 @@
|
||||
|
||||
|
||||
/obj/item/storage/attack_hand(mob/user)
|
||||
playsound(loc, "rustle", 50, TRUE, -5)
|
||||
playsound(loc, use_sound, 50, TRUE, -5)
|
||||
|
||||
if(ishuman(user))
|
||||
var/mob/living/carbon/human/H = user
|
||||
|
||||
@@ -189,6 +189,10 @@ falloff_distance - Distance at which falloff begins. Sound is at peak volume (in
|
||||
/proc/get_sfx(soundin)
|
||||
if(istext(soundin))
|
||||
switch(soundin)
|
||||
if("patchpack")
|
||||
soundin = pick('sound/effects/CC0/patchpack1.ogg', 'sound/effects/CC0/patchpack2.ogg', 'sound/effects/CC0/patchpack3.ogg', 'sound/effects/CC0/patchpack4.ogg', 'sound/effects/CC0/patchpack5.ogg')
|
||||
if("pillbottle")
|
||||
soundin = pick('sound/effects/CC0/pillbottle1.ogg', 'sound/effects/CC0/pillbottle2.ogg', 'sound/effects/CC0/pillbottle3.ogg', 'sound/effects/CC0/pillbottle4.ogg')
|
||||
if("shatter")
|
||||
soundin = pick('sound/effects/glassbr1.ogg','sound/effects/glassbr2.ogg','sound/effects/glassbr3.ogg')
|
||||
if("explosion")
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
The sounds stored in this folder are licenced under CC0 1.0. https://creativecommons.org/publicdomain/zero/1.0/ https://creativecommons.org/publicdomain/zero/1.0/legalcode
|
||||
|
||||
Credits:
|
||||
pillbottle1.ogg, pillbottle2.ogg, pillbottle3.ogg, pillbottle4.ogg are a derivative of https://freesound.org/people/Rudmer_Rotteveel/sounds/536419/.
|
||||
patchpack1.ogg, patchpack2.ogg, patchpack3.ogg, patchpack4.ogg, patchpack5.ogg are a derivative of https://freesound.org/people/SpliceSound/sounds/188189/
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user