コード例 #1
0
 private void askForMordredTarget(Card[] selection, Card mordredCard)
 {
     advDeck.discardCard(new Card[] { mordredCard });
     tempCardSelection = hp.removeCard(selection, mordredCard);
     if (activeQuest != null)
     {
         ui.askForPlayerChoice(activeQuest.getCurrentPlayer(), state.ASKINGFORMORDREDTARGET, "Select player you wish to remove an ally from", hp.removePlayers(activeQuest.getPlayerArr(), activeQuest.getPlayerInt(activeQuest.getCurrentPlayer())));
     }
     else if (tourney != null)
     {
         ui.askForPlayerChoice(tourney.getCurrentPlayer(), state.ASKINGFORMORDREDTARGET, "Select player you wish to remove an ally from", hp.removePlayers(tourney.getPlayerArr(), tourney.getPlayerInt(tourney.getCurrentPlayer())));
     }
 }
コード例 #2
0
    public override Card[] playTournament(ActiveTourney tourney)
    {
        bool someoneWillEvolve = false;
        bool iWillEvolve       = false;

        Card[] tempHand = getOnlyType("ally", "weapon", "amour");
        tempHand = sortHand(tempHand);
        int BPtotal = 0;

        Card[] submit = null;

        for (int i = 0; i < tourney.getPlayerArr().Length; i++)
        {
            if (tourney.getPlayerArr()[i] != player)
            {
                if (hp.willPlayerEvolve(tourney.getPlayerArr()[i], tounamentReward))
                {
                    someoneWillEvolve = true;
                }
            }
        }

        iWillEvolve = hp.willPlayerEvolve(player, tounamentReward);
        if (iWillEvolve || someoneWillEvolve)
        {
            Card [] weaponHand = getOnlyType("weapon");
            weaponHand = sortHand(weaponHand);

            Card [] amourHand = getOnlyType("amour");
            amourHand = sortHand(amourHand);

            Card [] allyHand = getOnlyType("ally");
            allyHand = sortHand(allyHand);

            if (amourHand != null)
            {
                for (int i = 0; i < amourHand.Length; i++)
                {
                    submit = hp.addCard(submit, amourHand[i]);
                }
            }
            if (allyHand != null)
            {
                for (int i = 0; i < allyHand.Length; i++)
                {
                    submit = hp.addCard(submit, allyHand[i]);
                }
            }
            if (weaponHand != null)
            {
                for (int i = 0; i < weaponHand.Length; i++)
                {
                    if (!hp.checkIfArrayContainsCard(submit, weaponHand[i]))
                    {
                        submit = hp.addCard(submit, weaponHand[i]);
                    }
                }
            }
            player.discardCard(submit);
            return(submit);
        }
        else
        {
            for (int i = 0; i < hand.Length; i++)
            {
                if (hp.numberOfCardInstancesInHand(hand, hand[i]) >= 2)
                {
                    submit = hp.addCard(submit, hand[i]);
                    player.discardCard(submit);
                    return(submit);
                }
            }
        }
        return(submit);
    }