Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Jogador:
- def __init__(self, nome, email, num_jogos, num_vitorias):
- self.nome = nome
- self.email = email
- self.num_jogos = num_jogos
- self.num_vitorias = num_vitorias
- self.num_jogadores = 0
- def sobre(self):
- self.num_jogadores += 2
- print("Jogador:",self.nome,", número de jogos efetuados:",self.num_jogos,"Vitórias:",self.num_vitorias,"Total de jogadores no sistema:",self.num_jogadores)
- p1 = Jogador("Alucio Eugenio","alu@hotmail.com",2,2)
- p1.sobre()
- p2 = Jogador("Skrt","alu@hotmail.com",2,2)
- p2.sobre()
- class Wizzard(Jogador):
- def __init__(self,magic,health,spells,emfuga=False):
- self.magic = magic
- self.health = health
- self.spells = spells
- self.emfuga = emfuga
- def setMagic(self):
- if self.magic < 0 and self.magic > 100:
- print("Nao é possivel receber numero negativo ou superior a 100")
- else:
- pass
- def setSpells(self):
- if self.spells < 0 and self.spells > 100:
- print("Nao é possivel receber numero negativo ou superior a 100")
- else:
- pass
- def setHealth(self):
- if self.health < 0 and self.health > 100:
- print("Nao é possivel receber numero negativo ou superior a 100")
- else:
- pass
- class Warrior(Jogador):
- def __init__(self,strength,health,weapons,emfuga):
- self.strength = strength
- self.health = health
- self.weapons = weapons
- self.emfuga = emfuga
- def setStrength(self):
- if self.strength < 0 and self.strength > 100:
- print("Nao é possivel receber numero negativo ou superior a 100")
- else:
- pass
- def setWeapons(self):
- if self.weapons < 0 and self.weapons > 10:
- print("Nao é possivel receber numero negativo ou superior a 100")
- else:
- pass
- def setHealth(self):
- if self.health < 0 and self.health > 100:
- print("Nao é possivel receber numero negativo ou superior a 100")
- else:
- pass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement