Advertisement
Guest User

Untitled

a guest
Oct 13th, 2015
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 KB | None | 0 0
  1. import random
  2.  
  3. class grasspokemon:
  4. def __init__(self, name, health, attackmin, maxattack):
  5. self.name = name
  6. self.health = health
  7. self.attackmin = attackmin
  8. self.maxattack = maxattack
  9. class enemypokemon:
  10. def __init__(self, name, minhealth, maxhealth, minattack, maxattack):
  11. self.name = name
  12. self.minhealth = minhealth
  13. self.maxhealth = maxhealth
  14. self.minattack = minattack
  15. self.maxattack = maxattack
  16.  
  17.  
  18. Bulbasaur = grasspokemon('Bulbasaur', 5, 5, 10)
  19.  
  20.  
  21.  
  22. rattatata = enemypokemon('Rattatata', 3, 10, 2, 4)
  23. pidgey = enemypokemon('Pidgey', 3, 10, 2, 4)
  24. geodude = enemypokemon('Geodude', 3, 10, 2, 4)
  25. wild = [rattatata, pidgey, geodude];
  26. m_index = random.randint(0,len(wild)-1)
  27. wild_pokemon = wild[m_index]
  28.  
  29.  
  30. print 'A wild', wild_pokemon.name, 'has appeared!'
  31.  
  32. battle = raw_input('Will you battle? or flee? ')
  33. if battle == 'battle':
  34.  
  35. while wild_pokemon.maxhealth >= 1:
  36.  
  37. pokedam = random.randint(Bulbasaur.attackmin, Bulbasaur.maxattack)
  38. enemhealth = wild_pokemon.maxhealth
  39.  
  40.  
  41.  
  42. damage = pokedam - enemhealth
  43.  
  44. encounter = raw_input('Would you like to use vinewhip or razorleaf?')
  45.  
  46. if encounter == 'vinewhip':
  47.  
  48. enemhealth = enemhealth - damage
  49.  
  50. print enemhealth
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement