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)
 def  setUp(self):
     """ Build the Pkmn and Delegate for the test """
     self.user = BuildPokemonBattleWrapper()
     self.target = BuildPokemonBattleWrapper()
     self.environment = BattleEnvironment()
     
     self.delegate = NullDamageDelegate()
Esempio n. 3
0
 def  setUp(self):
     """ Build the Pkmn and Precondition Checker for the test """
     self.user = BuildPokemonBattleWrapper()
     self.target = BuildPokemonBattleWrapper()
     self.environment = BattleEnvironment()
     
     attack = AttackFactory.getAttackAsNew("TACKLE")
     self.preconditionChecker = PreconditionChecker(self.user, self.target, self.environment, attack)
Esempio n. 4
0
 def  setUp(self):
     """ Build the Pkmn and Delegate for the test """
     self.attack = BuildAttack()
     self.user = BuildPokemonBattleWrapper()
     self.target = BuildPokemonBattleWrapper()
     self.environment = BattleEnvironment()
     
     self.toHit = 100.0
     self.delegate = HitDelegate(self.attack, self.toHit)
Esempio n. 5
0
 def __init__(self, playerTrainer, oppTrainer):
     """ Builds the two participating sides of the battle """
     self.playerSide = BattleSide(playerTrainer)
     self.oppSide = BattleSide(oppTrainer)
     self.environment = BattleEnvironment()
     self.over = False
     self.round = BattleRound(self.playerSide, self.oppSide,
                              self.environment)
     self.eventQueue = deque()
     self.introduce()
Esempio n. 6
0
 def  setUp(self):
     """ Build the Effect, Environment, and Pokemon for the test """
     self.turnToAttack = 1
     self.effect = WeatherChargeDelegate(2, self.turnToAttack, "Some Message", Hail.type)
     self.environment = BattleEnvironment()
     self.user = BuildPokemonBattleWrapper()
Esempio n. 7
0
 def setUp(self):
     """ Build the Pkmn and Delegate for the test """
     self.delegate = AlwaysHitDelegate("")
     self.environment = BattleEnvironment()
 def setUp(self):
     """ Build the *** for the test """
     self.environment = BattleEnvironment()
     self.environment.weather = None
Esempio n. 9
0
 def setUp(self):
     """ Grabs the message dictionary from StatModDelegate """
     self.environment = BattleEnvironment()
     self.pkmn = BuildPokemonBattleWrapper()
     self.delegate = ChargeDelegate(2, 0, "")