Ejemplo n.º 1
0
 def performWeatherEffectOnPokemon(self, pokemon):
     """ Performs the weather's effect on the Pokemon """
     messages = []
     if not self.immune(pokemon):
         messages.append("{0} was buffeted by the hail.".format(pokemon.getName()))
         messages += pokemon.takeRatioOfHealthAsDamage(16)
     messages += Weather.performWeatherEffectOnPokemon(self, pokemon)
     return messages
Ejemplo n.º 2
0
 def performWeatherEffectOnPokemon(self, pokemon):
     """ Performs the weather's effect on the Pokemon """
     messages = []
     if not self.immune(pokemon):
         messages.append("{0} was buffeted by the hail.".format(
             pokemon.getName()))
         messages += pokemon.takeRatioOfHealthAsDamage(16)
     messages += Weather.performWeatherEffectOnPokemon(self, pokemon)
     return messages
Ejemplo n.º 3
0
class performWeatherEffectOnPokemon(unittest.TestCase):
    """ Test cases of performWeatherEffectOnPokemon """
    def setUp(self):
        """ Build the Pokemon Battle Wrapper and weather for the test """
        self.weather = Weather()
        self.pkmn = BuildPokemonBattleWrapper()

    def performWeatherEffectOnPokemonMessage(self):
        """ Test that performWeatherEffectOnPokemon returns the Weather's between turns message """
        messages = self.weather.performWeatherEffectOnPokemon(self.pkmn)
        assert messages == [], "Should receive an empty between turn message for each Pokemon"
Ejemplo n.º 4
0
class performWeatherEffectOnPokemon(unittest.TestCase):
    """ Test cases of performWeatherEffectOnPokemon """
    
    def  setUp(self):
        """ Build the Pokemon Battle Wrapper and weather for the test """
        self.weather = Weather()
        self.pkmn = BuildPokemonBattleWrapper()
        
    def performWeatherEffectOnPokemonMessage(self):
        """ Test that performWeatherEffectOnPokemon returns the Weather's between turns message """
        messages = self.weather.performWeatherEffectOnPokemon(self.pkmn)
        assert messages == [], "Should receive an empty between turn message for each Pokemon"