示例#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)
示例#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
示例#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()
示例#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()
示例#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)
示例#6
0
 def setAction(self, entry):
     """ Set the Attack Action """
     self.action = AttackAction(entry.getAttack(), self.pkmn,
                                self.targets[0], self.environment)
示例#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)