@Override public ChooseACardNameEffect copy() { return new ChooseACardNameEffect(this); }
@Override public boolean apply(Game game, Ability source) { new ChooseACardNameEffect(TypeOfName.ALL).apply(game, source); String cardName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY); FilterCard filter = new FilterCard(); filter.add(new NamePredicate(cardName)); ContinuousEffect effect = new SpellsCostReductionAllEffect(filter, 1); effect.setDuration(Duration.EndOfTurn); game.addEffect(effect, source); return true; } }
public ChooseACardNameEffect(TypeOfName typeOfName) { super(Outcome.Detriment); this.typeOfName = typeOfName; staticText = setText(); }
@Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); if (player != null) { TargetOpponent target = new TargetOpponent(true); if (player.choose(Outcome.Benefit, target, source.getSourceId(), game)) { Player opponent = game.getPlayer(target.getFirstTarget()); if (opponent != null) { MageObject sourceObject = game.getObject(source.getSourceId()); player.lookAtCards(sourceObject != null ? sourceObject.getIdName() : null, opponent.getHand(), game); player.chooseUse(Outcome.Benefit, "Press ok to name a card", "You won't be able to resize the window once you do", "Ok", " ", source, game); } } } return super.apply(game, source); } }
public RunedHalo(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{W}{W}"); // As Runed Halo enters the battlefield, name a card. Ability ability = new AsEntersBattlefieldAbility(new ChooseACardNameEffect(ChooseACardNameEffect.TypeOfName.ALL)); // You have protection from the chosen name. ability.addEffect(new RunedHaloSetProtectionEffect()); this.addAbility(ability); }
public BoobyTrap(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{6}"); // As Booby Trap enters the battlefield, name a card other than a basic land card and choose an opponent. AsEntersBattlefieldAbility etbAbility = new AsEntersBattlefieldAbility(new ChooseACardNameEffect(ChooseACardNameEffect.TypeOfName.NOT_BASIC_LAND_NAME)); etbAbility.addEffect(new ChooseOpponentEffect(Outcome.Damage)); this.addAbility(etbAbility); // The chosen player reveals each card he or she draws. // When the chosen player draws the named card, sacrifice Booby Trap. If you do, Booby Trap deals 10 damage to that player. this.addAbility(new BoobyTrapTriggeredAbility()); }
public Nevermore(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}{W}"); // As Nevermore enters the battlefield, name a nonland card. this.addAbility(new AsEntersBattlefieldAbility(new ChooseACardNameEffect(ChooseACardNameEffect.TypeOfName.NON_LAND_NAME))); // The named card can't be cast. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new NevermoreEffect2())); }
public AlpineMoon(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{R}"); // As Alpine Moon enters the battlefield, choose a nonbasic land card name. this.addAbility(new AsEntersBattlefieldAbility(new ChooseACardNameEffect(ChooseACardNameEffect.TypeOfName.NONBASIC_LAND_NAME))); // Lands your opponents control with the chosen name lose all land types and abilities, and they gain "{T}: Add one mana of any color." this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new AlpineMoonEffect())); }
public PithingNeedle(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{1}"); // As Pithing Needle enters the battlefield, name a card. this.addAbility(new AsEntersBattlefieldAbility(new ChooseACardNameEffect(ChooseACardNameEffect.TypeOfName.ALL))); // Activated abilities of sources with the chosen name can't be activated unless they're mana abilities. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PithingNeedleEffect())); }
public PhyrexianRevoker(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT,CardType.CREATURE},"{2}"); this.subtype.add(SubType.HORROR); this.power = new MageInt(2); this.toughness = new MageInt(1); // As Phyrexian Revoker enters the battlefield, name a nonland card. this.addAbility(new AsEntersBattlefieldAbility(new ChooseACardNameEffect(ChooseACardNameEffect.TypeOfName.NON_LAND_NAME))); // Activated abilities of sources with the chosen name can't be activated. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PhyrexianRevokerEffect2())); }
public MeddlingMage(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{W}{U}"); this.subtype.add(SubType.HUMAN); this.subtype.add(SubType.WIZARD); this.power = new MageInt(2); this.toughness = new MageInt(2); // As Meddling Mage enters the battlefield, name a nonland card. this.addAbility(new AsEntersBattlefieldAbility(new ChooseACardNameEffect(ChooseACardNameEffect.TypeOfName.NON_LAND_NAME))); //The named card can't be cast. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new MeddlingMageReplacementEffect())); }
public SpoilsOfTheVault(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{B}"); // Name a card. Reveal cards from the top of your library until you reveal the named card, then put that card into your hand. Exile all other cards revealed this way, and you lose 1 life for each of the exiled cards. this.getSpellAbility().addEffect(new ChooseACardNameEffect(ChooseACardNameEffect.TypeOfName.ALL)); this.getSpellAbility().addEffect(new SpoilsOfTheVaultEffect()); }
public DesperateResearch(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{B}"); // Choose a card name other than a basic land card name. Reveal the top seven cards of your library and put all of them with that name into your hand. Exile the rest. this.getSpellAbility().addEffect(new ChooseACardNameEffect(ChooseACardNameEffect.TypeOfName.NOT_BASIC_LAND_NAME)); this.getSpellAbility().addEffect(new DesperateResearchEffect()); }
public CursedScroll(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{1}"); // {3}, {T}: Name a card. Reveal a card at random from your hand. If it's the named card, Cursed Scroll deals 2 damage to any target. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ChooseACardNameEffect(ChooseACardNameEffect.TypeOfName.ALL), new ManaCostsImpl("{3}")); ability.addEffect(new CursedScrollEffect()); ability.addCost(new TapSourceCost()); ability.addTarget(new TargetAnyTarget()); this.addAbility(ability); }
public Mise(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{U}"); // Choose a nonland card name, then reveal the top card of your library. If that card has the chosen name, you draw three cards. this.getSpellAbility().addEffect(new ChooseACardNameEffect(ChooseACardNameEffect.TypeOfName.NON_LAND_NAME)); this.getSpellAbility().addEffect(new MiseEffect()); }
public DeclarationOfNaught(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{U}{U}"); // As Declaration of Naught enters the battlefield, name a card. this.addAbility(new AsEntersBattlefieldAbility(new ChooseACardNameEffect(ChooseACardNameEffect.TypeOfName.ALL))); // {U}: Counter target spell with the chosen name. SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CounterTargetEffect(), new ManaCostsImpl("{U}")); ability.setTargetAdjuster(DeclarationOfNaughtAdjuster.instance); ability.addTarget(new TargetSpell(filter)); this.addAbility(ability); }
public CouncilOfTheAbsolute(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{W}{U}"); this.subtype.add(SubType.HUMAN); this.subtype.add(SubType.ADVISOR); this.power = new MageInt(2); this.toughness = new MageInt(4); // As Council of the Absolute enters the battlefield, name a card other than a creature or a land card. this.addAbility(new AsEntersBattlefieldAbility(new ChooseACardNameEffect(ChooseACardNameEffect.TypeOfName.NON_LAND_AND_NON_CREATURE_NAME))); // Your opponents can't cast the chosen card. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CouncilOfTheAbsoluteReplacementEffect())); // Spells with the chosen name cost 2 less for you to cast. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CouncilOfTheAbsoluteCostReductionEffect())); }
public MagusOfTheScroll(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{R}"); this.subtype.add(SubType.HUMAN); this.subtype.add(SubType.WIZARD); this.power = new MageInt(1); this.toughness = new MageInt(1); // {3}, {tap}: Name a card. Reveal a card at random from your hand. If it's the named card, Magus of the Scroll deals 2 damage to any target. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ChooseACardNameEffect(ChooseACardNameEffect.TypeOfName.ALL), new ManaCostsImpl("{3}")); ability.addEffect(new MagusOfTheScrollEffect()); ability.addCost(new TapSourceCost()); ability.addTarget(new TargetAnyTarget()); this.addAbility(ability); }
public Dispossess(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{B}"); // Name an artifact card. Search target player's graveyard, hand, and library for any number of cards with that name and exile them. Then that player shuffles their library. this.getSpellAbility().addEffect((new ChooseACardNameEffect(ChooseACardNameEffect.TypeOfName.ARTIFACT_NAME))); this.getSpellAbility().addTarget(new TargetPlayer()); this.getSpellAbility().addEffect(new DispossessEffect()); }
public Predict(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{U}"); // Name a card, then target player puts the top card of their library into their graveyard. If that card is the named card, you draw two cards. Otherwise, you draw a card. this.getSpellAbility().addEffect(new ChooseACardNameEffect(ChooseACardNameEffect.TypeOfName.ALL)); this.getSpellAbility().addEffect(new PredictEffect()); this.getSpellAbility().addTarget(new TargetPlayer()); }