def test_minion_insertion_multiple(initialized_game): # Test that a minion inserted before the attack order doesnt disrupt attack order attacker_board = initialized_game.player_board[0] defender_board = initialized_game.player_board[1] defender_bag = PunchingBag() attacker_board.set_minions( [RatPack(taunt=True), Sellemental(), WrathWeaver()]) defender_board.set_minions([defender_bag]) initialized_game.start_of_game() # Attack with Rat initialized_game.single_round() # Skip bag attack initialized_game.single_round() # Attack with sellemental initialized_game.single_round() defender_bag.attack = 99 # Bag attacks and kills rat initialized_game.single_round() assert (len(attacker_board.minions) == 4) assert (attacker_board.minions[0].name and attacker_board.minions[1].name == "Rat") # Next minion to attack should be the wrath weaver (rats are inserted before it) minion = attacker_board.select_attacking_minion() assert (minion.name == "Wrath Weaver")
def test_minion_deathrattle_return_attack(initialized_game): # if a minion with deathrattle (or reborn) attacks and survives and on the next opposing attack # it is attacked and killed, its left most deathrattle minion (or its reborn self) should be next in the attack order attacker_board = initialized_game.player_board[0] defender_board = initialized_game.player_board[1] # TEST DEATHRATTLE attacker_board.set_minions([HarvestGolem(taunt=True), Imp()]) defender_board.set_minions([Sellemental(), Sellemental(), Sellemental()]) initialized_game.start_of_game(0) # Golem Attacks initialized_game.single_round() # Golem is attacked and killed initialized_game.single_round() attacker = attacker_board.select_attacking_minion() assert (attacker.name == "Damaged Golem") # TEST REBORN attacker_board.set_minions([BronzeWarden(taunt=True), HarvestGolem()]) defender_board.set_minions([Sellemental(), Sellemental(), Sellemental()]) initialized_game.start_of_game(0) # Dragon Attacks initialized_game.single_round() # Dragon is attacked and killed initialized_game.single_round() # Reborn dragon should still be the next attacker attacker = attacker_board.select_attacking_minion() assert (attacker.reborn_triggered) assert (attacker.name == "Bronze Warden") # TEST DEATHRATTLE AND REBORN punching_bag = PunchingBag() attacker_board.set_minions([ MicroMummy(taunt=True, deathrattles=[ReplicatingMenaceDeathrattle()]), HarvestGolem() ]) defender_board.set_minions([punching_bag]) initialized_game.start_of_game(0) # Mummy Attacks initialized_game.single_round() # Punching bag kills mummy punching_bag.attack = 99 initialized_game.single_round() # Mummy dies, microbots spawn first, then mummy is reborn, bots should attack first attacker = attacker_board.select_attacking_minion() assert (attacker.name == "Microbot") assert (attacker_board.minions[3].name == "Micro Mummy") assert (attacker_board.minions[3].reborn_triggered)