@Override public boolean apply(Card card, Game game) { return card.isOwnedBy(ownerId); }
@Override public boolean putInGraveyard(Card card, Game game) { if (card.isOwnedBy(playerId)) { this.graveyard.add(card); } else { return game.getPlayer(card.getOwnerId()).putInGraveyard(card, game); } return true; }
public void putOnBottom(Card card, Game game) { if (card.isOwnedBy(playerId)) { card.setZone(Zone.LIBRARY, game); library.remove(card.getId()); library.add(card.getId()); } else { game.getPlayer(card.getOwnerId()).getLibrary().putOnBottom(card, game); } }
@Override public boolean apply(ObjectSourcePlayer<Card> input, Game game) { return input.getObject().isOwnedBy(game.getCombat().getDefendingPlayerId(input.getSourceId(), game)); }
@Override public boolean applies(UUID sourceId, Ability source, UUID affectedControllerId, Game game) { if (sourceId.equals(source.getSourceId())) { Card card = game.getCard(source.getSourceId()); if (card != null && card.isOwnedBy(affectedControllerId) && game.getState().getZone(source.getSourceId()) == Zone.EXILED) { return true; } } return false; } }
public void putOnTop(Card card, Game game) { if (card.isOwnedBy(playerId)) { card.setZone(Zone.LIBRARY, game); library.addFirst(card.getId()); } else { game.getPlayer(card.getOwnerId()).getLibrary().putOnTop(card, game); } }
@Override public void watch(GameEvent event, Game game) { if (event.getType() == EventType.ZONE_CHANGE && ((ZoneChangeEvent) event).isDiesEvent()) { MageObject card = game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); if (card != null && ((Card) card).isOwnedBy(this.controllerId) && card.isCreature()) { creatureIds.add(card.getId()); } } }
@Override public boolean applies(UUID sourceId, Ability source, UUID affectedControllerId, Game game) { if (sourceId.equals(source.getSourceId())) { Card card = game.getCard(source.getSourceId()); if (card != null && card.isOwnedBy(affectedControllerId) && game.getState().getZone(source.getSourceId()) == Zone.EXILED) { return true; } } return false; } }
@Override public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) { Card card = game.getCard(objectId); return card != null && card.isOwnedBy(getTargetPointer().getFirst(game, source)) && game.getState().getZone(objectId) == Zone.HAND && affectedControllerId.equals(source.getControllerId()); }
@Override public boolean applies(UUID sourceId, Ability source, UUID affectedControllerId, Game game) { if (sourceId.equals(source.getSourceId())) { Card card = game.getCard(source.getSourceId()); if (card != null && card.isOwnedBy(affectedControllerId) && game.getState().getZone(source.getSourceId()) == Zone.GRAVEYARD) { return true; } } return false; } }
@Override public void watch(GameEvent event, Game game) { if (event.getType() == GameEvent.EventType.ZONE_CHANGE && ((ZoneChangeEvent) event).isDiesEvent()) { MageObject card = game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); if (card != null && ((Card) card).isOwnedBy(this.controllerId) && card.isCreature()) { creaturesCount++; } } }
@Override public boolean applies(GameEvent event, Ability source, Game game) { if (((ZoneChangeEvent) event).getToZone() == Zone.GRAVEYARD) { Card card = game.getCard(event.getTargetId()); if (card != null && card.isOwnedBy(source.getControllerId())) { Permanent permanent = ((ZoneChangeEvent) event).getTarget(); if (!(permanent instanceof PermanentToken)) { return true; } } } return false; }
@Override public boolean canTarget(UUID id, Ability source, Game game) { UUID firstTarget = this.getFirstTarget(); if (firstTarget != null) { Card card = game.getCard(firstTarget); Card targetCard = game.getCard(id); if (card == null || targetCard == null || !card.isOwnedBy(targetCard.getOwnerId())) { return false; } } return super.canTarget(id, source, game); }
@Override public boolean applies(GameEvent event, Ability source, Game game) { if (((ZoneChangeEvent) event).getToZone() == Zone.GRAVEYARD) { Card card = game.getCard(event.getTargetId()); if (card != null && card.isOwnedBy(source.getControllerId())) { Permanent permanent = ((ZoneChangeEvent) event).getTarget(); if (!(permanent instanceof PermanentToken)) { return true; } } } return false; }
@Override public boolean applies(GameEvent event, Ability source, Game game) { if (((ZoneChangeEvent) event).getToZone() == Zone.GRAVEYARD) { Card card = game.getCard(event.getTargetId()); if (card != null && card.isOwnedBy(source.getControllerId())) { Permanent permanent = ((ZoneChangeEvent) event).getTarget(); if (!(permanent instanceof PermanentToken)) { return true; } } } return false; }
@Override public boolean applies(GameEvent event, Ability source, Game game) { if (((ZoneChangeEvent) event).getToZone() == Zone.GRAVEYARD) { Card card = game.getCard(event.getTargetId()); if (card != null && card.isOwnedBy(source.getControllerId())) { Permanent permanent = ((ZoneChangeEvent) event).getTarget(); if (!(permanent instanceof PermanentToken)) { return true; } } } return false; }
@Override public boolean applies(UUID sourceId, Ability source, UUID affectedControllerId, Game game) { if (sourceId.equals(source.getSourceId())) { Card card = game.getCard(source.getSourceId()); if (card != null && card.isOwnedBy(affectedControllerId) && (game.getState().getZone(source.getSourceId()) == Zone.EXILED || game.getState().getZone(source.getSourceId()) == Zone.GRAVEYARD)) { return true; } } return false; } }
@Override public boolean applies(UUID sourceId, Ability source, UUID affectedControllerId, Game game) { if (sourceId.equals(source.getSourceId())) { Card card = game.getCard(source.getSourceId()); if (card != null && card.isOwnedBy(affectedControllerId) && game.getState().getZone(source.getSourceId()) == Zone.GRAVEYARD && game.getBattlefield().count(filter, source.getSourceId(), source.getControllerId(), game) > 0) { return true; } } return false; } }
@Override public boolean apply(Game game, Ability source) { FaithsRewardWatcher watcher = game.getState().getWatcher(FaithsRewardWatcher.class); if (watcher != null) { for (UUID id : watcher.cards) { Card c = game.getCard(id); if (c != null && c.isOwnedBy(source.getControllerId()) && game.getState().getZone(id) == Zone.GRAVEYARD) { c.moveToZone(Zone.BATTLEFIELD, source.getSourceId(), game, false); } } return true; } return false; }
@Override public boolean canTarget(UUID id, Ability source, Game game) { Card card = game.getCard(id); if (card != null && card.isOwnedBy(source.getControllerId()) && game.getState().getZone(card.getId()) == Zone.EXILED) { for (ExileZone exile : game.getExile().getExileZones()) { if (exile != null && exile.contains(id)) { return filter.match(card, source.getControllerId(), game); } } } return false; }