private boolean hasTargets(SpellAbility spellAbility, Game game) { if (spellAbility.getModes().getSelectedModes().size() > 1) { for (UUID modeId : spellAbility.getModes().getSelectedModes()) { Mode mode = spellAbility.getModes().get(modeId); if (!mode.getTargets().isEmpty()) { return true; } } return false; } else { return !spellAbility.getTargets().isEmpty(); } }
public TargetAddressIterator(Card card) { this.lastSpellAbilityIndex = 0; this.spellAbilityIterator = null; this.modes = card.getSpellAbility().getModes(); this.modeIterator = this.modes.getSelectedModes().iterator(); calcNext(); }
public PlungeIntoDarkness(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{B}"); // Choose one - this.getSpellAbility().getModes().setMinModes(1); this.getSpellAbility().getModes().setMaxModes(1); // Sacrifice any number of creatures, then you gain 3 life for each sacrificed creature; this.getSpellAbility().addEffect(new PlungeIntoDarknessLifeEffect()); // or pay X life, then look at the top X cards of your library, put one of those cards into your hand, and exile the rest. Mode mode = new Mode(); mode.addEffect(new PlungeIntoDarknessSearchEffect()); this.getSpellAbility().getModes().addMode(mode); // Entwine {B} this.addAbility(new EntwineAbility("{B}")); }
public DisplayOfDominance(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{G}"); // Choose one - this.getSpellAbility().getModes().setMinModes(1); this.getSpellAbility().getModes().setMaxModes(1); // Destroy target blue or black noncreature permanent this.getSpellAbility().addEffect(new DestroyTargetEffect()); this.getSpellAbility().addTarget(new TargetPermanent(filter)); // or Permanents you control can't be the targets of blue or black spells your opponents control this turn Mode mode = new Mode(); mode.addEffect(new DisplayOfDominanceEffect()); this.getSpellAbility().getModes().addMode(mode); }
public SecondSight(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{U}"); // Choose one - this.getSpellAbility().getModes().setMinModes(1); this.getSpellAbility().getModes().setMaxModes(1); //Look at the top five cards of target opponent's library, then put them back in any order; this.getSpellAbility().addEffect(new SecondSightEffect()); this.getSpellAbility().addTarget(new TargetOpponent()); //or look at the top five cards of your library, then put them back in any order. this.getSpellAbility().getModes().addMode(new Mode(new LookLibraryControllerEffect(5))); // Entwine {U} this.addAbility(new EntwineAbility("{U}")); }
public CleansingNova(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{W}{W}"); // Choose one — // • Destroy all creatures. this.getSpellAbility().addEffect(new DestroyAllEffect(StaticFilters.FILTER_PERMANENT_CREATURES)); // • Destroy all artifacts and enchantments. Mode mode = new Mode(); mode.addEffect(new DestroyAllEffect(filter)); this.getSpellAbility().getModes().addMode(mode); }
public FissureVent(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{R}{R}"); // Choose one or both - Destroy target artifact; and/or destroy target nonbasic land. this.getSpellAbility().getModes().setMinModes(1); this.getSpellAbility().getModes().setMaxModes(2); this.getSpellAbility().addEffect(new DestroyTargetEffect()); this.getSpellAbility().addTarget(new TargetArtifactPermanent().withChooseHint("destroy")); Mode mode1 = new Mode(); mode1.addEffect(new DestroyTargetEffect()); mode1.addTarget(new TargetNonBasicLandPermanent().withChooseHint("destroy")); this.getSpellAbility().addMode(mode1); }
public CrushContraband(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{3}{W}"); // Choose one or both - Destroy target artifact; or Destroy target land. this.getSpellAbility().getModes().setMinModes(1); this.getSpellAbility().getModes().setMaxModes(2); this.getSpellAbility().addEffect(new ExileTargetEffect()); this.getSpellAbility().addTarget(new TargetArtifactPermanent().withChooseHint("destroy")); Mode mode1 = new Mode(); mode1.addEffect(new ExileTargetEffect()); mode1.addTarget(new TargetEnchantmentPermanent().withChooseHint("destroy")); this.getSpellAbility().addMode(mode1); }
public SwirlingTorrent(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{5}{U}"); // Choose one or both — this.getSpellAbility().getModes().setMinModes(1); this.getSpellAbility().getModes().setMaxModes(2); // • Put target creature on top of its owner's library. this.getSpellAbility().addEffect(new PutOnLibraryTargetEffect(true)); this.getSpellAbility().addTarget(new TargetCreaturePermanent().withChooseHint("put on library top")); // • Return target creature to its owner's hand. Mode mode = new Mode(new ReturnToHandTargetEffect()); mode.addTarget(new TargetCreaturePermanent().withChooseHint("return to hand")); this.getSpellAbility().addMode(mode); }
public TemporalCascade(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{5}{U}{U}"); // Choose one - Each player shuffles their hand and graveyard into their library; this.getSpellAbility().addEffect(new ShuffleHandGraveyardAllEffect()); // or each player draws seven cards. Mode mode = new Mode(); mode.addEffect(new TemporalCascadeDrawEffect()); this.getSpellAbility().getModes().addMode(mode); // Entwine {2} this.addAbility(new EntwineAbility("{2}")); }
public AppliedBiomancy(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{G}{U}"); // Choose one or both — this.getSpellAbility().getModes().setMinModes(1); this.getSpellAbility().getModes().setMaxModes(2); // • Target creature gets +1/+1 until end of turn. this.getSpellAbility().addEffect(new BoostTargetEffect(1, 1)); this.getSpellAbility().addTarget(new TargetCreaturePermanent().withChooseHint("gets +1/+1 until end of turn")); // • Return target creature to its owner's hand. Mode mode = new Mode(new ReturnToHandTargetEffect()); mode.addTarget(new TargetCreaturePermanent().withChooseHint("return to its owner's hand")); this.getSpellAbility().addMode(mode); }
public WailOfTheNim(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{2}{B}"); // Choose one - Regenerate each creature you control; this.getSpellAbility().addEffect(new RegenerateAllEffect(new FilterControlledCreaturePermanent())); // or Wail of the Nim deals 1 damage to each creature and each player. Mode mode = new Mode(); mode.addEffect(new DamageEverythingEffect(1)); this.getSpellAbility().getModes().addMode(mode); // Entwine {B} this.addAbility(new EntwineAbility("{B}")); }
public JourneyOfDiscovery(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{2}{G}"); // Choose one - Search your library for up to two basic land cards, reveal them, put them into your hand, then shuffle your library; this.getSpellAbility().addEffect(new SearchLibraryPutInHandEffect(new TargetCardInLibrary(0, 2, StaticFilters.FILTER_CARD_BASIC_LAND))); // or you may play up to two additional lands this turn. Mode mode = new Mode(); mode.addEffect(new PlayAdditionalLandsControllerEffect(2, Duration.EndOfTurn)); this.getSpellAbility().getModes().addMode(mode); // Entwine {2}{G} this.addAbility(new EntwineAbility("{2}{G}")); }
public RoarOfTheKha(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{W}"); // Choose one - Creatures you control get +1/+1 until end of turn; this.getSpellAbility().addEffect(new BoostControlledEffect(1, 1, Duration.EndOfTurn)); // or untap all creatures you control. Mode mode = new Mode(); mode.addEffect(new UntapAllControllerEffect(new FilterControlledCreaturePermanent(), rule)); this.getSpellAbility().getModes().addMode(mode); // Entwine {1}{W} this.addAbility(new EntwineAbility("{1}{W}")); }
public ShrivelingRot(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{2}{B}{B}"); // Choose one - // Until end of turn, whenever a creature is dealt damage, destroy it. this.getSpellAbility().addEffect(new CreateDelayedTriggeredAbilityEffect(new ShrivelingRotDestroyTriggeredAbility())); // Until end of turn, whenever a creature dies, that creature's controller loses life equal to its toughness. Mode mode = new Mode(); mode.addEffect(new CreateDelayedTriggeredAbilityEffect(new ShrivelingRotLoseLifeTriggeredAbility())); this.getSpellAbility().getModes().addMode(mode); // Entwine {2}{B} this.addAbility(new EntwineAbility("{2}{B}")); }
public ToothAndNail(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{5}{G}{G}"); // Choose one - // Search your library for up to two creature cards, reveal them, put them into your hand, then shuffle your library; this.getSpellAbility().addEffect(new SearchLibraryPutInHandEffect(new TargetCardInLibrary(0, 2, new FilterCreatureCard()), true)); // or put up to two creature cards from your hand onto the battlefield. Mode mode = new Mode(); mode.addEffect(new ToothAndNailPutCreatureOnBattlefieldEffect()); this.getSpellAbility().getModes().addMode(mode); // Entwine {2} this.addAbility(new EntwineAbility("{2}")); }
public BarbedLightning(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{R}"); // Choose one - Barbed Lightning deals 3 damage to target creature; this.getSpellAbility().addEffect(new DamageTargetEffect(3)); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); // or Barbed Lightning deals 3 damage to target player. Mode mode = new Mode(); mode.addEffect(new DamageTargetEffect(3)); mode.addTarget(new TargetPlayerOrPlaneswalker()); this.getSpellAbility().getModes().addMode(mode); // Entwine {2} this.addAbility(new EntwineAbility("{2}")); }
public InciteWar(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{R}"); // Choose one - Creatures target player controls attack this turn if able; this.getSpellAbility().addEffect(new InciteWarMustAttackEffect()); this.getSpellAbility().addTarget(new TargetPlayer()); this.getSpellAbility().addWatcher(new AttackedThisTurnWatcher()); // or creatures you control gain first strike until end of turn. Mode mode = new Mode(); mode.addEffect(new GainAbilityAllEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn, filter)); this.getSpellAbility().getModes().addMode(mode); // Entwine {2} this.addAbility(new EntwineAbility("{2}")); }
public LibraryOfLatNam(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{4}{U}"); // An opponent chooses one this.getSpellAbility().getModes().setModeChooser(TargetController.OPPONENT); // You draw three cards at the beginning of the next turn's upkeep; this.getSpellAbility().addEffect(new CreateDelayedTriggeredAbilityEffect(new AtTheBeginOfNextUpkeepDelayedTriggeredAbility(new DrawCardSourceControllerEffect(3)), false)); // or you search your library for a card, put that card into your hand, then shuffle your library. Mode mode = new Mode(); Effect effect = new SearchLibraryPutInHandEffect(new TargetCardInLibrary(), false, true); //effect.setText("you search your library for a card, put that card into your hand, then shuffle your library"); mode.addEffect(effect); this.getSpellAbility().addMode(mode); }
public SolarTide(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{4}{W}{W}"); // Choose one - Destroy all creatures with power 2 or less; this.getSpellAbility().addEffect(new DestroyAllEffect(filter1)); // or destroy all creatures with power 3 or greater. Mode mode = new Mode(); mode.addEffect(new DestroyAllEffect(filter2)); this.getSpellAbility().getModes().addMode(mode); // Entwine-Sacrifice two lands. this.addAbility(new EntwineAbility(new SacrificeTargetCost(new TargetControlledPermanent(2, 2, new FilterControlledLandPermanent("two lands"), true)))); }