Examples of TargetControlledPermanent


Examples of mage.target.common.TargetControlledPermanent

  public boolean apply(Game game, Ability source) {
    List<UUID> perms = new ArrayList<UUID>();
    for (Player player: game.getPlayers().values()) {
      int numTargets = Math.min(amount, game.getBattlefield().countAll(filter, player.getId()));
      filter.setTargetController(TargetController.YOU);
      TargetControlledPermanent target = new TargetControlledPermanent(numTargets, numTargets, filter, false);
      while (!target.isChosen()) {
        player.choose(Outcome.Sacrifice, target, game);
      }
      perms.addAll(target.getTargets());
    }
    for (UUID permID: perms) {
      Permanent permanent = game.getPermanent(permID);
      if (permanent != null)
        permanent.sacrifice(source.getSourceId(), game);
View Full Code Here

Examples of mage.target.common.TargetControlledPermanent

  @Override
  public boolean apply(Game game, Ability source) {
    Player player = game.getPlayer(source.getControllerId());
    if (player != null) {
      TargetControlledPermanent target = new TargetControlledPermanent(filter);
      if (target.canChoose(null, source.getControllerId(), game)) {
        target.setRequired(true);
        if (player.choose(Outcome.Neutral, target, game)) {
          Permanent permanent = game.getPermanent(target.getFirstTarget());
          if (permanent != null) {
            permanent.addCounters("phylactery", 1);
          }
        }
      }
View Full Code Here

Examples of mage.target.common.TargetControlledPermanent

    this.power = new MageInt(2);
    this.toughness = new MageInt(2);
    TargetCardInLibrary target = new TargetCardInLibrary(new FilterLandCard());
    Costs costs = new CostsImpl();
    costs.add(new TapSourceCost());
    costs.add(new SacrificeTargetCost(new TargetControlledPermanent(1, 1, filter, false)));
    this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new KnightOfTheReliquaryEffect()));
    this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new SearchLibraryPutInPlayEffect(target, false, Outcome.PutLandInPlay), costs));
  }
View Full Code Here

Examples of mage.target.common.TargetControlledPermanent

    return new EldraziMonumentEffect(this);
  }

  @Override
  public boolean apply(Game game, Ability source) {
    TargetControlledPermanent target = new TargetControlledCreaturePermanent();
    target.setRequired(true);
    Player player = game.getPlayer(source.getControllerId());
    if (target.canChoose(source.getId(), source.getControllerId(), game)) {
      player.choose(this.outcome, target, game);
      Permanent permanent = game.getPermanent(target.getFirstTarget());
      if (permanent != null) {
        return permanent.sacrifice(source.getSourceId(), game);
      }
    }
    Permanent permanent = game.getPermanent(source.getSourceId());
View Full Code Here

Examples of mage.target.common.TargetControlledPermanent

        this.power = new MageInt(4);
        this.toughness = new MageInt(4);
        this.addAbility(FlyingAbility.getInstance());
        Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new ManaCostsImpl("{1}{W}{B}"));
        ability.addCost(new TapSourceCost());
        ability.addTarget(new TargetControlledPermanent(filter));
        this.addAbility(ability);
        this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new UntapSourceEffect(), new ManaCostsImpl("{2}{U}")));
    }
View Full Code Here

Examples of mage.target.common.TargetControlledPermanent

  public Deprive(UUID ownerId) {
    super(ownerId, 59, "Deprive", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{U}{U}");
    this.expansionSetCode = "ROE";
    this.color.setBlue(true);
    this.getSpellAbility().addCost(new ReturnToHandTargetCost(new TargetControlledPermanent(filter)));
    this.getSpellAbility().addTarget(new TargetSpell());
    this.getSpellAbility().addEffect(new CounterTargetEffect());
  }
View Full Code Here

Examples of mage.target.common.TargetControlledPermanent

        // Shroud (This creature can't be the target of spells or abilities.)
        this.addAbility(ShroudAbility.getInstance());

        // When Scythe Tiger enters the battlefield, sacrifice it unless you sacrifice a land.
        this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new SacrificeTargetCost(new TargetControlledPermanent(filter)))));
    }
View Full Code Here

Examples of mage.target.common.TargetControlledPermanent

        List<UUID> perms = new ArrayList<>();
        for (UUID playerId : controller.getInRange()) {
            Player player = game.getPlayer(playerId);
            if (player != null) {
                int numTargets = Math.min(amount.calculate(game, source, this), game.getBattlefield().countAll(filter, player.getId(), game));
                TargetControlledPermanent target = new TargetControlledPermanent(numTargets, numTargets, filter, true);
                if (target.canChoose(player.getId(), game)) {
                    while (!target.isChosen() && player.isInGame()) {
                        player.choose(Outcome.Sacrifice, target, source.getSourceId(), game);
                    }
                    perms.addAll(target.getTargets());
                }
            }
        }
        for (UUID permID : perms) {
            Permanent permanent = game.getPermanent(permID);
View Full Code Here

Examples of mage.target.common.TargetControlledPermanent

                    if (controller != null) {
                        Cards cards = new CardsImpl();
                        cards.add(permanent);
                        controller.lookAtCards("Soulbond", cards, game);
                        if (controller.chooseUse(Outcome.Benefit, "Use Soulbond?", game)) {
                            TargetControlledPermanent target = new TargetControlledPermanent(filter);
                            target.setNotTarget(true);
                            if (target.canChoose(permanent.getId(), controller.getId(), game)) {
                                if (controller.choose(Outcome.Benefit, target, permanent.getId(), game)) {
                                    Permanent chosen = game.getPermanent(target.getFirstTarget());
                                    if (chosen != null) {
                                        chosen.setPairedCard(permanent.getId());
                                        permanent.setPairedCard(chosen.getId());
                                        game.informPlayers(new StringBuilder(controller.getName()).append(" souldbonds ").append(permanent.getLogName()).append(" with ").append(chosen.getName()).toString());
                                    }
View Full Code Here

Examples of mage.target.common.TargetControlledPermanent

    public AltarOfDementia(UUID ownerId) {
        super(ownerId, 266, "Altar of Dementia", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{2}");
        this.expansionSetCode = "TMP";

        // Sacrifice a creature: Target player puts a number of cards equal to the sacrificed creature's power from the top of his or her library into his or her graveyard.
        Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AltarOfDementiaEffect(), new SacrificeTargetCost(new TargetControlledPermanent(filter)));
        ability.addTarget(new TargetPlayer());
        this.addAbility(ability);
       
    }
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.