Search in sources :

Example 21 with DrawCardSourceControllerEffect

use of mage.abilities.effects.common.DrawCardSourceControllerEffect in project mage by magefree.

the class Borrowing100000ArrowsEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Player opponent = game.getPlayer(this.getTargetPointer().getFirst(game, source));
    if (opponent != null) {
        FilterCreaturePermanent filter = new FilterCreaturePermanent();
        filter.add(TappedPredicate.TAPPED);
        filter.add(new ControllerIdPredicate(opponent.getId()));
        return new DrawCardSourceControllerEffect(game.getBattlefield().count(filter, source.getSourceId(), source.getControllerId(), game)).apply(game, source);
    }
    return false;
}
Also used : Player(mage.players.Player) FilterCreaturePermanent(mage.filter.common.FilterCreaturePermanent) DrawCardSourceControllerEffect(mage.abilities.effects.common.DrawCardSourceControllerEffect) ControllerIdPredicate(mage.filter.predicate.permanent.ControllerIdPredicate)

Aggregations

DrawCardSourceControllerEffect (mage.abilities.effects.common.DrawCardSourceControllerEffect)21 Player (mage.players.Player)10 Permanent (mage.game.permanent.Permanent)9 UUID (java.util.UUID)4 Card (mage.cards.Card)4 CardsImpl (mage.cards.CardsImpl)4 Ability (mage.abilities.Ability)2 OneShotEffect (mage.abilities.effects.OneShotEffect)2 CardImpl (mage.cards.CardImpl)2 CardSetInfo (mage.cards.CardSetInfo)2 CardType (mage.constants.CardType)2 Outcome (mage.constants.Outcome)2 Zone (mage.constants.Zone)2 FilterCreaturePermanent (mage.filter.common.FilterCreaturePermanent)2 ControllerIdPredicate (mage.filter.predicate.permanent.ControllerIdPredicate)2 Game (mage.game.Game)2 DamagedEvent (mage.game.events.DamagedEvent)2 Objects (java.util.Objects)1 MageInt (mage.MageInt)1 MageObjectReference (mage.MageObjectReference)1