@Override public boolean replaceEvent(GameEvent event, Ability source, Game game) { Permanent permanent = game.getPermanent(event.getTargetId()); if (permanent != null) { permanent.regenerate(source.getSourceId(), game); return new TransformSourceEffect(true).apply(game, source); } return false; }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { if (game.getBattlefield().count(filter, source.getSourceId(), source.getControllerId(), game) >= 3) { return new TransformSourceEffect(true).apply(game, source); } } return false; } }
@Override public boolean apply(Game game, Ability source) { Permanent p = game.getPermanent(source.getSourceId()); if (p != null) { if (p.getCounters(game).getCount(CounterType.HATCHLING) >= 5) { p.removeCounters(CounterType.HATCHLING.getName(), p.getCounters(game).getCount(CounterType.HATCHLING), game); TransformSourceEffect effect = new TransformSourceEffect(true); return effect.apply(game, source); } } return false; }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { controller.moveCards(controller.getLibrary().getTopCards(game, 2), Zone.GRAVEYARD, source, game); if (controller.getGraveyard().count(filter, source.getSourceId(), source.getControllerId(), game) >= 1) { return new TransformSourceEffect(true).apply(game, source); } } return false; } }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null && controller.getLibrary().hasCards()) { Card card = controller.getLibrary().getFromTop(game); controller.moveCards(card, Zone.GRAVEYARD, source, game); if (card.isInstant() || card.isSorcery()) { new TransformSourceEffect(true).apply(game, source); } return true; } return false; }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); UUID exileId = CardUtil.getCardExileZoneId(game, source); MageObject sourceObject = source.getSourceObject(game); if (controller != null && exileId != null && sourceObject != null) { controller.drawCards(1, game); TargetCardInHand target = new TargetCardInHand(); controller.choose(outcome, target, source.getSourceId(), game); Card cardToExile = game.getCard(target.getFirstTarget()); if (cardToExile != null) { controller.moveCardsToExile(cardToExile, source, game, true, exileId, sourceObject.getIdName()); } Set<Integer> usedCMC = new HashSet<>(); ExileZone exileZone = game.getExile().getExileZone(exileId); if (exileZone != null) { for (Card card : exileZone.getCards(game)) { usedCMC.add(card.getConvertedManaCost()); } if (usedCMC.size() > 4) { controller.gainLife(4, game, source); new UntapSourceEffect().apply(game, source); new TransformSourceEffect(true).apply(game, source); } } return true; } return false; } }
@Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null && player != null) { permanent.addCounters(CounterType.CHARGE.createInstance(), source, game); int counters = permanent.getCounters(game).getCount(CounterType.CHARGE); if (counters > 3 && player.chooseUse(Outcome.Benefit, "Transform this?", source, game)) { permanent.removeCounters("charge", counters, game); new TransformSourceEffect(true).apply(game, source); } return true; } return false; } }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); UUID exileId = CardUtil.getCardExileZoneId(game, source); MageObject sourceObject = source.getSourceObject(game); if (controller != null && exileId != null && sourceObject != null) { new ExileTargetEffect(exileId, sourceObject.getIdName()).setTargetPointer(targetPointer).apply(game, source); game.applyEffects(); ExileZone exileZone = game.getExile().getExileZone(exileId); if (exileZone != null && exileZone.size() > 2) { new TransformSourceEffect(true).apply(game, source); } return true; } return false; } }
@Override public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getSourceId()); Player player = game.getPlayer(source.getControllerId()); if (player != null) { player.scry(1, source, game); if (permanent != null) { permanent.addCounters(CounterType.LANDMARK.createInstance(), source, game); int counters = permanent.getCounters(game).getCount(CounterType.LANDMARK); if (counters > 2) { permanent.removeCounters("landmark", counters, game); new TransformSourceEffect(true).apply(game, source); new CreateTokenEffect(new TreasureToken("XLN"), 3).apply(game, source); } return true; } } return false; } }
@Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId()); if (player != null && sourcePermanent != null) { if (player.getLibrary().hasCards()) { Card card = player.getLibrary().getFromTop(game); Cards cards = new CardsImpl(); cards.add(card); player.lookAtCards(sourcePermanent.getName(), cards, game); if (player.chooseUse(Outcome.DrawCard, "Do you wish to reveal the card at the top of the library?", source, game)) { player.revealCards(sourcePermanent.getName(), cards, game); if (filter.match(card, game)) { return new TransformSourceEffect(true, true).apply(game, source); } } } return true; } return false; } }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); MageObject sourceObject = source.getSourceObject(game); if (controller != null && sourceObject != null) { if (controller.getLibrary().hasCards()) { Card card = controller.getLibrary().getFromTop(game); if (card != null) { controller.lookAtCards(sourceObject.getIdName(), new CardsImpl(card), game); if (controller.chooseUse(Outcome.Neutral, "Do you wish to put the card into your graveyard?", source, game)) { controller.moveCards(card, Zone.GRAVEYARD, source, game); } if (controller.getGraveyard().size() > 6 && controller.chooseUse(Outcome.Neutral, "Transform " + sourceObject.getLogName() + "?", source, game)) { new TransformSourceEffect(true).apply(game, source); } } } return true; } return false; } }