Search in sources :

Example 61 with BoostTargetEffect

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

the class ExponentialGrowthEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Permanent permanent = game.getPermanent(source.getFirstTarget());
    if (permanent == null) {
        return false;
    }
    int xValue = source.getManaCostsToPay().getX();
    int multiplier = 1;
    for (int i = 0; i < xValue; i++) {
        multiplier = CardUtil.overflowMultiply(multiplier, 2);
    }
    multiplier = CardUtil.overflowDec(multiplier, 1);
    game.addEffect(new BoostTargetEffect(CardUtil.overflowMultiply(multiplier, permanent.getPower().getValue()), 0, Duration.EndOfTurn), source);
    return true;
}
Also used : Permanent(mage.game.permanent.Permanent) TargetCreaturePermanent(mage.target.common.TargetCreaturePermanent) BoostTargetEffect(mage.abilities.effects.common.continuous.BoostTargetEffect)

Example 62 with BoostTargetEffect

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

the class FistfulOfForceEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Player controller = game.getPlayer(source.getControllerId());
    Permanent creature = game.getPermanent(getTargetPointer().getFirst(game, source));
    if (controller != null && creature != null) {
        ContinuousEffect effect = new BoostTargetEffect(2, 2, Duration.EndOfTurn);
        effect.setTargetPointer(new FixedTarget(creature.getId(), game));
        game.addEffect(effect, source);
        if (ClashEffect.getInstance().apply(game, source)) {
            game.addEffect(effect.copy(), source);
            effect = new GainAbilityTargetEffect(TrampleAbility.getInstance(), Duration.EndOfTurn);
            effect.setTargetPointer(new FixedTarget(creature.getId(), game));
            game.addEffect(effect.copy(), 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) ContinuousEffect(mage.abilities.effects.ContinuousEffect)

Example 63 with BoostTargetEffect

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

the class PhantasmalMountDelayedTriggeredAbility method apply.

@Override
public boolean apply(Game game, Ability source) {
    Permanent targetCreature = game.getPermanent(source.getFirstTarget());
    if (targetCreature != null) {
        ContinuousEffect effect = new BoostTargetEffect(1, 1, Duration.EndOfTurn);
        effect.setTargetPointer(new FixedTarget(source.getFirstTarget(), game));
        game.addEffect(effect, source);
        Effect sacrificeCreatureEffect = new SacrificeTargetEffect();
        Effect sacrificePhantasmalMountEffect = new SacrificeTargetEffect();
        ContinuousEffect gainAbility = new GainAbilityTargetEffect(FlyingAbility.getInstance(), Duration.EndOfTurn);
        gainAbility.setTargetPointer(new FixedTarget(source.getFirstTarget(), game));
        game.addEffect(gainAbility, source);
        sacrificeCreatureEffect.setTargetPointer(new FixedTarget(source.getFirstTarget(), game));
        sacrificePhantasmalMountEffect.setTargetPointer(new FixedTarget(source.getSourceId(), game));
        DelayedTriggeredAbility dTA = new PhantasmalMountDelayedTriggeredAbility(sacrificeCreatureEffect, source.getSourceId());
        DelayedTriggeredAbility dTA2 = new PhantasmalMountDelayedTriggeredAbility(sacrificePhantasmalMountEffect, source.getFirstTarget());
        game.addDelayedTriggeredAbility(dTA, source);
        game.addDelayedTriggeredAbility(dTA2, source);
        return true;
    }
    return false;
}
Also used : FixedTarget(mage.target.targetpointer.FixedTarget) FilterControlledCreaturePermanent(mage.filter.common.FilterControlledCreaturePermanent) Permanent(mage.game.permanent.Permanent) TargetControlledCreaturePermanent(mage.target.common.TargetControlledCreaturePermanent) DelayedTriggeredAbility(mage.abilities.DelayedTriggeredAbility) BoostTargetEffect(mage.abilities.effects.common.continuous.BoostTargetEffect) GainAbilityTargetEffect(mage.abilities.effects.common.continuous.GainAbilityTargetEffect) BoostTargetEffect(mage.abilities.effects.common.continuous.BoostTargetEffect) ContinuousEffect(mage.abilities.effects.ContinuousEffect) SacrificeTargetEffect(mage.abilities.effects.common.SacrificeTargetEffect) OneShotEffect(mage.abilities.effects.OneShotEffect) Effect(mage.abilities.effects.Effect) GainAbilityTargetEffect(mage.abilities.effects.common.continuous.GainAbilityTargetEffect) ContinuousEffect(mage.abilities.effects.ContinuousEffect) SacrificeTargetEffect(mage.abilities.effects.common.SacrificeTargetEffect)

Example 64 with BoostTargetEffect

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

the class SigardianZealotEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Player player = game.getPlayer(source.getControllerId());
    Permanent permanent = source.getSourcePermanentOrLKI(game);
    if (player == null || permanent == null) {
        return false;
    }
    int power = permanent.getPower().getValue();
    if (power == 0) {
        return false;
    }
    TargetPermanent target = new TargetCreaturesWithDifferentPowers();
    player.choose(outcome, target, source.getSourceId(), game);
    Cards cards = new CardsImpl(target.getTargets());
    if (cards.isEmpty()) {
        return false;
    }
    game.addEffect(new BoostTargetEffect(power, power).setTargetPointer(new FixedTargets(cards, game)), source);
    game.addEffect(new GainAbilityTargetEffect(VigilanceAbility.getInstance(), Duration.EndOfTurn).setTargetPointer(new FixedTargets(cards, game)), source);
    return true;
}
Also used : Player(mage.players.Player) Permanent(mage.game.permanent.Permanent) TargetPermanent(mage.target.TargetPermanent) FixedTargets(mage.target.targetpointer.FixedTargets) BoostTargetEffect(mage.abilities.effects.common.continuous.BoostTargetEffect) GainAbilityTargetEffect(mage.abilities.effects.common.continuous.GainAbilityTargetEffect) TargetPermanent(mage.target.TargetPermanent) TargetCreaturesWithDifferentPowers(mage.target.common.TargetCreaturesWithDifferentPowers) Cards(mage.cards.Cards) CardsImpl(mage.cards.CardsImpl)

Example 65 with BoostTargetEffect

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

the class TrepanationBladeDiscardEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Permanent equipment = game.getPermanent(source.getSourceId());
    if (equipment != null && equipment.getAttachedTo() != null) {
        Permanent creature = game.getPermanent(equipment.getAttachedTo());
        if (creature == null) {
            return false;
        }
        UUID defenderId = game.getCombat().getDefenderId(creature.getId());
        Player defendingPlayer = game.getPlayer(defenderId);
        if (defendingPlayer == null) {
            return false;
        }
        CardsImpl cards = new CardsImpl();
        for (Card card : defendingPlayer.getLibrary().getCards(game)) {
            cards.add(card);
            if (card.isLand(game)) {
                break;
            }
        }
        defendingPlayer.revealCards(equipment.getName(), cards, game);
        defendingPlayer.moveCards(cards, Zone.GRAVEYARD, source, game);
        if (!cards.isEmpty()) {
            ContinuousEffect effect = new BoostTargetEffect(cards.size(), 0, Duration.EndOfTurn);
            effect.setTargetPointer(new FixedTarget(creature, game));
            game.addEffect(effect, source);
        }
        return true;
    }
    return false;
}
Also used : FixedTarget(mage.target.targetpointer.FixedTarget) Player(mage.players.Player) Permanent(mage.game.permanent.Permanent) BoostTargetEffect(mage.abilities.effects.common.continuous.BoostTargetEffect) ContinuousEffect(mage.abilities.effects.ContinuousEffect) UUID(java.util.UUID) CardsImpl(mage.cards.CardsImpl) Card(mage.cards.Card)

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