Advertisement
Karp_xD

Enemy

May 16th, 2022
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.45 KB | None | 0 0
  1. import Hero
  2. class Enemy:
  3.     def __init__(self, health, damage):
  4.         self.health = health
  5.         self.damage = damage
  6.     def fight(self):
  7.         WIN = 0
  8.         self.health -= Hero.hero.damage
  9.         Hero.hero.health -= self.damage
  10.         if self.health <= 0:
  11.             WIN = True
  12.         if Hero.hero.health <= 0:
  13.             WIN = False
  14.         if self.health <= 0 and Hero.hero.health <= 0:
  15.             WIN = None
  16.         return WIN
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement