Esempio n. 1
0
def BuildActionLock(
        user=BuildPokemonBattleWrapper(),
        attackAction=BuildAttackAction(user=BuildPokemonBattleWrapper())):
    """ Builds an Action Lock """
    attackAction.user = user
    turns = 3
    return ActionLock(user, attackAction, turns)
Esempio n. 2
0
 def applyEffect(self, user, target, environment):
     """ Applies the delegates effect """
     messages = []
     pkmn = self.getEffectedPokemon(user, target)
     
     if not self.immune(pkmn):
         pkmn.encore = ActionLock(pkmn, pkmn.lastAction, self.turns)
             
     return messages
    def affectPkmn(self, pkmn):
        """ Applies the lock to the correct pkmn """
        message = []
        if pkmn.lastAction and hasattr(pkmn.lastAction, "attack"):
            pkmn.actionLock = ActionLock(pkmn,  \
                                                        pkmn.lastAction, self.turns)
        else:
            message = ["But it failed"]

        return message
Esempio n. 4
0
 def setUp(self):
     """ Build action for the test"""
     attack = AttackFactory.getAttackAsNew("TACKLE")
     self.action = AttackAction(attack, None, None, None)
     self.turns = 2
     self.actionLock = ActionLock(self, self.action, self.turns)
Esempio n. 5
0
 def setUp(self):
     """ Build action for the tests"""
     self.doneLock = ActionLock(None, None, 0)
     self.notDoneLock = ActionLock(None, None, 1)
 def applyLock(self, pkmn):
     """ Locks the side to use this move """
     pkmn.actionLock = ActionLock(pkmn, pkmn.lastAction, self.turns - 1)