@Override public AddCardTypeTargetEffect copy() { return new AddCardTypeTargetEffect(this); }
@Override public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getFirstTarget()); if (permanent == null || !permanent.isFaceDown(game)) { this.discard(); return false; } return super.apply(game, source); } }
@Override public boolean apply(Game game, Ability source) { boolean result = false; for (UUID targetId : targetPointer.getTargets(game, source)) { Permanent target = game.getPermanent(targetId); if (target != null) { for (CardType cardType : addedCardTypes) { if (!target.getCardType().contains(cardType)) { target.addCardType(cardType); } } result = true; } } if (!result) { if (this.getDuration() == Duration.Custom) { this.discard(); } } return result; }
public ThranForge(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}"); // {2}: Until end of turn, target nonartifact creature gets +1/+0 and becomes an artifact in addition to its other types. Ability ability = new SimpleActivatedAbility( Zone.BATTLEFIELD, new BoostTargetEffect(1, 0, Duration.EndOfTurn) .setText("Until end of turn, target nonartifact creature gets +1/+0"), new GenericManaCost(2)); ability.addEffect( new AddCardTypeTargetEffect(Duration.EndOfTurn, CardType.ARTIFACT) .setText("and becomes an artifact in addition to its other types") ); ability.addTarget(new TargetPermanent(filter)); this.addAbility(ability); }
@Override public String getText(Mode mode) { if (staticText != null && !staticText.isEmpty()) { return staticText; } StringBuilder sb = new StringBuilder(); sb.append("Target ").append(mode.getTargets().get(0).getTargetName()).append(" becomes "); boolean article = false; for (CardType cardType : addedCardTypes) { if (!article) { if (cardType.toString().startsWith("A") || cardType.toString().startsWith("E")) { sb.append("an "); } else { sb.append("a "); } article = true; } sb.append(cardType.toString().toLowerCase(Locale.ENGLISH)).append(" "); } sb.append("in addition to its other types"); if (getDuration() == Duration.EndOfTurn) { sb.append(" until end of turn"); } return sb.toString(); } }
public TezzeretCruelMachinist(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.PLANESWALKER}, "{4}{U}{U}"); this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.TEZZERET); this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(4)); // +1: Draw a card. this.addAbility(new LoyaltyAbility(new DrawCardSourceControllerEffect(1), 1)); // 0: Until your next turn, target artifact you control becomes a 5/5 creature in addition to its other types. Ability ability = new LoyaltyAbility(new AddCardTypeTargetEffect( Duration.UntilYourNextTurn, CardType.ARTIFACT, CardType.CREATURE ).setText("Until your next turn, target artifact you control becomes an artifact creature"), 0); ability.addEffect(new SetPowerToughnessTargetEffect( 5, 5, Duration.UntilYourNextTurn ).setText("with base power and toughness 5/5")); ability.addTarget(new TargetPermanent(StaticFilters.FILTER_CONTROLLED_PERMANENT_ARTIFACT)); this.addAbility(ability); // −7: Put any number of cards from your hand onto the battlefield face down. They're 5/5 artifact creatures. this.addAbility(new LoyaltyAbility(new TezzeretCruelMachinistEffect(), -7)); }
public LiquimetalCoating (UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{2}"); // {T}: Target permanent becomes an artifact in addition to its other types until end of turn. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCardTypeTargetEffect(Duration.EndOfTurn, CardType.ARTIFACT), new TapSourceCost()); ability.addTarget(new TargetPermanent()); this.addAbility(ability); }
public PhyrexianScriptures(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{B}{B}"); this.subtype.add(SubType.SAGA); // <i>(As this Saga enters and after your draw step, add a lore counter. Sacrifice after III.)</i> SagaAbility sagaAbility = new SagaAbility(this, SagaChapter.CHAPTER_III); // I — Put a +1/+1 counter on up to one target creature. That creature becomes an artifact in addition to its other types. Effects effects = new Effects(); effects.add(new AddCountersTargetEffect(CounterType.P1P1.createInstance())); effects.add(new AddCardTypeTargetEffect(Duration.WhileOnBattlefield, CardType.ARTIFACT) .setText("That creature becomes an artifact in addition to its other types") ); sagaAbility.addChapterEffect(this, SagaChapter.CHAPTER_I, SagaChapter.CHAPTER_I, effects, new TargetCreaturePermanent(0, 1)); // II — Destroy all nonartifact creatures. sagaAbility.addChapterEffect(this, SagaChapter.CHAPTER_II, new DestroyAllEffect(filter)); // III — Exile all cards from all opponents' graveyards. sagaAbility.addChapterEffect(this, SagaChapter.CHAPTER_III, new ExileGraveyardAllPlayersEffect(StaticFilters.FILTER_CARD_CARDS, TargetController.OPPONENT) ); this.addAbility(sagaAbility); }
public MyrLandshaper(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT,CardType.CREATURE},"{3}"); this.subtype.add(SubType.MYR); this.power = new MageInt(1); this.toughness = new MageInt(1); // {tap}: Target land becomes an artifact in addition to its other types until end of turn. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCardTypeTargetEffect(Duration.EndOfTurn, CardType.ARTIFACT), new TapSourceCost()); Target target = new TargetLandPermanent(); ability.addTarget(target); this.addAbility(ability); }
public ArgentMutation(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{2}{U}"); this.getSpellAbility().addEffect(new AddCardTypeTargetEffect(Duration.EndOfTurn, CardType.ARTIFACT)); this.getSpellAbility().addTarget(new TargetPermanent()); this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1)); }
public TezzeretTheSchemerEmblem() { this.setName("Emblem Tezzeret"); Effect effect = new AddCardTypeTargetEffect(Duration.EndOfGame, CardType.ARTIFACT, CardType.CREATURE); effect.setText("target artifact you control becomes an artifact creature"); Ability ability = new BeginningOfCombatTriggeredAbility(Zone.COMMAND, effect, TargetController.YOU, false, true); effect = new SetPowerToughnessTargetEffect(5, 5, Duration.EndOfGame); effect.setText("with base power and toughness 5/5"); ability.addEffect(effect); ability.addTarget(new TargetPermanent(FILTER_CONTROLLED_PERMANENT_ARTIFACT)); this.getAbilities().add(ability); } }
public PeacewalkerColossus(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}"); this.subtype.add(SubType.VEHICLE); this.power = new MageInt(6); this.toughness = new MageInt(6); // {1}{W}: Another target Vehicle you control becomes an artifact creature until end of turn. Effect effect = new AddCardTypeTargetEffect(Duration.EndOfTurn, CardType.CREATURE); effect.setText("Another target Vehicle you control becomes an artifact creature until end of turn"); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{1}{W}")); ability.addTarget(new TargetControlledPermanent(filter)); this.addAbility(ability); // Crew 4 <i>(Tap any number of creatures you control with total power 4 or more: This Vehicle becomes an artifact creature until end of turn.) this.addAbility(new CrewAbility(4)); }
public AshnodsTransmogrant(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{1}"); // {T}, Sacrifice Ashnod's Transmogrant: Put a +1/+1 counter on target nonartifact creature. That creature becomes an artifact in addition to its other types. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersTargetEffect(CounterType.P1P1.createInstance()), new TapSourceCost()); ability.addCost(new SacrificeSourceCost()); Effect effect = new AddCardTypeTargetEffect(Duration.WhileOnBattlefield, CardType.ARTIFACT); effect.setText("That creature becomes an artifact in addition to its other types"); ability.addEffect(effect); ability.addTarget(new TargetCreaturePermanent(filter)); this.addAbility(ability); }
public NeurokTransmuter(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{U}"); this.subtype.add(SubType.HUMAN); this.subtype.add(SubType.WIZARD); this.power = new MageInt(2); this.toughness = new MageInt(2); // {U}: Target creature becomes an artifact in addition to its other types until end of turn. Ability becomeArtifactAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCardTypeTargetEffect(Duration.EndOfTurn, CardType.ARTIFACT), new ManaCostsImpl("{U}")); becomeArtifactAbility.addTarget(new TargetCreaturePermanent()); this.addAbility(becomeArtifactAbility); // {U}: Until end of turn, target artifact creature becomes blue and isn't an artifact. Effect blueEffect = new BecomesColorTargetEffect(ObjectColor.BLUE, Duration.EndOfTurn); blueEffect.setText("Until end of turn, target artifact creature becomes blue and "); Ability becomeBlueAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, blueEffect, new ManaCostsImpl("{U}")); becomeBlueAbility.addTarget(new TargetCreaturePermanent(filter)); Effect loseArtifactEffect = new LoseArtifactTypeTargetEffect(Duration.EndOfTurn); loseArtifactEffect.setText("isn't an artifact"); becomeBlueAbility.addEffect(loseArtifactEffect); this.addAbility(becomeBlueAbility); }
public Memnarch(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT,CardType.CREATURE},"{7}"); addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.WIZARD); this.power = new MageInt(4); this.toughness = new MageInt(5); // {1}{U}{U}: Target permanent becomes an artifact in addition to its other types. Effect effect = new AddCardTypeTargetEffect(Duration.WhileOnBattlefield, CardType.ARTIFACT); effect.setText("Target permanent becomes an artifact in addition to its other types"); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{1}{U}{U}")); ability.addTarget(new TargetPermanent()); this.addAbility(ability); // {3}{U}: Gain control of target artifact. Ability ability2 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainControlTargetEffect(Duration.WhileOnBattlefield), new ManaCostsImpl("{3}{U}")); ability2.addTarget(new TargetArtifactPermanent()); this.addAbility(ability2); }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); MageObject sourceObject = source.getSourceObject(game); if (controller == null || sourceObject == null) { return false; } Card card = controller.getLibrary().getFromTop(game); if (card != null) { controller.revealCards(sourceObject.getIdName(), new CardsImpl(card), game); if (filter.match(card, game) && controller.chooseUse(outcome, "Put " + card.getName() + "onto battlefield?", source, game)) { controller.moveCards(card, Zone.BATTLEFIELD, source, game); Permanent permanent = game.getPermanent(card.getId()); if (permanent != null) { permanent.addCounters(CounterType.MANIFESTATION.createInstance(), source, game); ContinuousEffect effect = new AddCardTypeTargetEffect(Duration.Custom, CardType.ENCHANTMENT); effect.setTargetPointer(new FixedTarget(permanent, game)); game.addEffect(effect, source); } } } return true; } }
public TezzeretAgentOfBolas(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.PLANESWALKER}, "{2}{U}{B}"); this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.TEZZERET); this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(3)); // +1: Look at the top five cards of your library. You may reveal an artifact card from among them and put it into your hand. Put the rest on the bottom of your library in any order. this.addAbility(new LoyaltyAbility(new LookLibraryAndPickControllerEffect(5, 1, filter, true), 1)); // -1: Target artifact becomes an artifact creature with base power and toughness 5/5. Effect effect = new AddCardTypeTargetEffect(Duration.EndOfGame, CardType.ARTIFACT, CardType.CREATURE); effect.setText("Target artifact becomes an artifact creature"); LoyaltyAbility ability1 = new LoyaltyAbility(effect, -1); effect = new SetPowerToughnessTargetEffect(5, 5, Duration.EndOfGame); effect.setText("with base power and toughness 5/5"); ability1.addEffect(effect); ability1.addTarget(new TargetArtifactPermanent()); this.addAbility(ability1); // -4: Target player loses X life and you gain X life, where X is twice the number of artifacts you control. LoyaltyAbility ability2 = new LoyaltyAbility(new TezzeretAgentOfBolasEffect2(), -4); ability2.addTarget(new TargetPlayer()); this.addAbility(ability2); }
public XathridGorgon(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{5}{B}"); this.subtype.add(SubType.GORGON); this.power = new MageInt(3); this.toughness = new MageInt(6); // Deathtouch this.addAbility(DeathtouchAbility.getInstance()); // {2}{B}, {tap}: Put a petrification counter on target creature. It gains defender and becomes a colorless artifact in addition to its other types. Its activated abilities can't be activated. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersTargetEffect(CounterType.PETRIFICATION.createInstance()), new ManaCostsImpl("{2}{B}")); ability.addCost(new TapSourceCost()); ability.addTarget(new TargetCreaturePermanent()); Effect effect = new GainAbilityTargetEffect(DefenderAbility.getInstance(), Duration.Custom); effect.setText("It gains defender"); ability.addEffect(effect); effect = new AddCardTypeTargetEffect(Duration.Custom, CardType.ARTIFACT); effect.setText("and becomes a colorless artifact in addition to its other types"); ability.addEffect(effect); ability.addEffect(new BecomesColorTargetEffect(new ObjectColor(), Duration.Custom, "")); ability.addEffect(new XathridGorgonCantActivateEffect()); this.addAbility(ability); }