Search in sources :

Example 11 with BoostTargetEffect

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

the class ScentOfIvyEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    RevealTargetFromHandCost cost = new RevealTargetFromHandCost(new TargetCardInHand(0, Integer.MAX_VALUE, filter));
    if (!cost.pay(source, game, source, source.getControllerId(), true)) {
        return false;
    }
    int xValue = cost.getNumberRevealedCards();
    game.addEffect(new BoostTargetEffect(xValue, xValue, Duration.EndOfTurn), source);
    return true;
}
Also used : RevealTargetFromHandCost(mage.abilities.costs.common.RevealTargetFromHandCost) TargetCardInHand(mage.target.common.TargetCardInHand) BoostTargetEffect(mage.abilities.effects.common.continuous.BoostTargetEffect)

Example 12 with BoostTargetEffect

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

the class ScentOfNightshadeEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    RevealTargetFromHandCost cost = new RevealTargetFromHandCost(new TargetCardInHand(0, Integer.MAX_VALUE, filter));
    if (!cost.pay(source, game, source, source.getControllerId(), true)) {
        return false;
    }
    int xValue = -1 * cost.getNumberRevealedCards();
    game.addEffect(new BoostTargetEffect(xValue, xValue, Duration.EndOfTurn), source);
    return true;
}
Also used : RevealTargetFromHandCost(mage.abilities.costs.common.RevealTargetFromHandCost) TargetCardInHand(mage.target.common.TargetCardInHand) BoostTargetEffect(mage.abilities.effects.common.continuous.BoostTargetEffect)

Example 13 with BoostTargetEffect

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

the class WolfStikeEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    if (game.checkDayNight(false)) {
        BoostTargetEffect effect = new BoostTargetEffect(2, 0, Duration.EndOfTurn);
        game.addEffect(effect, source);
        return true;
    }
    return false;
}
Also used : BoostTargetEffect(mage.abilities.effects.common.continuous.BoostTargetEffect)

Example 14 with BoostTargetEffect

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

the class GodEternalRhonasEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Permanent godEternalRhonas = game.getPermanent(source.getSourceId());
    for (Permanent permanent : game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) {
        if (permanent == null || godEternalRhonas != null && permanent == godEternalRhonas) {
            continue;
        }
        ContinuousEffect effect = new BoostTargetEffect(permanent.getPower().getValue(), 0, Duration.EndOfTurn);
        effect.setTargetPointer(new FixedTarget(permanent, game));
        game.addEffect(effect, source);
        ContinuousEffect effect2 = new GainAbilityTargetEffect(VigilanceAbility.getInstance(), Duration.EndOfTurn);
        effect2.setTargetPointer(new FixedTarget(permanent, game));
        game.addEffect(effect2, source);
    }
    return true;
}
Also used : FixedTarget(mage.target.targetpointer.FixedTarget) Permanent(mage.game.permanent.Permanent) FilterControlledCreaturePermanent(mage.filter.common.FilterControlledCreaturePermanent) BoostTargetEffect(mage.abilities.effects.common.continuous.BoostTargetEffect) GainAbilityTargetEffect(mage.abilities.effects.common.continuous.GainAbilityTargetEffect) ContinuousEffect(mage.abilities.effects.ContinuousEffect)

Example 15 with BoostTargetEffect

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

the class HammerHelperEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Player controller = game.getPlayer(source.getControllerId());
    Permanent targetCreature = game.getPermanent(source.getFirstTarget());
    if (controller != null && targetCreature != null) {
        source.getEffects().get(0).setTargetPointer(new FixedTarget(targetCreature.getId(), game));
        game.addEffect(new GainControlTargetEffect(Duration.EndOfTurn), source);
        targetCreature.untap(game);
        int amount = controller.rollDice(outcome, source, game, 6);
        game.addEffect(new BoostTargetEffect(amount, 0, Duration.EndOfTurn), source);
        game.addEffect(new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn), source);
        return true;
    }
    return false;
}
Also used : FixedTarget(mage.target.targetpointer.FixedTarget) Player(mage.players.Player) Permanent(mage.game.permanent.Permanent) TargetCreaturePermanent(mage.target.common.TargetCreaturePermanent) BoostTargetEffect(mage.abilities.effects.common.continuous.BoostTargetEffect) GainAbilityTargetEffect(mage.abilities.effects.common.continuous.GainAbilityTargetEffect) GainControlTargetEffect(mage.abilities.effects.common.continuous.GainControlTargetEffect)

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