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

avatarEarthKingdom.js (4395B)


      1 var nm15 = ["ch", "b", "f", "g", "h", "l", "m", "p", "r", "b", "f", "g", "h", "l", "m", "p", "r", "sh", "x"];
      2 var nm16 = ["ao", "uo", "aa", "a", "e", "o", "a", "e", "i", "o", "u", "a", "e", "i", "o", "u", "a", "e", "i", "o", "u", "a", "e", "i", "o", "u"];
      3 var nm17 = ["h", "l", "m", "n", "h", "l", "m", "n", "h", "l", "m", "n", "h", "l", "m", "n", "sh", "t"];
      4 var nm18 = ["", "", "", "", "", "", "h", "ng", "n", "ng", "n", "r"];
      5 var nm19 = ["", "", "b", "f", "g", "gy", "h", "k", "ky", "l", "n", "m", "s", "sh", "t", "w"];
      6 var nm20 = ["k", "l", "m", "n", "r", "sh", "v", "y"];
      7 var nm21 = ["", "", "", "", "", "", "", "", "", "", "ph", "h", "h", "ng", "n", "n"];
      8 var nm22 = ["a", "e", "i", "o", "a", "o"];
      9 first = -1;
     10 triggered = 0;
     11 reset = 0;
     12 
     13 function preload(arrayOfImages) {
     14     $(arrayOfImages).each(function() {
     15         $('<img/>')[0].src = this;
     16     });
     17 }
     18 preload(['../images/backgrounds/avatarTheBoulder.jpg', '../images/backgrounds/avatarToph.jpg', '../images/backgrounds/avatarJooDee.jpg']);
     19 
     20 function nameGen(type) {
     21     if (reset === 1) {
     22         $("#nameGen").css("background-image", bg);
     23         reset = 0;
     24     }
     25     $('#placeholder').css('textTransform', 'capitalize');
     26     var tp = type;
     27     var br = "";
     28     var element = document.createElement("div");
     29     element.setAttribute("id", "result");
     30     nTp = Math.random() * 50 | 0;
     31     if (nTp === 0 && first !== 0 && triggered === 0) {
     32         nTp = Math.random() * 3 | 0;
     33         if (nTp === 0) {
     34             toph();
     35         } else if (nTp === 1) {
     36             jooDee();
     37         } else {
     38             theBoulder();
     39         }
     40     } else {
     41         for (i = 0; i < 10; i++) {
     42             if (tp === 1) {
     43                 nTp = Math.random() * 7 | 0;
     44                 nameFem()
     45                 while (nMs === "") {
     46                     nameFem();
     47                 }
     48                 names = nMs;
     49                 if (nTp === 0) {
     50                     nameFem()
     51                     while (nMs === "") {
     52                         nameFem();
     53                     }
     54                     names = names + " " + nMs;
     55                 }
     56             } else {
     57                 nTp = Math.random() * 4 | 0;
     58                 nameMas()
     59                 while (nMs === "") {
     60                     nameMas();
     61                 }
     62                 names = nMs;
     63                 if (nTp === 0) {
     64                     nameMas()
     65                     while (nMs === "") {
     66                         nameMas();
     67                     }
     68                     names = names + " " + nMs;
     69                 }
     70             }
     71             br = document.createElement('br');
     72             element.appendChild(document.createTextNode(names));
     73             element.appendChild(br);
     74         }
     75         if (document.getElementById("result")) {
     76             document.getElementById("placeholder").removeChild(document.getElementById("result"));
     77         }
     78         document.getElementById("placeholder").appendChild(element);
     79         first++;
     80     }
     81 }
     82 
     83 function nameMas() {
     84     nTp = Math.random() * 5 | 0;
     85     rnd = Math.random() * nm15.length | 0;
     86     rnd2 = Math.random() * nm16.length | 0;
     87     rnd5 = Math.random() * nm18.length | 0;
     88     if (nTp < 2) {
     89         nMs = nm15[rnd] + nm16[rnd2] + nm18[rnd5];
     90     } else {
     91         rnd3 = Math.random() * nm17.length | 0;
     92         rnd4 = Math.random() * nm16.length | 0;
     93         if (rnd2 < 4) {
     94             while (rnd4 < 3) {
     95                 rnd4 = Math.random() * nm16.length | 0;
     96             }
     97         }
     98         while (nm17[rnd3] === nm15[rnd] || nm17[rnd3] === nm18[rnd5]) {
     99             rnd3 = Math.random() * nm17.length | 0;
    100         }
    101         nMs = nm15[rnd] + nm16[rnd2] + nm17[rnd3] + nm16[rnd4] + nm18[rnd5];
    102     }
    103     testSwear(nMs);
    104 }
    105 
    106 function nameFem() {
    107     nTp = Math.random() * 4 | 0;
    108     rnd = Math.random() * nm19.length | 0;
    109     rnd2 = Math.random() * nm22.length | 0;
    110     rnd5 = Math.random() * nm21.length | 0;
    111     if (nTp < 2) {
    112         while (nm19[rnd] === "" && nm21[rnd5] === "") {
    113             rnd = Math.random() * nm19.length | 0;
    114         }
    115         nMs = nm19[rnd] + nm22[rnd2] + nm21[rnd5];
    116     } else {
    117         rnd3 = Math.random() * nm20.length | 0;
    118         rnd4 = Math.random() * nm22.length | 0;
    119         while (nm20[rnd3] === nm19[rnd] || nm20[rnd3] === nm22[rnd5]) {
    120             rnd3 = Math.random() * nm20.length | 0;
    121         }
    122         nMs = nm19[rnd] + nm22[rnd2] + nm20[rnd3] + nm22[rnd4] + nm21[rnd5];
    123     }
    124     testSwear(nMs);
    125 }