Advertisement
Guest User

Untitled

a guest
Jun 25th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.03 KB | None | 0 0
  1. class Stats:
  2.     def __init__(self, name):
  3.  
  4.         self.name = name
  5.         self.hp = 100
  6.         self.st = 100
  7.         self.mag = 100
  8.  
  9.  
  10.     def Display(self):
  11.  
  12.         print("Name : ", self.name,
  13.             "\nhp = ", self.hp,
  14.             "\nst =", self.st,
  15.             "\nmag =", self.mag, "\n")
  16.         self.Modify()
  17.  
  18.     def Modify(self):
  19.  
  20.         # edit user stats
  21.         b = int(input("How many points would you like to add?"))
  22.  
  23.         c = input("Which Stat would you like to edit?"
  24.                 "\nst | hp | mag :")
  25.  
  26.         # User Options
  27.         if c == "mag":
  28.  
  29.             self.mag += + b
  30.             self.Display()
  31.  
  32.         elif c == "st":
  33.  
  34.             self.st += b
  35.             self.Display()
  36.  
  37.         elif c == "hp":
  38.  
  39.             self.hp += b
  40.             self.Display()
  41.  
  42.         else:
  43.             print("invalid input")
  44.             self.Modify()
  45.  
  46. class Hero(Stats):
  47.  
  48.     def __init__(self, name):
  49.         Stats.__init__(self, name)
  50.         self.Display()
  51.  
  52. amra = Hero("Amrasurion")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement