Examples of EAIAction


Examples of csa.jportal.ai.enhancedAI.EAIAction

        }


        for (int i = 0; i < action.manaPayment.size(); i++)
        {
            EAIAction manaSource = action.manaPayment.elementAt(i);
            executeAction(manaSource, player, false);
        }
        if (manaOnly) return;

        currentAction = action;
        if (isSourceEmpty(action))
        {
            doSourceCardEffect(HintAll.HINT_SITUATION_ACTIVATION, card, null, player);
        }
        for (int i = 0; i < action.targets.size(); i++)
        {
            EAIAction target = action.targets.elementAt(i);
            if (target.isSource)
                doSourceCardEffect(HintAll.HINT_SITUATION_ACTIVATION, card, target, player);
        }
        if (isTargetEmpty(action))
        {
             doTargetCardEffect(HintAll.HINT_SITUATION_ACTIVATION, card, null, player);
        }
        for (int i = 0; i < action.targets.size(); i++)
        {
            EAIAction target = action.targets.elementAt(i);
            if (!target.isSource)
                doTargetCardEffect(HintAll.HINT_SITUATION_ACTIVATION, card, target, player);
        }
        currentAction = null;
    }
View Full Code Here

Examples of csa.jportal.ai.enhancedAI.EAIAction

        }


        for (int i = 0; i < action.manaPayment.size(); i++)
        {
            EAIAction manaSource = action.manaPayment.elementAt(i);
            executeAction(manaSource, player, false);
        }
        if (manaOnly) return;

        currentAction = action;
        if (isSourceEmpty(action))
        {
            doSourceCardEffect(HintAll.HINT_SITUATION_TRIGGERED, card, null, player);
        }
        for (int i = 0; i < action.targets.size(); i++)
        {
            EAIAction target = action.targets.elementAt(i);
            if (target.isSource)
                doSourceCardEffect(HintAll.HINT_SITUATION_TRIGGERED, card, target, player);
        }
        if (isTargetEmpty(action))
        {
             doTargetCardEffect(HintAll.HINT_SITUATION_TRIGGERED, card, null, player);
        }
        for (int i = 0; i < action.targets.size(); i++)
        {
            EAIAction target = action.targets.elementAt(i);
            if (!target.isSource)
                doTargetCardEffect(HintAll.HINT_SITUATION_TRIGGERED, card, target, player);
        }
        currentAction = null;
    }
View Full Code Here

Examples of csa.jportal.ai.enhancedAI.EAIAction

        }

        for (int i=0; i< size; i++)
        {
            MatchStackItem item = mMatch.getStackLastItems().elementAt(i);
            EAIAction action = null;

            // ensure in all Cards
            // in Match, instant stack cards
            // that are played as instant stack cards
            // are removed from hand - so this card can not be found anywhere else in match!
            // this was done to ensure the
            // player would not play that card again and again in stack reactions
            // here we have to make sure
            // that a single CardSim exists!
            CardSim test = allCards.get(item.card.getUniqueID());
            if (test == null)
            {
                test = new CardSim(item.card, mMatch.getIntOwner(item.card));
                allCards.put( item.card.toUString(), test);
            }

            Vector<EAIAction> targets = null;
            // Mana is allways null
            // since mana is already payed, when action is on stack!

           if (item.ev != null)
            {
                targets = new Vector<EAIAction>();
                if (item.ev.targetCard != null)
                {
                    EAIAction tAction = EAIAction.createTargetAction(i, mMatch.getPhase(), item.ev.targetCard, -1);
                    tAction.isTarget = true;
                    tAction.isSource = false;
                    targets.add(tAction);
                }
                if (item.ev.sourceCard != null)
                {
                    EAIAction tAction = EAIAction.createTargetAction(i, mMatch.getPhase(), item.ev.sourceCard, -1);
                    tAction.isTarget = false;
                    tAction.isSource = true;
                    targets.add(tAction);
                }
                if (item.ev.targetPlayer != null)
                {
                    int player = mMatch.getMyNumber(item.ev.targetPlayer);
                    EAIAction tAction = EAIAction.createTargetAction(i, mMatch.getPhase(), (Card) null, player);
                    tAction.isTarget = true;
                    tAction.isSource = false;
                    targets.add(tAction);
                }
            }
View Full Code Here

Examples of csa.jportal.ai.enhancedAI.EAIAction

    {
        if (mStack==null) return;

        while (!mStack.isEmpty())
        {
            EAIAction stackItem = mStack.elementAt(mStack.size()-1);
            executeAction(stackItem, stackItem.getSCard().owner, false);
            mStack.removeElement(stackItem);
        }

        for (int p=0; p < PLAYER_COUNT; p++)
        {
View Full Code Here

Examples of csa.jportal.ai.enhancedAI.EAIAction

        if (vMatch.mStack != null)
        {
            mStack = new Vector<EAIAction>();
            for (int i = 0; i < vMatch.mStack.size(); i++)
            {
                EAIAction eAIAction = vMatch.mStack.elementAt(i);
                mStack.addElement(new EAIAction(eAIAction));

               
                if (allCards.get( mStack.elementAt(i).getSCard().toUString()) == null)
                {
                    allCards.put( mStack.elementAt(i).getSCard().toUString(), mStack.elementAt(i).getSCard());
View Full Code Here

Examples of csa.jportal.ai.enhancedAI.EAIAction

            CardSimList attackers = getPossibleAttackers();
            int no = 1;
            for (int a=0; a< attackers.size(); a++)
            {
                CardSim at = attackers.getCard(a);
                EAIAction attack = EAIAction.createDeclareAttackerAction(no++, at);
                boolean success = executeAction(attack, thisTurnPlayer, false);

            }
        }
        if (phase == MatchConstants.PHASE_COMBAT_DECLARE_BLOCKERS)
        {
            //System.out.println("Buh");
        }
        if ((allBlockOne[(thisTurnPlayer+1)%2] != null) && (phase == MatchConstants.PHASE_COMBAT_DECLARE_BLOCKERS))
        {
            CardSim oneBlock = allBlockOne[(thisTurnPlayer+1)%2];

            // if the card designated to be "ONE BLOCK" is not attacking -> stupid!
            if (mAttacker.isInList(oneBlock))
            {
                CardSimList blockers = getPossibleBlockers((thisTurnPlayer+1)%2);
                int no = 1;
                for (int b=0; b< blockers.size(); b++)
                {

                    CardSim bl = blockers.getCard(b);
                    EAIAction target = EAIAction.createTargetAction(0, MatchConstants.PHASE_COMBAT_DECLARE_BLOCKERS, oneBlock, -1);


                    EAIAction block = EAIAction.createDeclareBlockerAction(no, bl, target);
                    boolean success = executeAction(block, (thisTurnPlayer+1)%2, false);
                }
            }
        }
View Full Code Here

Examples of csa.jportal.ai.enhancedAI.EAIAction

            if (sources != null )
            if (!sources.isEmpty())
            {
                // for now only player dependency
                // this should be action 0, and no other!
                EAIAction action = sources.elementAt(0);
                if (!action.targetIsPlayer)
                {
                    // error
                    // for now just add targets!
                    // done in targetting EAIPlanTree
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.