Advertisement
Taximaniac

Player Class MonsterKiller

Jan 28th, 2020
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.53 KB | None | 0 0
  1. from random import randint
  2.  
  3. class Player():
  4.    
  5.     def __init__(self, entity_type, name, min_attack, max_attack, heal):
  6.         self.type = entity_type
  7.         self.name = name
  8.         self.health = 100
  9.         self.min_attack = min_attack
  10.         self.max_attack = max_attack
  11.         self.heal = heal
  12.        
  13.     def attack(self):
  14.         return randint(self.min_attack, self.max_attack)
  15.  
  16.     def apply_damage(self, points):
  17.         self.health -= points
  18.  
  19.     def apply_healing(self):
  20.         self.health += self.heal
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement