Guest User

Untitled

a guest
May 23rd, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. class Character(object):
  2. def __init__(self, name, description, current_hp):
  3. self.name = name
  4. self.desc = description
  5. self.health = current_hp
  6.  
  7.  
  8. class Enemy(Character):
  9. def __init__(self, name, description, current_hp, current_room, drop):
  10. self.room = current_room
  11. self.drop = drop
  12. super(Enemy, self).__init__(name, description, current_hp)
  13.  
  14. def attack(self, target, amount):
  15. print("%s attacked you!" % self.name)
  16. target -= amount
  17.  
  18. def death(self, cause):
  19. print("%s was killed by your %s" % (self.name, str.lower(cause.name)))
  20. if self.drop is not None:
  21. print("%s dropped %s" % (self.name, str.lower(self.drop.name)))
Add Comment
Please, Sign In to add comment