Examples of HintBundle


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

        setHintValues(card, nKey, nValue);

// TARGET, TARGET_RESTRICTIONS, TYPE, COUNT, PLAY RESTTRICZIONS
        HashMap<String, HintBundle> m = new HashMap<String, HintBundle>();
        m.put("EFFECT_OPPONENT_DAMAGE", new HintBundle(TA_IS_OPPONENT, TY_DAMAGE));
        m.put("EFFECT_ALL_OF_A_KIND", new HintBundle(TA_FROM_FIELD, TR_CARD_TYPE_CREATURE, CT_ALL_CARDS));
        m.put("EFFECT_ONE_CREATURE_TO_GRAVE", new HintBundle(TA_FROM_FIELD, TR_CARD_PLAYER, TR_CARD_OPPONENT, TR_CARD_TYPE_CREATURE, TY_FIELD_TO_GRAVE, CT_SINGLE));
        m.put("EFFECT_ONE_CREATURE_DAMAGE", new HintBundle(TA_FROM_FIELD, TR_CARD_PLAYER, TR_CARD_OPPONENT, TR_CARD_TYPE_CREATURE, TY_DAMAGE, CT_SINGLE));
        m.put("EFFECT_ONE_CREATURE_TO_HAND", new HintBundle(TA_FROM_FIELD, TR_CARD_PLAYER, TR_CARD_OPPONENT, TR_CARD_TYPE_CREATURE, TY_FIELD_TO_HAND, CT_SINGLE));
        m.put("EFFECT_ONE_LAND_TO_GRAVE", new HintBundle(TA_FROM_LAND, TR_CARD_PLAYER, TR_CARD_OPPONENT, TR_CARD_TYPE_LAND, TY_LAND_TO_GRAVE, CT_SINGLE));
        m.put("EFFECT_ONE_PLAYER_DAMAGE", new HintBundle(TA_IS_PLAYER ,TA_IS_OPPONENT, TY_DAMAGE));
        m.put("EFFECT_ONE_PLAYER_HEAL", new HintBundle(TA_IS_PLAYER ,TA_IS_OPPONENT, TY_HEAL));
        m.put("EFFECT_ONE_CREATURE_TAPPED_TO_GRAVE", new HintBundle(TA_FROM_FIELD, TR_CARD_PLAYER, TR_CARD_OPPONENT, TR_CARD_TYPE_CREATURE, TR_CARD_TAPPED_NEED, TY_FIELD_TO_GRAVE, CT_SINGLE));
        m.put("EFFECT_PLAYER_CREATURE_DAMAGE", new HintBundle(TA_FROM_FIELD, TR_CARD_PLAYER, TR_CARD_TYPE_CREATURE, TY_DAMAGE, CT_SINGLE));
        m.put("EFFECT_ONE_CREATURE_TO_TAPPED", new HintBundle(TA_FROM_FIELD, TR_CARD_PLAYER, TR_CARD_OPPONENT, TR_CARD_TYPE_CREATURE, TY_TO_TAP, CT_SINGLE));
        m.put("EFFECT_ONE_TAP_CREATURE", new HintBundle(TA_FROM_FIELD, TR_CARD_PLAYER, TR_CARD_OPPONENT, TR_CARD_TYPE_CREATURE, TY_TO_TAP, CT_SINGLE));
        m.put("EFFECT_OPPONENT_ALL_CREATURE_TO_GRAVE", new HintBundle(TA_FROM_FIELD, TR_CARD_OPPONENT, TR_CARD_TYPE_CREATURE, TY_FIELD_TO_GRAVE, CT_ALL_CARDS));
        m.put("EFFECT_OPPONENT_HAND_TO_GRAVE", new HintBundle(TA_FROM_HAND, TR_CARD_OPPONENT, TY_HAND_TO_GRAVE, CT_SINGLE));
        m.put("EFFECT_OPPONENT_CREATURE_TO_GRAVE", new HintBundle(TA_FROM_FIELD, TR_CARD_OPPONENT, TR_CARD_TYPE_CREATURE, TY_FIELD_TO_GRAVE, CT_SINGLE));
        m.put("EFFECT_PLAYER_HEAL", new HintBundle(TA_IS_PLAYER, TY_HEAL));
        m.put("EFFECT_PLAYER_DAMAGE", new HintBundle(TA_IS_PLAYER, TY_DAMAGE));
        m.put("EFFECT_ON_CREATURE_OWNER", new HintBundle(TA_IS_OWNER));
        m.put("ADD_LAND_FROM_HAND", new HintBundle(TA_FROM_HAND, TR_CARD_TYPE_LAND, TY_HAND_TO_LAND, CT_SINGLE) );
        m.put("ADD_LAND_FROM_LIBRARY", new HintBundle(TA_FROM_LIBRARY, TR_CARD_TYPE_LAND, TY_LIBRARY_TO_LAND, CT_SINGLE));
        m.put("DAMGE_ALL_PLAYER", new HintBundle(TA_IS_PLAYER, TA_IS_OPPONENT, TY_DAMAGE, CT_ALL_PLAYERS ));
        m.put("DAMAGE_ALL", new HintBundle(TA_IS_PLAYER, TA_IS_OPPONENT, TA_FROM_FIELD, TR_CARD_PLAYER, TR_CARD_OPPONENT, TR_CARD_TYPE_CREATURE, TY_DAMAGE, CT_ALL_PLAYERS, CT_ALL_CARDS ));
        m.put("DAMAGE_ALL_CREATURE", new HintBundle(TA_FROM_FIELD, TR_CARD_PLAYER, TR_CARD_OPPONENT, TR_CARD_TYPE_CREATURE, TY_DAMAGE, CT_ALL_CARDS ));
        m.put("CARD_COLORS_NEEDED", new HintBundle(TR_CARD_COLOR_NEED));
        m.put("CARD_COLORS_MUST_NOT", new HintBundle(TR_CARD_COLOR_RESTRICTION ));
        m.put("CARD_SUBCARD_TYPES_NEEDED", new HintBundle(TR_CARD_SUBTYPE_NEED));
        m.put("CARD_TYPES_NEEDED", new HintBundle(TR_CARD_TYPE_NEED));
        m.put("HEAL_AMOUNT"new HintBundle(TY_HEAL, CT_AMOUNT_COUNT ));
        m.put("DAMAGE_AMOUNT", new HintBundle(TY_DAMAGE, CT_AMOUNT_COUNT ));
        m.put("FROM_OPPONENT_CREATURE", new HintBundle(TA_FROM_FIELD, TR_CARD_OPPONENT, TR_CARD_TYPE_CREATURE));
        m.put("FROM_PLAYER_CREATURE", new HintBundle(TA_FROM_FIELD, TR_CARD_PLAYER, TR_CARD_TYPE_CREATURE));
        m.put("FROM_OPPONENT_LIBRARY", new HintBundle(TA_FROM_LIBRARY, TR_CARD_OPPONENT));
        m.put("EFFECT_OPPONENT_ALL_TAPPED_CREATURE_TO_GRAVE", new HintBundle(TA_FROM_FIELD, TR_CARD_OPPONENT, TR_CARD_TYPE_CREATURE, TR_CARD_TAPPED_NEED, TY_FIELD_TO_GRAVE, CT_ALL_CARDS));
        m.put("EFFECT_ONE_CREATURE_TO_LIBRARY_TOP", new HintBundle(TA_FROM_FIELD, TR_CARD_PLAYER, TR_CARD_OPPONENT, TR_CARD_TYPE_CREATURE, TY_FIELD_TO_LIBRARY, TY_LIBRARY_TOP, CT_SINGLE));
        m.put("EFFECT_ONE_DRAW_CARD", new HintBundle(TA_IS_PLAYER ,TA_IS_OPPONENT, TY_LIBRARY_TO_HAND, CT_SINGLE));
        m.put("EFFECT_OPPONENT_DRAW_CARD", new HintBundle(TA_IS_OPPONENT, TY_LIBRARY_TO_HAND, CT_SINGLE));
        m.put("EFFECT_OPPONENT_LAND_TO_GRAVE", new HintBundle(TA_FROM_LAND, TR_CARD_OPPONENT, TR_CARD_TYPE_LAND, TY_LAND_TO_GRAVE, CT_SINGLE));
        m.put("EFFECT_PLAYER_CREATURE_ABILITY_ADD", new HintBundle(TA_FROM_FIELD, TR_CARD_PLAYER, TR_CARD_TYPE_CREATURE, TY_GENERAL_BUF ,TY_ABILITY_ADD, CT_SINGLE));
        m.put("EFFECT_PLAYER_CREATURE_FROM_GRAVE_TO_HAND", new HintBundle(TA_FROM_GRAVE, TR_CARD_PLAYER, TR_CARD_TYPE_CREATURE, TY_GRAVE_TO_HAND , CT_SINGLE));
        m.put("EFFECT_PLAYER_CREATURE_FROM_GRAVE_TO_LIBRARY", new HintBundle(TA_FROM_GRAVE, TR_CARD_PLAYER, TR_CARD_TYPE_CREATURE, TY_GRAVE_TO_LIBRARY , CT_SINGLE));
        m.put("EFFECT_PLAYER_CREATURE_FROM_GRAVE_TO_PLAY", new HintBundle(TA_FROM_GRAVE, TR_CARD_PLAYER, TR_CARD_TYPE_CREATURE, TY_GRAVE_TO_FIELD , CT_SINGLE));
        m.put("EFFECT_PLAYER_CREATURE_FROM_HAND_TO_PLAY", new HintBundle(TA_FROM_HAND, TR_CARD_PLAYER, TR_CARD_TYPE_CREATURE, TY_HAND_TO_FIELD , CT_SINGLE));
        m.put("EFFECT_PLAYER_CREATURE_POWER_ADD", new HintBundle(TA_FROM_FIELD, TR_CARD_PLAYER, TR_CARD_TYPE_CREATURE, TY_GENERAL_BUF ,TY_POWER_ADD));
        m.put("EFFECT_PLAYER_CREATURE_TOUGHNESS_ADD", new HintBundle(TA_FROM_FIELD, TR_CARD_PLAYER, TR_CARD_TYPE_CREATURE, TY_GENERAL_BUF , TY_TOUGHNESS_ADD));
        m.put("EFFECT_PLAYER_CREATURE_TO_GRAVE", new HintBundle(TA_FROM_FIELD, TR_CARD_PLAYER, TR_CARD_TYPE_CREATURE, TY_FIELD_TO_GRAVE , CT_SINGLE));
        m.put("EFFECT_PLAYER_CREATURE_TO_HAND", new HintBundle(TA_FROM_FIELD, TR_CARD_PLAYER, TR_CARD_TYPE_CREATURE, TY_FIELD_TO_HAND , CT_SINGLE));
        m.put("EFFECT_PLAYER_CREATURE_UNTAP", new HintBundle(TA_FROM_FIELD, TR_CARD_PLAYER, TR_CARD_TYPE_CREATURE, TY_TO_UNTAP  , CT_SINGLE));
        m.put("EFFECT_PLAYER_FROM_GRAVE_TO_LIBRARY", new HintBundle(TA_FROM_GRAVE, TR_CARD_PLAYER, TY_GRAVE_TO_LIBRARY , CT_SINGLE));
        m.put("EFFECT_PLAYER_HAND_CREATURE_TO_GRAVE", new HintBundle(TA_FROM_HAND, TR_CARD_PLAYER, TR_CARD_TYPE_CREATURE, TY_HAND_TO_GRAVE , CT_SINGLE));
        m.put("EFFECT_PLAYER_HAND_LAND_TO_GRAVE", new HintBundle(TA_FROM_HAND, TR_CARD_PLAYER, TR_CARD_TYPE_LAND, TY_HAND_TO_GRAVE , CT_SINGLE));
        m.put("EFFECT_PLAYER_HAND_TO_GRAVE", new HintBundle(TA_FROM_HAND, TR_CARD_PLAYER, TY_HAND_TO_GRAVE , CT_SINGLE));
        m.put("EFFECT_PLAYER_LAND_TO_GRAVE", new HintBundle(TA_FROM_LAND, TR_CARD_PLAYER, TR_CARD_TYPE_LAND, TY_LAND_TO_GRAVE , CT_SINGLE));
        m.put("EFFECT_PLAYER_LAND_TO_HAND", new HintBundle(TA_FROM_LAND, TR_CARD_PLAYER, TR_CARD_TYPE_LAND, TY_LAND_TO_HAND , CT_SINGLE));
        m.put("EFFECT_PLAYER_LIBRARY_LAND_TO_HAND", new HintBundle(TA_FROM_LIBRARY, TR_CARD_PLAYER, TR_CARD_TYPE_LAND, TY_LIBRARY_TO_HAND , CT_SINGLE));
        m.put("EFFECT_PLAYER_LIBRARY_TO_CREATURE", new HintBundle(TA_FROM_LIBRARY, TR_CARD_PLAYER, TR_CARD_TYPE_CREATURE, TY_LIBRARY_TO_FIELD , CT_SINGLE));
        m.put("EFFECT_PLAYER_LIBRARY_TO_HAND", new HintBundle(TA_FROM_LIBRARY, TR_CARD_PLAYER, TY_LIBRARY_TO_HAND, CT_SINGLE));
        m.put("EFFECT_PLAYER_SORCERY_FROM_GRAVE_TO_HAND", new HintBundle(TA_FROM_GRAVE, TR_CARD_PLAYER, TR_CARD_TYPE_SORCERY, TY_GRAVE_TO_HAND, CT_SINGLE));
        m.put("EFFECT_PLAYER_INSTANT_FROM_GRAVE_TO_HAND", new HintBundle(TA_FROM_GRAVE, TR_CARD_PLAYER, TR_CARD_TYPE_INSTANT, TY_GRAVE_TO_HAND, CT_SINGLE));
        m.put("OPPONENT_ATTACKER_NEED", new HintBundle(TR_CARD_ATTACKER, TR_CARD_OPPONENT, TR_CARD_TYPE_CREATURE ));
        m.put("PLAYER_CREATURE_ATTACKER_NEED", new HintBundle(TR_CARD_ATTACKER, TR_CARD_PLAYER, TR_CARD_TYPE_CREATURE ));
        m.put("OPPONENT_CREATURE_NEED", new HintBundle(TA_FROM_FIELD, TR_CARD_TYPE_CREATURE , TR_CARD_OPPONENT));
        m.put("OPPONENT_UNTAPPED_CREATURE_NEED", new HintBundle(TA_FROM_FIELD, TR_CARD_UNTAPPED_NEED, TR_CARD_TYPE_CREATURE, TR_CARD_OPPONENT));
        m.put("OPPONENT_TAPPED_CREATURE_NEED", new HintBundle(TA_FROM_FIELD, TR_CARD_TAPPED_NEED, TR_CARD_TYPE_CREATURE, TR_CARD_OPPONENT));
        m.put("PLAYER_CREATURE_NEED", new HintBundle(TA_FROM_FIELD, TR_CARD_TYPE_CREATURE, TR_CARD_PLAYER));
        m.put("PLAYER_CREATURE_GRAVE_NEED", new HintBundle(TA_FROM_GRAVE, TR_CARD_TYPE_CREATURE, TR_CARD_PLAYER));
        m.put("PLAYER_CREATURE_HAND_NEED", new HintBundle(TA_FROM_HAND, TR_CARD_TYPE_CREATURE, TR_CARD_PLAYER));
        m.put("PLAYER_CREATURE_MAYBE", new HintBundle(TA_FROM_FIELD, TR_CARD_TYPE_CREATURE, TR_CARD_PLAYER));
        m.put("PLAYER_CREATURE_TAPPED_NEED", new HintBundle(TA_FROM_FIELD, TR_CARD_TAPPED_NEED, TR_CARD_TYPE_CREATURE, TR_CARD_PLAYER));
        m.put("PLAYER_CREATURE_UNTAPPED_NEED", new HintBundle(TA_FROM_FIELD, TR_CARD_UNTAPPED_NEED, TR_CARD_TYPE_CREATURE, TR_CARD_PLAYER));
        m.put("OPPONENT_LAND_NEED", new HintBundle(TA_FROM_LAND, TR_CARD_TYPE_LAND, TR_CARD_OPPONENT));
        m.put("OPPONENT_UNTAPPED_LAND_NEED", new HintBundle(TA_FROM_LAND, TR_CARD_UNTAPPED_NEED, TR_CARD_TYPE_LAND, TR_CARD_OPPONENT));
        m.put("PLAYER_HAND_LAND_NEED", new HintBundle(TA_FROM_HAND, TR_CARD_TYPE_LAND, TR_CARD_PLAYER));
        m.put("PLAYER_LAND_NEED", new HintBundle(TA_FROM_LAND, TR_CARD_TYPE_LAND, TR_CARD_PLAYER));
        m.put("OPPONENT_HAND_NEED", new HintBundle(TA_FROM_HAND, TR_CARD_OPPONENT));
        m.put("PLAYER_GRAVE_NEED", new HintBundle(TA_FROM_GRAVE , TR_CARD_PLAYER));
        m.put("PLAYER_HAND_NEED", new HintBundle(TA_FROM_HAND, TR_CARD_PLAYER));
        m.put("FROM_OPPONENT_ATTACKER", new HintBundle(TA_FROM_FIELD, TR_CARD_ATTACKER, TR_CARD_TYPE_CREATURE, TR_CARD_OPPONENT));
        m.put("FROM_OPPONENT_GRAVE", new HintBundle(TA_FROM_GRAVE, TR_CARD_OPPONENT));
        m.put("FROM_OPPONENT_HAND", new HintBundle(TA_FROM_HAND, TR_CARD_OPPONENT));
        m.put("FROM_OPPONENT_LAND", new HintBundle(TA_FROM_LAND, TR_CARD_OPPONENT));
        m.put("FROM_PLAYER_GRAVE", new HintBundle(TA_FROM_GRAVE, TR_CARD_PLAYER));
        m.put("FROM_PLAYER_GRAVE_CREATURE", new HintBundle(TA_FROM_GRAVE, TR_CARD_TYPE_CREATURE, TR_CARD_PLAYER));
        m.put("FROM_PLAYER_HAND", new HintBundle(TA_FROM_HAND, TR_CARD_PLAYER));
        m.put("FROM_PLAYER_LAND", new HintBundle(TA_FROM_LAND, TR_CARD_PLAYER));
        m.put("FROM_PLAYER_LIBRARY", new HintBundle(TA_FROM_LIBRARY, TR_CARD_PLAYER));
        m.put("RETRIEVE_CREATURE_FROM_GRAVE_TO_HAND", new HintBundle(TA_FROM_GRAVE, TR_CARD_PLAYER, TR_CARD_TYPE_CREATURE, TY_GRAVE_TO_HAND , CT_SINGLE));
        m.put("EFFECT_OPPONENT_CARD_TO_GRAVE", new HintBundle(TA_FROM_LIBRARY,TR_CARD_OPPONENT, TY_LIBRARY_TO_GRAVE)); // only used once, library to grave
        m.put("CARD_ABILITIES_MUST_NOT", new HintBundle(TR_CARD_ABILITY_RESTRICTION ));
        m.put("CARD_ABILITIES_NEEDED", new HintBundle(TR_CARD_ABILITY_NEED ));
        m.put("CARD_MAX_NEED", new HintBundle(TR_CARD_COUNT_MAX ));
        m.put("CARD_MIN_NEED", new HintBundle(TR_CARD_COST_MIN ));
        m.put("CARD_ONLY_ONE", new HintBundle(TR_CARD_COUNT_MAX_ONE ));
        m.put("CARD_POWER_MUST_LOWER", new HintBundle(TR_CARD_POWER_MAX_MINUS_ONE ));
        m.put("CARD_SUBCARD_TYPES_MUST_NOT", new HintBundle(TR_CARD_SUBTYPE_RESTRICTION ));
        m.put("CARD_TYPES_MUST_NOT", new HintBundle(TR_CARD_TYPE_RESTRICTION ));
        m.put("INSTANT_WHEN_ATTACKING", new HintBundle(PR_REACT_ONLY_IN_ATTACKER));
        m.put("INSTANT_WHEN_ATTACKING_FINAL", new HintBundle(PR_REACT_ONLY_IN_ATTACKER_FINAL));
        m.put("EFFECT_OPPONENT_CREATURE_ALL_BLOCK_ONE", new HintBundle(TY_ALL_BLOCK_ONE ));
        m.put("EFFECT_OPPONENT_CREATURE_ALL_MUST_ATTACK", new HintBundle(TY_ALL_MUST_ATTACK ));
        m.put("EFFECT_OPPONENT_CREATURE_ONLY_ONE_BLOCK", new HintBundle(TY_ONE_ONLY_BLOCCK )); // twice
        m.put("EFFECT_OPPONENT_UNTAP_DENIAL", new HintBundle(TY_UNTAP_DENIAL ));
        m.put("EFFECT_OPPONENT_ATTACK_DENIAL", new HintBundle(TY_ATTACK_DENIAL ));
        m.put("EFFECT_PLAYER_DOUBLE_PHASE", new HintBundle(TY_REPLAY_PHASE ));
        m.put("EFFECT_PLAYER_HALF_LIFE", new HintBundle(TA_IS_PLAYER, TY_HALF_LIFE ));
        m.put("EFFECT_NOT_CREATURE_DAMAGED", new HintBundle(TY_NOT_DAMAGEABLE_BY_CREATURE )); // once -> 20184
        m.put("EFFECT_WHEN_ATTACKING", new HintBundle(O_WHEN_ATTACKING  ));
        m.put("EFFECT_WHEN_BLOCKING", new HintBundle(O_WHEN_BLOCKING));
        m.put("EFFECT_WHEN_BLOCKED", new HintBundle(O_WHEN_BLOCKED));
        m.put("EFFECT_WHEN_ACTIVATED", new HintBundle(O_WHEN_ATTACKED));
        m.put("EFFECT_WHEN_PLAYED", new HintBundle(O_WHEN_PLAYED));
        m.put("EFFECT_WHEN_DRAW_CARD", new HintBundle(O_WHEN_CARD_DRAWN ));
        m.put("EFFECT_WHEN_GRAVEYARD", new HintBundle(O_WHEN_PUT_TO_GRAVEYARD ));
        m.put("EFFECT_WHEN_NOT_BLOCKED", new HintBundle(O_WHEN_NOT_BLOCKED ));
        m.put("EFFECT_OPPONENT_DEBUF_CREATURE", new HintBundle(TR_CARD_OPPONENT, TY_GENERAL_DEBUF ));
        m.put("EFFECT_PLAYER_BUF_CREATURE", new HintBundle(TR_CARD_PLAYER, TY_GENERAL_BUF));
        m.put("ATTACK_LIMITATION", new HintBundle(TY_GENERAL_ATTACK_LIMITATION));
        m.put("BLOCKER_LIMITATION", new HintBundle(TY_GENERAL_BLOCKER_LIMITATION ));
        m.put("BLOCK_LIMITATION", new HintBundle(TY_GENERAL_BLOCK_LIMITATION ));
        m.put("BLOCKER_LIMITATION_SINGLE_ATTACKER_NOT_BLOCKABLE", new HintBundle(TY_GENERAL_BLOCKER_LIMITATION, TY_NOT_BLOCKABLE_IF_SINGLE_ATTACKER ));
        m.put("BLOCK_CANT_BLOCK", new HintBundle(TY_CANT_BLOCK , TY_GENERAL_BLOCK_LIMITATION));
        m.put("EFFECT_BOTH_SELECT_LIBRARY_CARD", new HintBundle(TA_FROM_LIBRARY, TR_CARD_PLAYER, TR_CARD_OPPONENT, TY_CHOSE_FROM_LIBRARY ));
        m.put("EFFECT_CARD_UNBLOCKABLE", new HintBundle(TY_NOT_BLOCKABLE ));
        m.put("EFFECT_SELF_DESTRUCT", new HintBundle(TY_SELF_DESTRUCT ));
        m.put("EFFECT_OPPONENT_HAND_LIBRARY_SWITCH", new HintBundle(TR_CARD_OPPONENT, TY_LIBRARY_ROCHADE)); // once
        m.put("EFFECT_PLAYER_HAND_LIBRARY_SWITCH", new HintBundle(TR_CARD_PLAYER, TY_LIBRARY_ROCHADE))// once
        m.put("EFFECT_BOTH_EXCHANGE_ALL_HAND_CARDS", new HintBundle(TR_CARD_OPPONENT, TR_CARD_PLAYER, TY_LIBRARY_ROCHADE)); // once
        m.put("AMOUNT_CALCULATED_BY", new HintBundle()); // can not be easily translated... depends on hint settings
        m.put("AMOUNT_MULTIPLYER", new HintBundle(CT_HAS_MULTIPLYER ));
        m.put("COUNT", new HintBundle(CT_AMOUNT_COUNT ));
        m.put("COUNT_X", new HintBundle(CT_X_COUNT));
        m.put("DAMAGE_AMOUNT_COUNT_CREATURE", new HintBundle(CT_MULTIPLY_RESTRICTION_TYPE_TARGET_CREATURE  ));
        m.put("DAMAGE_AMOUNT_COUNT_LAND", new HintBundle(CT_MULTIPLY_RESTRICTION_TYPE_TARGET_LAND  ));
        m.put("DAMAGE_AMOUNT_SUBTYPE_COUNT", new HintBundle(CT_MULTIPLY_RESTRICTION_SUBTYPE ));
        m.put("HEAL_AMOUNT_TYPE_COUNT_X2"new HintBundle(CT_HAS_MULTIPLYER_TWO));
        m.put("EFFECT_TEMP_AURA", new HintBundle(TY_AURA));
        m.put("AURA_BLOCK_MOD", new HintBundle(TY_AURA ,TY_GENERAL_BLOCK_LIMITATION  ));
        m.put("AURA_DURATION", new HintBundle(TY_AURA, TI_TURN_COUNT ));
        m.put("AURA_EFFECT_BLOCK_PROTECTION", new HintBundle(TY_AURA, TY_GENERAL_BLOCK_LIMITATION, TY_NOT_BLOCKABLE )); // once
        m.put("AURA_EFFECT_ON_COLOR", new HintBundle(TA_FROM_FIELD, TR_CARD_COLOR_NEED, TR_CARD_TYPE_CREATURE, TY_AURA));
        m.put("AURA_EFFECT_PLAYER", new HintBundle(TA_IS_PLAYER,TY_PLAYER_AURA  ));
        m.put("AURA_EFFECT_PLAYER_CREATURES", new HintBundle(TA_FROM_FIELD, TR_CARD_PLAYER ));
        m.put("AURA_POWER_MOD", new HintBundle(TY_AURA, TY_POWER_ADD, TY_GENERAL_BUF));
        m.put("CARD_SELF_OK", new HintBundle(TR_CARD_SELF_NOT_ALLOWED));
        m.put("INSTANT_NEGATES_CREATURE", new HintBundle(TA_FROM_STACK, TR_CARD_TYPE_CREATURE, TY_NEGATE_STACK_CARD ));
        m.put("INSTANT_NEGATES_PLAYER_DAMAGE", new HintBundle(TA_FROM_STACK, TY_NEGATE_STACK_PLAYER_DAMAGE ));
        m.put("INSTANT_NEGATES_SORCERY", new HintBundle(TA_FROM_STACK, TR_CARD_TYPE_SORCERY, TY_NEGATE_STACK_CARD));
        m.put("IS_MULTISELECT_CARD", new HintBundle(CT_MULTI));
        m.put("MAINPHASE2_NEEDED", new HintBundle(PA_MAIN2_NEEDED));
        m.put("SHOULD_ATTACK", new HintBundle(PA_SHOULD_ATTACK));
        m.put("INSTANT_WHEN_OPPONENT_CREATURE_PLAYED", new HintBundle(TR_CARD_TYPE_CREATURE, PR_REACT_ONLY_AFTER_CARD_PLAYED ));
        m.put("INSTANT_WHEN_OPPONENT_SORCERY_PLAYED", new HintBundle(TR_CARD_TYPE_SORCERY, PR_REACT_ONLY_AFTER_CARD_PLAYED ));


// ok when empty
        m.put("COMBO_PREFERED_WITH_LIST", new HintBundle()); // once- ignored combos not done with usual hints
        m.put("HINT_TARGET", new HintBundle());
        m.put("INSTANT_GENERAL", new HintBundle());
        m.put("CAN_BE_TAPPED_INSTEAD_ATTACK", new HintBundle()); // as situation handled
        m.put("CAN_BE_TAPPED_INSTEAD_BLOCK", new HintBundle())// as situation handled

// player hints?

        m.put("OPPONENT_CREATURE_MAYBE", new HintBundle());
        m.put("OPPONENT_HIGHER_HEALTH_NEED", new HintBundle());
/*
        m.put("OPPONENT_HAND_NEED", new HintBundle(PH_OPPONENT_HAND_NEED));
        m.put("OPPONENT_CREATURE_NEED", new HintBundle(PH_OPPONENT_CREATURE_NEED));
        m.put("OPPONENT_LAND_NEED", new HintBundle(PH_OPPONENT_LAND_NEED));
        m.put("OPPONENT_ATTACKER_NEED", new HintBundle(PH_OPPONENT_ATTACKER_NEED));
View Full Code Here

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

        Vector<Phrase> phrasesFound = new Vector<Phrase>();
        HintDefinition.setHintCard(card);

        // SITUATIONS
        new Phrase(new StringArray("When", "enter|enters", "$battlefield->"+HINT_SITUATION_CARD_PLAYED, "$AS_KEY"), card, phrasesFound,
                   new HintBundle(O_WHEN_PLAYED));
        new Phrase(new StringArray("If|Whenever", "$attack->"+HINT_SITUATION_ATTACKER+"|attacks->"+HINT_SITUATION_ATTACKER, "$AS_KEY"), card, phrasesFound,
                   new HintBundle(O_WHEN_ATTACKING));
        new Phrase(new StringArray("If|Whenever", "$become|becomes", "blocked->"+HINT_SITUATION_ATTACKER, "$AS_KEY"), card, phrasesFound,
                   new HintBundle(O_WHEN_BLOCKED));
        new Phrase(new StringArray("$can´t_be_blocked->"+HINT_SITUATION_ATTACKER, "$AS_KEY", "$NO_POS+"), card, phrasesFound,
                   new HintBundle(O_WHEN_ATTACKING, TY_GENERAL_BUF, TY_NOT_BLOCKABLE));


        // TARGETS
        new Phrase(new StringArray("Target", "Opponent", "card|cards", "$NO_POS+"), card, phrasesFound,
                   new HintBundle(TR_CARD_OPPONENT));
        new Phrase(new StringArray("Target", "creature"), card, phrasesFound,
                   new HintBundle(TA_FROM_FIELD, TR_CARD_PLAYER, TR_CARD_OPPONENT, TR_CARD_TYPE_CREATURE, CT_SINGLE));
        new Phrase(new StringArray("$NAME", "$TYPE|Creature", "it_gets|he_gets|she_gets|the_gets", "$NO_POS+"), card, phrasesFound,
                   new HintBundle(TA_FROM_FIELD, CT_SINGLE, TA_SELF, TR_CARD_SELF_NOT_ALLOWED));
        new Phrase(new StringArray("$NAME", "$TYPE|Creature","can´t_be", "$NO_POS+"), card, phrasesFound,
                   new HintBundle(TA_FROM_FIELD, CT_SINGLE, TA_SELF, TR_CARD_SELF_NOT_ALLOWED));

        // TYPES / AMOUNT
        new Phrase(new StringArray("get|gets", "$+1/+0->1|+2/+0->2|+3/+0->3|+4/+0->4|+1/+1->1|+2/+1->2|+3/+1->3|+4/+1->4|+1/+2->1|+2/+2->2|+3/+2->3|+4/+2->4|+1/+4->1|+2/+4->2|+3/+4->3|+4/+4->4", "$AS_VALUE", "$NO_POS+"), card, phrasesFound,
                   new HintBundle(TY_GENERAL_BUF, TY_POWER_ADD, CT_AMOUNT_COUNT));
        new Phrase(new StringArray("get|gets", "$+0/+1->1|+0/+2->2|+0/+3->3|+0/+4->4|+1/+1->1|+1/+2->2|+1/+3->3|+1/+4->4|+2/+1->1|+2/+2->2|+2/+3->3|+2/+4->4|+4/+1->1|+4/+2->2|+4/+3->3|+4/+4->4", "$AS_VALUE", "$NO_POS+"), card, phrasesFound,
                   new HintBundle(TY_GENERAL_BUF, TY_TOUGHNESS_ADD, CT_AMOUNT_COUNT));
        new Phrase(new StringArray("discard|discards"), card, phrasesFound,
                   new HintBundle(TA_FROM_HAND, TY_HAND_TO_GRAVE));

        // COUNT
        new Phrase(new StringArray("$a_card->1", "$AS_VALUE"), card, phrasesFound,
                   new HintBundle(CT_SINGLE, CT_TARGET_COUNT));

        // RESTRICTIONS
        new Phrase(new StringArray("except", "$black->B", "$AS_VALUE", "$NO_POS+"), card, phrasesFound,
                   new HintBundle(TR_CARD_COLOR_NEED));
        new Phrase(new StringArray("except", "creaturs", "$NO_POS+"), card, phrasesFound,
                   new HintBundle(TR_CARD_TYPE_CREATURE));

        // TIMING
        new Phrase(new StringArray("$until_end_of_turn->1", "$AS_VALUE"), card, phrasesFound,
                   new HintBundle(TI_TURN_COUNT));


        for (int i = 0; i < phrasesFound.size(); i++)
        {
            Phrase phrase = phrasesFound.elementAt(i);
View Full Code Here

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

            key = HintAll.HINT_SITUATION_BLOCKER;
        else  if(cam.type == CardAndMana.CAM_BLOCKED)
            key = HintAll.HINT_SITUATION_BLOCKED;
        else return ret;

        if (EAIHelper.hasHint(cam.card, key, new HintBundle(HintSourceTypes.SY_OPPONENT_CHOSEN)))
        {
            ret.addElement(new Vector<EAIAction>());
            return ret;
        }

        int sc = EAIHelper.getSourceCount(cam.card, hints, key);
        if (sc == 0)
        {
            if (EAIHelper.hasHint(cam.card, key, new HintBundle(HintSourceCount.CS_SOURCE_COUNT_CHOSEN)))
            {
                sc = -1;
            }
            else
            {
                ret.addElement(new Vector<EAIAction>());
                return ret;
            }
        }

        // and than create all permutations of all actions and return them
        int minTargets = EAIHelper.getMinSourceCount(cam.card, hints, key);
        int maxTargets = EAIHelper.getMaxSourceCount(cam.card, hints, key);

        // now generate possible "sources"
        boolean isHidden = vMatch.isLibraryHidden();
        CardSimList possibleCardTargets = vMatch.getSourceEffectedList(key, cam.card, E.pNumber, hints);
        if (isHidden)
            vMatch.hideLibrary();
       
       
        boolean rochade = hints.hasAnyHint(key, new HintBundle(HintSourceTypes.SY_LIBRARY_ROCHADE));
        if (rochade)
        {
            // assume we would like to switch only cards which are right now unplayable
            possibleCardTargets = EAIHelper.onlyNotEnoughManaGeneral(possibleCardTargets, vMatch.getLand(cam.card.getOwner()));
        }

        int good = EAIHelper.isGoodEffectCardSource(cam.card, key);
        if (E.aiPlayer.getEAIConfig().getDontDamageOwn())
        {
             if (good == -1) // BAD
             {
                 if (EAIHelper.cardTargetOpponentPossible(cam.card, key , true))
                 {
                    possibleCardTargets = EAIHelper.removeOwnerCards(possibleCardTargets, player);
                 }
             }
             else if (good == 1) // good
             {
                 if (EAIHelper.cardTargetPlayerPossible(cam.card, key , true))
                 {
                    possibleCardTargets = EAIHelper.removeOwnerCards(possibleCardTargets, (player+1)%2);
                 }
             }
        }



        if (possibleCardTargets.hasRealCards())
            possibleCardTargets = possibleCardTargets.removeDummies();
        Vector<Integer> possiblePlayerTargets = vMatch.getPlayerSourceEffectedList(key, cam.card, E.pNumber, hints);

        // searching thru the library would otherwise return the WHOLE library!
        // - > permutation overload!
        //possibleCardTargets = reduceEqualIDsToMax(possibleCardTargets, maxTargets);
        possibleCardTargets = reduceSameToMax(possibleCardTargets, maxTargets);
       
        int SOME_SENSIBLE_CHOSING_SIZE = LIBRARY_SEARCH_WIDTH;
        if (possibleCardTargets.size() > SOME_SENSIBLE_CHOSING_SIZE)
        {
            possibleCardTargets = reduceTargetToSensible(possibleCardTargets, SOME_SENSIBLE_CHOSING_SIZE, player, vMatch, cam.card, good);
        }

        // now create actions
        Vector<EAIAction> actions = new Vector<EAIAction>();
        for (int i = 0; i < possibleCardTargets.size(); i++)
        {
            CardSim card = possibleCardTargets.getCard(i);
            // if card is a damaging X card
            // only allow targets which will be destroyed by it exactly
            if (good != 1) // not good
            {
                if (EAIHelper.isCreatureDamageCardSource(cam.card, key))
                {
                    if (cam.card.getCard().getManaCost() == -1)
                    {
                        // damage X
                        int damage = cam.cost.getAllManaCount() - cam.card.getCard().getManaCostNonX();

                        if (card.getNowToughness() != damage) continue;
                    }

                    // reduce creature targets to only the ones we can actually kill
                    // we do not test only the damage this card can do
                    // but all possible damage we can do till the end of testing
                    // within this leaf
                    // compared to the "damage" allready taken (ToughnessNOW)
                    if (vMatch.getPhase() != MatchConstants.PHASE_COMBAT_DECLARE_BLOCKERS)
                        if ((card.getNowToughness() > maxDamageInTodo) && (onlyCreatureKillDamage))
                            continue;
              
                }
            }

            EAIAction action = EAIAction.createTargetAction(0, vMatch.getPhase(), card, -1);
            action.isSource = true;
            actions.addElement(action);

        }

        for (int i = 0; i < possiblePlayerTargets.size(); i++) {
            Integer ii = possiblePlayerTargets.elementAt(i);
            if (good != 1) // not good
            {
                if (cam.card.getCard().getManaCost() == -1)
                {
                    int cost = cam.cost.getAllManaCount();
                   
                    if (vMatch.getLand(player).size() != cost) continue;

                }
            }

            EAIAction action = EAIAction.createTargetAction(0, vMatch.getPhase(), (CardSim)null, ii.intValue());
            action.isSource = true;
            actions.addElement(action);
        }



        int loopMin = 1;
        int loopMax = sc;

        if (loopMax > maxTargets) loopMax = maxTargets;
        if (loopMin < minTargets) loopMin = minTargets;
        if (actions.size() < loopMin) return null;
        if (loopMin>0) loopMin--; // since permutations are +1

        if (loopMax == -1) // count chosen by player
        {
            // than max count is the count of available actions
            loopMax = actions.size();
        }
       
        boolean noPermutation = hints.hasAnyHint(key, new HintBundle(HintPlayability.PA_NO_TARGET_PERMUTATION));

        if (noPermutation)
        {
            ret.addElement(actions);
        }
View Full Code Here

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

                else
                    key = HintAll.HINT_SITUATION_CARD_PLAYED;
            }
        else return ret;

        if (EAIHelper.hasHint(cam.card, key, new HintBundle(HintSourceTypes.SY_OPPONENT_CHOSEN)))
        {
            return ret;
        }

        int sc = EAIHelper.getSourceCount(cam.card, hints, key);
View Full Code Here

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

                    dependenedPlayer = action.targetPlayerNumber;
                }
            }
        }

        if (EAIHelper.hasHint(cam.card, key, new HintBundle(HintTargetTypes.TY_OPPONENT_CHOSEN)))
        {
            ret.addElement(new Vector<EAIAction>());
            return ret;
        }

        if (hints.hasHint(key, HintAll.TY_YES_NO))
        {
            Vector<EAIAction> yesV = new Vector<EAIAction>();
            Vector<EAIAction> noV = new Vector<EAIAction>();
            yesV.addElement(EAIAction.createYesNoAction(0, true, player));
            yesV.elementAt(0).isTarget = true;

            noV.addElement(EAIAction.createYesNoAction(0, false, player));
            noV.elementAt(0).isTarget = true;

            ret.addElement(yesV);
            ret.addElement(noV);
            return ret;
        }
        boolean isHidden = vMatch.isLibraryHidden();
        CardSimList possibleCardTargets = vMatch.getTargetEffectedList(key, cam.card, E.pNumber, hints, sources);
        if (sourceListDependened)
        {
            // add source targets
            for (int i = 0; i < sources.size(); i++) {
                EAIAction action = sources.elementAt(i);
                if (action.getSCard()!=null)
                    possibleCardTargets.addCard(action.getSCard());
            }
        }
       
        if (isHidden)
            vMatch.hideLibrary();
//taregt edependeble on source new hint
        possibleCardTargets = adjustSourcesToTargets(key, cam.card, sources, possibleCardTargets);

        int tc = EAIHelper.getTargetCount(cam.card, hints, key);

        if (tc == 0)
        {
            if (EAIHelper.hasHint(cam.card, key, new HintBundle(HintTargetCount.CT_TARGET_COUNT_CHOSEN)))
            {
                tc = -1;
            }
            else
            {
                ret.addElement(new Vector<EAIAction>());
                return ret;
            }
        }


        // and than create all permutations of all actions and return them
        int minTargets = EAIHelper.getMinTargetCount(cam.card, hints, key);
        int maxTargets = EAIHelper.getMaxTargetCount(cam.card, hints, key);

       
        boolean creatureDamage = EAIHelper.isCreatureDamageCardTarget(cam.card, key);
        boolean creatureBuf = EAIHelper.isBufCardTarget(cam.card, key);
        boolean doPermutations = true;

        int good = EAIHelper.isGoodEffectCardTarget(cam.card, key);
       
       
        boolean isMoveBad = EAIHelper.isMoveBadTarget(cam.card, key);
        boolean isMoveHand = EAIHelper.isMoveHandTarget(cam.card, key);
       
        if (isMoveBad && isMoveHand) isMoveBad = false;
       
        if (E.aiPlayer.getEAIConfig().getDontDamageOwn())
        {
             if (good==-1) // bad
             {
                 // only remove own targets if opponent target are at all possible!
                 if (EAIHelper.cardTargetOpponentPossible(cam.card, key , false))
                 {
                    // getDontDamageOwn ! so don´t try this!
                    
                     if (countOwnerCards(possibleCardTargets, (player+1)%2)>=maxTargets)
                        possibleCardTargets = EAIHelper.removeOwnerCards(possibleCardTargets, player);
                     else
                     {
                         boolean may = false;
                         if (EAIHelper.hasHint(cam.card, key, new HintBundle(HintTargetTypes.TY_PASSIV_OPTIONAL)))
                         {
                             may = true;
                             passiveMay = true;
                         }
                         if (EAIHelper.hasHint(cam.card, key, new HintBundle(HintTargetTypes.TY_ACTIVE_OPTIONAL)))
                         {
                             may = true;
                             activeMay = true;
                         }
                         if (may)
                            possibleCardTargets = EAIHelper.removeOwnerCards(possibleCardTargets, player);

                     }



                 }
                 if (isMoveBad)
                 {
                     // this is in general a destroy card card
                     // select max the two expansive cards as optimazattion
                     possibleCardTargets = possibleCardTargets.onlyExpansive(2);
                    
                 }
                
             }
             else if (good==1) // good
             {
                 if (EAIHelper.cardTargetPlayerPossible(cam.card, key , false))
                 {
                    if (countOwnerCards(possibleCardTargets, player)>=maxTargets)
                        possibleCardTargets = EAIHelper.removeOwnerCards(possibleCardTargets, (player+1)%2);
                    if (cam.card.isEnchantment())
                        possibleCardTargets = EAIHelper.removeOwnerCards(possibleCardTargets, (player+1)%2);
                 }
             }
             else // good = 0
             {
                 if (isMoveHand)
                 {
                     possibleCardTargets = EAIHelper.removeExtraPlayoutFeaturesPlayersCard(possibleCardTargets, (player+1)%2);
                 }
             }
        }
        if (good == 0)
        {
             if (isMoveHand)
             {
                 possibleCardTargets = EAIHelper.removeNotExtraPlayoutFeaturesPlayersCard(possibleCardTargets, player);
             }
        }

        Vector<Integer> possiblePlayerTargets = vMatch.getPlayerTargetEffectedList(key, cam.card, E.pNumber, hints);
       
        if (possibleCardTargets.hasRealCards())
            possibleCardTargets = possibleCardTargets.removeDummies();

        if (good == 1) // good
        {
            for (int i=0; i < possiblePlayerTargets.size(); i++)
            {
                int tt = possiblePlayerTargets.elementAt(i);
                if (tt == ((player+1)%2) )
                {
                    possiblePlayerTargets.remove(i);
                    break;
                }
            }
        }
        if (good == -1) // bad
        {
            for (int i=0; i < possiblePlayerTargets.size(); i++)
            {
                int tt = possiblePlayerTargets.elementAt(i);
                if (tt == player )
                {
                    possiblePlayerTargets.remove(i);
                    break;
                }
            }
        }

        // debug with err 1 4 times alaborn!!!
        int SOME_SENSIBLE_CHOSING_SIZE = LIBRARY_SEARCH_WIDTH;
        //if (SOME_SENSIBLE_CHOSING_SIZE > maxTargets) SOME_SENSIBLE_CHOSING_SIZE = maxTargets;
        // possibleCardTargets = reduceEqualIDsToMax(possibleCardTargets, maxTargets);
        possibleCardTargets = reduceSameToMax(possibleCardTargets, maxTargets);
        if (SOME_SENSIBLE_CHOSING_SIZE < maxTargets)
            SOME_SENSIBLE_CHOSING_SIZE = maxTargets;
        if (possibleCardTargets.size() > SOME_SENSIBLE_CHOSING_SIZE)
        {
/* todo in reduce to sensible take into account the amount of damage a card can do
            int damage = 0;
            if (creatureDamage)
            {
                damage = hints.getHintValueInt(key, HintAll.CS_AMOUNT_COUNT);
            }
*/
            if (EAIHelper.isMoveHandTarget(cam.card, key))
            {
                // check if playout has a nice effect
                CardSimList possibleCardTargetsTest = removePlayerCardsWithNotNicePlayoutEffects(possibleCardTargets, player, vMatch);
                if (possibleCardTargetsTest.size() < minTargets)
                {
                    // get cheapest till count ok
                    CardSimList temp = possibleCardTargets.removeOwner((player+1)%2).sortListByCost();
                    while ((possibleCardTargetsTest.size() < minTargets) && (temp.size()>0))
                    {
                        CardSim c = temp.getCard(0);
                        temp.remove(c);
                        possibleCardTargetsTest.addCard(c);
                       
                    }
                }
                possibleCardTargets = possibleCardTargetsTest;
               
                possibleCardTargetsTest = removeOpponentCardsWithNicePlayoutEffects(possibleCardTargets, player, vMatch);
                if (possibleCardTargetsTest.size() < minTargets)
                {
                    // get expansive till count ok
                    CardSimList temp = possibleCardTargets.removeOwner((player+1)%2).sortListByCost();
                    while ((possibleCardTargetsTest.size() < minTargets) && (temp.size()>0))
                    {
                        CardSim c = temp.getCard(temp.size()-1);
                        temp.remove(c);
                        possibleCardTargetsTest.addCard(c);
                       
                    }
                   
                }
                possibleCardTargets = possibleCardTargetsTest;
            }
            possibleCardTargets = reduceTargetToSensible(possibleCardTargets, SOME_SENSIBLE_CHOSING_SIZE, player, vMatch, cam.card, good);
        }

        // now create actions
        Vector<EAIAction> actions = new Vector<EAIAction>();

        if ((EAIHelper.hasHint(cam.card, key, new HintBundle(HintTargetTypes.TY_DIVIDE_AMOUNT))) && (creatureDamage))
        {
            int divided = 0;
            // e.g. forked lightning!
            for (int tt = 0; tt < maxTargets; tt++)
            {
                for (int i = 0; i < possibleCardTargets.size(); i++)
                {
                    CardSim card = possibleCardTargets.getCard(i);

                    // reduce creature targets to only the ones we can actually kill
                    // we do not test only the damage this card can do
                    // but all possible damage we can do till the end of testing
                    // within this leaf
                    // compared to the "damage" allready taken (ToughnessNOW)
                    if (vMatch.getPhase() != MatchConstants.PHASE_COMBAT_DECLARE_BLOCKERS)
                        if ((card.getNowToughness() > maxDamageInTodo) && (onlyCreatureKillDamage))
                            continue;
                    if (card.getNowToughness() <= card.helper)
                        continue; // creature is already dead!

                    EAIAction action = EAIAction.createTargetAction(0, vMatch.getPhase(), card, -1);
                    action.isTarget = true;
                    actions.addElement(action);
                   
                    // helper helps us to only add cards to divided damage
                    // as long as the divided damage for that card is
                    // not enough to kill it
                    card.helper++; // plus one damage
                    divided++; // only divide actions for max Targets!
                    if (divided>=maxTargets) break;
                }
                if (divided>=maxTargets) break;

            }
        }
        else
        {
            int currentChosenCount = 0;
            boolean choseCount = (EAIHelper.hasHint(cam.card, key, new HintBundle(HintTargetCount.CT_TARGET_COUNT_CHOSEN)));

            // for "Ransack" as it is implemented now!
            boolean actionsDone = false;
            if ((choseCount) && (possibleCardTargets.size() >0))
            {
                int sizeChosen = 1;
                if (maxTargets > 1)
                {
                    sizeChosen = maxTargets / 2;
                }
                CardSimList goodHalf = new CardSimList();
                CardSimList badHalf = possibleCardTargets.copyList();

                int cPlayer = 0;
                if (sourceDependened)
                    cPlayer =dependenedPlayer;
                else
                    cPlayer = badHalf.getCard(0).getOwner();
               
               
                // from cPlayer point of view
                for (int ii=badHalf.size()-1;ii >=0; ii--)
                {
                    CardSim g = EAIHelper.selectGoodCard(badHalf, true, cPlayer, vMatch, cam.card);
                    if (g == null) break;
                    goodHalf.addCard(g);
                    badHalf.remove(g);
                    if (goodHalf.size() >=sizeChosen) break;
                }
                if (EAIHelper.hasHint(cam.card, key, new HintBundle(HintTargetTypes.TY_CHOICE_LIBTOP_BOTTOM)));
                {
                    doPermutations = false;
                    if (player == cPlayer)
                    {
                        // put good cards on top of lib
                        actionsDone = true;
                        for (int i = 0; i < goodHalf.size(); i++)
                        {
                            CardSim card = goodHalf.getCard(i);
                            EAIAction action = EAIAction.createTargetAction(0, vMatch.getPhase(), card, -1);
                            action.isTarget = true;
                            actions.addElement(action);
                        }
                    }
                    else
                    {
                        // put good cards on top of lib
                        actionsDone = true;
                        for (int i = 0; i < badHalf.size(); i++)
                        {
                            CardSim card = badHalf.getCard(i);
                            EAIAction action = EAIAction.createTargetAction(0, vMatch.getPhase(), card, -1);
                            action.isTarget = true;
                            actions.addElement(action);
                        }
                    }

                    // do no permutation, since for now the
                    // above selection scheme of good/bad cards is
                    // a fixed algorithm and we do not make any further suggestions as of now
                    ret.addElement(actions);
                    return ret;
                }
            }
           
            if (!actionsDone)
            {
                for (int i = 0; i < possibleCardTargets.size(); i++)
                {
                    CardSim card = possibleCardTargets.getCard(i);

                    // if card is a damaging X card
                    // only allow targets which will be destroyed by it exactly
                    if (good != 1) // not good
                    {
                        if (creatureDamage)
                        {
                            if (cam.card.getCard().getManaCost() == -1)
                            {
                                // damage X
                                int damage = cam.cost.getAllManaCount() - cam.card.getCard().getManaCostNonX();

                                if (card.getNowToughness() != damage) continue;
                            }

                            // reduce creature targets to only the ones we can actually kill
                            // we do not test only the damage this card can do
                            // but all possible damage we can do till the end of testing
                            // within this leaf
                            // compared to the "damage" allready taken (ToughnessNOW)
                            else
                            {
                                if (card.getOwner() != player)
                                {
                                    if (vMatch.getPhase() != MatchConstants.PHASE_COMBAT_DECLARE_BLOCKERS)
                                        if ((card.getNowToughness() > maxDamageInTodo) && (onlyCreatureKillDamage))
                                            continue;
                                }
                            }
                        }
                    }
                    else
                    {
                        if (creatureBuf)
                        {
                            boolean isPower = EAIHelper.isPowerBufTarget(cam.card, key);
                            // except power bufs -> do more damage on players
                            if (!isPower)
                            {
                                // do not buf own creatures if opponent has no creatures
                                if (vMatch.getBattlefield((player+1)%2).getSubListByType("Creature").size() == 0)
                                {
                                        continue;
                                }

                                // extrem testing would be nice here!
                                // if creature survives attack anyway - dont buf
                                // hm, this has pros and cons
                                // con e.g. cant cast flight on a strong creature
                                // in order to only hurt opponent...
                                //if (!isWeakling(card, player))
                                //     continue;
                            }
                        }
                    }

                    EAIAction action = EAIAction.createTargetAction(0, vMatch.getPhase(), card, -1);
                    action.isTarget = true;
                    actions.addElement(action);
                }
            }
        }

        for (int i = 0; i < possiblePlayerTargets.size(); i++)
        {
            Integer ii = possiblePlayerTargets.elementAt(i);

            if (good != 1) // not good
            {
                if (cam.card.getCard().getManaCost() == -1)
                {
                    int xMana = 0;
                    if (cam.type == CardAndMana.CAM_ACTIVATE)
                        xMana = cam.cost.getAllManaCount()-cam.card.getCard().getActivationManaCostNonX();
                    if (cam.type == CardAndMana.CAM_PLAY)
                        xMana = cam.cost.getAllManaCount()-cam.card.getCard().getManaCostNonX();

                    int cost = cam.cost.getAllManaCount();
                    if (vMatch.getLand(player).size() != cost)
                    {
                        if (xMana < vMatch.getLife(ii)) // not dead
                        {
                            continue;
                        }
                    }
                }
                if (creatureDamage)
                {
                    if (possibleCardTargets.size() > 0)
                    {
                        // dont damage player if we have a creature target and health of player is "high"

                        // xmana not set here!
                        int xMana = 0;
                        if (cam.type == CardAndMana.CAM_ACTIVATE)
                            xMana = cam.cost.getAllManaCount()-cam.card.getCard().getActivationManaCostNonX();
                        if (cam.type == CardAndMana.CAM_PLAY)
                            xMana = cam.cost.getAllManaCount()-cam.card.getCard().getManaCostNonX();

                        if (cam.card.getCard().getManaCost() == -1)
                            {if (vMatch.getLife(ii) >xMana) continue;}
                        else if (vMatch.getLife(ii) >5) continue;
                    }
                }
            }
           
            EAIAction action = EAIAction.createTargetAction(0, vMatch.getPhase(), (CardSim)null, ii.intValue());
            action.isTarget = true;
            actions.addElement(action);
        }



        int loopMin = 1;
        int loopMax = tc;

        if (loopMax > maxTargets) loopMax = maxTargets;
        if (loopMin < minTargets) loopMin = minTargets;
        if (loopMax == -1) // count chosen by player
        {
            // than max count is the count of available actions
            loopMax = actions.size();
        }

       
        if (actions.size() < loopMin)
        {
           if (EAIHelper.hasHint(cam.card, key, new HintBundle(HintTargetTypes.TY_PASSIV_OPTIONAL)))
           {
                ret.addElement(new Vector<EAIAction>());
                return ret;
           }
            else if(EAIHelper.hasHint(cam.card, key, new HintBundle(HintTargetTypes.TY_ACTIVE_OPTIONAL)))
           {
                // TODO: Active optional not done yet!
                return null;
           }
           else
                return null;
        }
        if (loopMin>0)
            loopMin--; // since permutations are +1

        boolean noPermutation = hints.hasAnyHint(key, new HintBundle(HintPlayability.PA_NO_TARGET_PERMUTATION));

        if (EAIHelper.hasHint(cam.card, key, new HintBundle(HintTargetTypes.TY_DIVIDE_AMOUNT)))
            noPermutation = true; // permutations are "inclusive" by divide amount!
       
       
       
        if (noPermutation)
View Full Code Here

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

                else
                    key = HintAll.HINT_SITUATION_CARD_PLAYED;
            }
        else return ret;

        if (EAIHelper.hasHint(cam.card, key, new HintBundle(HintTargetTypes.TY_OPPONENT_CHOSEN)))
        {
            return ret;
        }

        int tc = EAIHelper.getTargetCount(cam.card, hints, key);
View Full Code Here

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

                possibleCardTargets.addCard(sCard);
            }
            return possibleCardTargets;
        }
        // if souce inherent add dummy
        if (EAIHelper.hasHint(card, key, new HintBundle(HintAll.SY_INHERENT)))
        {
            CardSim dummy = new CardSim (Card.buildDummy());
            if (EAIHelper.hasHint(card, key, new HintBundle(HintAll.SR_CARD_PLAYER)))
                dummy.setOwner(player);
            else
                dummy.setOwner((player+1)%2);
            possibleCardTargets.addCard( dummy);
        }
View Full Code Here

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

            int player = 0;
            if (!isAttacker[0]) player = 1;
            int opponent = (player+1)%2;

            // evaluate Aura in Attack
            CardSimList playerAuras = getAurasOccurrence(new HintBundle(O_WHEN_ATTACKING), player);
            for (int i=0; i < playerAuras.size(); i++)
            {
                CardSim source = playerAuras.getCard(i);
                AIEnhancedCardHints hints = AIEnhancedCardHints.getHints(source);
                String key = hints.getKey(O_WHEN_ATTACKING);

                CardSimList effectedList = getTargetEffectedList(key, source, player, hints, null);
                for (int e=0; e< effectedList.size(); e++)
                {
                    CardSim tCard = effectedList.getCard(e);
                    tCard = allCards.get(tCard.getCard().getUniqueID());
                    int tPlayer = tCard.owner;

                    doTargetEffectOnOneCard(tCard, tPlayer, key, hints, player, source);
                }
            }

            // evaluate Aura in Attack
            CardSimList opponentAuras = getAurasOccurrence(new HintBundle(O_WHEN_BLOCKING), opponent);
            for (int i=0; i < opponentAuras.size(); i++)
            {
                CardSim source = opponentAuras.getCard(i);
                AIEnhancedCardHints hints = AIEnhancedCardHints.getHints(source);
                String key = hints.getKey(O_WHEN_BLOCKING);

                CardSimList effectedList = getTargetEffectedList(key, source, opponent, hints, null);
                for (int e=0; e< effectedList.size(); e++)
                {
                    CardSim tCard = effectedList.getCard(e);
                    tCard = allCards.get(tCard.getCard().getUniqueID());

                    int tPlayer = tCard.owner;
                    doTargetEffectOnOneCard(tCard, tPlayer, key, hints, player, source);
                }
            }

        }
        else if (phase == PHASE_MAIN2) // combat is reolved AFTRER setting the phase so we must take the next one
        {
            reverseEffect = true;
            // remove auras

            // add auras
            int player = 0;
            if (!isAttacker[0]) player = 1;
            int opponent = (player+1)%2;

            // evaluate Aura in Attack
            CardSimList playerAuras = getAurasOccurrence(new HintBundle(O_WHEN_ATTACKING), player);
            for (int i=0; i < playerAuras.size(); i++)
            {
                CardSim source = playerAuras.getCard(i);
                AIEnhancedCardHints hints = AIEnhancedCardHints.getHints(source);
                String key = hints.getKey(O_WHEN_ATTACKING);

                CardSimList effectedList = getTargetEffectedList(key, source, player, hints, null);
                for (int e=0; e< effectedList.size(); e++)
                {
                    CardSim tCard = effectedList.getCard(e);
                    tCard = allCards.get(tCard.getCard().getUniqueID());
                    int tPlayer = tCard.owner;
                    doTargetEffectOnOneCard(tCard, tPlayer, key, hints, player, source);
                }
            }

            // evaluate Aura in Block
            CardSimList opponentAuras = getAurasOccurrence(new HintBundle(O_WHEN_BLOCKING), opponent);
            for (int i=0; i < opponentAuras.size(); i++)
            {
                CardSim source = opponentAuras.getCard(i);
                AIEnhancedCardHints hints = AIEnhancedCardHints.getHints(source);
                String key = hints.getKey(O_WHEN_BLOCKING);
View Full Code Here

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

        if (hints.hasHint(hintKey, TY_INHERENT)) return ret; // card has targets, but they are not to be selected

        int opponent = 0;
        if (player == 0) opponent = 1;

        if (hints.hasAnyHint(hintKey, new HintBundle(TA_IS_PLAYER)))
            ret.addElement(player);
        if (hints.hasAnyHint(hintKey, new HintBundle(TA_IS_OPPONENT)))
            ret.addElement(opponent);


        return ret;
    }
View Full Code Here

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

        if (hints.hasHint(hintKey, SY_INHERENT)) return ret; // card has targets, but they are not to be selected

        int opponent = 0;
        if (player == 0) opponent = 1;

        if (hints.hasAnyHint(hintKey, new HintBundle(S_IS_PLAYER)))
            ret.addElement(player);
        if (hints.hasAnyHint(hintKey, new HintBundle(S_IS_OPPONENT)))
            ret.addElement(opponent);

        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.