@Override public boolean checkTrigger(GameEvent event, Game game) { return game.getCard(event.getSourceId()).isLand() && event.getPlayerId().equals(this.controllerId); }
@Override public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) { UUID cardId = getTargetPointer().getFirst(game, source); if (cardId == null) { this.discard(); // card is no longer in the origin zone, effect can be discarded } else if (objectId.equals(cardId) && affectedControllerId.equals(authorizedPlayerId)) { Card card = game.getCard(objectId); // TODO: Allow to cast Zoetic Cavern face down return card != null && !card.isLand(); } return false; } }
@Override public boolean applies(GameEvent event, Ability source, Game game) { ZoneChangeEvent zEvent = (ZoneChangeEvent) event; if (zEvent.getToZone() == Zone.BATTLEFIELD) { Card card = game.getCard(zEvent.getTargetId()); if (card != null && card.isLand()) { return true; } } return false; } }
@Override public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) { UUID targetId = getTargetPointer().getFirst(game, source); if (targetId == null) { this.discard(); } else if (objectId.equals(targetId) && affectedControllerId.equals(source.getControllerId())) { Card card = game.getCard(objectId); // TODO: Allow to cast Zoetic Cavern face down return card != null && !card.isLand(); } return false; } }
@Override public void watch(GameEvent event, Game game) { if (event.getType() == GameEvent.EventType.PLAY_LAND) { Card card = game.getCard(event.getTargetId()); if (card != null && card.isLand() && card.isCreature() && !playerPlayedLand.contains(event.getPlayerId())) { playerPlayedLand.add(event.getPlayerId()); landPlayed.add(event.getTargetId()); } } }
@Override public boolean checkTrigger(GameEvent event, Game game) { if (game.getOpponents(this.getControllerId()).contains(event.getPlayerId())) { Card discarded = game.getCard(event.getTargetId()); if (discarded != null && discarded.isLand()) { return true; } } return false; }
private int checkIfNextLibCardIsNonLandAndExile(Player controller, Ability source, Game game) { Card card = controller.getLibrary().getFromTop(game); if (card != null) { controller.moveCardToExileWithInfo(card, null, "", source.getSourceId(), game, Zone.LIBRARY, true); return card.isLand() ? 0 : 1; } return 0; } }
@Override public boolean checkTrigger(GameEvent event, Game game) { if (game.getOpponents(this.getControllerId()).contains(event.getPlayerId())) { Card discarded = game.getCard(event.getTargetId()); if (discarded != null && !discarded.isLand() && !discarded.isCreature()) { return true; } } return false; }
@Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); if (player == null) { return false; } Card card = player.discardOne(false, source, game); if (card == null || !card.isLand()) { player.drawCards(1, game); } else { player.drawCards(2, game); } return true; } }
@Override public boolean playCard(Card card, Game game, boolean noMana, boolean ignoreTiming, MageObjectReference reference) { if (card == null) { return false; } boolean result; if (card.isLand()) { result = playLand(card, game, ignoreTiming); } else { result = cast(card.getSpellAbility(), game, noMana, reference); } if (!result) { game.informPlayer(this, "You can't play " + card.getIdName() + '.'); } return result; }
public static boolean cardCanBePlayedNow(Card card, UUID playerId, Game game) { if (card.isLand()) { return game.canPlaySorcery(playerId) && game.getPlayer(playerId).canPlayLand(); } else { return card.getSpellAbility() != null && card.getSpellAbility().spellCanBeActivatedRegularlyNow(playerId, game); } }
@Override public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) { if (affectedControllerId.equals(source.getControllerId()) && getTargetPointer().getTargets(game, source).contains(objectId)) { Card card = game.getCard(objectId); if (card != null && !card.isLand() && card.getSpellAbility().getCosts() != null) { Player player = game.getPlayer(affectedControllerId); if (player != null) { player.setCastSourceIdWithAlternateMana(objectId, null, card.getSpellAbility().getCosts()); } } return true; } return false; } }
@Override public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) { Card cardOnTop = game.getCard(objectId); if (cardOnTop != null && affectedControllerId.equals(source.getControllerId()) && cardOnTop.isOwnedBy(source.getControllerId()) && (!cardOnTop.getManaCost().isEmpty() || cardOnTop.isLand()) && filter.match(cardOnTop, game)) { Player player = game.getPlayer(cardOnTop.getOwnerId()); if (player != null && cardOnTop.equals(player.getLibrary().getFromTop(game))) { return true; } } return false; }
@Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); if (player != null) { Card card = player.getLibrary().getFromTop(game); if (card != null) { player.moveCards(card, Zone.GRAVEYARD, source, game); if (card.isLand()) { game.addEffect(new CantBeBlockedByAllSourceEffect(StaticFilters.FILTER_PERMANENT_CREATURES, Duration.EndOfTurn), source); } } return true; } return false; } }
@Override public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) { if (affectedControllerId.equals(source.getControllerId())) { Card card = game.getCard(objectId); MageObject sourceObject = game.getObject(source.getSourceId()); if (card != null && !card.isLand() && sourceObject != null) { UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), sourceObject.getZoneChangeCounter(game)); if (exileId != null) { ExileZone exileZone = game.getState().getExile().getExileZone(exileId); return exileZone != null && exileZone.contains(objectId); } } } return false; } }
@Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(targetPointer.getFirst(game, source)); if (player != null) { Card discardedCard = player.discardOne(false, source, game); if (discardedCard != null && discardedCard.isLand()) { Card spellCard = game.getStack().getSpell(source.getSourceId()).getCard(); if (spellCard != null) { player.moveCards(spellCard, Zone.HAND, source, game); } } return true; } return false; }
@Override public boolean checkTrigger(GameEvent event, Game game) { if (!event.getPlayerId().equals(getControllerId())) { Card source = game.getPermanentOrLKIBattlefield(event.getSourceId()); if (source != null && (source.isArtifact() || source.isCreature() || source.isLand())) { StackAbility stackAbility = (StackAbility) game.getStack().getStackObject(event.getSourceId()); if (!(stackAbility.getStackAbility() instanceof ActivatedManaAbilityImpl)) { for (Effect effect : getEffects()) { effect.setTargetPointer(new FixedTarget(event.getPlayerId())); } return true; } } } return false; }
@Override public boolean apply(Game game, Ability source) { SecondSunriseWatcher watcher = game.getState().getWatcher(SecondSunriseWatcher.class); if (watcher != null) { for (UUID id : watcher.cards) { Card c = game.getCard(id); if (c != null && game.getState().getZone(id) == Zone.GRAVEYARD) { if (c.isArtifact() || c.isCreature() || c.isEnchantment() || c.isLand()) c.moveToZone(Zone.BATTLEFIELD, source.getSourceId(), game, false); } } return true; } return false; }
@Override public boolean apply(Game game, Ability source) { Player you = game.getPlayer(source.getControllerId()); Player targetPlayer = game.getPlayer(source.getFirstTarget()); if (targetPlayer != null && targetPlayer.getLibrary().hasCards()) { Card card = targetPlayer.getLibrary().getFromTop(game); card.moveToExile(id, "Scrib Nibblers Exile", source.getSourceId(), game); if (card.isLand() && you != null) { you.gainLife(1, game, source); return true; } } return false; } }
@Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); if (player != null) { for (Card card : player.getGraveyard().getCards(game)) { if (card != null && card.isLand()) { PlayLandFromGraveyardAbility ability = new PlayLandFromGraveyardAbility(card.getName()); ability.setSourceId(card.getId()); ability.setControllerId(card.getOwnerId()); game.getState().addOtherAbility(card, ability); } } return true; } return false; } }