Example #1
0
 def  setUp(self):
     """ Build the Pkmn and Precondition Checker for the test """
     self.user = BuildPokemonBattleWrapper()
     self.target = BuildPokemonBattleWrapper()
     self.environment = BattleEnvironment()
     
     self.attack = AttackFactory.getAttackAsNew("DIG")
     self.preconditionChecker = PreconditionChecker(self.user, self.target, self.environment, self.attack)
     
     attack2 = AttackFactory.getAttackAsNew("TACKLE")
     self.preconditionChecker2 = PreconditionChecker(self.user, self.target, self.environment, attack2)
Example #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
 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  setUp(self):
     """ Build the Trainer and Pokemon lists for use in tests """
     self.trainer = ComputerTrainer()
     self.battlePkmn = BuildPokemonBattleWrapper(trainer = self.trainer)
     self.targetPkmn  = BuildPokemonBattleWrapper()
     
     self.attack = AttackFactory.getAttackAsNew("TACKLE")
     self.battlePkmn.pkmn.battleDelegate.attacks = [self.attack]
Example #5
0
 def  setUp(self):
     """ Build the Pkmn and Delegate for the test """
     self.user = BuildPokemonBattleWrapper()
     self.target = BuildPokemonBattleWrapper()
     attack = AttackFactory.getAttackAsNew("TACKLE")
     
     self.hp = 100
     self.target.setCurrHP(self.hp)
     
     self.delegate = OneHitDelegate(attack, 1)
Example #6
0
 def levelUp(self):
     """ Level up the Pokemon """
     self.level += 1
     events = ["{0} leveled up to level {1}.".format(self.name, self.level)]
     
     self.stats.levelUp()
     if self.level in self.species.attacksForLevel:
         for attackName in self.species.attacksForLevel[self.level]:
             attack = AttackFactory.getAttackAsNew(attackName)
             event = LearnAttackEvent(self, attack)
             if event.canLearnAttack():
                 events += event.perform()
             else:
                 events.append(event)
     return events
 def  setUp(self):
     """ Build the Attack, Delegates and Pkmn for the test """
     self.attack = AttackFactory.getAttackAsNew("MEGA DRAIN")
     self.target = BuildPokemonBattleWrapper()
     self.damage = 20
 def setUp(self):
     """ Build the Attack, Delegates and Pkmn for the test """
     self.attack = AttackFactory.getAttackAsNew("MEGA DRAIN")
     self.target = BuildPokemonBattleWrapper()
     self.damage = 20
Example #9
0
def BuildAttack(attack="TACKLE"):
    """ Builds an Attack """
    return AttackFactory.getAttackAsNew(attack)
Example #10
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)
Example #11
0
def BuildAttack(attack = "TACKLE"):
    """ Builds an Attack """
    return AttackFactory.getAttackAsNew(attack)
Example #12
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)