@Override public PutOnLibraryTargetEffect copy() { return new PutOnLibraryTargetEffect(this); }
@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 Mortuary(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{B}"); // Whenever a creature is put into your graveyard from the battlefield, put that card on top of your library. Ability ability = new PutIntoGraveFromBattlefieldAllTriggeredAbility(new PutOnLibraryTargetEffect(true, "put that card on top of your library."), false, StaticFilters.FILTER_PERMANENT_CREATURE, true, true); this.addAbility(ability); }
public HauntedCrossroads(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{B}"); // {B}: Put target creature card from your graveyard on top of your library. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PutOnLibraryTargetEffect(true), new ManaCostsImpl("{B}")); ability.addTarget(new TargetCardInYourGraveyard(StaticFilters.FILTER_CARD_CREATURE_YOUR_GRAVEYARD)); this.addAbility(ability); }
public VesselOfEndlessRest(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{3}"); // When Vessel of Endless Rest enters the battlefield, put target card from a graveyard on the bottom of its owner's library. Ability ability = new EntersBattlefieldTriggeredAbility(new PutOnLibraryTargetEffect(false), false); ability.addTarget(new TargetCardInGraveyard()); this.addAbility(ability); // {tap}: Add one mana of any color. this.addAbility(new AnyColorManaAbility()); }
public ReitoLantern(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{2}"); // Put target card from a graveyard on the bottom of its owner's library. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PutOnLibraryTargetEffect(false), new GenericManaCost(3)); ability.addTarget(new TargetCardInGraveyard()); this.addAbility(ability); }
public NulltreadGargantuan (UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{G}{U}"); this.subtype.add(SubType.BEAST); this.power = new MageInt(5); this.toughness = new MageInt(6); // When Nulltread Gargantuan enters the battlefield, put a creature you control on top of its owner's library. Ability ability = new EntersBattlefieldTriggeredAbility(new PutOnLibraryTargetEffect(true), false); Target target = new TargetControlledCreaturePermanent(); target.setNotTarget(true); ability.addTarget(target); this.addAbility(ability); }
public MortuaryMire(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.LAND}, ""); // Mortuary Mire enters the battlefield tapped. this.addAbility(new EntersBattlefieldTappedAbility()); // When Mortuary Mire enters the battlefield, you may put target creature card from your graveyard on top of your library. Ability ability = new EntersBattlefieldTriggeredAbility(new PutOnLibraryTargetEffect(true), true); ability.addTarget(new TargetCardInYourGraveyard(StaticFilters.FILTER_CARD_CREATURE_YOUR_GRAVEYARD)); this.addAbility(ability); // {T}: Add {B}. this.addAbility(new BlackManaAbility()); }
public VedalkenDismisser(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{5}{U}"); this.subtype.add(SubType.VEDALKEN); this.subtype.add(SubType.WIZARD); this.power = new MageInt(2); this.toughness = new MageInt(2); // When Vedalken Dismisser enters the battlefield, put target creature on top of its owner's library. Ability ability = new EntersBattlefieldTriggeredAbility(new PutOnLibraryTargetEffect(true), false); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); }
public NantukoTracer(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{G}"); this.subtype.add(SubType.INSECT); this.subtype.add(SubType.DRUID); this.power = new MageInt(2); this.toughness = new MageInt(1); // When Nantuko Tracer enters the battlefield, you may put target card from a graveyard on the bottom of its owner's library. Ability ability = new EntersBattlefieldTriggeredAbility(new PutOnLibraryTargetEffect(false), true); ability.addTarget(new TargetCardInGraveyard()); this.addAbility(ability); }
public HuntingDrake(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{U}"); this.subtype.add(SubType.DRAKE); this.power = new MageInt(2); this.toughness = new MageInt(2); // Flying this.addAbility(FlyingAbility.getInstance()); // When Hunting Drake enters the battlefield, put target red or green creature on top of its owner's library. Ability ability = new EntersBattlefieldTriggeredAbility(new PutOnLibraryTargetEffect(true)); ability.addTarget(new TargetCreaturePermanent(filter)); this.addAbility(ability); }
public LoomingHoverguard(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{U}{U}"); this.subtype.add(SubType.DRONE); this.power = new MageInt(3); this.toughness = new MageInt(3); this.addAbility(FlyingAbility.getInstance()); Ability ability = new EntersBattlefieldTriggeredAbility(new PutOnLibraryTargetEffect(true), false); ability.addTarget(new TargetPermanent(filter)); this.addAbility(ability); }
public TimeEbb(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{2}{U}"); this.getSpellAbility().addEffect(new PutOnLibraryTargetEffect(true)); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); }
public PlowUnder(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{3}{G}{G}"); // Put two target lands on top of their owners' libraries. this.getSpellAbility().addEffect(new PutOnLibraryTargetEffect(true)); this.getSpellAbility().addTarget(new TargetLandPermanent(2,2, StaticFilters.FILTER_LANDS, false)); }
public Salvage(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{G}"); // Put target card from your graveyard on top of your library. this.getSpellAbility().addEffect(new PutOnLibraryTargetEffect(true)); this.getSpellAbility().addTarget(new TargetCardInYourGraveyard()); }
public TemporalEddy(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{2}{U}{U}"); // Put target creature or land on top of its owner's library. this.getSpellAbility().addEffect(new PutOnLibraryTargetEffect(true)); this.getSpellAbility().addTarget(new TargetPermanent(filter)); }
public Excommunicate(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{2}{W}"); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addEffect(new PutOnLibraryTargetEffect(true)); }
public NaturalObsolescence(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{G}"); // Put target artifact on the bottom of its owner's library. this.getSpellAbility().addTarget(new TargetArtifactPermanent()); this.getSpellAbility().addEffect(new PutOnLibraryTargetEffect(false)); }
public HuaTuoHonoredPhysician(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{G}{G}"); addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.HUMAN); this.power = new MageInt(1); this.toughness = new MageInt(2); // {tap}: Put target creature card from your graveyard on top of your library. Activate this ability only during your turn, before attackers are declared. Ability ability = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, new PutOnLibraryTargetEffect(true), new TapSourceCost(), MyTurnBeforeAttackersDeclaredCondition.instance); ability.addTarget(new TargetCardInYourGraveyard(StaticFilters.FILTER_CARD_CREATURE_YOUR_GRAVEYARD)); this.addAbility(ability); }
public Repel(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{3}{U}"); // Put target creature on top of its owner's library. this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addEffect(new PutOnLibraryTargetEffect(true)); }