Beispiel #1
0
    public override void doAction(Action cause, Card user, HearthstoneBoard board, List <Card> alwaysUse)
    {
        board.printDebugMessage("Performing action: deathrattle dmg bonus: " + user, HearthstoneBoard.OutputPriority.EFFECTTRIGGERS);

        BoardSide userBoard = board.getBoardFromMinion(user);

        if (userBoard.Count == 1)
        {
            return;
        }


        for (int i = 0; i < times; i++)
        {
            while (true)
            {
                int target = board.getRandomNumber(0, userBoard.Count);
                if (userBoard[target] != user)
                {
                    board.printDebugMessage("Giving damage bonus to " + userBoard[target].getReadableName(), HearthstoneBoard.OutputPriority.INTENSEDEBUG);
                    userBoard[target].addAttack(user.getAttack(board));
                    break;;
                }
            }
        }
    }
Beispiel #2
0
    public override void doAction(Action cause, Card user, HearthstoneBoard board, List <Card> alwaysUse)
    {
        board.printDebugMessage("Performing action: deathrattledivine: " + user, HearthstoneBoard.OutputPriority.EFFECTTRIGGERS);

        BoardSide userBoard = board.getBoardFromMinion(user);

        for (int i = 0; i < times; i++)
        {
            bool stop = true;
            foreach (Card c in userBoard)
            {
                if (c != user && !c.divineShield)
                {
                    board.printDebugMessage("Found minion without divine shield " + c.getReadableName(), HearthstoneBoard.OutputPriority.INTENSEDEBUG);
                    stop = false;
                }
            }
            if (stop)
            {
                return;
            }
            while (true)
            {
                int target = board.getRandomNumber(0, userBoard.Count);
                if (!userBoard[target].divineShield && userBoard[target] != user)
                {
                    board.printDebugMessage("Giving divine shield to " + userBoard[target].getReadableName(), HearthstoneBoard.OutputPriority.INTENSEDEBUG);
                    userBoard[target].setDivineShield(true);
                    break;
                }
            }
        }
    }
Beispiel #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 Card getRandomCard(HearthstoneBoard board)
 {
     return(CardCreatorFactory.createFromName(pool[board.getRandomNumber(0, pool.Length)]));
 }
Beispiel #5
0
 public Card getRandomCard(HearthstoneBoard board)
 {
     return(this[board.getRandomNumber(0, Count)]);
 }
Beispiel #6
0
    public override void doAction(Action cause, Card user, HearthstoneBoard board, List <Card> alwaysUse)
    {
        board.printDebugMessage("Performing action: make extra summon: " + user, HearthstoneBoard.OutputPriority.EFFECTTRIGGERS);
        BoardSide userboard = board.getBoardFromMinion(user);

        for (int i = 0; i < userboard.IndexOf(user); i++)
        {
            if (userboard[i].hasEffect(this))
            {
                return;
            }
        }
        if (current < 1)
        {
            current = count;
        }
        else
        {
            Card c = ((CardSpawnedAction)cause).spawnedCard();
            if (c == user)
            {
                return;
            }
            current--;
            board.printDebugMessage("khadgar effect used, count is now " + current, HearthstoneBoard.OutputPriority.INTENSEDEBUG);
            board.addNewMinionToBoard(board.getPlayerFromMinion(user), c.copy().setId(board.getRandomNumber(1, 9999)), board.getPositionFromMinion(c), true);
        }
    }