big steppy
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

35 line
1.3 KiB

  1. let sounds = {
  2. "crush": ["Thump.", "Crunch.", "Crrruunch.", "CRUNCH!", "CRRRUNNCH!", "SKRRRRUNCH!", "SKRRRRRRRSMASH!"],
  3. "swallow": ["Ulp.", "Gulp.", "Glrph.", "Glrrrpkh.", "Gluuuurrkph!","GLRP!","GLRRRRPKH!","GLUUUUURRPKH!"],
  4. "liquid": ["Dribble.","Splat.","Splash.","Sploosh.","SPLASH!","SPLOOSH!","SPLOOOOOOSH!"],
  5. "insert": ["Slp.","Shlp.","Shlllp.","Shlllrp.","SHLP!","SHLLLLRP!"],
  6. "drop": ["Thump.","Thump!","Splat.","Splat!","SPLAT!"],
  7. "belch": ["Burp.","Urph.","Urrrrrph.","UuuuuuuRRRRRPPHHHhhhh.","UUUURRRRPHH!","BUUUURRRRRRRRPPPHHH!"],
  8. "fart":
  9. ["Pft.","Pffft.","Pfffffbt.","Frrrrrrrt.","FRRRRRRRRPBBT!"],
  10. "scat":
  11. ["Clench.","Squeeeeeze.","Squeeeeeeeeeeeze.","Sqlllllch.","SQLLLLLLCH!"],
  12. "digest":
  13. ["Grrgle.","Grrrrgle","Grrrrlglorp.","GrrrrGLRRRLPH!","GRRRRRLGPRLHK!"],
  14. "goo":
  15. ["Splat.", "Squish.", "Squish!", "SQLCH!", "SQLLLLRCH!", "SQQQQUEEEEELLCH!"],
  16. "vomit":
  17. ["Hurk.", "Hurrk.", "Bleugh.", "Bleugh!", "Bleeeugh!", "BLEEEUGHK!"],
  18. "breath":
  19. ["Woosh.","Fwoosh.","FWOOSH.","FWOOSH!","FWOOOOOOSH!"]
  20. };
  21. function pickByMass(list, mass) {
  22. let index = Math.floor(Math.log10(mass/100)/2);
  23. index = Math.max(index, 0);
  24. if (index < list.length)
  25. return list[index];
  26. else
  27. return list[list.length-1];
  28. }
  29. function getSound(name, mass) {
  30. return pickByMass(sounds[name],mass);
  31. }