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.

85 lines
3.9 KiB
JavaScript

var nm1 = ["", "", "", "", "", "c", "f", "h", "l", "m", "n", "ph", "s", "th", "v", "z"];
var nm2 = ["a", "e", "a", "e", "a", "e", "i"];
var nm3 = ["cr", "d", "dr", "g", "l", "ll", "lr", "ln", "lv", "m", "mn", "n", "nn", "nd", "ng", "nr", "rr", "sr", "st", "tt", "tr", "v", "vr", "z"];
var nm4 = ["a", "e", "a", "e", "a", "e", "i", "o"];
var nm5 = ["g", "h", "l", "ll", "m", "n", "r", "rr", "v", "z"];
var nm6 = ["a", "o", "a", "o", "e", "i"];
var nm7 = ["h", "n", "nd", "rg", "rn", "s"];
var nm8 = ["b", "d", "g", "h", "l", "m", "n", "s", "r", "v", "z"];
var nm9 = ["a", "e", "o", "a", "e", "o", "i", "u"];
var nm10 = ["d", "dr", "dd", "gn", "gr", "gl", "gv", "ld", "ll", "lr", "ln", "lm", "m", "mn", "nd", "ndr", "ngr", "r", "rn", "rl", "rg", "rv", "v", "vn", "vr", "vl"];
var nm11 = ["a", "e", "i", "a", "e", "i", "o"];
var nm12 = ["c", "k", "c", "k", "g", "d", "g", "l", "n"];
var nm13 = ["Acid", "Ash", "Black", "Blind", "Bold", "Bone", "Bright", "Burn", "Chain", "Chaos", "Cinder", "Cloud", "Coal", "Cold", "Crimson", "Cruel", "Dark", "Dead", "Death", "Dirt", "Doom", "Evil", "Fear", "Fire", "Flame", "Fume", "Furor", "Fury", "Ghost", "Giant", "Gloom", "Glow", "Grim", "Heat", "Hell", "Hook", "Hot", "Ice", "Iron", "Kill", "Lava", "Mad", "Magma", "Molten", "Night", "Poison", "Primal", "Prime", "Putrid", "Rage", "Red", "Shadow", "Smog", "Smoke", "Soot", "Steam", "Storm", "Sun", "Venom", "Vile", "War", "Wild"];
var nm14 = ["breath", "claw", "claws", "fang", "fangs", "jaw", "jaws", "maw", "mouth", "snag", "talon", "teeth", "tongue", "tooth", "wing", "wings", "mug", "snout"];
var br = "";
function nameGen(type) {
var tp = type;
$('#placeholder').css('textTransform', 'capitalize');
var element = document.createElement("div");
element.setAttribute("id", "result");
for (i = 0; i < 10; i++) {
if (i < 7) {
if (tp === 1) {
nameFem();
while (nMs === "") {
nameFem();
}
} else {
nameMas();
while (nMs === "") {
nameMas();
}
}
} else {
rnd = Math.random() * nm13.length | 0;
rnd2 = Math.random() * nm14.length | 0;
nMs = nm13[rnd] + nm14[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() {
rnd = Math.random() * nm8.length | 0;
rnd2 = Math.random() * nm9.length | 0;
rnd3 = Math.random() * nm10.length | 0;
rnd4 = Math.random() * nm11.length | 0;
rnd5 = Math.random() * nm12.length | 0;
while (nm10[rnd3] === nm8[rnd] || nm10[rnd3] === nm12[rnd5]) {
rnd3 = Math.random() * nm10.length | 0;
}
nMs = nm8[rnd] + nm9[rnd2] + nm10[rnd3] + nm11[rnd4] + nm12[rnd5];
testSwear(nMs);
}
function nameFem() {
nTp = Math.random() * 3 | 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;
rnd5 = Math.random() * nm7.length | 0;
while (nm3[rnd3] === nm1[rnd] || nm3[rnd3] === nm7[rnd5]) {
rnd3 = Math.random() * nm10.length | 0;
}
if (nTp === 0) {
nMs = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm4[rnd4] + nm7[rnd5];
} else {
rnd6 = Math.random() * nm6.length | 0;
rnd7 = Math.random() * nm5.length | 0;
while (nm3[rnd3] === nm5[rnd7] || nm5[rnd7] === nm7[rnd5]) {
rnd7 = Math.random() * nm12.length | 0;
}
nMs = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm6[rnd6] + nm5[rnd7] + nm4[rnd4] + nm7[rnd5];
}
testSwear(nMs);
}