pfFleshwarp.js (3662B)
1 var nm1 = ["", "b", "d", "f", "g", "h", "k", "m", "n", "s", "sh", "w", "z"]; 2 var nm2 = ["a", "e", "o", "u"]; 3 var nm3 = ["cr", "gl", "gr", "mb", "mp", "rbl", "rdl", "rgl", "rn", "sb", "sk", "str", "tr", "tl", "ttl", "zb", "zl", "zk", "ztr"]; 4 var nm4 = ["a", "e", "e", "i", "i", "o", "o", "u"]; 5 var nm5 = ["f", "ff", "g", "g", "mp", "k", "m", "n", "n", "nn", "nd", "nt", "r", "r", "rd", "rm", "rn", "rt", "st", "s", "ss", "t", "tt"]; 6 var nm6 = ["", "g", "k", "m", "n", "r", "t"]; 7 var nm7 = ["mouth", "nose", "head", "chest", "back", "mouthed", "nosed", "headed", "chested", "backed", "feet", "hands", "eyes", "ears", "arms", "legs", "handed", "legged", "armed", "eared", "limbs", "limbed", "fingers", "fingered", "toes", "toed"]; 8 var nm8 = ["no", "zero", "double", "two", "twin", "extra", "split", "triple", "trice", "three", "quadrupel", "quad", "four", "five", "six", "seven", "eight", "dozen"]; 9 var nm9 = ["bark", "root", "stone", "liquid", "little", "big", "twist", "split", "twin", "break", "broken", "gore", "warp", "demon", "angel", "fiend", "bone", "craven", "dire", "long", "shrunk", "balloon", "feeble", "giant", "grim", "high", "no", "limp", "light", "low", "high", "mad", "numb"]; 10 var nm10 = ["mouth", "nose", "head", "chest", "back", "mouthed", "nosed", "headed", "chested", "backed", "feet", "hands", "eyes", "ears", "arms", "legs", "handed", "legged", "armed", "eared", "limbs", "limbed", "fingers", "fingered", "toes"]; 11 var nm11 = [" ", "-", ""]; 12 var br = ""; 13 14 function nameGen() { 15 $('#placeholder').css('textTransform', 'capitalize'); 16 var element = document.createElement("div"); 17 element.setAttribute("id", "result"); 18 for (i = 0; i < 10; i++) { 19 nameMas(); 20 while (nMs === "") { 21 nameMas(); 22 } 23 nTp = Math.random() * 2 | 0; 24 rnd11 = Math.random() * nm11.length | 0; 25 if (nTp === 0) { 26 rnd = Math.random() * nm7.length | 0; 27 if (rnd < 10) { 28 rnd2 = Math.random() * 7 | 0; 29 } else if (rnd < 20) { 30 rnd2 = Math.random() * 13 | 0; 31 } else if (rnd < 22) { 32 rnd2 = Math.random() * 17 | 0; 33 } else { 34 rnd2 = Math.random() * nm8.length | 0; 35 } 36 nMs += ", " + nm8[rnd2] + nm11[rnd11] + nm7[rnd]; 37 } else { 38 rnd = Math.random() * nm9.length | 0; 39 rnd2 = Math.random() * nm10.length | 0; 40 nMs += ", " + nm9[rnd] + nm11[rnd11] + nm10[rnd2]; 41 } 42 br = document.createElement('br'); 43 element.appendChild(document.createTextNode(nMs)); 44 element.appendChild(br); 45 } 46 if (document.getElementById("result")) { 47 document.getElementById("placeholder").removeChild(document.getElementById("result")); 48 } 49 document.getElementById("placeholder").appendChild(element); 50 } 51 52 function nameMas() { 53 nTp = Math.random() * 6 | 0; 54 rnd = Math.random() * nm1.length | 0; 55 rnd2 = Math.random() * nm2.length | 0; 56 if (nTp < 2) { 57 rnd3 = Math.random() * nm5.length | 0; 58 while (nm1[rnd] === "" || nm1[rnd] === nm5[rnd3]) { 59 rnd = Math.random() * nm1.length | 0; 60 } 61 nMs = nm1[rnd] + nm2[rnd2] + nm5[rnd3]; 62 } else { 63 rnd3 = Math.random() * nm3.length | 0; 64 rnd4 = Math.random() * nm4.length | 0; 65 rnd5 = Math.random() * nm6.length | 0; 66 if (nm3[rnd3] > 8) { 67 while (nm3[rnd3] === nm1[rnd] || nm3[rnd3] === nm6[rnd5]) { 68 rnd3 = Math.random() * nm3.length | 0; 69 } 70 } 71 nMs = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm4[rnd4] + nm6[rnd5]; 72 } 73 testSwear(nMs); 74 }