Advertisement
atanasovetr

Nedovurshen OOP Kaufland

Mar 16th, 2019
315
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.00 KB | None | 0 0
  1. dmgTaken = 0
  2.  
  3. class Outrider:
  4.     def __init__(self, id1, name1, color1, dmg1, life1, shield1, capacity1):
  5.         self.id1 = float(id1)
  6.         self.name1 = str(name1)
  7.         self.color1 = bool(color1)
  8.         self.dmg1 = float(dmg1)
  9.         self.life1 = float(life1)
  10.         self.shield1 = float(shield1)
  11.         self.capacity1 = float(capacity1)
  12.         if self.color1 == True:
  13.             self.color1 = "White"
  14.         else:
  15.             self.color1 = "Black"
  16.  
  17.     def attack(self):
  18.         option = int(input())
  19.         if option == 2:
  20.             if dmg1 > shield2:
  21.                 life2 -= dmg1 - shield2
  22.             else:
  23.                 shield2-= dmg1
  24.         elif option == 3:
  25.             if dmg1 > shield3:
  26.                 life3 -= dmg1 - shield3
  27.             else:
  28.                 shield3-= dmg1
  29.     def is_destroyed(self, IsDestroyed1 = False):
  30.         self.IsDestroyed1 = IsDestroyed1
  31.         if life1 <= 0:
  32.             IsDestroyed1 = True
  33.             print(IsDestroyed1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement