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

governmentTypes.js (2639B)


      1 var nm1 = ["People's", "Co-Operative", "Democratic", "Democratic Socialist", "Democratic People's", "Federal Democratic", "People's", "Socialist", "People's Democratic", "People's Socialist", "Federative", "Plurinational", "Communist", "Capitalist"];
      2 var nm2 = ["State", "States", "Republic", "Commonwealth", "Confederation", "Federation", "Duchy", "Kingdom", "Empire", "Principality", "Sultanate", "Union", "Monarchy", "Hegemony", "Alliance", "League", "Caliphate"];
      3 var nm3 = ["Absolute", "Altruistic", "Ancient", "Boundless", "Common", "Determined", "Devout", "Divine", "Elevated", "Enlightened", "Eternal", "First", "Free", "Glorious", "Grand", "Great", "Hallowed", "Holy", "Honorable", "Honored", "Independent", "Infinite", "Invincible", "Loyal", "Majestic", "Matriarchal", "Patriarchal", "Peaceful", "Powerful", "Proud", "Pure", "Radiant", "Righteous", "Rightful", "Second", "Serene", "Spiritual", "Superior", "Supreme", "Timeless", "True", "Ultimate", "United", "Venerated", "Vigilant"];
      4 var nm4 = ["Academics'", "Artisan's", "Champion's", "Chosen One's", "Clergy's", "Commoner's", "Divinity's", "Economists'", "Farmer's", "Fortune's", "General's", "Highborn's", "Individual's", "Judge's", "Mage's", "Merchant's", "Minister's", "Noble's", "Officer's", "Patriot's", "People's", "Philosopher's", "Sage's", "Scholar's", "Scientists'", "Seer's", "Slaver's", "Sorcerer's", "Trader's", "Warrior's"];
      5 var br = "";
      6 
      7 function nameGen() {
      8     var element = document.createElement("div");
      9     element.setAttribute("id", "result");
     10     for (i = 0; i < 10; i++) {
     11         rnd2 = Math.random() * nm2.length | 0;
     12         if (i < 7) {
     13             nTp = Math.random() * 5 | 0;
     14             if (nTp === 0) {
     15                 rnd3 = Math.random() * nm3.length | 0;
     16                 names = nm3[rnd3] + " " + nm2[rnd2];
     17             } else if (nTp < 3) {
     18                 rnd = Math.random() * nm1.length | 0;
     19                 rnd3 = Math.random() * nm3.length | 0;
     20                 names = nm3[rnd3] + " " + nm1[rnd] + " " + nm2[rnd2];
     21             } else {
     22                 rnd = Math.random() * nm1.length | 0;
     23                 names = nm1[rnd] + " " + nm2[rnd2];
     24             }
     25         } else {
     26             rnd = Math.random() * nm4.length | 0;
     27             names = nm4[rnd] + " " + nm2[rnd2];
     28         }
     29         br = document.createElement('br');
     30         element.appendChild(document.createTextNode(names));
     31         element.appendChild(br);
     32     }
     33     if (document.getElementById("result")) {
     34         document.getElementById("placeholder").removeChild(document.getElementById("result"));
     35     }
     36     document.getElementById("placeholder").appendChild(element);
     37 }