@Override public void counter(UUID sourceId, Game game) { this.counter(sourceId, game, Zone.GRAVEYARD, false, ZoneDetail.NONE); }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { Spell targetSpell = game.getSpell(this.getTargetPointer().getFirst(game, source)); if (targetSpell != null) { int cmc = targetSpell.getConvertedManaCost(); if (cmc <= 2 || (KickedCondition.instance.apply(game, source) && cmc <= 4)) { targetSpell.counter(source.getSourceId(), game); } } return true; } return false; } }
|| stackObject.getName().contains(((SplitCard)mageObject).getRightHalfCard().getName()))) { Spell spell = (Spell) stackObject; spell.counter(source.getSourceId(), game); game.informPlayers(sourceObject.getLogName() + ": the split-card spell named " + spell.getName() + " was countered."); && stackObject.getName().contains(card.getName())) { Spell spell = (Spell) stackObject; spell.counter(source.getSourceId(), game); game.informPlayers(sourceObject.getLogName() + ": the spell named " + spell.getName() + " was countered.");
@Override public boolean apply(Game game, Ability source) { Spell spell = game.getSpell(targetPointer.getFirst(game, source)); if (spell == null) { return false; } String spellName = spell.getName(); FilterPermanent filter1 = new FilterPermanent(); filter1.add(new NamePredicate(spellName)); filter1.add(Predicates.not(TokenPredicate.instance)); if (!game.getBattlefield().getActivePermanents(filter1, source.getControllerId(), game).isEmpty()) { spell.counter(source.getControllerId(), game); return true; } FilterCard filter2 = new FilterCard(); filter2.add(new NamePredicate(spellName)); for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) { Player player = game.getPlayer(playerId); if (player == null) { continue; } if (player.getGraveyard().count(filter2, game) > 0) { spell.counter(source.getControllerId(), game); return true; } } return false; } }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); Spell targetSpell = game.getStack().getSpell(source.getFirstTarget()); if (targetSpell != null) { Player controllerOfTargetedSpell = game.getPlayer(targetSpell.getControllerId()); if (controller != null && controllerOfTargetedSpell != null) { int numToDiscard = controller.getAmount(0, controller.getHand().size(), "How many cards do you want to discard?", game); Cards discardedCards = controller.discard(numToDiscard, false, source, game); int actualNumberDiscarded = discardedCards.size(); GenericManaCost cost = new GenericManaCost(actualNumberDiscarded * 3); if (controllerOfTargetedSpell.chooseUse(Outcome.AIDontUseIt, "Do you want to pay " + cost.convertedManaCost() + " to prevent " + targetSpell.getName() + " from gettting countered?", source, game) && cost.pay(source, game, source.getSourceId(), controllerOfTargetedSpell.getId(), false)) { return true; } else { targetSpell.counter(source.getSourceId(), game); return true; } } } return false; } }
return false; } else { spell.counter(source.getId(), game); game.informPlayers(spell.getName() + " has been countered due to " + controller.getName() + " not paying " + cost.getText()); return true;