Esempio n. 1
0
def BuildAttackAction(user=BuildPokemonBattleWrapper(),
                      target=BuildPokemonBattleWrapper(),
                      attack="TACKLE"):
    """ Builds an Attack Action """
    attack = BuildAttack(attack=attack)
    environment = BattleEnvironment()
    return AttackAction(attack, user, target, environment)
Esempio n. 2
0
 def setUp(self):
     """ Build the Attack Action """
     attack = AttackFactory.getAttackAsNew("TACKLE")
     self.priority = attack.speedDelegate.priority
     attack.use = self.use
     self.action = AttackAction(attack, None, None, None)
     self.usedAttack = False
Esempio n. 3
0
 def setAction(self, entry):
     """ Set the Chosen Action """
     if entry.getAttack().currPowerPoints == 0:
         self.runController(
             MessageBoxController(
                 BattleMessage("No PP left for this attack."), self.screen))
     else:
         self.action = AttackAction(entry.getAttack(), self.pokemon,
                                    self.targets[0], self.environment)
         self.stopRunning()
Esempio n. 4
0
 def setAction(self, entry):
     """ Set the Chosen Action """
     self.action = AttackAction(entry.getAttack(), self.pokemon,
                                self.targets[0], self.battle.environment)
     self.stopRunning()
Esempio n. 5
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. 6
0
 def setAction(self, entry):
     """ Set the Attack Action """
     self.action = AttackAction(entry.getAttack(), self.pkmn,
                                self.targets[0], self.environment)
Esempio n. 7
0
 def pickAction(self, user, targets, playerSide, oppSide, environment):
     """ Has the trainer pick its action via the screen
          Should be overwritten in subclasses """
     return AttackAction(None, None, None, None)