Examples of CardSim


Examples of csa.jportal.ai.enhancedAI.enhancedSim.CardSim

        Vector <SingleFight> fights = formation.getFormation();
        int no=0;
        for (int f = 0; f < fights.size(); f++)
        {
            SingleFight singleFight = fights.elementAt(f);
            CardSim matchAttacker = vMatch.getAttacker(singleFight.attacker);
            CardSimList blockers = singleFight.blocker;

            if (blockers.size() > 0)
            {
                EAIAction target = EAIAction.createTargetAction(0, MatchConstants.PHASE_COMBAT_DECLARE_BLOCKERS, matchAttacker , -1);
View Full Code Here

Examples of csa.jportal.ai.enhancedAI.enhancedSim.CardSim

    CardSimList removePlayerCardsWithNotNicePlayoutEffects(CardSimList possibleCardTargets, int player, VirtualMatch vMatch)
    {
        CardSimList ret = new CardSimList();
        for (int i=0; i< possibleCardTargets.size(); i++)
        {
            CardSim card = possibleCardTargets.getCard(i);
            if (card.getOwner() != player)
            {
                ret.addCard(card);
                continue;
            }
            if (EAIHelper.isNicePlayoutCard(card))
View Full Code Here

Examples of csa.jportal.ai.enhancedAI.enhancedSim.CardSim

    CardSimList removeOpponentCardsWithNicePlayoutEffects(CardSimList possibleCardTargets, int player, VirtualMatch vMatch)
    {
        CardSimList ret = new CardSimList();
        for (int i=0; i< possibleCardTargets.size(); i++)
        {
            CardSim card = possibleCardTargets.getCard(i);
            if (card.getOwner() == player)
            {
                ret.addCard(card);
                continue;
            }
            if (!EAIHelper.isNicePlayoutCard(card))
View Full Code Here

Examples of csa.jportal.ai.enhancedAI.enhancedSim.CardSim

        if (isGoodEffect == 1)
        {
            for (int i=0; i<=maxSize; i++)
            {
                // use scoring like in old AI
                CardSim chosen = EAIHelper.selectGoodCard(clone, playerNo==player, playerNo, vMatch, initiatorCard );

                if (chosen == null) break;
                clone.remove(chosen);
                ret.addCard(chosen);
            }
        }
        else
        {
            while (clone.size() > maxSize)
            {
                // use scoring like in old AI
                CardSim chosen = EAIHelper.selectGoodCard(clone, playerNo==player, playerNo, vMatch, initiatorCard );

                if (chosen == null) break;
                clone.remove(chosen);
            }
            ret = clone;
View Full Code Here

Examples of csa.jportal.ai.enhancedAI.enhancedSim.CardSim

        int no=0;
        boolean didBlock = false;
        for (int f = 0; f < fights.size(); f++)
        {
            SingleFight singleFight = fights.elementAt(f);
            CardSim matchAttacker = vMatch.getAttacker(singleFight.attacker);
            CardSimList blockers = singleFight.blocker;
            int ta = 0;

            for (int b = 0; b < blockers.size(); b++)
            {
View Full Code Here

Examples of csa.jportal.ai.enhancedAI.enhancedSim.CardSim

    {
        CardSimList attackers = vMatch.getAttacker();
        CardSimList ret = new CardSimList();
        for (int b=0; b<blockers.size(); b++)
        {
            CardSim bl = blockers.getCard(b);
            boolean blocking = false;
            for (int a=0; ((a<attackers.size()) && (!blocking)); a++)
            {
                CardSim at = attackers.getCard(a);
                CardSimList atbl = vMatch.getBlocker(at);
                if (atbl.isInList(bl))
                {
                    blocking = true;
                }
View Full Code Here

Examples of csa.jportal.ai.enhancedAI.enhancedSim.CardSim

    {
        CardSimList ret = new CardSimList();
       
        for (int i=0; i<list.size(); i++)
        {
            CardSim currentCard = list.getCard(i);

            if (ret.countSame(currentCard) <maxSame)
            {
                ret.addCard(currentCard);
            }
View Full Code Here

Examples of csa.jportal.ai.enhancedAI.enhancedSim.CardSim

    {
        CardSimList ret = new CardSimList();
       
        for (int i=0; i<list.size(); i++)
        {
            CardSim currentCard = list.getCard(i);

            if (ret.countID(currentCard) <maxSame)
            {
                ret.addCard(currentCard);
            }
View Full Code Here

Examples of csa.jportal.ai.enhancedAI.enhancedSim.CardSim

        c.attackers = attackers;

        for (int a=0; a< attackers.size(); a++)
        {
            boolean blockPossible = false;
            CardSim attacker = attackers.getCard(a);
           
            for (int b=0; b<blockers.size(); b++)
            {
                CardSim blocker = blockers.getCard(b);
                blockPossible = SingleFight.canBlock(blocker, attacker, c, false);
                if (blockPossible) break;
            }           
            if (!blockPossible)
            {
View Full Code Here

Examples of csa.jportal.ai.enhancedAI.enhancedSim.CardSim

                key = HintAll.HINT_SITUATION_ACTIVATION;
            if (action.type == EAIAction.ACTION_PLAY_CARD)
                key = HintAll.HINT_SITUATION_CARD_PLAYED;
            if (action.getSCard().isInstant())
                key = HintAll.HINT_SITUATION_INSTANT;
            CardSim source = action.getSCard();
            if (!EAIHelper.isBufCard(source, key)) continue;
           
            // now all Buf targets of
            // our played card should be worth the buf
            // meaning should be attacking!
            // if not verification failed!
           
            Vector<EAIAction> targets = action.targets;
            for (int t=0; t< targets.size(); t++)
            {
                EAIAction tAction = targets.elementAt(t);
                CardSim target = tAction.getSCard();
                if (target==null) continue; // e.g. samite healer protects player, than target is null!
                boolean found = false;
                for (int v=i+1; v< doneActions.size(); v++)
                {
                    CardSim cs = doneActions.elementAt(v).getSCard();
                    if (cs.getCard().getUniqueID().equals(target.getCard().getUniqueID()))
                    {
                        found = true;
                        break;
                    }
                }
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.