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

swMikkians.js (3373B)


      1 var nm1 = ["", "d", "h", "r", "s", "t", "v", "z"];
      2 var nm2 = ["ee", "a", "a", "e", "i", "i", "a", "a", "e", "i", "i", "a", "a", "e", "i", "i", "a", "a", "e", "i", "i", "a", "a", "e", "i", "i"];
      3 var nm3 = ["k", "pl", "r", "v", "vl", "vr", "z"];
      4 var nm4 = ["ee", "a", "a", "e", "i", "a", "a", "e", "i", "a", "a", "e", "i", "a", "a", "e", "i", "a", "a", "e", "i", "a", "a", "e", "i"];
      5 var nm5 = ["", "l", "m", "n", "r", "s"];
      6 var nm15 = ["", "h", "m", "h", "m", "h", "m", "mr", "n", "n", "n", "nr", "nm", "v", "v", "v", "vl", "vr", "z", "z", "z", "zl", "zr"];
      7 var nm16 = ["a", "a", "e", "i"];
      8 var nm17 = ["h", "l", "m", "n", "r", "s", "v", "z"];
      9 var nm18 = ["ee", "ie", "a", "a", "i", "e", "a", "a", "i", "e", "a", "a", "i", "e", "a", "a", "i", "e", "a", "a", "i", "e", "a", "a", "i", "e", "a", "a", "i", "e"];
     10 var nm19 = ["", "h", "l", "m", "n", "s"];
     11 var br = "";
     12 
     13 function nameGen(type) {
     14     var tp = type;
     15     $('#placeholder').css('textTransform', 'capitalize');
     16     var element = document.createElement("div");
     17     element.setAttribute("id", "result");
     18     for (i = 0; i < 10; i++) {
     19         nameSur();
     20         while (nSr === "") {
     21             nameSur();
     22         }
     23         nameFem();
     24         while (nMs === "") {
     25             nameFem();
     26         }
     27         names = nMs + " " + nSr;
     28         br = document.createElement('br');
     29         element.appendChild(document.createTextNode(names));
     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 nameFem() {
     39     nTp = Math.random() * 4 | 0;
     40     rnd = Math.random() * nm1.length | 0;
     41     rnd2 = Math.random() * nm2.length | 0;
     42     rnd3 = Math.random() * nm5.length | 0;
     43     if (nTp === 0) {
     44         while (nm1[rnd] === "") {
     45             rnd = Math.random() * nm1.length | 0;
     46         }
     47         while (nm1[rnd] === nm5[rnd3] || nm5[rnd3] === "") {
     48             rnd3 = Math.random() * nm5.length | 0;
     49         }
     50         nMs = nm1[rnd] + nm2[rnd2] + nm5[rnd3];
     51     } else {
     52         rnd4 = Math.random() * nm3.length | 0;
     53         rnd5 = Math.random() * nm4.length | 0;
     54         while (nm3[rnd4] === nm1[rnd] || nm3[rnd4] === nm5[rnd3]) {
     55             rnd4 = Math.random() * nm3.length | 0;
     56         }
     57         while (rnd2 === 0 && rnd5 === 0) {
     58             rnd5 = Math.random() * nm4.length | 0;
     59         }
     60         nMs = nm1[rnd] + nm2[rnd2] + nm3[rnd4] + nm4[rnd5] + nm5[rnd3];
     61     }
     62     testSwear(nMs);
     63 }
     64 
     65 function nameSur() {
     66     nTp = Math.random() * 6 | 0;
     67     rnd = Math.random() * nm15.length | 0;
     68     rnd2 = Math.random() * nm16.length | 0;
     69     rnd3 = Math.random() * nm19.length | 0;
     70     if (nTp < 2) {
     71         while (nm15[rnd] === "") {
     72             rnd = Math.random() * nm15.length | 0;
     73         }
     74         while (nm15[rnd] === nm19[rnd3] || nm19[rnd3] === "") {
     75             rnd3 = Math.random() * nm19.length | 0;
     76         }
     77         nSr = nm15[rnd] + nm16[rnd2] + nm19[rnd3];
     78     } else {
     79         rnd4 = Math.random() * nm17.length | 0;
     80         rnd5 = Math.random() * nm18.length | 0;
     81         while (nm17[rnd4] === nm15[rnd] || nm17[rnd4] === nm19[rnd3]) {
     82             rnd4 = Math.random() * nm17.length | 0;
     83         }
     84         nSr = nm15[rnd] + nm16[rnd2] + nm17[rnd4] + nm18[rnd5] + nm19[rnd3];
     85     }
     86     testSwear(nSr);
     87 }