offline-fantasy-name-generators

Offline version of www.fantasynamegenerators.com
git clone https://git.neptards.moe/neptards/offline-fantasy-name-generators.git
Log | Files | Refs | README

pathfinderRatfolk.js (3111B)


      1 var nm1 = ["", "", "", "", "", "", "", "b", "br", "c", "cr", "ch", "d", "dr", "dj", "g", "gr", "gn", "gl", "j", "k", "kr", "kv", "kn", "m", "n", "p", "pr", "r", "s", "st", "sr", "skr", "sc", "scr", "sk", "t", "tr", "v", "vr", "z", "zr"];
      2 var nm2 = ["a", "e", "i", "o", "a", "e", "i"];
      3 var nm3 = ["cc", "cd", "cr", "gg", "gr", "gk", "gv", "gd", "kk", "kr", "kv", "kz", "m", "mm", "md", "mk", "mv", "mz", "n", "nn", "nd", "nv", "nk", "ng", "nz", "rr", "r", "rk", "rv", "rz", "rc", "rg", "rd", "vv", "v", "vd", "vk", "vz"];
      4 var nm4 = ["c", "g", "c", "g", "hl", "hz", "hk", "hn", "hc", "k", "m", "n", "q", "r", "s", "t", "z", "k", "m", "n", "q", "r", "s", "t", "z"];
      5 var nm5 = ["b", "bh", "c", "ch", "dh", "f", "fr", "fh", "gh", "j", "k", "m", "n", "nh", "p", "r", "s", "sh", "t", "th", "v", "vh", "z", "zh"];
      6 var nm6 = ["a", "e", "i", "o", "u", "e", "e", "e", "i", "i", "i"];
      7 var nm7 = ["b", "bb", "c", "cc", "f", "ff", "g", "gg", "j", "k", "kk", "l", "ll", "m", "mm", "n", "nn", "p", "pp", "r", "rr", "s", "ss", "t", "tt", "z", "zz"];
      8 var nm8 = ["", "", "", "", "", "", "", "", "ch", "f", "hm", "hl", "ks", "l", "m", "n", "r", "s", "sh", "t", "th", "tch", "x"];
      9 var br = "";
     10 
     11 function nameGen(type) {
     12     $('#placeholder').css('textTransform', 'capitalize');
     13     var tp = type;
     14     var element = document.createElement("div");
     15     element.setAttribute("id", "result");
     16     for (i = 0; i < 10; i++) {
     17         if (tp === 1) {
     18             nameFem();
     19             while (nMs === "") {
     20                 nameFem();
     21             }
     22         } else {
     23             nameMas();
     24             while (nMs === "") {
     25                 nameMas();
     26             }
     27         }
     28         br = document.createElement('br');
     29         element.appendChild(document.createTextNode(nMs));
     30         element.appendChild(br);
     31     }
     32     if (document.getElementById("result")) {
     33         document.getElementById("placeholder").removeChild(document.getElementById("result"));
     34     }
     35     document.getElementById("placeholder").appendChild(element);
     36 }
     37 
     38 function nameMas() {
     39     rnd = Math.floor(Math.random() * nm1.length);
     40     rnd2 = Math.floor(Math.random() * nm2.length);
     41     rnd5 = Math.floor(Math.random() * nm4.length);
     42     if (i < 5) {
     43         while (rnd < 7) {
     44             rnd = Math.floor(Math.random() * nm1.length);
     45         }
     46         nMs = nm1[rnd] + nm2[rnd2] + nm4[rnd5];
     47     } else {
     48         rnd3 = Math.floor(Math.random() * nm3.length);
     49         rnd4 = Math.floor(Math.random() * nm2.length);
     50         nMs = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm2[rnd4] + nm4[rnd5];
     51     }
     52     testSwear(nMs);
     53 }
     54 
     55 function nameFem() {
     56     rnd = Math.floor(Math.random() * nm5.length);
     57     rnd2 = Math.floor(Math.random() * nm6.length);
     58     rnd5 = Math.floor(Math.random() * nm8.length);
     59     if (i < 5) {
     60         while (rnd5 < 8) {
     61             rnd5 = Math.floor(Math.random() * nm8.length);
     62         }
     63         nMs = nm5[rnd] + nm6[rnd2] + nm8[rnd5];
     64     } else {
     65         rnd3 = Math.floor(Math.random() * nm7.length);
     66         rnd4 = Math.floor(Math.random() * nm6.length);
     67         nMs = nm5[rnd] + nm6[rnd2] + nm7[rnd3] + nm6[rnd4] + nm8[rnd5];
     68     }
     69     testSwear(nMs);
     70 }