Search in sources :

Example 51 with BoostTargetEffect

use of mage.abilities.effects.common.continuous.BoostTargetEffect in project mage by magefree.

the class PlaneswalkersFavorEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Player opponent = game.getPlayer(source.getTargets().get(0).getFirstTarget());
    if (opponent != null && !opponent.getHand().isEmpty()) {
        Cards revealed = new CardsImpl();
        Card card = opponent.getHand().getRandom(game);
        if (card != null) {
            revealed.add(card);
            int boostValue = card.getManaValue();
            opponent.revealCards("Planeswalker's Favor", revealed, game);
            ContinuousEffect effect = new BoostTargetEffect(boostValue, boostValue, Duration.EndOfTurn);
            effect.setTargetPointer(new FixedTarget(source.getTargets().get(1).getFirstTarget()));
            game.addEffect(effect, source);
        }
        return true;
    }
    return false;
}
Also used : FixedTarget(mage.target.targetpointer.FixedTarget) Player(mage.players.Player) BoostTargetEffect(mage.abilities.effects.common.continuous.BoostTargetEffect) ContinuousEffect(mage.abilities.effects.ContinuousEffect) Cards(mage.cards.Cards) CardsImpl(mage.cards.CardsImpl) Card(mage.cards.Card)

Example 52 with BoostTargetEffect

use of mage.abilities.effects.common.continuous.BoostTargetEffect in project mage by magefree.

the class PlaneswalkersScornEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Player opponent = game.getPlayer(source.getTargets().get(0).getFirstTarget());
    if (opponent != null && !opponent.getHand().isEmpty()) {
        Cards revealed = new CardsImpl();
        Card card = opponent.getHand().getRandom(game);
        if (card != null) {
            revealed.add(card);
            int boostValue = -1 * card.getManaValue();
            opponent.revealCards("Planeswalker's Scorn", revealed, game);
            ContinuousEffect effect = new BoostTargetEffect(boostValue, boostValue, Duration.EndOfTurn);
            effect.setTargetPointer(new FixedTarget(source.getTargets().get(1).getFirstTarget()));
            game.addEffect(effect, source);
        }
        return true;
    }
    return false;
}
Also used : FixedTarget(mage.target.targetpointer.FixedTarget) Player(mage.players.Player) BoostTargetEffect(mage.abilities.effects.common.continuous.BoostTargetEffect) ContinuousEffect(mage.abilities.effects.ContinuousEffect) Cards(mage.cards.Cards) CardsImpl(mage.cards.CardsImpl) Card(mage.cards.Card)

Example 53 with BoostTargetEffect

use of mage.abilities.effects.common.continuous.BoostTargetEffect in project mage by magefree.

the class RoarOfJukaiEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Player controller = game.getPlayer(source.getControllerId());
    if (controller != null) {
        if (new PermanentsOnTheBattlefieldCondition(filter).apply(game, source)) {
            for (Permanent permanent : game.getBattlefield().getActivePermanents(filterBlocked, source.getControllerId(), source.getSourceId(), game)) {
                ContinuousEffect effect = new BoostTargetEffect(2, 2, Duration.EndOfTurn);
                effect.setTargetPointer(new FixedTarget(permanent, game));
                game.addEffect(effect, source);
            }
        }
        return true;
    }
    return false;
}
Also used : FixedTarget(mage.target.targetpointer.FixedTarget) Player(mage.players.Player) FilterPermanent(mage.filter.FilterPermanent) Permanent(mage.game.permanent.Permanent) FilterCreaturePermanent(mage.filter.common.FilterCreaturePermanent) BoostTargetEffect(mage.abilities.effects.common.continuous.BoostTargetEffect) PermanentsOnTheBattlefieldCondition(mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition) ContinuousEffect(mage.abilities.effects.ContinuousEffect)

Example 54 with BoostTargetEffect

use of mage.abilities.effects.common.continuous.BoostTargetEffect in project mage by magefree.

the class TaigamSidisisHandEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Player controller = game.getPlayer(source.getControllerId());
    if (controller != null) {
        Permanent targetCreature = game.getPermanent(getTargetPointer().getFirst(game, source));
        if (targetCreature != null) {
            int amount = 0;
            for (Cost cost : source.getCosts()) {
                if (cost instanceof ExileFromGraveCost) {
                    amount = ((ExileFromGraveCost) cost).getExiledCards().size();
                    ContinuousEffect effect = new BoostTargetEffect(-amount, -amount, Duration.EndOfTurn);
                    effect.setTargetPointer(new FixedTarget(source.getTargets().getFirstTarget(), game));
                    game.addEffect(effect, source);
                }
            }
        }
    }
    return false;
}
Also used : FixedTarget(mage.target.targetpointer.FixedTarget) Player(mage.players.Player) Permanent(mage.game.permanent.Permanent) TargetCreaturePermanent(mage.target.common.TargetCreaturePermanent) ExileFromGraveCost(mage.abilities.costs.common.ExileFromGraveCost) BoostTargetEffect(mage.abilities.effects.common.continuous.BoostTargetEffect) ContinuousEffect(mage.abilities.effects.ContinuousEffect) Cost(mage.abilities.costs.Cost) TapSourceCost(mage.abilities.costs.common.TapSourceCost) ExileFromGraveCost(mage.abilities.costs.common.ExileFromGraveCost)

Example 55 with BoostTargetEffect

use of mage.abilities.effects.common.continuous.BoostTargetEffect in project mage by magefree.

the class NeyithOfTheDireHuntEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Permanent permanent = game.getPermanent(source.getFirstTarget());
    if (permanent == null) {
        return false;
    }
    int power = permanent.getPower().getValue();
    game.addEffect(new BoostTargetEffect(power, 0, Duration.EndOfTurn), source);
    game.addEffect(new MustBeBlockedByAtLeastOneTargetEffect(Duration.EndOfCombat), source);
    return true;
}
Also used : Permanent(mage.game.permanent.Permanent) TargetCreaturePermanent(mage.target.common.TargetCreaturePermanent) BoostTargetEffect(mage.abilities.effects.common.continuous.BoostTargetEffect) MustBeBlockedByAtLeastOneTargetEffect(mage.abilities.effects.common.combat.MustBeBlockedByAtLeastOneTargetEffect)

Aggregations

BoostTargetEffect (mage.abilities.effects.common.continuous.BoostTargetEffect)81 Permanent (mage.game.permanent.Permanent)58 FixedTarget (mage.target.targetpointer.FixedTarget)46 ContinuousEffect (mage.abilities.effects.ContinuousEffect)36 TargetCreaturePermanent (mage.target.common.TargetCreaturePermanent)34 Player (mage.players.Player)31 GainAbilityTargetEffect (mage.abilities.effects.common.continuous.GainAbilityTargetEffect)16 FilterCreaturePermanent (mage.filter.common.FilterCreaturePermanent)10 TargetPermanent (mage.target.TargetPermanent)10 TargetControlledCreaturePermanent (mage.target.common.TargetControlledCreaturePermanent)10 Card (mage.cards.Card)9 FilterControlledCreaturePermanent (mage.filter.common.FilterControlledCreaturePermanent)8 CardsImpl (mage.cards.CardsImpl)7 FilterPermanent (mage.filter.FilterPermanent)7 UUID (java.util.UUID)5 RevealTargetFromHandCost (mage.abilities.costs.common.RevealTargetFromHandCost)5 OneShotEffect (mage.abilities.effects.OneShotEffect)5 TargetCardInHand (mage.target.common.TargetCardInHand)5 Ability (mage.abilities.Ability)4 MageObject (mage.MageObject)3