Advertisement
Guest User

Untitled

a guest
Aug 20th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.20 KB | None | 0 0
  1. #SHIT TO DO
  2. #Create objects: units and classes, items
  3. #Create function for  spawning items
  4. #Way to pick up items
  5. #Game timer for cooldowns
  6. #World creation
  7. #AI
  8.  
  9. class world:
  10.     def __init__(self, size):
  11.         self.size = size
  12.  
  13. class items:
  14.    
  15.     def __init__(self, name, itemType, objectState = 'item'):
  16.        
  17.         self.name = name
  18.         self.itemType = itemType
  19.        
  20. class consumables(items):
  21.    
  22.     def __init__(self):
  23.         pass
  24.  
  25. class equipables(items):
  26.    
  27.     def __init__(self):
  28.         pass
  29.        
  30. class player:
  31.    
  32.     #Every unit should have basic attributes that are shared among all
  33.     def __init__(self, name, hp = 100, sp = 50, atk = 15, defense = 7, speed = 10, inventory = [], equips = [], objectState = 'player',healthCooldown = False, manaCooldown = False):
  34.        
  35.         self.name = name
  36.         self.hp = hp
  37.         self.sp = sp
  38.         self.atk = atk
  39.         self.defense = defense
  40.         self.inventory = inventory
  41.         self.equips = equips
  42.         self.healthCooldown = healthCooldown
  43.         self.manaCooldown = manaCooldown
  44.        
  45.     def attack(self, enemy):
  46.         #Basic formula when a unit attacks another unit
  47.         enemy.hp = enemy.hp - (enemy.defense - self.attack)
  48.    
  49.     def heal(self):
  50.        
  51.         #When a unit wants to recover health... it will add HP and subtract from inventory
  52.         self.hp += self.inventory[potions.hp]
  53.         #Cool down *Need to figure out how to make a game timer*
  54.         self.healthCooldown = True
  55.        
  56.     def manaPot(self):
  57.        
  58.         #When a unit wants to recover mana... it will add SP and subtract from inventory
  59.         self.sp += self.inventory[potions.sp]
  60.         #Cool down *Need to figure out how to make a game timer*
  61.         self.manaCooldown = True
  62.        
  63. class warrior(player):
  64.    
  65.     def __init__(self):
  66.         player.__init__(self)
  67.         self.attack = 20
  68.  
  69. class mage(player):
  70.    
  71.     def __init__(self):
  72.         pass
  73.        
  74. class assassin(player):
  75.    
  76.     def __init__(self):
  77.         pass
  78.        
  79. class tank(player):
  80.    
  81.     def __init__(self):
  82.         pass
  83.        
  84. class healer(player):
  85.    
  86.     def __init__(self):
  87.         pass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement