public OrbitalBombardment(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{3}{W}{W}"); // Destroy all non-Starship creatuers. getSpellAbility().getEffects().add(new DestroyAllEffect(new FilterCreaturePermanent(filter))); }
public SabaccGame(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{U}"); /* * Choose target permanent an opponent controls. That opponent chooses a permanent you control. * Flip a coin. If you win the flip, gain control of the permanent you chose. * If you lose the flip, your opponent gains control of the permanent they chose. */ this.getSpellAbility().getEffects().add(new SabaccGameEffect()); this.getSpellAbility().getTargets().add(new TargetPermanent(filter)); }
public BruteForce(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{R}"); // Target creature gets +3/+3 until end of turn. this.getSpellAbility().getEffects().add(new BoostTargetEffect(3,3, Duration.EndOfTurn)); this.getSpellAbility().getTargets().add(new TargetCreaturePermanent()); }
public RavensCrime(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{B}"); // Target player discards a card. this.getSpellAbility().getEffects().add(new DiscardTargetEffect(1)); this.getSpellAbility().getTargets().add(new TargetPlayer()); // Retrace this.addAbility(new RetraceAbility(this)); }
public SurgingDementia(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{B}"); // Ripple 4 this.addAbility(new RippleAbility(4).setRuleAtTheTop(true)); // Target player discards a card. this.getSpellAbility().getEffects().add(new DiscardTargetEffect(1)); this.getSpellAbility().getTargets().add(new TargetPlayer()); }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); Card cipherCard = game.getCard(cipherCardId); if (cipherCard != null && controller != null) { Card copyCard = game.copyCard(cipherCard, source, controller.getId()); SpellAbility ability = copyCard.getSpellAbility(); // remove the cipher effect from the copy ability.getEffects().removeIf(effect -> effect instanceof CipherEffect); controller.cast(ability, game, true, new MageObjectReference(source.getSourceObject(game), game)); } return false; }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { StackObject stackObject = game.getStack().getStackObject(source.getId()); Spell spell = (Spell) stackObject; if (spell == null) { return false; } spell = spell.copySpell(source.getControllerId()); // Remove Epic effect from the spell Effect epicEffect = null; for (Effect effect : spell.getSpellAbility().getEffects()) { if (effect instanceof EpicEffect) { epicEffect = effect; break; } } spell.getSpellAbility().getEffects().remove(epicEffect); DelayedTriggeredAbility ability = new AtTheBeginOfYourNextUpkeepDelayedTriggeredAbility(new EpicPushEffect(spell, rule), Duration.EndOfGame, false); game.addDelayedTriggeredAbility(ability, source); game.addEffect(new EpicReplacementEffect(), source); return true; } return false; }
public PartWater(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{X}{X}{U}"); // X target creatures gain islandwalk until end of turn. Effect effect = new GainAbilityTargetEffect(new IslandwalkAbility(false), Duration.EndOfTurn); effect.setText("X target creatures gain islandwalk until end of turn"); this.getSpellAbility().getEffects().add(effect); this.getSpellAbility().getTargets().add(new TargetCreaturePermanent()); this.getSpellAbility().setTargetAdjuster(PartWaterAdjuster.instance); }
private void playRemoval(List<UUID> creatures, Game game) { for (UUID creatureId : creatures) { for (Card card : this.playableInstant) { if (card.getSpellAbility().canActivate(playerId, game).canActivate()) { for (Effect effect : card.getSpellAbility().getEffects()) { if (effect.getOutcome() == Outcome.DestroyPermanent || effect.getOutcome() == Outcome.ReturnToHand) { if (card.getSpellAbility().getTargets().get(0).canTarget(creatureId, card.getSpellAbility(), game)) { if (this.activateAbility(card.getSpellAbility(), game)) { return; } } } } } } } }
public EmergeAbility(Card card, ManaCosts<ManaCost> emergeCost) { super(emergeCost, card.getName() + " with emerge", Zone.HAND, SpellAbilityType.BASE_ALTERNATE); this.getCosts().addAll(card.getSpellAbility().getCosts().copy()); this.getEffects().addAll(card.getSpellAbility().getEffects().copy()); this.getTargets().addAll(card.getSpellAbility().getTargets().copy()); this.timing = card.getSpellAbility().getTiming(); this.setRuleAtTheTop(true); this.emergeCost = emergeCost.copy(); }
public SpectacleAbility(Card card, ManaCost spectacleCosts) { super(spectacleCosts, card.getName() + " with spectacle", Zone.HAND, SpellAbilityType.BASE_ALTERNATE); this.getCosts().addAll(card.getSpellAbility().getCosts().copy()); this.getEffects().addAll(card.getSpellAbility().getEffects().copy()); this.getTargets().addAll(card.getSpellAbility().getTargets().copy()); this.spellAbilityType = SpellAbilityType.BASE_ALTERNATE; this.timing = card.getSpellAbility().getTiming(); this.setRuleAtTheTop(true); this.rule = "Spectacle " + spectacleCosts.getText() + " <i>(You may cast this spell for its spectacle cost rather than its mana cost if an opponent lost life this turn.)</i>"; }
public SurgeAbility(Card card, String surgeCosts) { super(new ManaCostsImpl<>(surgeCosts), card.getName() + " with surge", Zone.HAND, SpellAbilityType.BASE_ALTERNATE); this.getCosts().addAll(card.getSpellAbility().getCosts().copy()); this.getEffects().addAll(card.getSpellAbility().getEffects().copy()); this.getTargets().addAll(card.getSpellAbility().getTargets().copy()); this.spellAbilityType = SpellAbilityType.BASE_ALTERNATE; this.timing = card.getSpellAbility().getTiming(); this.setRuleAtTheTop(true); this.rule = "Surge " + surgeCosts + " <i>(You may cast this spell for its surge cost if you or a teammate has cast another spell this turn.)</i>"; }
private void playDamage(List<UUID> creatures, Game game) { for (UUID creatureId : creatures) { Permanent creature = game.getPermanent(creatureId); for (Card card : this.playableInstant) { if (card.getSpellAbility().canActivate(playerId, game).canActivate()) { for (Effect effect : card.getSpellAbility().getEffects()) { if (effect instanceof DamageTargetEffect) { if (card.getSpellAbility().getTargets().get(0).canTarget(creatureId, card.getSpellAbility(), game)) { if (((DamageTargetEffect) effect).getAmount() > (creature.getPower().getValue() - creature.getDamage())) { if (this.activateAbility(card.getSpellAbility(), game)) { return; } } } } } } } } }
public JumpStartAbility(Card card) { super(card.getManaCost(), card.getName() + " with jump-start", Zone.GRAVEYARD, SpellAbilityType.BASE_ALTERNATE); this.getCosts().addAll(card.getSpellAbility().getCosts().copy()); Cost cost = new DiscardTargetCost(new TargetCardInHand()); cost.setText(""); this.addCost(cost); this.getEffects().addAll(card.getSpellAbility().getEffects().copy()); this.getTargets().addAll(card.getSpellAbility().getTargets().copy()); this.spellAbilityType = SpellAbilityType.BASE_ALTERNATE; this.timing = card.getSpellAbility().getTiming(); }
public RetraceAbility(Card card) { super(card.getManaCost(), card.getName() + " with retrace", Zone.GRAVEYARD, SpellAbilityType.BASE_ALTERNATE); this.getCosts().addAll(card.getSpellAbility().getCosts().copy()); Cost cost = new DiscardTargetCost(new TargetCardInHand(new FilterLandCard())); cost.setText(""); this.addCost(cost); this.getEffects().addAll(card.getSpellAbility().getEffects().copy()); this.getTargets().addAll(card.getSpellAbility().getTargets().copy()); this.spellAbilityType = SpellAbilityType.BASE_ALTERNATE; this.timing = card.getSpellAbility().getTiming(); }
public AwakenAbility(Card card, int awakenValue, String awakenCosts) { super(new ManaCostsImpl<>(awakenCosts), card.getName() + " with awaken", Zone.HAND, SpellAbilityType.BASE_ALTERNATE); this.getCosts().addAll(card.getSpellAbility().getCosts().copy()); this.getEffects().addAll(card.getSpellAbility().getEffects().copy()); this.getTargets().addAll(card.getSpellAbility().getTargets().copy()); this.spellAbilityType = SpellAbilityType.BASE_ALTERNATE; this.timing = card.getSpellAbility().getTiming(); this.addTarget(new TargetControlledPermanent(new FilterControlledLandPermanent(filterMessage))); this.addEffect(new AwakenEffect()); this.awakenValue = awakenValue; rule = "Awaken " + awakenValue + "—" + awakenCosts + " <i>(If you cast this spell for " + awakenCosts + ", also put " + CardUtil.numberToText(awakenValue, "a") + " +1/+1 counters on target land you control and it becomes a 0/0 Elemental creature with haste. It's still a land.)</i>"; }
public OjutaisCommand(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{W}{U}"); // Choose two - this.getSpellAbility().getModes().setMinModes(2); this.getSpellAbility().getModes().setMaxModes(2); // Return target creature card with converted mana cost 2 or less from your graveyard to the battlefield; this.getSpellAbility().getEffects().add(new ReturnFromGraveyardToBattlefieldTargetEffect()); this.getSpellAbility().getTargets().add(new TargetCardInYourGraveyard(filter)); // or You gain 4 life; Mode mode = new Mode(); mode.addEffect(new GainLifeEffect(4)); this.getSpellAbility().getModes().addMode(mode); // or Counter target creature spell; mode = new Mode(); mode.addTarget(new TargetSpell(StaticFilters.FILTER_SPELL_CREATURE)); mode.addEffect(new CounterTargetEffect()); this.getSpellAbility().getModes().addMode(mode); // or Draw a card mode = new Mode(); mode.addEffect(new DrawCardSourceControllerEffect(1)); this.getSpellAbility().getModes().addMode(mode); }
public KolaghansCommand(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{B}{R}"); // Choose two - this.getSpellAbility().getModes().setMinModes(2); this.getSpellAbility().getModes().setMaxModes(2); // Return target creature card from your graveyard to your hand; this.getSpellAbility().getEffects().add(new ReturnFromGraveyardToHandTargetEffect()); this.getSpellAbility().getTargets().add(new TargetCardInYourGraveyard(1, StaticFilters.FILTER_CARD_CREATURE_YOUR_GRAVEYARD)); // or Target player discards a card; Mode mode = new Mode(); mode.addEffect(new DiscardTargetEffect(1)); mode.addTarget(new TargetPlayer()); this.getSpellAbility().getModes().addMode(mode); // or Destroy target artifact; mode = new Mode(); mode.addEffect(new DestroyTargetEffect()); mode.addTarget(new TargetPermanent(filter)); this.getSpellAbility().getModes().addMode(mode); // or Kolaghan's Command deals 2 damage to any target. mode = new Mode(); mode.addEffect(new DamageTargetEffect(2)); mode.addTarget(new TargetAnyTarget()); this.getSpellAbility().getModes().addMode(mode); }
public SilumgarsCommand(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{3}{U}{B}"); // Choose two - this.getSpellAbility().getModes().setMinModes(2); this.getSpellAbility().getModes().setMaxModes(2); // Counter target noncreature spell; this.getSpellAbility().getEffects().add(new CounterTargetEffect()); this.getSpellAbility().getTargets().add(new TargetSpell(filter)); // or Return target permanent to its owner's hand; Mode mode = new Mode(); mode.addEffect(new ReturnToHandTargetEffect()); mode.addTarget(new TargetPermanent()); this.getSpellAbility().getModes().addMode(mode); // or Target creature gets -3/-3 until end of turn; mode = new Mode(); mode.addEffect(new BoostTargetEffect(-3, -3, Duration.EndOfTurn)); mode.addTarget(new TargetCreaturePermanent()); this.getSpellAbility().getModes().addMode(mode); // or Destroy target planeswalker. mode = new Mode(); mode.addEffect(new DestroyTargetEffect()); mode.addTarget(new TargetPermanent(filter2)); this.getSpellAbility().getModes().addMode(mode); }
this.getSpellAbility().getEffects().add(new PreventDamageByTargetEffect(Duration.EndOfTurn)); this.getSpellAbility().getTargets().add(new TargetSpell(new FilterInstantOrSorcerySpell()));