Package mage.target

Examples of mage.target.Target


        this.color.setBlue(true);

        // {1}: Return target land you control to its owner's hand.
        Effect returnToHand = new ReturnToHandTargetEffect();
        Target targetLandYouControl = new TargetLandPermanent(landYouControl);
        Ability returnLandToHand = new SimpleActivatedAbility(Zone.BATTLEFIELD, returnToHand, new GenericManaCost(1));
        returnLandToHand.addTarget(targetLandYouControl);
        this.addAbility(returnLandToHand);

        // {1}, Discard a land card: Draw a card.
View Full Code Here


        this.expansionSetCode = "DDF";

        this.color.setBlue(true);

        // Return target nonland permanent and all other permanents with the same name as that permanent to their owners' hands.
        Target target = new TargetNonlandPermanent();
        this.getSpellAbility().addTarget(target);
        this.getSpellAbility().addEffect(new ReturnToHandAllNamedPermanentsEffect());
    }
View Full Code Here

        this.color.setRed(true);
        this.power = new MageInt(4);
        this.toughness = new MageInt(5);

        Ability ability = new EntersBattlefieldTriggeredAbility(new DamageTargetEffect(1), false);
        Target target = new TargetCreatureOrPlayer();
        ability.addTarget(target);
        this.addAbility(ability);
    }
View Full Code Here

        this.color.setWhite(true);

        // Target permanent you control gains protection from artifacts or from the color of your choice until end of turn.
        this.getSpellAbility().addEffect(new RazorBarrierEffect(Duration.EndOfTurn));
        Target target = new TargetControlledPermanent();
        this.getSpellAbility().addTarget(target);
    }
View Full Code Here

        this.color.setGreen(true);

        // Destroy target artifact or enchantment.
        this.getSpellAbility().addEffect(new DestroyTargetEffect());
        Target target = new TargetPermanent(filter);
        this.getSpellAbility().addTarget(target);
        // Splice onto Arcane {3}{G}
        this.addAbility(new SpliceOntoArcaneAbility("{3}{G}"));
    }
View Full Code Here

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

        // {X}, {T}: Target creature with power X or less is unblockable this turn.
        Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new UnblockableTargetEffect(), new ManaCostsImpl("{X}"));
        Target target = new TargetCreaturePermanent(filter);
        ability.addTarget(target);
        ability.addCost(new TapSourceCost());
        this.addAbility(ability);

    }
View Full Code Here

                if (effect instanceof UnblockableTargetEffect) {
                    int manaX = ability.getManaCostsToPay().getX();
                    ability.getTargets().clear();
                    FilterCreaturePermanent newFilter = new FilterCreaturePermanent(new StringBuilder("creature with power ").append(manaX).append(" or less").toString());
                    filter.add(new PowerPredicate(Filter.ComparisonType.LessThan, manaX +1));
                    Target target = new TargetCreaturePermanent(newFilter);
                    ability.addTarget(target);
                    break;
                }
            }
        }
View Full Code Here

        this.power = new MageInt(4);
        this.toughness = new MageInt(5);

        // When Scab-Clan Giant enters the battlefield, it fights target creature an opponent controls chosen at random.
        Ability ability = new EntersBattlefieldTriggeredAbility(new ScabClanGiantEffect());
        Target target = new TargetCreaturePermanent(filter);
        target.setRandom(true);
        ability.addTarget(target);
        this.addAbility(ability);
    }
View Full Code Here

        this.toughness = new MageInt(1);

        // Whenever Blood Artist or another creature dies, target player loses 1 life and you gain 1 life.
        Ability ability = new DiesThisOrAnotherCreatureTriggeredAbility(new LoseLifeTargetEffect(1), false);
        ability.addEffect(new GainLifeEffect(1));
        Target target = new TargetPlayer();
        ability.addTarget(target);
        this.addAbility(ability);
    }
View Full Code Here

        if (ability instanceof SimpleActivatedAbility) {
            int xValue = ability.getManaCostsToPay().getX();
            ability.getTargets().clear();
            FilterArtifactPermanent filter = new FilterArtifactPermanent(new StringBuilder("artifact with converted mana cost ").append(xValue).toString());
            filter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.Equal, xValue));
            Target target = new TargetPermanent(filter);
            ability.addTarget(target);
        }
    }
View Full Code Here

TOP

Related Classes of mage.target.Target

Copyright © 2018 www.massapicom. 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.