def BuildAttackAction(user=BuildPokemonBattleWrapper(), target=BuildPokemonBattleWrapper(), attack="TACKLE"): """ Builds an Attack Action """ attack = BuildAttack(attack=attack) environment = BattleEnvironment() return AttackAction(attack, user, target, environment)
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
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()
def setAction(self, entry): """ Set the Chosen Action """ self.action = AttackAction(entry.getAttack(), self.pokemon, self.targets[0], self.battle.environment) self.stopRunning()
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)
def setAction(self, entry): """ Set the Attack Action """ self.action = AttackAction(entry.getAttack(), self.pkmn, self.targets[0], self.environment)
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)