title: Python Class Pokemon Battle
body: <p>Hey stackoverflow users,</p>
  
  <p>I am trying to write a Python class for a pokemon battle. I followed the posts <a href="https://stackoverflow.com/a/11706586/6811718">here</a>, but I am trying to integrate the different pokemon typing. For instance, fire, grass, and water and allow them to function as they do in the game. For example, fire is super effective against grass. I am not sure if I should add in another function for type or define the typing within the constructor and write a series of nesting statements that determine effectiveness or ineffectiveness.</p>
  
  <pre><code>class Pokemon(object):
          def __init__(self, name, HP, Damage, type):
          self.name = name     #Sets the name of the Pokemon
          self.HP = HP         #The Hit Points or health of this pokemon
          self.Damage = Damage #The amount of Damage this pokemon does every     attack
          self.type = type #Determines the type of the pokmeon to factor in effectiveness
  
      def Battle(self, Opponent):
          if self.type == 'grass':
              self.Damage = self.Damage * 1.35
  
          if(self.HP &gt; 0): #While your pokemon is alive it will coninute the Battle
              print("%s did %d Damage to %s"%(self.name, self.Damage, Opponent.name)) #Text-based combat descriptors
              print("%s has %d HP left"%(Opponent.name,Opponent.HP)) #Text-based descriptor for the opponent's health
  
          Opponent.HP -= self.Damage #The damage you inflict upon the opponent is subtracted here
          return Opponent.Battle(self)  #Now the Opponent pokemon attacks
      else:
          print("%s wins! (%d HP left)" %(Opponent.name, Opponent.HP)) #declares the winner of the Battle
          return Opponent, self  #return a tuple (Winner, Loser)
  
  Squirtle = Pokemon('Squirtle', 100, 5, 'water')
  Bulbasaur = Pokemon('Bulbasaur', 100, 10, 'grass')
  Winner, Loser = Bulbasaur.Battle(Squirtle)
  </code></pre>