|
|
|
@@ -1,34 +1,47 @@ |
|
|
|
let last_used = {}; |
|
|
|
|
|
|
|
let sounds = { |
|
|
|
"crush": ["Thump.", "Crunch.", "Crrruunch.", "CRUNCH!", "CRRRUNNCH!", "SKRRRRUNCH!", "SKRRRRRRRSMASH!"], |
|
|
|
"swallow": ["Ulp.", "Gulp.", "Glrph.", "Glrrrpkh.", "Gluuuurrkph!","GLRP!","GLRRRRPKH!","GLUUUUURRPKH!"], |
|
|
|
"liquid": ["Dribble.","Splat.","Splash.","Sploosh.","SPLASH!","SPLOOSH!","SPLOOOOOOSH!"], |
|
|
|
"insert": ["Slp.","Shlp.","Shlllp.","Shlllrp.","SHLP!","SHLLLLRP!"], |
|
|
|
"drop": ["Thump.","Thump!","Splat.","Splat!","SPLAT!"], |
|
|
|
"belch": ["Burp.","Urph.","Urrrrrph.","UuuuuuuRRRRRPPHHHhhhh.","UUUURRRRPHH!","BUUUURRRRRRRRPPPHHH!"], |
|
|
|
"crush": [["Thump.", "Thoomp."], ["Crunch."], ["Crrruunch."], ["CRUNCH!"], ["CRRRUNNCH!"], ["SKRRRRUNCH!"], ["SKRRRRRRRSMASH!"]], |
|
|
|
"swallow": [["Ulp.", "Glp.", "Slurp."], ["Glrph.", "Glurk."], ["Gluuuurrkph!", "Glurp - GLK."],["GLRP!", "GULP!", "GLUK!"],["GLRRRRPKH!", "GLUUUURK!"],["GLUUUUURRPKH!", "GLOOOORPH-GLK!"]], |
|
|
|
"liquid": [["Dribble."],["Splat."],["Splash."],["Sploosh."],["SPLASH!"],["SPLOOSH!"],["SPLOOOOOOSH!"]], |
|
|
|
"insert": [["Slp.", "Shlk."],["Shlp.", "Shlrp."],["Shlllp."],["SHLP!", "SQUELCH!"],["SHLLLLRP!"]], |
|
|
|
"drop": [["Thump."],["Thump!"],["Splat."],["Splat!"],["SPLAT!"]], |
|
|
|
"belch": [["Burp.", "Urp."],["Urph.", "Burph."],["Urrrrrph."],["UuuuuuuRRRRRPPHHHhhhh."],["UUUURRRRPHH!"],["BUUUURRRRRRRRPPPHHH!"]], |
|
|
|
"fart": |
|
|
|
["Pft.","Pffft.","Pfffffbt.","Frrrrrrrt.","FRRRRRRRRPBBT!"], |
|
|
|
[["Pft."],["Pffft."],["Pfffffbt."],["Frrrrrrrt."],["FRRRRRRRRPBBT!"]], |
|
|
|
"scat": |
|
|
|
["Clench.","Squeeeeeze.","Squeeeeeeeeeeeze.","Sqlllllch.","SQLLLLLLCH!"], |
|
|
|
[["Clench."],["Squeeeeeze."],["Squeeeeeeeeeeeze."],["Sqlllllch."],["SQLLLLLLCH!"]], |
|
|
|
"digest": |
|
|
|
["Grrgle.","Grrrrgle","Grrrrlglorp.","GrrrrGLRRRLPH!","GRRRRRLGPRLHK!"], |
|
|
|
[["Grrgle."],["Grrrrgle"],["Grrrrlglorp."],["GrrrrGLRRRLPH!"],["GRRRRRLGPRLHK!"]], |
|
|
|
"goo": |
|
|
|
["Splat.", "Squish.", "Squish!", "SQLCH!", "SQLLLLRCH!", "SQQQQUEEEEELLCH!"], |
|
|
|
[["Splat."], ["Squish."], ["Squish!"], ["SQLCH!"], ["SQLLLLRCH!"], ["SQQQQUEEEEELLCH!"]], |
|
|
|
"vomit": |
|
|
|
["Hurk.", "Hurrk.", "Bleugh.", "Bleugh!", "Bleeeugh!", "BLEEEUGHK!"], |
|
|
|
[["Hurk."], ["Hurrk."], ["Bleugh."], ["Bleugh!"], ["Bleeeugh!"], ["BLEEEUGHK!"]], |
|
|
|
"breath": |
|
|
|
["Woosh.","Fwoosh.","FWOOSH.","FWOOSH!","FWOOOOOOSH!"] |
|
|
|
[["Woosh."],["Fwoosh."],["FWOOSH."],["FWOOSH!"],["FWOOOOOOSH!"]], |
|
|
|
"chew": |
|
|
|
[["Snap.", "Crack."],["Crunch."],["Crack!"],["CRUNCH!"],["CRRRUNCH!"]] |
|
|
|
}; |
|
|
|
|
|
|
|
function pickByMass(list, mass) { |
|
|
|
function pickByMass(name, mass) { |
|
|
|
let list = sounds[name]; |
|
|
|
let index = Math.floor(Math.log10(mass/100)/2); |
|
|
|
index = Math.max(index, 0); |
|
|
|
|
|
|
|
if (index < list.length) |
|
|
|
return list[index]; |
|
|
|
else |
|
|
|
return list[list.length-1]; |
|
|
|
choice = index < list.length ? list[index] : list[list.length-1]; |
|
|
|
|
|
|
|
let subindex = Math.floor(Math.random() * Math.floor(choice.length)); |
|
|
|
|
|
|
|
// less likely to repeat |
|
|
|
if (last_used[name] != undefined && last_used[name] == subindex) { |
|
|
|
subindex = Math.floor(Math.random() * Math.floor(choice.length)); |
|
|
|
} |
|
|
|
|
|
|
|
last_used[name] = subindex; |
|
|
|
|
|
|
|
return choice[subindex]; |
|
|
|
} |
|
|
|
|
|
|
|
function getSound(name, mass) { |
|
|
|
return pickByMass(sounds[name],mass); |
|
|
|
return "<i>" + pickByMass(name,mass) + "</i>"; |
|
|
|
} |