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.
 
 
 

31 lines
1.1 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. };
  17. function pickByMass(list, mass) {
  18. let index = Math.floor(Math.log10(mass/100)/2);
  19. index = Math.max(index, 0);
  20. if (index < list.length)
  21. return list[index];
  22. else
  23. return list[list.length-1];
  24. }
  25. function getSound(name, mass) {
  26. return pickByMass(sounds[name],mass);
  27. }