Guest User

Untitled

a guest
Jul 6th, 2018
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.69 KB | None | 0 0
  1. var desc = ["Fearsome", "Vengeful", "Bald", "Fat", "Thin", "Hungry", "Thirsty", "Ravenous", "Starving", "Portly", "Quiet", "Noisy", "Loud", "Silent", "Penitent", "Injured", "Limping", "Bloody", "Bleeding", "Thoughtful", "Murderous", "Dead", "Blind", "Mysterious", "Arcane", "All-seeing", "Transcendent", "Drunken", "Hammered", "Feasting", "Greedy", "Stingy", "Jolly", "Happy", "Smiling", "Frowning", "Contemptuous", "Jovial", "Ill-tempered", "Vicious", "Lecherous", "Burly", "Cross-eyed", "One-eyed", "Red-eyed", "Toothless", "Tattooed", "Scarred", "Pierced", "Lone", "Howling", "Grappling", "Wretched", "Beloved", "Cantankerous", "Crafty", "Salty", "Shifty"];
  2. var ppl = ["Dwarf", "Elf", "Giant", "Halfing", "Knight", "Pirate", "Slave", "King", "Queen", "Prince", "Princess", "Barbarian", "Bard", "Cleric", "Priest", "Druid", "Sorcerer", "Wizard", "Warrior", "Thief", "Rogue", "Cutpurse", "Mage", "Ranger", "Wench", "Maid", "Butler", "Urchin", "Champion", "Hero", "Vagrant", "Shadow", "Assassin"];
  3. var colors = ["Red", "Orange", "Yellow", "Green", "Blue", "Purple", "Violet", "Brown", "Black", "White", "Gray", "Golden", "Silver", "Crimson", "Emerald", "Ruby", "Silver", "Turquoise"];
  4. var emotions = ["Pensive", "Laughing", "Yelling", "Smoking", "Angry", "Flaming", "Drunken", "Flying", "Lost", "Sleeping", "Frowning", "Smiling", "Grinning", "Chuckling", "Roaring", "Cursing", "Buxom", "Busty"];
  5. var materials = ["Ivory", "Ebon", "Stone", "Wooden", "Alabaster", "Turquoise", "Glass", "Ceramic", "Crystal", "Emerald", "Diamond", "Amethyst", "Jade", "Ruby", "Gleaming", "Sparkling"];
  6. var dwelling = ["Den", "Cage", "Lair", "Cave", "Alcove", "Nest", "Fen", "Rest", "Hut", "Bog", "Swamp", "Portal", "Plane"];
  7. var things = ["Flame", "Sand", "Sun", "Moon", "Stars", "Silence", "Shadow", "Wind", "Sword", "Spear", "Whisper", "Cask"];
  8. var animals = ["Orc", "Ogre", "Hawk", "Troll", "Bear", "Dragon", "Goblin", "Snake", "Squirrel", "Wolf", "Unicorn", "Hag", "Toad", "Nymph", "Fairy", "Sprite", "Kraken", "Minotaur", "Serpent", "Hydra"];
  9. var items_tv = ["Blade", "Mug", "Plow", "Wagon", "Fist", "Dagger", "Diamond", "Tankard", "Keg"];
  10. var innTypes = ["Inn", "Tavern", "Alehouse", "Rest", "Bar", "Dive", "Drinkery", "Gin mill", "Grog Shop", "Lodge", "Pub", "Roadhouse", "Saloon", "Speakeasy", "Taphouse", "Taproom", "Watering hole", "Cottage", "Chalet", "Hostel", "Refuge", "Den", "Shelter"];
  11.  
  12. var tavern_templates = [{pattern:"The Material Animal", fn:function(){return the() + tLookup(materials) + " " + tLookup(animals) + apos() + " " + tLookup(innTypes);}},
  13. {pattern:"The Color Animal",fn:function(){return the() + tLookup(colors) + " " + tLookup(animals) + apos() + " " + tLookup(innTypes);}},
  14. {pattern:"The Emotion Animal",fn:function(){return the() + tLookup(emotions) + " " + tLookup(animals) + apos() + " " + tLookup(innTypes);}},
  15. {pattern:"The Emotion Person",fn:function(){return the() + tLookup(emotions) + " " + tLookup(ppl) + apos() + " " + tLookup(innTypes);}},
  16. {pattern:"The Person & Animal",fn:function(){return tavernWrap( tLookup(ppl) + " & " + tLookup(animals) );}},
  17. {pattern:"The Animal's Dwelling",fn:function(){return "The " + tLookup(animals) + "'s " + tLookup(dwelling);}},
  18. {pattern:"The Animal & Animal",fn:function(){return tavernWrap(tLookup(animals) + " & " + tLookup(animals));}},
  19. {pattern:"The Thing & Thing",fn:function(){return tavernWrap( tLookup(things) + " & " + tLookup(things) );}},
  20. {pattern:"The Material Item",fn:function(){return tavernWrap(tLookup(materials) + " " + tLookup(items_tv), true);}},
  21. {pattern:"The Material Dwelling",fn:function(){return "The " + tLookup(materials) + " " + tLookup(dwelling);}},
  22. {pattern:"The Emotion Item",fn:function(){return the() + tLookup(emotions) + " " + tLookup(items_tv) + innType();}},
  23. {pattern:"The Color Item",fn:function(){return tavernWrap(tLookup(colors) + " " + tLookup(items_tv), true);}},
  24. {pattern:"The Color Thing",fn:function(){return tavernWrap(tLookup(colors) + " " + tLookup(things), true);}},
  25. {pattern:"The Descriptor Animal",fn:function(){return the() + tLookup(desc) + " " + tLookup(animals) + apos() + " " + tLookup(innTypes);}},
  26. {pattern:"The Descriptor People",fn:function(){return the() + tLookup(desc) + " " + tLookup(ppl) + apos() + " " + tLookup(innTypes);}}];
  27.  
  28. function GetTavernName(seed) {
  29. if (seed)
  30. Math.seedrandom(seed);
  31. var templateInt = random(tavern_templates.length);
  32. var template = tavern_templates[templateInt];
  33. return template.fn();
  34. }
  35.  
  36. function generateTavernName(num)
  37. {
  38. !num ? num = 1 : Math.min(num, 100);
  39.  
  40. var results = [];
  41. for(var i = 0;i<num;i++)
  42. {
  43. var templateInt = random(tavern_templates.length);
  44. var template = tavern_templates[templateInt];
  45. results.push(template.fn());
  46. }
  47. return results;
  48. };
  49.  
  50. function tavernWrap(name, own)
  51. {
  52. var pos = "";
  53. if (own)
  54. pos = apos();
  55. var type = random(3);
  56. if (type == 0)
  57. return "The " + name;
  58. if (type == 1)
  59. return "The " + name + innType(pos);
  60. else
  61. return name + pos + " " + tLookup(innTypes);
  62. }
  63.  
  64. function the()
  65. {
  66. if (randomBoolean())
  67. return "The ";
  68. return "";
  69. }
  70.  
  71. function innType(apos)
  72. {
  73. var text = "";
  74. if (apos)
  75. text = apos;
  76. if (randomBoolean())
  77. return text + " " + tLookup(innTypes);
  78. return "";
  79. }
  80.  
  81. function apos()
  82. {
  83. var possessive = randomBoolean();
  84. var apos = possessive ? "'s" : "";
  85. return apos;
  86. }
  87.  
  88. function tLookup(cat)
  89. {
  90. return cat[random(cat.length)];
  91. }
  92.  
  93. function random(x, seed)
  94. {
  95. return Math.floor(Math.random()*x);
  96. };
  97.  
  98. function randomBoolean()
  99. {
  100. return random(2) - 1;
  101. };
Advertisement
Add Comment
Please, Sign In to add comment