Advertisement
Pilz

Bow & Arrow: A Python Stand Generator

Dec 5th, 2015
258
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 6.91 KB | None | 0 0
  1. # A Stand Generator for Python
  2.  
  3. #Imported stuff goes below
  4.  
  5. import random
  6.  
  7. # Global variables and lists go below.  Global variables/databases are not bad practice, being bad at using them is bad practice.
  8.  
  9. standAdjective = ["Red", "Blue", "Yellow", "Green", "Hot", "Cold", "Smooth", "Fluffy"]; #adjectives to be combined with the stand's mystical name part
  10. standMystical = {  #the various Mystical things the stand could be
  11.   "Greek" : ["Zeus", "Hera", "Hermes", "Ares" ],
  12.   "Egypt" : ["Thoth", "Osiris", "Bast" ],
  13.   "Tarot" : ["Tower", "Magician", "Moon", "Star", "Sun", "Hanged Man" ]
  14. }
  15. standAdjectiveForm = ["a bizzare", "a mighty", "a mutant" ]; #used for describing the stand
  16. standCoreForm = ["dog", "cat", "bird", "whale", "lemur" ]; #the core appearance of the stand
  17. standGrade = {0 : "Special", 1 : "A", 2 : "B", 3 : "C", 4 : "D", 5 : "E" }
  18. standType = ['Generalist', 'Self-Limited', 'Close-Ranged Power', 'Long-Ranged Manipulated', 'Long-Ranged Autopilot' ]
  19.  
  20.  
  21. #functions used throughout the code go here
  22.  
  23. def det_standType(): #returns the type of stand the person will be generating
  24.    random.seed()
  25.    standTypeChoice = random.randrange(4)
  26.    return standType[standTypeChoice]
  27.  
  28. def det_standNameMystical(): #Choses a stand base with a 'mystical' theme
  29.   random.seed()
  30.   mysticChoices = standMystical.keys() # Pulls possible topics from the pool
  31.   mysticChosen = mysticChoices[random.randrange(len(mysticChoices))] #Choses a topic
  32.   baseChoicesNumber = len(standMystical[mysticChosen]) #draws number of possible bases from the topic
  33.   baseChoicesOptions = standMystical[mysticChosen]
  34.   baseChoicesFinal = baseChoicesOptions[random.randrange(int(baseChoicesNumber))]
  35.   return baseChoicesFinal
  36.  
  37. def det_standAdjective(): #choses an adjective for the stand name
  38.   random.seed()
  39.   standAdjectiveChoice = random.randrange(len(standAdjective))
  40.   return standAdjective[standAdjectiveChoice]
  41.  
  42. def det_standAdjectiveForm(): #choses an Adjective for the stand's form
  43.   random.seed()
  44.   standAdFormChoice = random.randrange(len(standAdjectiveForm))
  45.   return standAdjectiveForm[standAdFormChoice]
  46.  
  47. def det_standCoreForm(): #choses the core form of the stand
  48.   random.seed()
  49.   standFormChoice = random.randrange(len(standCoreForm))
  50.   return standCoreForm[standFormChoice]
  51.  
  52. def det_standGrade(category): #calculates the grading of the stand in accordance with the type generated
  53.   random.seed()
  54.   if category == 'Generalist':
  55.     destructivePower = standGrade[random.randint(2, 4)]
  56.     speedPower = standGrade[random.randint(2, 3)]
  57.     rangePower = standGrade[random.randint(2, 4)]
  58.     duraPower = standGrade[random.randint(3, 4)]
  59.     precisePower = standGrade[random.randint(2, 4)]
  60.     learnPower = standGrade[random.randint(1, 5)]
  61.     standStats = ('  Your stand is graded ' + destructivePower + ' in destructive power, ' + speedPower + ' in speed and reflexes, ' + rangePower + ' in the range at which it can operate, ' + duraPower + ' in the stand\'s endurance and ability to take punishment, ' + precisePower + ' in its dexterity and accuracy, or general precision of its movements, and ' + learnPower + ' in its potential to develop further given future training or experience.')
  62.     return standStats
  63.   elif category == 'Self-Limited':
  64.     destructivePower = standGrade[random.randint(1, 4)]
  65.     speedPower = standGrade[random.randint(1, 3)]
  66.     rangePower = standGrade[0]
  67.     duraPower = standGrade[random.randint(1, 2)]
  68.     precisePower = standGrade[random.randint(1, 4)]
  69.     learnPower = standGrade[random.randint(1, 4)]
  70.     standStats =('  Your stand is graded ' + destructivePower + ' in destructive power, ' + speedPower + ' in speed and reflexes, ' + rangePower + ' in range because it is only able to access your very immediate surroundings, ' + duraPower + ' in the stand\'s endurance and ability to take punishment, ' + precisePower + ' in its dexterity and accuracy, or general precision of its movements, and ' + learnPower + ' in its potential to develop further given future training or experience.')
  71.     return standStats
  72.   elif category == 'Close-Ranged Power':
  73.     destructivePower = standGrade[random.randint(1, 3)]
  74.     speedPower = standGrade[random.randint(1, 4)]
  75.     rangePower = standGrade[random.randint(3, 5)]
  76.     duraPower = standGrade[random.randint(2, 3)]
  77.     precisePower = standGrade[random.randint(1, 5)]
  78.     learnPower = standGrade[random.randint(1, 5)]
  79.     standStats =('  Your stand is graded ' + destructivePower + ' in destructive power, ' + speedPower + ' in speed and reflexes, ' + rangePower + ' in the range at which it can operate, ' + duraPower + ' in the stand\'s endurance and ability to take punishment, ' + precisePower + ' in its dexterity and accuracy, or general precision of its movements, and ' + learnPower + ' in its potential to develop further given future training or experience.')
  80.     return standStats
  81.   elif category == 'Long-Ranged Manipulated':
  82.     destructivePower = standGrade[random.randint(2, 5)]
  83.     speedPower = standGrade[random.randint(1, 5)]
  84.     rangePower = standGrade[1]
  85.     duraPower = standGrade[random.randint(3, 5)]
  86.     precisePower = standGrade[random.randint(1, 3)]
  87.     learnPower = standGrade[random.randint(1, 5)]
  88.     standStats =('  Your stand is graded ' + destructivePower + ' in destructive power, ' + speedPower + ' in speed and reflexes, ' + rangePower + ' in the range at which it can operate, though it may be far longer, ' + duraPower + ' in the stand\'s endurance and ability to take punishment, ' + precisePower + ' in its dexterity and accuracy, or general precision of its movements, and ' + learnPower + ' in its potential to develop further given future training or experience.')
  89.     return standStats
  90.   elif category == 'Long-Range Autopilot':
  91.     destructivePower = standGrade[random.randint(2, 5)]
  92.     speedPower = standGrade[random.randint(2, 5)]
  93.     rangePower = standGrade[0]
  94.     duraPower = standGrade[random.randint(2, 5)]
  95.     precisePower = standGrade[random.randint(4, 5)]
  96.     learnPower = standGrade[random.randint(2, 5)]
  97.     standStats =(  'Your stand is graded ' + destructivePower + ' in destructive power, ' + speedPower + ' in speed and reflexes, ' + rangePower + ' in range as a result of its ability to act completely independant from your command, ' + duraPower + ' in the stand\'s endurance and ability to take punishment, ' + precisePower + ' in its dexterity and accuracy, or general precision of its movements, and ' + learnPower + ' in its potential to develop further given future training or experience.')
  98.     return standStats
  99.   else:
  100.     return 'WHOOPS PILZ DUN FUKT UP'
  101.  
  102. type = det_standType()
  103. grade = det_standGrade(type)
  104. nameNoun = det_standNameMystical()
  105. nameAdjective = det_standAdjective()
  106. formNoun = det_standCoreForm()
  107. formAdjective = det_standAdjectiveForm()
  108.  
  109. print('Your stand is a ' + type + '-type.  It is called ' + nameAdjective + ' ' + nameNoun + ' and takes the form of a ' + formAdjective + ' ' + formNoun + '.')
  110. print(grade)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement