public override void doAction(Action cause, Card user, HearthstoneBoard board, List <Card> alwaysUse)
    {
        board.printDebugMessage("Performing action: bomb deathrattle: " + user, HearthstoneBoard.OutputPriority.EFFECTTRIGGERS);
        BoardSide   opponentBoard = board.getOpponentBoardFromMinion(user);
        List <Card> targets       = new List <Card>();

        for (int i = 0; i < times; i++)
        {
            if (opponentBoard.Count == 0)
            {
                return;
            }
            Card target = opponentBoard.getRandomCardAlive(board);
            if (target == null)
            {
                return;
            }
            user.causeDamageToTarget(target, board, 4);
            targets.Add(target);
        }
        foreach (Card c in targets)
        {
            c.deathCheck(board);
        }
    }
    public override void doAction(Action cause, Card user, HearthstoneBoard board, List <Card> alwaysUse)
    {
        board.printDebugMessage("Performing action: overkill fire: " + user, HearthstoneBoard.OutputPriority.EFFECTTRIGGERS);
        BoardSide opponentBoard = board.getOpponentBoardFromMinion(user);

        if (opponentBoard.Count != 0)
        {
            for (int i = 0; i < opponentBoard.Count; i++)
            {
                if (opponentBoard[i].isAlive())
                {
                    user.causeDamageToTarget(opponentBoard[i], board, dmg);
                    break;
                }
            }
        }
    }
Example #3
0
    public override void doAction(Action cause, Card user, HearthstoneBoard board, List <Card> alwaysUse)
    {
        board.printDebugMessage("Performing action: start of turn fire: " + user, HearthstoneBoard.OutputPriority.EFFECTTRIGGERS);
        BoardSide opponentBoard = board.getOpponentBoardFromMinion(user);
        BoardSide current       = board.getBoardFromMinion(user);
        int       counter       = 0;

        foreach (Card c in current)
        {
            if (c.typeMatches(Card.Type.Dragon))
            {
                counter++;
            }
        }
        for (int i = 0; i < times; i++)
        {
            if (opponentBoard.Count == 0)
            {
                return;
            }
            int target = board.getRandomNumber(0, opponentBoard.Count);
            if (board.stopFlag)
            {
                board.attacker         = user;
                board.defender         = opponentBoard[target];
                board.finishedWorkFlag = true;
                while (board.stopFlag)
                {
                    Thread.Sleep(100);
                }
                board.finishedWorkFlag = false;
                board.stopFlag         = true;
            }
            user.causeDamageToTarget(opponentBoard[target], board, counter);
        }
    }
 public override void doAction(Action cause, Card user, HearthstoneBoard board, List <Card> alwaysUse)
 {
     board.printDebugMessage("Performing action: deathrattlesummon opponent: " + user, HearthstoneBoard.OutputPriority.EFFECTTRIGGERS);
     board.addNewMinionToBoard(board.getOpponentBoardFromMinion(user), CardCreatorFactory.createFromName(summon).setAttackPriority(Card.MAX_PRIORITY - 1), -1, false);
 }