class Riven:
camp = 'Noxus'
def __init__(self,nickname,
aggressivity=50,
life_value=414,
money=1001,
armor=3):
self.nickname = nickname
self.aggressivity = aggressivity
self.life_value = life_value
self.money = money
self.armor = armor
def attack(self,enemy):
damage_value = self.aggressivity-enemy.armor
enemy.life_value -= damage_value
class Garen:
camp='Demacia'
def __init__(self,nickname,
aggressivity=58,
life_value=455,
money=100,
armor=10):
self.nickname = nickname
self.aggressivity= aggressivity
self.life_value = life_value
self.money = money
self.armor = armor
def attack(self,enemy):
damage_value=self.aggressivity-enemy.armor
enemy.life_value -= damage_value
class BlackCleaver:
def __init__(self, price=475, aggrev=9, life_value=100):
self.price=price
self.aggrev=aggrev
self.life_value=life_value
def update(self,obj):
obj.money -= self.price
obj.aggressivity=self.aggrev
obj.life_value+=self.life_value
def fire(self,obj):
obj.life_value-=1000
r1=Riven('草')
g1=Garen('盖')
b1=BlackCleaver()
print(r1.aggressivity,r1.life_value,r1.money)
if r1.money>b1.price:
r1.b1=b1
b1.update(r1)
print(g1.life_value)
r1.attack(g1)
print(g1.life_value)
r1.b1.fire(g1)
print(g1.life_value)