Examples of ManaCollection


Examples of csa.jportal.match.ManaCollection

        Card card = pendingCommunication.E.mInitiatorCard;
        if (mana.paymentType == ManaPayment.MP_TRIGGER_ACTIVATE_CARD)
        {
            // only spontanous Mana supported as yet
            EAIAction ret;
            ManaCollection cost = ManaCollection.getCost(mana);
            ManaCollection possibleMana = E.helper.getMaxAvailableMana(vMatch);
            ManaCollection paymentMana = possibleMana.getPaymentFor(cost, null);

            // not enough mana to pay!
            if (paymentMana == null)
            {
                EAIAction p = EAIAction.createPayManaAction(0, -1, null);
                boolean success = vMatch.executeAction(p, player, false);
                addAction(0, p);
                String key = EnhancedAI.generateCurrentVMatchKey(vMatch, player);
                p.setVMatchKeyAfter(key);
                return;
            }

            Vector <ManaItem> items = paymentMana.getManaItems();
            Vector<EAIAction> payment = new Vector<EAIAction>();
            if (items.size() >0 )
            {
                for (int i = 0; i < items.size(); i++)
                {
View Full Code Here

Examples of csa.jportal.match.ManaCollection

            {
                EAIPlanTree leaf = new EAIPlanTree(this, false);
                leafs.addElement(leaf);
               
                // opponent: activate cards that are in battlefield -> like kings assassin!
                ManaCollection possibleMana = EAIHelper.getMaxAvailableMana(vMatch, opponent);
                CardSimList possibleActivateableCards = vMatch.getBattlefield(opponent);
                possibleActivateableCards = EAIHelper.onlyAllowedToActivate(possibleActivateableCards, currentPhase, true, vMatch);
                possibleActivateableCards = EAIHelper.onlyUntappedToActivate(possibleActivateableCards);

                Vector<CardAndMana> _cam = new Vector<CardAndMana>();
                for(int c=0; c< possibleActivateableCards.size(); c++)
                {
                    CardSim card = possibleActivateableCards.getCard(c);
                    ManaCollection cost = ManaCollection.getActivateCost(card);
                   
                    // TODO: hack for kicker prevention
                    //
                    if (!card.getCard().isKicker())
                        if (possibleMana.isCostFit(cost))
                        {
                            _cam.addElement(new CardAndMana(CardAndMana.CAM_ACTIVATE , card, cost));
                            possibleMana = possibleMana.subMana(cost);
                        }
                }

                // cams ready, now -> targets! (one)
                for (int i = _cam.size()-1; i >= 0; i--)
                {
                    CardAndMana cam = _cam.elementAt(i);
                    AIEnhancedCardHints hints = AIEnhancedCardHints.getHints(cam.card);
                    Vector<EAIAction> sources = createOneOpponentSource(cam, hints); // at least one empty target! or null -> must targets not available!
                    if (sources == null)
                    {
                        continue;
                    }
                    Vector<EAIAction> targets = createOneOpponentTarget(cam, hints)// at least one empty target! or null -> must targets not available!
                    if (targets == null)
                    {
                        continue;
                    }
                    Vector<EAIAction> target = joinSourceAndTarget(sources, targets);
                    boolean successfull = leaf.leafExceuteOneAction(cam, target, opponent, camListBefor(_cam, i));
                }
            }
            else if(currentPhase == MatchConstants.PHASE_COMBAT_DECLARE_ATTACKERS)
            {
                if (mDoStacking)
                {
                    // in stack I dont estimate opponents attackers
                    EAIPlanTree leaf = new EAIPlanTree(this, false); // try out
                    leafs.addElement(leaf);
                    return;
                }

                // opponent: activate cards that are in battlefield

                // todo build best attacking opponent can do
                // which would be the worst case scenario
                // doing an ALL OUT attack :-)
                // therefor only that option is to be tested
                // "Phew" - no explosion of choices here!

//System.out.println("Try declaring attackers of other AI!");
                // generate instant, activations

                // generate instant, activations
                // after that create all possible attackers

                // create permutations
                // possibly reuse same in different leafs (not known from here,
                // other leafs are in parent - caching and cloning?

                // now for each leaf all attack possibilities

                // dummy as long as above is not implemented
                // allways add a empty leaf
                EAIPlanTree leaf = new EAIPlanTree(this, false);

                // opponent: activate cards that are in battlefield -> like kings assassin!
                ManaCollection possibleMana = EAIHelper.getMaxAvailableMana(vMatch, opponent);
                CardSimList possibleActivateableCards = vMatch.getBattlefield(opponent);
                possibleActivateableCards = EAIHelper.onlyAllowedToActivate(possibleActivateableCards, currentPhase, true, vMatch);
                possibleActivateableCards = EAIHelper.onlyUntappedToActivate(possibleActivateableCards);

                CardSimList activated = new CardSimList();
               
                Vector<CardAndMana> _cam = new Vector<CardAndMana>();
                for(int c=0; c< possibleActivateableCards.size(); c++)
                {
                    CardSim card = possibleActivateableCards.getCard(c);
                    ManaCollection cost = ManaCollection.getActivateCost(card);
                    if (possibleMana.isCostFit(cost))
                    {
                        _cam.addElement(new CardAndMana(CardAndMana.CAM_ACTIVATE , card, cost));
                        possibleMana = possibleMana.subMana(cost);
                    }
View Full Code Here

Examples of csa.jportal.match.ManaCollection

        if (landsOnly.size() == 1) return landsOnly.getCard(0);
       

        CardSimList hand = (CardSimList) vMatch.getHand(E.pNumber).clone();
//        hand.removeTypes("Land")
        ManaCollection possibleMana = E.helper.getMaxAvailableManaUnstated(vMatch);
        int preCount = EAIHelper.onlyEnoughMana(hand, possibleMana).size();
       
        int manaBlack = vMatch.getLand(E.pNumber).getSubListBySubType("Swamp").size();
        int manaRed = vMatch.getLand(E.pNumber).getSubListBySubType("Mountain").size();
        int manaWhite = vMatch.getLand(E.pNumber).getSubListBySubType("Plains").size();
        int manaBlue = vMatch.getLand(E.pNumber).getSubListBySubType("Island").size();
        int manaGreen = vMatch.getLand(E.pNumber).getSubListBySubType("Forest").size();

        int blackNeed = getNeedMana("B");
        int redNeed = getNeedMana("R");
        int whiteNeed = getNeedMana("W");
        int blueNeed = getNeedMana("U");
        int greenNeed = getNeedMana("G");
       
        if (!landsOnly.hasLand("B"))
            blackNeed = Integer.MIN_VALUE;
        else
            blackNeed -= manaBlack;
           
        if (!landsOnly.hasLand("R"))
            redNeed = Integer.MIN_VALUE;
        else
            redNeed -= manaRed;
       
        if (!landsOnly.hasLand("W"))
            whiteNeed = Integer.MIN_VALUE;
        else
            whiteNeed -= manaWhite;

        if (!landsOnly.hasLand("U"))
            blueNeed = Integer.MIN_VALUE;
        else
            blueNeed -= manaBlue;
   
        if (!landsOnly.hasLand("G"))
            greenNeed = Integer.MIN_VALUE;
        else
            greenNeed -= manaGreen;
       
        for (int i=0; i< landsOnly.size(); i++)
        {
            CardSim newLand = landsOnly.getCard(i);
            possibleMana = E.helper.getMaxAvailableManaUnstated(vMatch);
           
            ManaItem mana = ManaItem.createManaItem(newLand);
            possibleMana.addMana(mana);

            int count = EAIHelper.onlyEnoughMana(hand, possibleMana).size();
            if (count == preCount) continue;
            if (newLand.getNowColor().toUpperCase().indexOf("R") != -1)
                redNeed+=2;
View Full Code Here

Examples of csa.jportal.match.ManaCollection

    }

    String buildFuturePlayPossibleKey()
    {
        String key = "";
        ManaCollection possibleMana = E.helper.getMaxAvailableMana(vMatch);
        // list of all cards, that can be played with mana available

        // HAND cards
        CardSimList hand = (CardSimList) vMatch.getHand(E.pNumber).clone();
        CardSimList possiblePlayableCards;
View Full Code Here

Examples of csa.jportal.match.ManaCollection

     *
     * NOT checked if fitting targets are available for cards!
     */
    Vector<CardAndMana> generatePossibleActionsGeneral(boolean restrictMana, Vector<EAIAction> stack)
    {
        ManaCollection possibleMana = E.helper.getMaxAvailableMana(vMatch);
        CardSimList hand = (CardSimList) vMatch.getHand(E.pNumber).clone();
        // list of all cards, that can be played with mana available
        CardSimList possiblePlayableCards;


        // do different optimizations of "possible" playable cards

        // LAND Play
        // should be in phase 1
        // and only one land of a type
        boolean landPlay = true;
        boolean removeDebufs = false;
        if (isMyTurn())
        {
            if (E.aiPlayer.getEAIConfig().getLandForceMain1())
            {
                if (vMatch.getPhase() != MatchConstants.PHASE_MAIN1)
                {
                    landPlay = false;
                }
            }
            if (landPlay)
            {
                if (!decidePlayLand())
                {
                    landPlay = false;
                }
                else
                {
                }
            }
            // this one should ensure land play when a land was got in attacking phase
            // like tapping tales researcher...
            if (vMatch.getPhase() == MatchConstants.PHASE_MAIN2)
            {
                if (decidePlayLand())
                {
                    if (!(vMatch.isLandPlayed(E.pNumber)))
                    {
                        if (E.aiPlayer.getEAIConfig().getLandForceMain1())
                        {
                            landPlay = true;
                        }
                    }
                }
            }
        }
        else
        {
            landPlay = false;
        }
        boolean willPlayLand = false;
        if ((vMatch.isLandPlayed(E.pNumber)) || (!landPlay))
        {
            // remove all lands, apart from land that is about to be played
            for (int i = hand.size()-1; i >= 0 ; i--)
            {
                CardSim card = hand.getCard(i);
                if (card.isLand())
                {
                    hand.remove(card);
                }
            }
            possiblePlayableCards = hand;
        }
        else
        {
            possiblePlayableCards = hand;
            // reduce to one land per type
            for (int i=0; i <possiblePlayableCards.size(); i++)
            {
                CardSim c = possiblePlayableCards.getCard(i);
                if (c.getType().equals("Basic Land"))
                {
                    removeButOneLandTypeAndFirstInList(possiblePlayableCards, c);
                    willPlayLand = true;
                }
            }
        }

        if (willPlayLand)
        {
            // reduce land play options to the one we think is best
            CardSimList landsOnly = possiblePlayableCards.getSubListByType("Basic Land");
            possiblePlayableCards = possiblePlayableCards.removeTypes("Basic Land");
            CardSim goodLand = getBestPlayableLand(landsOnly);
            if (goodLand != null)
                possiblePlayableCards.addCard(goodLand);
        }

        if (isMyTurn())
        {
            // and without additional buf/debuf/damage stuff
            // all of them should only be played in Main 2
            if (vMatch.getPhase() == MatchConstants.PHASE_MAIN1)
            {
                // if we can / should not attack
                // than there is no need to try buffing our creatures
                if (!canAttack())
                {
                    // dont consider one turn only Buffs
                    possiblePlayableCards = EAIHelper.removeOneRoundBufs(HintAll.HINT_SITUATION_CARD_PLAYED, possiblePlayableCards);

                    // dont consider one turn only Debufs for opponent Buffs
                    possiblePlayableCards = EAIHelper.removeOneRoundDeBufs(HintAll.HINT_SITUATION_CARD_PLAYED, possiblePlayableCards);
                    removeDebufs = true;
                }
            }
            else if (vMatch.getPhase() == MatchConstants.PHASE_MAIN2)
            {
                // dont consider one turn only Buffs
                possiblePlayableCards = EAIHelper.removeOneRoundBufs(HintAll.HINT_SITUATION_CARD_PLAYED, possiblePlayableCards);

                // dont consider one turn only Debufs for opponent Buffs
                possiblePlayableCards = EAIHelper.removeOneRoundDeBufs(HintAll.HINT_SITUATION_CARD_PLAYED, possiblePlayableCards);
                removeDebufs = true;
            }

        }

        // wenn keine Gegner da sind, keine Debuf / Damage Creature Cards
        if (vMatch.getBattlefield((E.pNumber+1)%).size() == 0)
        {
            if (!removeDebufs)
            {
                possiblePlayableCards = EAIHelper.removeOneRoundDeBufs(HintAll.HINT_SITUATION_CARD_PLAYED, possiblePlayableCards);
            }
            possiblePlayableCards = EAIHelper.removeCreatureOnlyDamages(HintAll.HINT_SITUATION_CARD_PLAYED, possiblePlayableCards);
        }
        if ((vMatch.getPhase() == MatchConstants.PHASE_MAIN1) || (vMatch.getPhase() == MatchConstants.PHASE_MAIN2))
        {
            // remove buf / debug instants
            // this can and will be played in attack / block
            possiblePlayableCards = EAIHelper.removeDeBufInstants(possiblePlayableCards);
        }
       
        CardSimList field = vMatch.getBattlefield(E.pNumber);

        if (restrictMana)
            possiblePlayableCards = EAIHelper.onlyEnoughMana(possiblePlayableCards, possibleMana);

        // in general for all phases

        // only relevant in stacking... but doesnt hurt anything if not stack
        boolean isFinalCall = E.match.isFinalStackCall();

    
        possiblePlayableCards = EAIHelper.onlyAllowedToPlay(possiblePlayableCards, vMatch.getPhase(), myTurn, stack, isFinalCall);

        if (mDoStacking)
        {
            if ((!myTurn) && ((vMatch.getPhase() == MatchConstants.PHASE_COMBAT_DECLARE_ATTACKERS)))
            {
                // remove activatables
                // that are also activateable in Blocker Phase!
                CardSimList alsoInBlocker = EAIHelper.onlyAllowedToPlay(possiblePlayableCards, MatchConstants.PHASE_COMBAT_DECLARE_BLOCKERS, myTurn, new Vector<EAIAction>(), false);
                possiblePlayableCards.removeListDirect(alsoInBlocker);
               
                if (vMatch.getAttacker().size()==0)
                {
                    possiblePlayableCards = EAIHelper.removeDeBufInstants(possiblePlayableCards);
                }
            }
        }
       
       
       
        field = field.onlyActivatable(); // possibly add land here
        field = field.removeSick();

        // list of all cards, that can be activated with mana availbal
        CardSimList possibleActivateableCards = field;
        if (restrictMana)
            possibleActivateableCards = EAIHelper.onlyEnoughManaActivate(possibleActivateableCards, possibleMana);

        // in general for all phases
        possibleActivateableCards = EAIHelper.onlyAllowedToActivate(possibleActivateableCards, vMatch.getPhase(), myTurn, vMatch);
        possibleActivateableCards = EAIHelper.onlyUntappedToActivate(possibleActivateableCards);
        if (E.aiPlayer.getEAIConfig().getReducedActivationEvaluation())
        {
            if (!mDoStacking)
                possibleActivateableCards = EAIHelper.reduceActivationEvaluation(possibleActivateableCards, vMatch.getPhase(), myTurn, vMatch);
        }
        if (mDoStacking)
        {
            if ((!myTurn) && ((vMatch.getPhase() == MatchConstants.PHASE_COMBAT_DECLARE_ATTACKERS)))
            {
                // remove activatables
                // that are also activateable in Blocker Phase!
                CardSimList alsoInBlocker = EAIHelper.onlyAllowedToActivate(possibleActivateableCards, MatchConstants.PHASE_COMBAT_DECLARE_BLOCKERS, myTurn, vMatch);
                possibleActivateableCards.removeListDirect(alsoInBlocker);

                if (vMatch.getAttacker().size()==0)
                {
                    possibleActivateableCards = EAIHelper.removeDeBufActivations(possibleActivateableCards);
                }
            }
           
        }
       
       
        possiblePlayableCards = EAIHelper.removeRestrictedCards(HintAll.HINT_SITUATION_CARD_PLAYED, possiblePlayableCards, vMatch.getPhase(), myTurn, vMatch);
        // TODO: Limit activateable Cards to same extend as playable cards
boolean NEW_CSA = true;       
        // For Play cards
        if (mDoStacking)
        {
            // if we are in stack reaction
            if (vMatch.getStack().isEmpty())
            {
                // and there is nothing on stack
                // we assume, that all is right, and nothing instant to be done!

                // if not in block phase
                if (vMatch.getPhase() != MatchConstants.PHASE_COMBAT_DECLARE_BLOCKERS)
                {
                    for(int c=possiblePlayableCards.size()-1; c>=0; c--)
                    {
                        CardSim card = possiblePlayableCards.getCard(c);

                        if (card.isInstant())
                        {
                            if (EAIHelper.hasPlayRestriction(card, HintAll.HINT_SITUATION_INSTANT))
                                continue;
                            if (EAIHelper.isBufCard(card, HintAll.HINT_SITUATION_INSTANT))
                                possiblePlayableCards.remove(card);
                        }
                    }           
                }
if (NEW_CSA)
{

                // if not in block phase
                if (vMatch.getPhase() != MatchConstants.PHASE_COMBAT_DECLARE_BLOCKERS)
                {
                    for(int c=possibleActivateableCards.size()-1; c>=0; c--)
                    {
                        CardSim card = possibleActivateableCards.getCard(c);

                        if (EAIHelper.hasPlayRestriction(card, HintAll.HINT_SITUATION_ACTIVATION))
                            continue;
                        // this is ok here, since we come here only on empty stack
                        if (EAIHelper.isBufCard(card, HintAll.HINT_SITUATION_ACTIVATION))
                            possibleActivateableCards.remove(card);
                    }           
                }
}               
            }
            else // stack is not empty
            {
if (NEW_CSA)
{
                // TODO CSA
                // check if stack is creature damage card, if yes allow
                // bufs
                // if instant is stack influence card -> allow it
                // if instant is player health card -> allow it

                boolean stackIsPlayerDamage = EAIHelper.isStackPlayerDamage(player, stack);
                boolean stackIsCreatureDamage = EAIHelper.isStackCreatureDamage(player, stack);
               
                for(int c=possiblePlayableCards.size()-1; c>=0; c--)
                {
                    CardSim card = possiblePlayableCards.getCard(c);
                    if (!card.isInstant())
                    {
                        possiblePlayableCards.remove(card);
                        continue;
                    }
                    if (stackIsPlayerDamage)
                    {
                        // remove player heals
                        if (!EAIHelper.isHealCard(card, HintAll.HINT_SITUATION_INSTANT))
                        {
                            possiblePlayableCards.remove(card);
                            continue;
                        }
                    }
                    if (stackIsCreatureDamage)
                    {
                        // remove creature bufs
                        if (!EAIHelper.isBufCard(card, HintAll.HINT_SITUATION_INSTANT))
                        {
                            possiblePlayableCards.remove(card);
                            continue;
                        }
                    }
                }           
                for(int c=possibleActivateableCards.size()-1; c>=0; c--)
                {
                    CardSim card = possibleActivateableCards.getCard(c);
                    if (!EAIHelper.hasPlayRestriction(card, HintAll.HINT_SITUATION_ACTIVATION))
                    {
                        possibleActivateableCards.remove(card);
                        continue;
                    }
                    if (stackIsPlayerDamage)
                    {
                        // remove player heals
                        if (!EAIHelper.isHealCard(card, HintAll.HINT_SITUATION_ACTIVATION))
                        {
                            possibleActivateableCards.remove(card);
                            continue;
                        }
                    }
                    if (stackIsCreatureDamage)
                    {
                        // remove creature bufs
                        if (!EAIHelper.isBufCard(card, HintAll.HINT_SITUATION_ACTIVATION))
                        {
                            possibleActivateableCards.remove(card);
                            continue;
                        }
                    }
                }           
               
}               
               
            }
        }
       
        Vector<CardAndMana> cam = new Vector<CardAndMana>();
       
        for(int c=0; c< possiblePlayableCards.size(); c++)
        {
            CardSim card = possiblePlayableCards.getCard(c);
            if (card.getCard().getManaCost()!=-1)
            {
                // non X Mana j
                cam.addElement(new CardAndMana(CardAndMana.CAM_PLAY , card, ManaCollection.getPlayCost(card) ) );
            }
            else
            {
                //X card

                // damagaing X cards only in Main1
                if (EAIHelper.isCreatureDamageCard(card, HintAll.HINT_SITUATION_CARD_PLAYED))
                {
                    if (!EAIHelper.isPlayerDamageCard(card, HintAll.HINT_SITUATION_CARD_PLAYED))
                    {
                        if (vMatch.getPhase() != MatchConstants.PHASE_MAIN1)
                        {
                            continue;
                        }
                    }
                }

                int maxX = MAX_X;
               
                if (maxX==0)
                {
                    ManaCollection baseCost = ManaCollection.getPlayCostBase(card);
                    ManaCollection rest = possibleMana.subMana(baseCost);
                    for (int m=0; m<rest. getManaItems().size(); m++)
                    {
                        baseCost.addMana(rest.getManaItems().elementAt(m));
                        cam.addElement(new CardAndMana(CardAndMana.CAM_PLAY , card, new ManaCollection(baseCost) ) );
                    }
                }
                else
                {
                    int step = (possibleMana.subMana(ManaCollection.getPlayCostBase(card)).getManaItems().size())/maxX;
                   
                    int currentMana = step;
                    while (maxX > 0)
                    {
                        ManaCollection baseCost = ManaCollection.getPlayCostBase(card);
                        ManaCollection rest = possibleMana.subMana(baseCost);

                        for (int m=0; m<currentMana; m++)
                        {
                            baseCost.addMana(rest.getManaItems().elementAt(m));
                        }
                        currentMana += step;
                        maxX--;
                        cam.addElement(new CardAndMana(CardAndMana.CAM_PLAY , card, new ManaCollection(baseCost) ) );
                    }
                }
            }
        //count x
        }
View Full Code Here

Examples of csa.jportal.match.ManaCollection


    EAIAction createAction(CardAndMana cam, int phase, Vector<EAIAction> targets, int pl, Vector<CardAndMana> otherPossiblePlayouts)
    {
        EAIAction ret;
        ManaCollection cost = cam.cost;
        ManaCollection possibleMana = EAIHelper.getMaxAvailableMana(vMatch, pl);
        ManaCollection paymentMana = possibleMana.getPaymentFor(cost, otherPossiblePlayouts);

        // not enough mana to pay!
        if (paymentMana == nullreturn null;

        Vector <ManaItem> items = paymentMana.getManaItems();

        Vector<EAIAction> payment = new Vector<EAIAction>();
        if (items.size() >0 )
        {
            for (int i = 0; i < items.size(); i++)
View Full Code Here

Examples of csa.jportal.match.ManaCollection

        {
            CardAndMana cam = forced.elementAt(i);

            // one WITH - no choice
            // all actions also to one leaf - since now choice!
            ManaCollection possibleMana = E.helper.getMaxAvailableMana(vMatch);
            if (!EAIHelper.hasEnoughMana(cam.cost, possibleMana))
            {
                continue;
            }
View Full Code Here

Examples of csa.jportal.match.ManaCollection

    }

    private Vector<CardAndMana> onlyEnoughMana(Vector<CardAndMana> list)
    {
        Vector<CardAndMana> ret = new Vector<CardAndMana>();
        ManaCollection possibleMana = E.helper.getMaxAvailableMana(vMatch);
        for (int i=0; i< list.size(); i++)
        {
            CardAndMana cam = list.elementAt(i);
           
            if (EAIHelper. hasEnoughMana(cam.cost, possibleMana))
View Full Code Here

Examples of csa.jportal.match.ManaCollection

                        // for now we assume if payment is possible ->
                        // payment will be done, and trigger will be taken
                        int manaCost = triggerCard.getCard().getInTextManaCost();
                        if (manaCost > 0)
                        {
                            ManaCollection possibleMana = EAIHelper.getMaxAvailableMana(this, triggerOwner);
                            if (EAIHelper.hasEnoughManaInText(triggerCard,possibleMana))
                            {
                                triggerAllowed = true;
                                ManaCollection manaCol = ManaCollection.getInTextCost(triggerCard);
                                ManaCollection paymentMana = possibleMana.getPaymentFor(manaCol, null);
                                Vector <ManaItem> items = paymentMana.getManaItems();
                                // now activate all mana items
                                if (items.size() >0 )
                                {
                                    for (int mi = 0; mi < items.size(); mi++)
                                    {
View Full Code Here

Examples of csa.jportal.match.ManaCollection

     * Sets the lands from the vmatch to the ManaItem - this must be EXACTLY THAT!
     * @return ManaCollection
     */
    public ManaCollection getMaxAvailableMana(VirtualMatch vMatch)
    {
        ManaCollection mc = new ManaCollection();

        CardSimList lands = vMatch.getLand(E.pNumber);
        CardSimList field = vMatch.getBattlefield(E.pNumber);
        // todo cards that generate mana - played from hand

        for(int i=0; i < lands.size(); i++)
        {
            CardSim card = lands.getCard(i);
            if (card.isTapped()) continue;
            ManaItem mana = ManaItem.createManaItem(card);
            mc.addMana(mana);
        }

        for(int i=0; i < field.size(); i++)
        {
            CardSim card = field.getCard(i);

            String m = getManaGeneratingAbilityString(card.getCard());
            if (m.length() == 0) continue;
            if (card.isTapped()) continue;
            if (card.isSick()) continue;

            ManaItem mana = ManaItem.createManaItem(m, card);
            mc.addMana(mana);
        }
        return mc;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.