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

swStormtroopers.js (3181B)


      1 var nm1 = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"];
      2 var nm2 = ["", "-", "-", "-"];
      3 var nm3 = ["Abyss", "Advance ", "Aftermath ", "Alarm", "Ambush ", "Anarchy ", "Arch", "Ash", "Awe", "Bait", "Bane", "Barrage ", "Battle", "Bench", "Blade", "Blast ", "Blitz ", "Blizzard ", "Blood", "Bomb", "Bone", "Brake", "Brave ", "Brawl", "Break", "Brute ", "Burst ", "Buster", "Camo", "Cannon", "Chain", "Chaos", "Charge ", "Chasm ", "Chemic", "Cloud", "Coil", "Core ", "Coup", "Courage ", "Coven", "Cover", "Crash", "Crown", "Crush", "Cyclone ", "Dark ", "Dawn", "Decoy ", "Detonation ", "Dire ", "Dirt", "Dock", "Dread ", "Droid ", "Dusk", "Dust", "Eclipse ", "Edge", "End", "Eradictation ", "Fall ", "Fear ", "Fire", "Flock", "Fog", "Force ", "Frost", "Fury ", "Galaxy ", "Ghost", "Glacier", "Gravity ", "Hammer ", "Hate ", "Havoc ", "Hook", "Hysteria ", "Ice ", "Inferno ", "Infinity ", "Invasion ", "Ire ", "Light ", "Lunar", "Mad", "Mania ", "Master ", "Maverick ", "Mayhem ", "Mist ", "Moon", "Mud", "Night", "Orbital ", "Order ", "Panic ", "Patriot ", "Pestilence ", "Phantom ", "Phase", "Photo", "Plasma", "Power ", "Pressure ", "Prism ", "Prison ", "Probe ", "Pulse", "Quake", "Rage ", "Rampage ", "Rebel ", "Reform ", "Requiem ", "Rift ", "Risk", "Royal ", "Ruin", "Rush ", "Salt ", "Shade", "Shifter ", "Siege ", "Skirmish ", "Snow", "Solar", "Solo ", "Spite ", "Stress", "Strike", "Strike ", "Synth ", "Task", "Tempest ", "Throne ", "Thunder", "Torrent ", "Trail", "Trauma ", "Tremor", "Vault ", "Veil", "Victory ", "Whip", "Wing", "Wreck"];
      4 var br = "";
      5 
      6 function nameGen() {
      7     $('#placeholder').css('textTransform', 'capitalize');
      8     var element = document.createElement("div");
      9     element.setAttribute("id", "result");
     10     for (i = 0; i < 10; i++) {
     11         if (i < 5) {
     12             nTp = Math.random() * 4 | 0;
     13             if (nTp === 0) {
     14                 rnd = Math.random() * 9999 | 0;
     15                 names = rnd;
     16             } else {
     17                 rnd = Math.random() * 999 | 0;
     18                 rnd2 = Math.random() * nm1.length | 0;
     19                 rnd5 = Math.random() * nm2.length | 0;
     20                 if (nTp === 1) {
     21                     names = nm1[rnd2] + nm2[rnd5] + rnd;
     22                 } else {
     23                     rnd3 = Math.random() * nm1.length | 0;
     24                     if (nTp < 3) {
     25                         names = nm1[rnd2] + nm1[rnd3] + nm2[rnd5] + rnd;
     26                     } else {
     27                         rnd4 = Math.random() * nm1.length | 0;
     28                         names = nm1[rnd2] + nm1[rnd3] + nm1[rnd4] + nm2[rnd5] + rnd;
     29                     }
     30                 }
     31             }
     32         } else {
     33             rnd = Math.random() * nm3.length | 0;
     34             names = nm3[rnd] + "trooper";
     35         }
     36         br = document.createElement('br');
     37         element.appendChild(document.createTextNode(names));
     38         element.appendChild(br);
     39     }
     40     if (document.getElementById("result")) {
     41         document.getElementById("placeholder").removeChild(document.getElementById("result"));
     42     }
     43     document.getElementById("placeholder").appendChild(element);
     44 }