Advertisement
Guest User

Untitled

a guest
Feb 18th, 2020
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.12 KB | None | 0 0
  1. class Jogador:
  2. def __init__(self, nome, email, num_jogos, num_vitorias):
  3. self.nome = nome
  4. self.email = email
  5. self.num_jogos = num_jogos
  6. self.num_vitorias = num_vitorias
  7. self.num_jogadores = 0
  8.  
  9. def sobre(self):
  10. self.num_jogadores += 2
  11. 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)
  12.  
  13. p1 = Jogador("Alucio Eugenio","alu@hotmail.com",2,2)
  14. p1.sobre()
  15. p2 = Jogador("Skrt","alu@hotmail.com",2,2)
  16. p2.sobre()
  17.  
  18. class Wizzard(Jogador):
  19. def __init__(self,magic,health,spells,emfuga=False):
  20. self.magic = magic
  21. self.health = health
  22. self.spells = spells
  23. self.emfuga = emfuga
  24.  
  25. def setMagic(self):
  26. if self.magic < 0 and self.magic > 100:
  27. print("Nao é possivel receber numero negativo ou superior a 100")
  28. else:
  29. pass
  30.  
  31. def setSpells(self):
  32. if self.spells < 0 and self.spells > 100:
  33. print("Nao é possivel receber numero negativo ou superior a 100")
  34. else:
  35. pass
  36.  
  37. def setHealth(self):
  38. if self.health < 0 and self.health > 100:
  39. print("Nao é possivel receber numero negativo ou superior a 100")
  40. else:
  41. pass
  42.  
  43. class Warrior(Jogador):
  44. def __init__(self,strength,health,weapons,emfuga):
  45. self.strength = strength
  46. self.health = health
  47. self.weapons = weapons
  48. self.emfuga = emfuga
  49.  
  50. def setStrength(self):
  51. if self.strength < 0 and self.strength > 100:
  52. print("Nao é possivel receber numero negativo ou superior a 100")
  53. else:
  54. pass
  55.  
  56. def setWeapons(self):
  57. if self.weapons < 0 and self.weapons > 10:
  58. print("Nao é possivel receber numero negativo ou superior a 100")
  59. else:
  60. pass
  61.  
  62. def setHealth(self):
  63. if self.health < 0 and self.health > 100:
  64. print("Nao é possivel receber numero negativo ou superior a 100")
  65. else:
  66. pass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement