SHARE
TWEET

Untitled

a guest May 22nd, 2019 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import random
  2. import sys
  3.  
  4. print("One Click NPC Common Generator\n")
  5. """print("Press Enter to run.  Type 'quit' to exit.")"""
  6.  
  7. def d4():
  8.     return random.randint(0, 3)
  9.  
  10. def d6():
  11.     return random.randint(0, 5)
  12.  
  13. def d8():
  14.     return random.randint(0, 7)
  15.  
  16. def d10():
  17.     return random.randint(0, 9)
  18.  
  19. race = ["Dwarf", "Elf", "Halfling", "Human", "Human", "Gnome", "Half-Elf", "Half-Orc"]
  20. gender = ["Male", "Female", "Male", "Female"]
  21. adjective = ["Tattooed/Pierced/Unusual", "Long/Large/Loud/Extravagant", "Short/Small/Quiet/Simple",
  22.              "Missing/Injured/Damaged", "Beautiful/Ugly", "Colourful/Dyed/Painted"]
  23. feature = ["Nose/Voice", "Eyes/Eyebrows/Stare", "Beard/Hair/Sideburns", "Ears/Hearing", "Mouth/Lips/Laugh",
  24.        "Head/Forehead/Face", "Clothing", "Skin/Scar", "Shoes/Hat", "Teeth/Nails/Hands"]
  25.  
  26. first_parts = [
  27.     ["Dal", "Taer", "Mar", "Dyl", "Eth", "Clad", "Gal", "Bok"],
  28.     ["Hour", "Keth", "Dan", "Eth", "La", "Ged", "Ari", "Gun"],
  29.     ["Kal", "ELin", "San", "Jord", "Gab", "Dap", "Fae", "Ton"],
  30.     ["Gat", "Ay", "Tar", "Gab", "Zach", "Jip", "Avil", "Tar"],
  31.     ["Brot", "Lae", "Wil", "Zach", "Hay", "Cos", "Tyr", "Kez"],
  32.     ["Har", "Sil", "Fin", "Al", "Dyl", "Glon", "Yen", "Vug"],
  33.     ["Strom", "Arth", "Elk", "La", "Iv", "Smid", "Rad", "No"],
  34.     ["Glor", "Sca", "Jop", "Iv", "Jord", "Jen", "Ven", "Kir"],
  35.     ["Thog", "Evin", "Ric", "Kar", "Al", "Tin", "Lan", "Bro"],
  36.     ["Demm", "Kyr", "Bel", "Hay", "Kar", "Deb", "Dan", "Gor"]
  37. ]
  38. second_parts = [
  39.     ["omma", "ryl", "", "", "", "li", "tu", "og"],
  40.     ["ogg", "tha", "", "", "", "mer", "ana", "oto"],
  41.     ["osgra", "ina", "ow", "", "", "wun", "dra", "ust"],
  42.     ["ed", "ala", "em", "", "", "men", "ado", ""],
  43.     ["tirl", "yni", "", "", "", "alv", "la", "g"],
  44.     ["wod", "arun", "", "", "", "ip", "reg", "ak"]
  45. ]
  46. third_parts = [
  47.     ["rut", "en", "os", "an", "in", "ak", "il", "ik"],
  48.     ["lynn", "lia", "ra", "ley", "ina", "eth", "lia", "nor"],
  49.     ["li", "al", "er", "as", "riel", "urt", "on", "org"],
  50.     ["na", "aya", "yn", "na", "ila", "na", "tha", "gri"]
  51. ]
  52.  
  53.  
  54. def generate_npc():
  55.     name1 = first_parts[d10()][d8()]
  56.     name2 = second_parts[d6()][d8()]
  57.     name3 = third_parts[d4()][d8()]
  58.  
  59.     print("Name: {}{}{}".format(name1, name2, name3))
  60.     print("Gender: {}".format(gender[d4()]))
  61.     print("Race: {}".format(race[d8()]))
  62.     print("Feature: {} {}".format(adjective[d6()], feature[d10()]))
  63.  
  64. if __name__ == '__main__':
  65.     # If user provides number of npcs they want, make that many, otherwise just make one
  66.     if len(sys.argv) > 1:
  67.         num_of_npcs = int(sys.argv[1])
  68.         for i in range(num_of_npcs):
  69.             generate_npc()
  70.     else:
  71.         generate_npc()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top