public DreamEaterReflexiveTriggeredAbility() { super(new ReturnToHandTargetEffect()); this.addTarget(new TargetPermanent(filter)); this.optional = true; }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source)); if (permanent != null && controller != null) { if (permanent.isAttacking()) { if (controller.chooseUse(Outcome.Neutral, "Put " + permanent.getIdName() + " on top of its owner's library (otherwise return to hand)?", source, game)) { new PutOnLibraryTargetEffect(true).apply(game, source); } else { new ReturnToHandTargetEffect().apply(game, source); } } else { new ReturnToHandTargetEffect().apply(game, source); } return true; } return false; }
public PitchstoneWallTriggeredAbility() { super(Zone.BATTLEFIELD, new DoIfCostPaid(new ReturnToHandTargetEffect().setText("return the discarded card from your graveyard to your hand"), new SacrificeSourceCost()), false); }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { UUID targetId = getTargetPointer().getFirst(game, source); Card card = game.getCard(targetId); if (card != null) { controller.moveCards(card, Zone.BATTLEFIELD, source, game); Permanent creature = game.getPermanent(card.getId()); if (creature != null) { ContinuousEffect hasteEffect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.Custom); hasteEffect.setTargetPointer(new FixedTarget(creature, game)); game.addEffect(hasteEffect, source); ReturnToHandTargetEffect returnToHandEffect = new ReturnToHandTargetEffect(); returnToHandEffect.setText("return that creature to your hand"); returnToHandEffect.setTargetPointer(new FixedTarget(creature, game)); DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(returnToHandEffect); game.addDelayedTriggeredAbility(delayedAbility, source); } } return true; } return false; } }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { if (controller.chooseUse(Outcome.PutCreatureInPlay, choiceText, source, game)) { TargetCardInHand target = new TargetCardInHand(filter); if (controller.choose(Outcome.PutCreatureInPlay, target, source.getSourceId(), game)) { Card card = game.getCard(target.getFirstTarget()); if (card != null) { if (controller.moveCards(card, Zone.BATTLEFIELD, source, game)) { Permanent permanent = game.getPermanent(card.getId()); if (permanent != null) { ReturnToHandTargetEffect effect = new ReturnToHandTargetEffect(); effect.setTargetPointer(new FixedTarget(permanent, game)); DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(effect); game.addDelayedTriggeredAbility(delayedAbility, source); return true; } } } return false; } } return true; } return false; } }
public HallowedGround(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}"); // {W}{W}: Return target nonsnow land you control to its owner's hand. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ReturnToHandTargetEffect(), new ManaCostsImpl("{W}{W}")); ability.addTarget(new TargetControlledPermanent(filter)); this.addAbility(ability); }
public SelectiveSnare(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{X}{U}"); // Return X target creatures of the creature type of your choice to their owner's hand. this.getSpellAbility().addEffect( new ReturnToHandTargetEffect(true) .setText("Return X target creatures of " + "the creature type of your choice " + "to their owner's hand") ); this.getSpellAbility().setTargetAdjuster(SelectiveSnareAdjuster.instance); }
@Override public boolean apply(Game game, Ability source) { Permanent creature = game.getPermanent(source.getFirstTarget()); if (creature == null || creature.getPower().getValue() > new PermanentsOnBattlefieldCount(filter).calculate(game, source, this)) { return false; } return new ReturnToHandTargetEffect().apply(game, source); } }
public SealOfRemoval(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{U}"); // Sacrifice Seal of Removal: Return target creature to its owner's hand. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ReturnToHandTargetEffect(), new SacrificeSourceCost()); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); }
public ReapingTheGraves(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{B}"); // Return target creature card from your graveyard to your hand. this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(StaticFilters.FILTER_CARD_CREATURE_YOUR_GRAVEYARD)); this.getSpellAbility().addEffect(new ReturnToHandTargetEffect().setText("Return target creature card from your graveyard to your hand.")); // Storm this.addAbility(new StormAbility()); }
new ReturnToHandTargetEffect().apply(game, source);
public SurrakarBanisher(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{U}"); this.subtype.add(SubType.SURRAKAR); this.power = new MageInt(3); this.toughness = new MageInt(3); Ability ability = new EntersBattlefieldTriggeredAbility(new ReturnToHandTargetEffect(), true); ability.addTarget(new TargetCreaturePermanent(filter)); this.addAbility(ability); }
public TragicPoet(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{W}"); this.subtype.add(SubType.HUMAN); this.power = new MageInt(1); this.toughness = new MageInt(1); // {tap}, Sacrifice Tragic Poet: Return target enchantment card from your graveyard to your hand. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ReturnToHandTargetEffect() .setText("Return target enchantment card from your graveyard to your hand"), new TapSourceCost()); ability.addCost(new SacrificeSourceCost()); ability.addTarget(new TargetCardInYourGraveyard(filter)); this.addAbility(ability); }
public ManOWar(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{U}"); this.subtype.add(SubType.JELLYFISH); this.power = new MageInt(2); this.toughness = new MageInt(2); // When Man-o'-War enters the battlefield, return target creature to its owner's hand. Ability ability = new EntersBattlefieldTriggeredAbility(new ReturnToHandTargetEffect()); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); }
public Reap(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{G}"); // Return up to X target cards from your graveyard to your hand, where X is the number of black permanents target opponent controls as you cast Reap. this.getSpellAbility().addEffect(new ReturnToHandTargetEffect().setText("Return up to X target cards from your graveyard to your hand, where X is the number of black permanents target opponent controls as you cast Reap.")); this.getSpellAbility().addTarget(new TargetOpponent()); this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(0, 0)); this.getSpellAbility().setTargetAdjuster(ReapAdjuster.instance); }
public Groffskithur(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{5}{G}"); this.subtype.add(SubType.BEAST); this.power = new MageInt(3); this.toughness = new MageInt(3); // Whenever Groffskithur becomes blocked, you may return target card named Groffskithur from your graveyard to your hand. Ability ability = new BecomesBlockedTriggeredAbility(new ReturnToHandTargetEffect(), true); ability.addTarget(new TargetCardInYourGraveyard(filter)); this.addAbility(ability); }
public CommandOfUnsummoning(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{U}"); // Cast Command of Unsummoning only during the declare attackers step and only if you've been attacked this step. Ability ability = new CastOnlyDuringPhaseStepSourceAbility( TurnPhase.COMBAT, PhaseStep.DECLARE_ATTACKERS, AttackedThisStepCondition.instance, "Cast this spell only during the declare attackers step and only if you've been attacked this step." ); ability.addWatcher(new PlayerAttackedStepWatcher()); this.addAbility(ability); // Return one or two target attacking creatures to their owner's hand. this.getSpellAbility().addEffect(new ReturnToHandTargetEffect().setText("Return one or two target attacking creatures to their owner's hand.")); this.getSpellAbility().addTarget(new TargetAttackingCreature(1, 2, new FilterAttackingCreature(), false)); }
public DeadeyeRigHauler(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{U}"); this.subtype.add(SubType.HUMAN); this.subtype.add(SubType.PIRATE); this.power = new MageInt(3); this.toughness = new MageInt(2); // <i>Raid</i>— When Deadeye Rig-Hauler enters the battlefield, if you attacked with a creature this turn, you may return target creature to its owner's hand. Ability ability = new ConditionalInterveningIfTriggeredAbility(new EntersBattlefieldTriggeredAbility(new ReturnToHandTargetEffect(), true), RaidCondition.instance, "<i>Raid</i> — When {this} enters the battlefield, if you attacked with a creature this turn, you may return target creature to its owner's hand."); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability, new PlayerAttackedWatcher()); }
public MemorialToFolly(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.LAND}, ""); // Memorial to Folly enters the battlefield tapped. this.addAbility(new EntersBattlefieldTappedAbility()); this.addAbility(new BlackManaAbility()); // {2}{B}, {T}, Sacrifice Memorial to Folly: Return target creature card from your graveyard to your hand. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ReturnToHandTargetEffect() .setText("Return target creature card from your graveyard to your hand"), new ManaCostsImpl("{2}{B}")); ability.addCost(new TapSourceCost()); ability.addCost(new SacrificeSourceCost()); ability.addTarget(new TargetCardInYourGraveyard(new FilterCreatureCard("creature card from your graveyard"))); this.addAbility(ability); }
public SalvagerOfSecrets(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{U}{U}"); this.subtype.add(SubType.MERFOLK); this.subtype.add(SubType.WIZARD); this.power = new MageInt(2); this.toughness = new MageInt(2); // When Salvager of Secrets enters the battlefield, return target instant or sorcery card from your graveyard to your hand. EntersBattlefieldTriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new ReturnToHandTargetEffect(), false); Target target = new TargetCardInYourGraveyard(filter); ability.addTarget(target); this.addAbility(ability); }