コード例 #1
0
    public List <Card> setUpEarlyFoeEncounter(List <Card> hand, string questFoe, int prev)
    {
        strategyUtil strat        = new strategyUtil();
        List <Card>  foeEncounter = new List <Card>();
        List <Card>  foes         = new List <Card>();

        for (int i = 0; i < hand.Count; i++)
        {
            if (hand[i].type == "Foe Card" && strat.getValidCardBP(hand[i], new List <Player>(), questFoe) < prev)
            {
                foes.Add(hand[i]);
            }
        }

        foes = strat.sortFoesByDescendingOrder(foes, questFoe);
        foeEncounter.Add(foes[0]);
        hand.Remove(foes[0]);

        for (int i = 0; i < hand.Count; i++)
        {
            if (hand[i].type == "Weapon Card" && strat.hasMultiple(hand, hand[i].name) && strat.checkDuplicate(hand[i], foeEncounter, "Weapon Card") && ((strat.sumFoeEncounterCards(foeEncounter, questFoe) + strat.getValidCardBP(hand[i], new List <Player>(), questFoe) < prev)))
            {
                foeEncounter.Add(hand[i]);
                hand.Remove(hand[i]);
            }
        }
        return(foeEncounter);
    }
コード例 #2
0
    // We play the fewest cards possible to get to 50 or our best possible total
    public List <Card> playTournament(List <Player> players, List <Card> hand, int baseBP, int shields)
    {
        strategyUtil strat = new strategyUtil();
        // Generate a list of valid cards --> weapon, ally, and amour
        List <Card> validCards = new List <Card>();

        for (var i = 0; i < hand.Count; i++)
        {
            var type = hand[i].type;
            if (type == "Ally Card" || type == "Weapon Card" || type == "Amour Card")
            {
                validCards.Add(hand[i]);
            }
        }
        validCards = strat.sortAllValidCardsByDescendingBP(validCards, players, "");
        // get how much BP we need left by subtracting our base
        int bpNeeded = 50 - baseBP;

        // instantiate the list of cards were returning to play
        List <Card> cardsToPlay = new List <Card>();

        // index = 0, because were trying to move through the validCards one at a time
        int index = 0;

        // until either we run out of validCards or we have gone above the BP threshold we wish to hit (50)
        while (bpNeeded > 0 && index < validCards.Count)
        {
            // first make sure that we still have cards in validCards to evaluate
            // check that the card were trying to play isn't a duplicate weapon
            if (strat.checkDuplicate(validCards[index], cardsToPlay, "Weapon Card"))
            {
                // add the card to our cards to be played
                bpNeeded -= strat.getValidCardBP(validCards[index], players, "");
                cardsToPlay.Add(validCards[index]);
                hand.Remove(validCards[index]);
            }
            index++;
        }
        return(cardsToPlay);
    }
コード例 #3
0
    public List <Card> setUpEarlyFoeEncounter(List <Card> hand, string questFoe, int prev)
    {
        strategyUtil strat = new strategyUtil();
        // instantiate a list of foes we have and the foe encounter
        List <Card> foeEncounter = new List <Card>();
        List <Card> foes         = new List <Card>();

        // put all valid foe cards in the foes list
        for (int i = 0; i < hand.Count; i++)
        {
            if (hand[i].type == "Foe Card" && strat.getValidCardBP(hand[i], new List <Player>(), questFoe) < prev)
            {
                foes.Add(hand[i]);
            }
        }
        // sort by descending order, take teh strongest and return
        foes = strat.sortFoesByDescendingOrder(foes, questFoe);
        foeEncounter.Add(foes[0]);
        hand.Remove(foes[0]);

        return(foeEncounter);
    }