Examples of TargetCardInHand


Examples of mage.target.common.TargetCardInHand

        Player controller = game.getPlayer(source.getControllerId());
        MageObject sourceObject = game.getObject(source.getSourceId());
        if (controller != null && sourceObject != null) {
            FilterCard filter = new FilterCard("card in your hand to exile");
            FilterCard filter2 = new FilterCard("(move the window) card exiled by " + sourceObject.getLogName() + " to put on top of library");
            TargetCardInHand target = new TargetCardInHand(0, controller.getHand().size(), filter);
            target.setRequired(false);
            int amountExiled = 0;
            if (target.canChoose(source.getControllerId(), game) && target.choose(Outcome.Neutral, source.getControllerId(), source.getSourceId(), game)) {
                if (!target.getTargets().isEmpty()) {
                    List<UUID> targets = target.getTargets();
                    for (UUID targetId : targets) {
                        Card card = game.getCard(targetId);
                        if (card != null) {
                            card.setFaceDown(true);
                            if (card.moveToExile(source.getSourceId(), sourceObject.getLogName(), source.getSourceId(), game)) {
View Full Code Here

Examples of mage.target.common.TargetCardInHand

        this.color.setGreen(true);

        // {G}, Discard a creature card: Search your library for a creature card, reveal that card, and put it into your hand. Then shuffle your library.
        Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new SearchLibraryPutInHandEffect(new TargetCardInLibrary(filter), true, true), new ColoredManaCost(ColoredManaSymbol.G));
        ability.addCost(new DiscardTargetCost(new TargetCardInHand(filter)));
        this.addAbility(ability);
    }
View Full Code Here

Examples of mage.target.common.TargetCardInHand

        if (player != null) {
            Permanent auraPermanent = game.getPermanent(source.getSourceId());
            if (auraPermanent != null && auraPermanent.getSubtype().contains("Aura") && auraPermanent.getOwnerId().equals(source.getControllerId())) {
                Permanent enchantedPermanent = game.getPermanent(auraPermanent.getAttachedTo());
                filter.add(new AuraCardCanAttachToPermanentId(enchantedPermanent.getId()));
                TargetCardInHand target = new TargetCardInHand(0, 1, filter);
                if (player.choose(Outcome.PutCardInPlay, target, source.getSourceId(), game)) {
                    Card auraInHand = game.getCard(target.getFirstTarget());
                    if (auraInHand != null) {
                        player.putOntoBattlefieldWithInfo(auraInHand, game, Zone.HAND, source.getSourceId());
                        enchantedPermanent.addAttachment(auraInHand.getId(), game);
                        player.moveCardToHandWithInfo(auraPermanent, source.getSourceId(), game, Zone.BATTLEFIELD);
                        return true;
View Full Code Here

Examples of mage.target.common.TargetCardInHand

     * */
    //TODO implement may look at exile cards
    @Override
    public void mulligan(UUID playerId) {
        Player player = getPlayer(playerId);
        TargetCardInHand target = new TargetCardInHand(1, player.getHand().size(), new FilterCard("card to mulligan"));
        target.setNotTarget(true);
        target.setRequired(false);
        if (player.choose(Outcome.Exile, player.getHand(), target, this)){
            int numCards = target.getTargets().size();
            for(UUID uuid : target.getTargets()){
                Card card = player.getHand().get(uuid, this);
                if(card != null){
                    if(!mulliganedCards.containsKey(playerId)){
                        mulliganedCards.put(playerId, new CardsImpl());
                    }
View Full Code Here

Examples of mage.target.common.TargetCardInHand

        this.expansionSetCode = "EXO";

        this.color.setBlue(true);

        // Buyback-Discard two cards.
        this.addAbility(new BuybackAbility(new DiscardTargetCost(new TargetCardInHand(2, new FilterCard("two cards")))));
        // Counter target spell.
        this.getSpellAbility().addEffect(new CounterTargetEffect());
        this.getSpellAbility().addTarget(new TargetSpell());
    }
View Full Code Here

Examples of mage.target.common.TargetCardInHand

        return 0;
    }

    @Override
    public Cost getFixedCostsFromAnnouncedValue(int xValue) {
        TargetCardInHand target = new TargetCardInHand(xValue, filter);
        return new DiscardTargetCost(target);
    }
View Full Code Here

Examples of mage.target.common.TargetCardInHand

    @Override
    public boolean apply(Game game, Ability source) {
        Player controller = game.getPlayer(source.getControllerId());
        if (controller != null) {
            Target target = new TargetCardInHand(new FilterLandCard("land card"));
            if (target.canChoose(source.getSourceId(), source.getControllerId(), game)
                    && controller.choose(outcome, target, source.getSourceId(), game)) {
                Card card = game.getCard(target.getFirstTarget());
                if (card != null) {
                    controller.putOntoBattlefieldWithInfo(card, game, Zone.HAND, source.getSourceId(), tapped);
                }
            }
            return true;
View Full Code Here

Examples of mage.target.common.TargetCardInHand

        this.power = new MageInt(1);
        this.toughness = new MageInt(1);

        // {tap}: You may put a land card from your hand onto the battlefield. Activate this ability only any time you could cast a sorcery.
        Ability ability = new ActivateAsSorceryActivatedAbility(Zone.BATTLEFIELD, new PutLandFromHandOntoBattlefieldEffect(), new TapSourceCost());
        ability.addTarget(new TargetCardInHand(0, 1, new FilterLandCard()));
        this.addAbility(ability);
       
    }
View Full Code Here

Examples of mage.target.common.TargetCardInHand

                    ArrayList<Predicate<MageObject>> idPredicates = new ArrayList<>();
                    for (SpliceOntoArcaneAbility ability : spliceAbilities) {
                        idPredicates.add(new CardIdPredicate((ability.getSourceId())));
                    }
                    filter.add(Predicates.or(idPredicates));
                    TargetCardInHand target = new TargetCardInHand(filter);
                    controller.chooseTarget(Outcome.Benefit, target, abilityToModify, game);
                    UUID cardId = target.getFirstTarget();
                    if (cardId != null) {
                        SpliceOntoArcaneAbility selectedAbility = null;
                        for(SpliceOntoArcaneAbility ability :spliceAbilities) {
                            if (ability.getSourceId().equals(cardId)) {
                                selectedAbility = ability;
View Full Code Here

Examples of mage.target.common.TargetCardInHand

        this.cardName = cardName;
       
        FilterCard filter = new FilterCard("another card named " + cardName);
        filter.add(new NamePredicate(cardName));
        filter.add(new AnotherCardPredicate());
        this.addCost(new DiscardTargetCost(new TargetCardInHand(filter)));
    }
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.