@Override public int calculate(Game game, Ability sourceAbility, Effect effect) { return 2 * super.calculate(game, sourceAbility, effect) + 1; }
@Override public boolean checkTrigger(GameEvent event, Game game) { return new CountersSourceCount(CounterType.TIDE).calculate(game, this, null) == 4; }
@Override public boolean checkTrigger(GameEvent event, Game game) { return new CountersSourceCount(CounterType.TIDE).calculate(game, this, null) == 4; }
@Override public boolean apply(Game game, Ability source) { for (Iterator<MageObjectReference> it = affectedObjectList.iterator(); it.hasNext();) { Permanent permanent = it.next().getPermanent(game); if (permanent != null) { int unboostCount = -1 * new CountersSourceCount(CounterType.P1P1).calculate(game, source, this); permanent.addPower(unboostCount); permanent.addToughness(unboostCount); } else { it.remove(); } } return true; } }
@Override public boolean apply(Game game, Ability source) { ObjectColor color = (ObjectColor) game.getState().getValue(source.getSourceId() + "_color"); SubType subType = ChooseCreatureTypeEffect.getChosenCreatureType(source.getSourceId(), game); if (subType == null) { return false; } int x = (new CountersSourceCount(CounterType.CHARGE)).calculate(game, source, this); Token token = new RiptideReplicatorToken(color, subType, x); return token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId()); } }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { Cards cards = new CardsImpl(controller.getLibrary().getTopCards(game, amount.calculate(game, source, this))); if (!cards.isEmpty()) { controller.moveCardsToExile(cards.getCards(game), source, game, true, source.getSourceId(), CardUtil.createObjectRealtedWindowTitle(source, game, "")); ContinuousEffect effect = new FlamesOfRemembranceMayPlayExiledEffect(); effect.setTargetPointer(new FixedTargets(cards, game)); game.addEffect(effect, source); } return true; } return false; }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller == null) { return false; } int count = 1 + new CountersSourceCount(CounterType.LOYALTY).calculate(game, source, this); FilterPermanentCard filter = new FilterPermanentCard(); filter.add(Predicates.or(new CardTypePredicate(CardType.CREATURE), new CardTypePredicate(CardType.LAND))); filter.add(new ConvertedManaCostPredicate(ComparisonType.FEWER_THAN, count)); Card card = controller.getLibrary().getFromTop(game); if (card != null) { controller.lookAtCards(source, null, new CardsImpl(card), game); if (filter.match(card, game)) { if (controller.chooseUse(outcome, "Put " + card.getName() + " onto the battlefield?", source, game)) { controller.moveCards(card, Zone.BATTLEFIELD, source, game); } } } return true; } }