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

86 lines
4.7 KiB
JavaScript

var nm1 = ["b", "br", "d", "dr", "g", "gr", "n", "k", "kr", "r", "t", "th", "v", "y", "z"];
var nm2 = ["a", "a", "e", "o", "u", "u"];
var nm3 = ["d", "g", "dd", "ll", "m", "r", "z", "zz", "dr", "gr", "ld", "lg", "md", "mr", "nd", "nr", "rg", "rl", "rn", "zk", "zr"];
var nm4 = ["eo", "ea", "uu", "a", "o", "u", "a", "o", "u", "a", "o", "u", "a", "o", "u", "a", "o", "u", "a", "o", "u", "a", "o", "u", "a", "o", "u", "a", "o", "u", "a", "o", "u", "a", "o", "u"];
var nm5 = ["g", "gg", "k", "l", "n", "r", "g", "gg", "k", "l", "n", "r", "rg", "rk", "rn", "rt", "th", "th"];
var nm6 = ["amber", "ash", "barb", "battle", "beast", "bitter", "black", "blaze", "blood", "blunt", "bone", "boulder", "brick", "bristle", "bronze", "brown", "burn", "burning", "cask", "chain", "chest", "cinder", "coal", "cold", "dark", "dead", "death", "dew", "dim", "dirt", "doom", "dust", "earth", "ember", "fern", "fire", "flame", "flint", "frost", "froth", "fuse", "gloom", "gold", "gore", "granite", "gravel", "green", "grim", "grizzly", "gut", "guts", "hell", "hill", "hollow", "horn", "horse", "iron", "keg", "krag", "lone", "long", "man", "metal", "molten", "mourn", "mud", "nether", "oat", "orb", "ore", "pebble", "poison", "pyre", "rage", "rain", "rock", "rough", "rumble", "saur", "saw", "serpent", "shade", "shadow", "simple", "skull", "slate", "slaughter", "snow", "stone", "storm", "stout", "strong", "thunder", "titan", "tusk", "twilight", "void", "war", "wild"];
var nm7 = ["back", "bane", "bash", "basher", "beard", "belly", "belt", "bender", "bite", "biter", "blade", "blaze", "blight", "blood", "bone", "brace", "branch", "breaker", "breath", "bringer", "brow", "buckle", "buster", "chaser", "chew", "chewer", "cleaver", "crest", "crush", "crusher", "curse", "cut", "cutter", "dig", "digger", "doom", "eater", "eye", "eyes", "fall", "feet", "field", "fire", "fist", "flame", "flayer", "foot", "force", "forge", "fury", "gaze", "gazer", "gloom", "grip", "hammer", "hand", "head", "hell", "hole", "house", "howl", "hunter", "lash", "limb", "mark", "maul", "maw", "might", "mourn", "munch", "muncher", "pelt", "punch", "rage", "reaper", "reaver", "ripper", "roar", "scar", "seeker", "shoulder", "slayer", "snarl", "spine", "splinter", "splitter", "strength", "stride", "strider", "striker", "teeth", "tooth", "watcher"];
var br = "";
function nameGen(type) {
$('#placeholder').css('textTransform', 'capitalize');
var tp = type;
var element = document.createElement("div");
element.setAttribute("id", "result");
for (i = 0; i < 10; i++) {
if (tp === 1) {
nameFem();
while (nMs === "") {
nameFen();
}
} else {
nameMas();
while (nMs === "") {
nameMas();
}
}
rnd = Math.random() * nm6.length | 0;
rnd2 = Math.random() * nm7.length | 0;
while (nm6[rnd] === nm7[rnd2]) {
rnd2 = Math.random() * nm7.length | 0;
}
nMs = nMs + " " + nm6[rnd] + nm7[rnd2];
br = document.createElement('br');
element.appendChild(document.createTextNode(nMs));
element.appendChild(br);
}
if (document.getElementById("result")) {
document.getElementById("placeholder").removeChild(document.getElementById("result"));
}
document.getElementById("placeholder").appendChild(element);
}
function nameMas() {
nTp = Math.random() * 7 | 0;
rnd = Math.random() * nm1.length | 0;
rnd2 = Math.random() * nm2.length | 0;
rnd5 = Math.random() * nm5.length | 0;
if (nTp < 4) {
while (nm5[rnd5] < 12 && nm1[rnd] === "") {
rnd5 = Math.random() * nm5.length | 0;
}
nMs = nm1[rnd] + nm2[rnd2] + nm5[rnd5];
} else {
rnd3 = Math.random() * nm3.length | 0;
rnd4 = Math.random() * nm4.length | 0;
while (nm3[rnd3] === nm5[rnd5] || nm3[rnd3] === nm1[rnd]) {
rnd3 = Math.random() * nm3.length | 0;
}
nMs = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm4[rnd4] + nm5[rnd5];
}
testSwear(nMs);
}
function nameFem() {
nTp = Math.random() * 7 | 0;
rnd = Math.random() * nm1.length | 0;
rnd2 = Math.random() * nm2.length | 0;
rnd3 = Math.random() * nm3.length | 0;
rnd4 = Math.random() * nm4.length | 0;
while (nm3[rnd3] === nm1[rnd]) {
rnd3 = Math.random() * nm3.length | 0;
}
if (nTp < 4) {
nMs = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm4[rnd4];
} else {
if (rnd3 > 8) {
rnd5 = Math.random() * 8 | 0;
} else {
rnd5 = Math.random() * nm3.length | 0;
}
rnd6 = Math.random() * nm2.length | 0;
nMs = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm2[rnd6] + nm3[rnd5] + nm4[rnd4];
}
testSwear(nMs);
}