@Override public CounterTargetEffect copy() { return new CounterTargetEffect(this); }
@Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(game.getControllerId(source.getFirstTarget())); if (player == null) { return false; } player.moveCards(player.getLibrary().getTopCards(game, 3), Zone.GRAVEYARD, source, game); return new CounterTargetEffect().apply(game, source); } }
@Override public boolean apply(Game game, Ability source) { boolean countered = false; for (UUID targetId : getTargetPointer().getTargets(game, source)) { if (game.getStack().counter(targetId, source.getSourceId(), game)) { countered = true; } } return countered; }
ImprisonTriggeredAbility() { super(Zone.BATTLEFIELD, new DoIfCostPaid(new CounterTargetEffect().setText("counter that ability"), new DestroySourceEffect(), new ManaCostsImpl("1"))); }
@Override public boolean apply(Game game, Ability source) { Spell targetSpell = game.getStack().getSpell(source.getFirstTarget()); if(targetSpell != null && KickedCondition.instance.apply(game, targetSpell.getSpellAbility())) { return super.apply(game, source); } return false; }
public SpellBlast(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{X}{U}"); // Counter target spell with converted mana cost X. this.getSpellAbility().addEffect(new CounterTargetEffect().setText("counter target spell with converted mana cost X")); this.getSpellAbility().setTargetAdjuster(SpellBlastAdjuster.instance); }
@Override public boolean apply(Game game, Ability source) { Spell targetSpell = game.getStack().getSpell(getTargetPointer().getFirst(game, source)); if (targetSpell != null) { int spellCMC = targetSpell.getConvertedManaCost(); super.apply(game, source); new AddCountersSourceEffect(CounterType.P1P1.createInstance(spellCMC)).apply(game, source); return true; } return false; } }
public Douse(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{U}"); // {1}{U}: Counter target red spell. SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CounterTargetEffect(), new ManaCostsImpl("{1}{U}")); ability.addTarget(new TargetSpell(filter)); this.addAbility(ability); }
public SpellBurst(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{X}{U}"); // Buyback {3} this.addAbility(new BuybackAbility("{3}")); // Counter target spell with converted mana cost X. this.getSpellAbility().addEffect(new CounterTargetEffect().setText("counter target spell with converted mana cost X")); this.getSpellAbility().setTargetAdjuster(SpellBurstAdjuster.instance); }
@Override public boolean apply(Game game, Ability source) { StackObject stackObject = game.getStack().getStackObject(source.getFirstTarget()); if (stackObject == null) { return false; } ObjectColor creatureColors = new ObjectColor(); for (Permanent creature : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_CONTROLLED_CREATURES, source.getControllerId(), game)) { creatureColors = creatureColors.union(creature.getColor(game)); if (!creatureColors.intersection(stackObject.getColor(game)).isColorless()) { return new CounterTargetEffect().apply(game, source); } } return false; } }
public Deathgrip(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{B}{B}"); // {B}{B}: Counter target green spell. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CounterTargetEffect(), new ManaCostsImpl("{B}{B}")); ability.addTarget(new TargetSpell(filter)); this.addAbility(ability); }
public Mistfolk(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{U}{U}"); this.subtype.add(SubType.ILLUSION); this.power = new MageInt(1); this.toughness = new MageInt(2); // {U}: Counter target spell that targets Mistfolk. Ability ability = new SimpleActivatedAbility( new CounterTargetEffect() .setText("counter target spell that targets {this}"), new ManaCostsImpl("{U}") ); ability.addTarget(new TargetSpell(filter)); this.addAbility(ability); }
public Nix(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{U}"); // Counter target spell if no mana was spent to cast it. Effect effect = new ConditionalOneShotEffect(new CounterTargetEffect(), NoManaSpentToCastTargetCondition.instance); effect.setText("Counter target spell if no mana was spent to cast it"); this.getSpellAbility().addEffect(effect); this.getSpellAbility().addTarget(new TargetSpell()); }
ErayosEssenceToken() { super("Erayo's Essence", ""); addSuperType(SuperType.LEGENDARY); cardType.add(CardType.ENCHANTMENT); color.setBlue(true); // Whenever an opponent casts a spell for the first time in a turn, counter that spell. Effect effect = new CounterTargetEffect(); effect.setText("counter that spell"); this.addAbility(new ErayosEssenceTriggeredAbility(effect)); } public ErayosEssenceToken(final ErayosEssenceToken token) {
public PsychicTrance(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{U}{U}"); // Until end of turn, Wizards you control gain "{tap}: Counter target spell." Ability abilityToAdd = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CounterTargetEffect(), new TapSourceCost()); abilityToAdd.addTarget(new TargetSpell()); Effect effect = new GainAbilityControlledEffect(abilityToAdd, Duration.EndOfTurn, filter); effect.setText("until end of turn, Wizards you control gain \"{tap}: Counter target spell\""); this.getSpellAbility().addEffect(effect); }
public MysticSnake(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{G}{U}{U}"); this.subtype.add(SubType.SNAKE); this.power = new MageInt(2); this.toughness = new MageInt(2); this.addAbility(FlashAbility.getInstance()); Ability ability = new EntersBattlefieldTriggeredAbility(new CounterTargetEffect()); ability.addTarget(new TargetSpell()); this.addAbility(ability); }
public GutturalResponse(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{R/G}"); // Counter target blue instant spell. this.getSpellAbility().addEffect(new CounterTargetEffect()); this.getSpellAbility().addTarget(new TargetSpell(filter)); }
public RemoveSoul(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{U}"); this.getSpellAbility().addTarget(new TargetSpell(StaticFilters.FILTER_SPELL_CREATURE)); this.getSpellAbility().addEffect(new CounterTargetEffect()); }
public Envelop(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{U}"); // Counter target sorcery spell. this.getSpellAbility().addEffect(new CounterTargetEffect()); this.getSpellAbility().addTarget(new TargetSpell(filter)); }
public AvoidFate(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{G}"); // Counter target instant or Aura spell that targets a permanent you control. this.getSpellAbility().addEffect(new CounterTargetEffect()); this.getSpellAbility().addTarget(new TargetSpell(filter)); }