dndSatyrs.js (6275B)
1 var nm1 = ["", "", "", "d", "f", "k", "n", "p", "sp", "t", "z"]; 2 var nm2 = ["eo", "y", "a", "e", "i", "o"]; 3 var nm3 = ["f", "k", "l", "m", "n", "nt", "r"]; 4 var nm4 = ["ia", "y", "a", "e", "i", "y", "a", "e", "i"]; 5 var nm5 = ["k", "l", "m", "n", "pp", "r", "t", "v", "z"]; 6 var nm6 = ["ia", "a", "i", "o", "o", "o"]; 7 var nm7 = ["", "n", "s", "s", "s", "n", "s", "s", "s", "n", "s", "s", "s"]; 8 var nm8 = ["ch", "d", "k", "l", "n", "t", "x", "y", "z", "", ""]; 9 var nm9 = ["ei", "ai", "oi", "a", "e", "i", "o", "a", "e", "i", "o", "a", "e", "i", "o", "a", "e", "i", "o"]; 10 var nm10 = ["fn", "k", "l", "lp", "n", "nn", "r", "s", "t", "vr"]; 11 var nm11 = ["a", "e", "i", "i"]; 12 var nm12 = ["d", "l", "n", "r", "y"]; 13 var nm13 = ["ia", "oi", "oe", "a", "i", "a", "i", "a", "i", "a", "i", "a", "i", "a", "i"]; 14 var nm14 = ["amber", "auburn", "bristle", "bronze", "copper", "crimson", "dapple", "fawn", "frazzle", "frizzle", "ginger", "hazel", "messy", "orange", "ragged", "rough", "scarlet", "scraggy", "scruffle", "scruffy", "shaggy", "stubble", "umber"]; 15 var nm15 = ["back", "beard", "chin", "crest", "crown", "fluff", "fringe", "fur", "fuzz", "hair", "mane", "ridge", "ruff", "tuft"]; 16 var nm16 = ["dark", "flat", "free", "great", "hard", "keen", "little", "nobble", "proud", "quick", "skip", "still", "stout", "strong", "stubby", "swift", "twinkle"]; 17 var nm17 = ["horn", "horns", "foot", "hoof", "hoofs", "hooves", "feet"]; 18 var nm18 = ["Arrow", "Bash", "Basher", "Berry", "Bigby", "Bitsy", "Blaze", "Blossom", "Blush", "Blusher", "Bouncer", "Bounder", "Buster", "Caper", "Chip", "Comet", "Crimson", "Cuddles", "Curles", "Dancer", "Diamond", "Digger", "Dimple", "Dimples", "Dizzy", "Dusty", "Ember", "Flounce", "Flutters", "Fuzz", "Fuzzy", "Gambol", "Grace", "Grouch", "Happy", "Hopper", "Jitter", "Jolly", "Kindle", "Leaper", "Little", "Lopper", "Lucky", "Mellow", "Mistletoe", "Mouse", "Mugs", "Mugsy", "Nimble", "Parade", "Petal", "Pitch", "Plummet", "Prancer", "Pyro", "Quickstep", "Rags", "Rebel", "Red", "Robin", "Rose", "Rouge", "Ruby", "Rusty", "Scruffy", "Shimmer", "Shimmy", "Sketch", "Skip", "Skipper", "Skippy", "Slick", "Slim", "Smiles", "Smiley", "Spark", "Sparkle", "Sparkles", "Sparrow", "Spike", "Springstep", "Stretch", "Strutter", "Thunder", "Torch", "Tricks", "Tricky", "Twinkle", "Twinkles", "Twitch", "Waver", "Wiggles", "Wobble", "Zero", "Ziggy"]; 19 var br = ""; 20 21 function nameGen(type) { 22 $('#placeholder').css('textTransform', 'capitalize'); 23 var tp = type; 24 var element = document.createElement("div"); 25 element.setAttribute("id", "result"); 26 for (i = 0; i < 10; i++) { 27 if (tp === 2) { 28 nTp = Math.random() * 5 | 0; 29 if (nTp === 0) { 30 rnd = Math.random() * nm18.length | 0; 31 nMs = nm18[rnd]; 32 } else if (nTp < 3) { 33 rnd = Math.random() * nm14.length | 0; 34 rnd2 = Math.random() * nm15.length | 0; 35 while (nm14[rnd] === nm15[rnd2]) { 36 rnd2 = Math.random() * nm15.length | 0; 37 } 38 nMs = nm14[rnd] + nm15[rnd2]; 39 } else { 40 rnd = Math.random() * nm16.length | 0; 41 rnd2 = Math.random() * nm17.length | 0; 42 while (nm16[rnd] === nm17[rnd2]) { 43 rnd2 = Math.random() * nm17.length | 0; 44 } 45 nMs = nm16[rnd] + nm17[rnd2]; 46 } 47 } else if (tp === 1) { 48 nameFem(); 49 while (nMs === "") { 50 nameFem(); 51 } 52 } else { 53 nameMas(); 54 while (nMs === "") { 55 nameMas(); 56 } 57 } 58 br = document.createElement('br'); 59 element.appendChild(document.createTextNode(nMs)); 60 element.appendChild(br); 61 } 62 if (document.getElementById("result")) { 63 document.getElementById("placeholder").removeChild(document.getElementById("result")); 64 } 65 document.getElementById("placeholder").appendChild(element); 66 } 67 68 function nameFem() { 69 nTp = Math.random() * 8 | 0; 70 if (nTp === 0) { 71 rnd = Math.random() * 9 | 0; 72 rnd2 = Math.random() * 3 | 0; 73 nMs = nm8[rnd] + nm13[rnd2]; 74 } else { 75 rnd = Math.random() * nm8.length | 0; 76 rnd2 = Math.random() * nm9.length | 0; 77 rnd3 = Math.random() * nm10.length | 0; 78 rnd4 = Math.random() * nm13.length | 0; 79 if (nTp < 3) { 80 while (nm8[rnd] === nm10[rnd3]) { 81 rnd3 = Math.random() * nm10.length | 0; 82 } 83 while (rnd2 < 3) { 84 rnd2 = Math.random() * nm9.length | 0; 85 } 86 nMs = nm8[rnd] + nm9[rnd2] + nm10[rnd3] + nm13[rnd4]; 87 } else { 88 rnd5 = Math.random() * nm11.length | 0; 89 rnd6 = Math.random() * nm12.length | 0; 90 while (nm12[rnd6] === nm10[rnd3] && nm10[rnd3] === nm8[rnd]) { 91 rnd3 = Math.random() * nm10.length | 0; 92 } 93 while (rnd2 < 3 && rnd4 < 3) { 94 rnd2 = Math.random() * nm9.length | 0; 95 } 96 nMs = nm8[rnd] + nm9[rnd2] + nm10[rnd3] + nm11[rnd5] + nm12[rnd6] + nm13[rnd4]; 97 } 98 } 99 testSwear(nMs); 100 } 101 102 function nameMas() { 103 nTp = Math.random() * 2 | 0; 104 rnd = Math.random() * nm1.length | 0; 105 rnd2 = Math.random() * nm2.length | 0; 106 rnd3 = Math.random() * nm3.length | 0; 107 rnd4 = Math.random() * nm6.length | 0; 108 rnd5 = Math.random() * nm7.length | 0; 109 while (rnd2 === 0 && rnd4 === 0) { 110 rnd2 = Math.random() * nm2.length | 0; 111 } 112 if (nTp === 0) { 113 while (nm3[rnd3] === nm7[rnd5] && nm3[rnd3] === nm1[rnd]) { 114 rnd3 = Math.random() * nm3.length | 0; 115 } 116 nMs = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm6[rnd4] + nm7[rnd5]; 117 } else { 118 rnd6 = Math.random() * nm4.length | 0; 119 rnd7 = Math.random() * nm5.length | 0; 120 while (nm3[rnd5] === nm5[rnd3] && nm3[rnd5] === nm1[rnd]) { 121 rnd5 = Math.random() * nm3.length | 0; 122 } 123 while (rnd6 === 0 && rnd4 === 0) { 124 rnd6 = Math.random() * nm4.length | 0; 125 } 126 nMs = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm4[rnd6] + nm5[rnd7] + nm6[rnd4] + nm7[rnd5]; 127 } 128 testSwear(nMs); 129 }