Ejemplo n.º 1
0
    def set_aside_dead_minions(self, own_board: PlayerBoard,
                               enemy_board: PlayerBoard):
        """Remove any dead minions. Return the List of minions to process any deathrattles and reborn triggers.

        Arguments:
            board {PlayerBoard} -- Player board to check for dead minions
        """
        dead_minions = own_board.select_dead()
        left_neighors = []
        for minion in dead_minions:
            left_neighors.append(minion.left_neighbor)

        # Dead minions care about their left neighbor for deathrattle/reborn positioning
        for index, minion in enumerate(dead_minions):
            own_board.remove_minion(minion, enemy_board)
            minion.left_neighbor = left_neighors[index]

        return dead_minions
Ejemplo n.º 2
0
    def kill(self, minion: Minion, minion_board: PlayerBoard, opposing_board: PlayerBoard, minion_defending_player: bool):
        """Kill a minion off and update board using deathrattles and other triggers

        Arguments:
            minion {Minion} -- Minion that will die
            minion_board {PlayerBoard} -- Player board belonging to the minion
            opposing_board {PlayerBoard} -- Board opposing of the minion that dies
            minion_defending_player {bool} -- Whether the minion died is on the defending side for trigger orders
        """
        # TODO: Baron
        if minion_defending_player:
            opposing_board.remove_minion(minion)
        else:
            minion_board.remove_minion(minion)
        for deathrattle in minion.deathrattles:
            if minion_defending_player:
                deathrattle.trigger(minion, opposing_board, minion_board)
            else:
                deathrattle.trigger(minion, minion_board, opposing_board)
        self.check_deaths(minion_board, opposing_board)