From ea9c4f04610e5b559fbdf781335f2ecc82c70eb2 Mon Sep 17 00:00:00 2001 From: SandPoot Date: Sun, 4 Aug 2024 02:42:57 -0300 Subject: [PATCH] push --- .../code/datums/interactions/_interaction.dm | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/modular_sand/code/datums/interactions/_interaction.dm b/modular_sand/code/datums/interactions/_interaction.dm index 523df46fb2..374a0bd4e2 100644 --- a/modular_sand/code/datums/interactions/_interaction.dm +++ b/modular_sand/code/datums/interactions/_interaction.dm @@ -141,5 +141,15 @@ /datum/interaction/proc/post_interaction(mob/living/user, mob/living/target) COOLDOWN_START(user, last_interaction_time, 0.6 SECONDS) if(interaction_sound) - playsound(get_turf(user), interaction_sound, 50, 1, -1) + var/soundfile_to_play + + // pickweight so you can make a certain sound play + // more times. This does NOT mean you are forced to + // use the system. If you do not make the list + // associative, all options will have the same chances! + if(islist(interaction_sound)) + soundfile_to_play = pickweight(interaction_sound) + else + soundfile_to_play = interaction_sound + playsound(get_turf(user), soundfile_to_play, 50, 1, -1) return