Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Character(object):
- def __init__(self, name, description, current_hp):
- self.name = name
- self.desc = description
- self.health = current_hp
- class Enemy(Character):
- def __init__(self, name, description, current_hp, current_room, drop):
- self.room = current_room
- self.drop = drop
- super(Enemy, self).__init__(name, description, current_hp)
- def attack(self, target, amount):
- print("%s attacked you!" % self.name)
- target -= amount
- def death(self, cause):
- print("%s was killed by your %s" % (self.name, str.lower(cause.name)))
- if self.drop is not None:
- print("%s dropped %s" % (self.name, str.lower(self.drop.name)))
Add Comment
Please, Sign In to add comment