Examples of HintBundle


Examples of csa.jportal.ai.enhancedAI.enhancedHints.HintBundle

        CardSimList field =mBattlefield[player].copyList();
        for (int i=field.size()-1; i >= 0; i--)
        {
            CardSim card = field.getCard(i);
            AIEnhancedCardHints hints = AIEnhancedCardHints.getHints(card);
            if (!hints.hasAnyHint(new HintBundle(TY_AURA)))
            {
                field.remove(i);
            }
        }
        return field;
View Full Code Here

Examples of csa.jportal.ai.enhancedAI.enhancedHints.HintBundle

            {
                AIEnhancedCardHints hints = AIEnhancedCardHints.getHints(action.getSCard());

                action.targets.elementAt(i).setSCard(scard);
                // should be no TARGETS, but only Auras
                if (hints.hasAnyHint(new HintBundle(TY_OPENS_PLAYER_LIBRARY, TY_OPENS_OPPONENTS_LIBRARY, SY_OPENS_PLAYER_LIBRARY, SY_OPENS_OPPONENTS_LIBRARY)))
                {
                    initLibrary();
                }
                this_ret = ensureActionVMatchCards(action.targets.elementAt(i), player);
                if (!this_ret)
View Full Code Here

Examples of csa.jportal.ai.enhancedAI.enhancedHints.HintBundle

        if (hints.hasHint(hintKey, CS_HAS_MULTIPLYER))
        {
            amount = getSourceMultiplyAmount( player,  hintKey, hints);
        }

        if (hints.hasAnyHint(hintKey, new HintBundle(S_IS_OWNER)))
        {
            if (hints.hasAnyHint(hintKey, new HintBundle(SY_HEAL)))
            {
                life[tPlayer] += amount;
            }
            if (hints.hasAnyHint(hintKey, new HintBundle(SY_DAMAGE)))
            {
                life[tPlayer] -= amount;
            }
        }
        if (hints.hasAnyHint(hintKey, new HintBundle(SY_NEGATE_DAMAGE_AMOUNT)))
        {
            tCard.addPreventDamage(amount);
        }

        if (hints.hasAnyHint(hintKey, new HintBundle(SY_SELF_DESTRUCT)))
        {
            creatureToGrave(source);
        }
        if (hints.hasAnyHint(hintKey, new HintBundle(SY_TO_TAP)))
        {
            tCard.setTapped(true);
        }
        if (hints.hasAnyHint(hintKey, new HintBundle(SY_TO_UNTAP)))
        {
            tCard.setTapped(false);
        }
        if (hints.hasAnyHint(hintKey, new HintBundle(SY_ABILISY_ADD)))
        {
            String v = hints.getHintValue(hintKey, SY_ABILISY_ADD);
            if (!reverseEffect)
                tCard.addAbility(v);
            else
                tCard.subAbility(v);
        }
        if (hints.hasAnyHint(hintKey, new HintBundle(SY_DAMAGE, SY_TOUGHNESS_SUB)))
        {
            if (amount == 0)
                amount = hints.getHintValueInt(hintKey, SY_TOUGHNESS_SUB);
            if (hints.hasHint(hintKey, CS_X_COUNT))
            {
               amount = source.xMana;
            }
            if (!reverseEffect)
                tCard.addToughness(-amount);
            else
                tCard.subToughness(-amount);
            if (tCard.getNowToughness() <= 0)
            {
                creatureToGrave(tCard);
            }
        }
        if (hints.hasAnyHint(hintKey, new HintBundle(SY_TOUGHNESS_ADD)))
        {
            amount = hints.getHintValueInt(hintKey, SY_TOUGHNESS_ADD);
            if (hints.hasHint(hintKey, CS_X_COUNT))
            {
               amount = source.xMana;
            }
            if (!reverseEffect)
                tCard.addToughness(amount);
            else
                tCard.subToughness(amount);
        }
        if (hints.hasAnyHint(hintKey, new HintBundle(SY_POWER_ADD)))
        {
            amount = hints.getHintValueInt(hintKey, SY_POWER_ADD);
            if (hints.hasHint(hintKey, CS_X_COUNT))
            {
               amount = source.xMana;
            }
            if (!reverseEffect)
                tCard.addPower(amount);
            else
                tCard.subPower(amount);
        }
        if (hints.hasAnyHint(hintKey, new HintBundle(SY_POWER_SUB)))
        {
            amount = hints.getHintValueInt(hintKey, SY_POWER_SUB);
            if (hints.hasHint(hintKey, CS_X_COUNT))
            {
               amount = source.xMana;
            }
            if (!reverseEffect)
                tCard.addPower(-amount);
            else
                tCard.subPower(-amount);
        }
        if(hints.hasAnyHint(hintKey, new HintBundle(SY_ONE_ONLY_BLOCCK)))
        {
            if (!reverseEffect)
                tCard.addAbility("NoBlock");
            else
                tCard.subAbility("NoBlock");
        }
       
       
        CardSimList from = null;
        CardSimList to = null;
        if(hints.hasAnyHint(hintKey, new HintBundle(SY_LIBRARY_ROCHADE)))
        {
            if (!tCard.getCard().isDummy())
            {
                // NO Dummy library
                initLibrary();

                from = null;
                to = null;
                from = mHand[tPlayer];
                to = mLibrary[tPlayer];

                from.moveCardTo(tCard, to);
                to.shuffle();

                // draw first
                CardSim nCard = to.getCard(to.size()-1);
                to.moveCardTo(nCard, from);
            }
            return;
        }
        if(hints.hasAnyHint(hintKey, new HintBundle(SY_LIBRARY_GRAVE_ROCHADE)))
        {
            if (!tCard.getCard().isDummy())
            {
                // NO Dummy library
                initLibrary();

                from = mHand[tPlayer];
                to = mGraveyard[tPlayer];
                from.moveCardTo(tCard, to);
               
                CardSimList from2 = null;
                CardSimList to2 = null;
                from2 = mLibrary[tPlayer];
                to2 = mHand[tPlayer];
                from2.shuffle();

                // draw first
                CardSim nCard = from2.getCard(to.size()-1);
                to2.moveCardTo(nCard, from2);
            }
            return;
        }

        from = null;
        to = null;
        if (hints.hasAnyHint(hintKey, new HintBundle(SY_COMTROL_CHANGE)))
        {
            if (hints.hasAnyHint(hintKey, new HintBundle(S_FROM_LAND)))
            {
                to = mLand[player];
            }
            if (hints.hasAnyHint(hintKey, new HintBundle(S_FROM_FIELD)))
            {
                to = mBattlefield[player];
            }
            to.addCard(tCard);
            mControlChange = true;

        }
        from = null;
        to = null;

        boolean sicken = false;
        if (hints.hasAnyHint(hintKey, new HintBundle(SY_HAND_TO_GRAVE, SY_HAND_TO_LAND, SY_HAND_TO_FIELD, SY_HAND_TO_LIBRARY, SY_HAND_TO_EXILE)))
            from = mHand[tPlayer];
        if (hints.hasAnyHint(hintKey, new HintBundle(SY_LAND_TO_GRAVE, SY_LAND_TO_HAND, SY_LAND_TO_LIBRARY, SY_LAND_TO_EXILE)))
            from = mLand[tPlayer];
        if (hints.hasAnyHint(hintKey, new HintBundle(SY_LIBRARY_TO_GRAVE, SY_LIBRARY_TO_HAND, SY_LIBRARY_TO_LAND, SY_LIBRARY_TO_FIELD, SY_LIBRARY_TO_EXILE, SY_LIBRARY_TO_LIBRARY)))
            from = mLibrary[tPlayer];
        if (hints.hasAnyHint(hintKey, new HintBundle(SY_FIELD_TO_GRAVE, SY_FIELD_TO_HAND, SY_FIELD_TO_LIBRARY, SY_FIELD_TO_EXILE)))
            from = mBattlefield[tPlayer];
        if (hints.hasAnyHint(hintKey, new HintBundle(SY_GRAVE_TO_HAND, SY_GRAVE_TO_FIELD, SY_GRAVE_TO_LAND, SY_GRAVE_TO_LIBRARY, SY_GRAVE_TO_EXILE)))
            from = mGraveyard[tPlayer];

        if (hints.hasAnyHint(hintKey, new HintBundle(SY_HAND_TO_GRAVE, SY_LAND_TO_GRAVE, SY_LIBRARY_TO_GRAVE, SY_FIELD_TO_GRAVE)))
            to = mGraveyard[tPlayer];
        if (hints.hasAnyHint(hintKey, new HintBundle(SY_HAND_TO_LIBRARY, SY_LAND_TO_LIBRARY, SY_GRAVE_TO_LIBRARY, SY_FIELD_TO_LIBRARY, SY_LIBRARY_TO_LIBRARY)))
            to = mLibrary[tPlayer];
        if (hints.hasAnyHint(hintKey, new HintBundle(SY_HAND_TO_FIELD, SY_GRAVE_TO_FIELD, SY_LIBRARY_TO_FIELD)))
        {
            to = mBattlefield[tPlayer];
            sicken = true;
        }
        if (hints.hasAnyHint(hintKey, new HintBundle(SY_FIELD_TO_HAND, SY_GRAVE_TO_HAND, SY_LAND_TO_HAND, SY_LIBRARY_TO_HAND)))
            to = mHand[tPlayer];
        if (hints.hasAnyHint(hintKey, new HintBundle(SY_GRAVE_TO_LAND, SY_LIBRARY_TO_LAND, SY_HAND_TO_LAND)))
            to = mLand[tPlayer];
        if (hints.hasAnyHint(hintKey, new HintBundle(SY_HAND_TO_EXILE, SY_LAND_TO_EXILE, SY_FIELD_TO_EXILE, SY_GRAVE_TO_EXILE, SY_LIBRARY_TO_EXILE)))
            to = mGraveyard[tPlayer];
        if (hints.hasAnyHint(hintKey, new HintBundle(SY_LIBRARY_TOP)))
            to = mLibrary[tPlayer];
        if (hints.hasAnyHint(hintKey, new HintBundle(SY_LIBRARY_BOTTOM)))
            to = mLibrary[tPlayer];

        if (from == null)
        {
            if (mHand[tPlayer].isInList(tCard)) from = mHand[tPlayer];
            if (mLand[tPlayer].isInList(tCard)) from = mLand[tPlayer];
            if (mGraveyard[tPlayer].isInList(tCard)) from = mGraveyard[tPlayer];
            if (mLibrary[tPlayer].isInList(tCard)) from = mLibrary[tPlayer];
            if (mBattlefield[tPlayer].isInList(tCard)) from = mBattlefield[tPlayer];
        }


        if ((from != null) && (to != null))
        {
            if ((to == mGraveyard[tPlayer]) && (from == mBattlefield[tPlayer]))
            {
                creatureToGrave(tCard);
            }
            else
            {
                boolean done = false;
                if (hints.hasAnyHint(hintKey, new HintBundle(TY_LIBRARY_BOTTOM)))
                {
                    if (to == mLibrary[tPlayer])
                    {
                        done = true;
                        from.remove(tCard);
                        to.addCardFront(tCard);
                    }
                }
                if (!done)
                    from.moveCardTo(tCard, to);
                if (to == mGraveyard[player])
                    checkTriggerMoveToGrave(tCard);
                removeFromAttack(tCard);
                removeFromBlock(tCard);
            }
           
            if (sicken)
            {
                tCard.setSick(true);
            }
           
           // shuffle AFTER libryry top!
            if (hints.hasAnyHint(hintKey, new HintBundle(SY_LIBRARY_TOP)))
            {
                if(hints.hasAnyHint(hintKey, new HintBundle(HintAll.SY_LIBRARY_SHUFFLE)))
                {
                    CardSim newCard = mLibrary[tCard.owner].getCard(mLibrary[tCard.owner].size()-1);
                    int size = mLibrary[tCard.owner].size()-1;
                    mLibrary[tCard.owner] = new CardSimList();
                    for (int i=0; i< size; i++)
View Full Code Here

Examples of csa.jportal.ai.enhancedAI.enhancedHints.HintBundle

        {
           amount = source.xMana;
        }
          
            // target is a player
        if (hints.hasAnyHint(hintKey, new HintBundle(SY_NEGATE_DAMAGE_AMOUNT)))
        {
            preventPlayerDamage[player] += amount;
        }
        if (hints.hasAnyHint(hintKey, new HintBundle(SY_HEAL)))
        {
            life[player] += amount;
        }
        if (hints.hasAnyHint(hintKey, new HintBundle(SY_DAMAGE)))
        {
            life[player] -= amount;
        }
        if (hints.hasAnyHint(hintKey, new HintBundle(SY_HALF_LIFE)))
        {
            life[player] /= 2;
        }
    }
View Full Code Here

Examples of csa.jportal.ai.enhancedAI.enhancedHints.HintBundle

            // assuming card is on battlefield
            card.setNowToughness(card.getCard().getRealToughness());
            card.setTapped(true);
        }
        // only targets looked at rightnow! Undying beast
        else if(EAIHelper.hasHint(card.getCard(), key, new HintBundle(HintAll.TY_LIBRARY_TOP)))
        {
            mBattlefield[card.owner].moveCardTo(card, mLibrary[card.owner]);
        }
        else if(EAIHelper.hasHint(card.getCard(), key, new HintBundle(HintAll.TY_LIBRARY_SHUFFLE)))
        {
            // not shuffled - just moved to lib... Alabaster Angel
            mBattlefield[card.owner].moveCardTo(card, mLibrary[card.owner]);
            libShuffled = true;
        }
View Full Code Here

Examples of csa.jportal.ai.enhancedAI.enhancedHints.HintBundle

        CardSimList list = getBattlefield(blockingPlayer).copyList();
        String key = HintAll.HINT_SITUATION_BLOCKER;
        for (int i=list.size()-1; i>=0; i--)
        {
            CardSim card = list.getCard(i);
            if (EAIHelper.hasHint(card, key, new HintBundle(HintTargetTypes.TY_CANT_BLOCK, HintSourceTypes.SY_CANT_BLOCK)))
            {
                list.remove(i);
            }
            else
            {
View Full Code Here

Examples of csa.jportal.ai.enhancedAI.enhancedHints.HintBundle

        return ret;
    }
    public static boolean isTapCardTarget(CardSim card, String key)
    {
        boolean ret = false;
        HintBundle bundle = new HintBundle(TY_TO_TAP, TY_TO_UNTAP);
        ret = hasHint(card.getCard(), key, bundle);

        return ret;
    }
View Full Code Here

Examples of csa.jportal.ai.enhancedAI.enhancedHints.HintBundle

        return ret;
    }
    public static boolean isTapCardSource(CardSim card, String key)
    {
        boolean ret = false;
        HintBundle bundle = new HintBundle(SY_TO_TAP, SY_TO_UNTAP);
        ret = hasHint(card.getCard(), key, bundle);

        return ret;
    }
View Full Code Here

Examples of csa.jportal.ai.enhancedAI.enhancedHints.HintBundle

    // either from or to any filed,
    // draw lib, from battle to grave etc
    public static boolean isMoveHand(CardSim card, String key)
    {
        boolean ret = false;
        HintBundle bundle = new HintBundle();

        // might be bad
        bundle.add(TY_FIELD_TO_HAND);
        bundle.add(SY_FIELD_TO_HAND);
        ret = hasHint(card.getCard(), key, bundle);
        return ret;
    }
View Full Code Here

Examples of csa.jportal.ai.enhancedAI.enhancedHints.HintBundle

    // either from or to any filed,
    // draw lib, from battle to grave etc
    public static boolean isMoveHandTarget(CardSim card, String key)
    {
        boolean ret = false;
        HintBundle bundle = new HintBundle();

        // might be bad
        bundle.add(TY_FIELD_TO_HAND);
        ret = hasHint(card.getCard(), key, bundle);
        return ret;
    }
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.