Search in sources :

Example 76 with BoostTargetEffect

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

the class DevouringRageEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    int numberSpirits = 0;
    for (Cost cost : source.getCosts()) {
        if (cost instanceof SacrificeTargetCost) {
            numberSpirits = ((SacrificeTargetCost) cost).getPermanents().size();
        }
    }
    int amount = 3 + (numberSpirits * 3);
    Permanent targetCreature = game.getPermanent(getTargetPointer().getFirst(game, source));
    if (targetCreature != null) {
        ContinuousEffect effect = new BoostTargetEffect(amount, 0, Duration.EndOfTurn);
        effect.setTargetPointer(new FixedTarget(targetCreature.getId(), game));
        game.addEffect(effect, source);
        return true;
    }
    return false;
}
Also used : FixedTarget(mage.target.targetpointer.FixedTarget) SacrificeTargetCost(mage.abilities.costs.common.SacrificeTargetCost) Permanent(mage.game.permanent.Permanent) TargetCreaturePermanent(mage.target.common.TargetCreaturePermanent) FilterControlledCreaturePermanent(mage.filter.common.FilterControlledCreaturePermanent) TargetControlledCreaturePermanent(mage.target.common.TargetControlledCreaturePermanent) BoostTargetEffect(mage.abilities.effects.common.continuous.BoostTargetEffect) ContinuousEffect(mage.abilities.effects.ContinuousEffect) Cost(mage.abilities.costs.Cost) SacrificeTargetCost(mage.abilities.costs.common.SacrificeTargetCost)

Example 77 with BoostTargetEffect

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

the class AureliaExemplarOfJusticeEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Permanent creature = game.getPermanent(source.getFirstTarget());
    if (creature == null) {
        return false;
    }
    game.addEffect(new BoostTargetEffect(2, 0, Duration.EndOfTurn), source);
    if (creature.getColor(game).isRed()) {
        game.addEffect(new GainAbilityTargetEffect(TrampleAbility.getInstance(), Duration.EndOfTurn), source);
    }
    if (creature.getColor(game).isWhite()) {
        game.addEffect(new GainAbilityTargetEffect(VigilanceAbility.getInstance(), Duration.EndOfTurn), source);
    }
    return true;
}
Also used : Permanent(mage.game.permanent.Permanent) TargetControlledCreaturePermanent(mage.target.common.TargetControlledCreaturePermanent) BoostTargetEffect(mage.abilities.effects.common.continuous.BoostTargetEffect) GainAbilityTargetEffect(mage.abilities.effects.common.continuous.GainAbilityTargetEffect)

Example 78 with BoostTargetEffect

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

the class BronzeCudgelsEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Permanent permanent = source.getSourcePermanentOrLKI(game);
    if (permanent == null || game.getPermanent(permanent.getAttachedTo()) == null) {
        return false;
    }
    int resolvedCount = AbilityResolvedWatcher.getResolutionCount(game, source);
    if (resolvedCount < 1) {
        return false;
    }
    game.addEffect(new BoostTargetEffect(resolvedCount, 0).setTargetPointer(new FixedTarget(permanent.getOwnerId(), game)), source);
    return true;
}
Also used : FixedTarget(mage.target.targetpointer.FixedTarget) Permanent(mage.game.permanent.Permanent) BoostTargetEffect(mage.abilities.effects.common.continuous.BoostTargetEffect) AbilityResolutionCountHint(mage.abilities.hint.common.AbilityResolutionCountHint)

Example 79 with BoostTargetEffect

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

the class ChaoticStrikeEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Player controller = game.getPlayer(source.getControllerId());
    Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source));
    if (controller != null && permanent != null) {
        if (controller.flipCoin(source, game, true)) {
            game.addEffect(new BoostTargetEffect(1, 1, Duration.EndOfTurn), source);
            return true;
        }
    }
    return false;
}
Also used : Player(mage.players.Player) Permanent(mage.game.permanent.Permanent) TargetCreaturePermanent(mage.target.common.TargetCreaturePermanent) BoostTargetEffect(mage.abilities.effects.common.continuous.BoostTargetEffect)

Example 80 with BoostTargetEffect

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

the class ConsumeStrengthEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Permanent permanent = game.getPermanent(source.getFirstTarget());
    if (permanent != null) {
        ContinuousEffect effect = new BoostTargetEffect(2, 2, Duration.EndOfTurn);
        effect.setTargetPointer(new FixedTarget(permanent, game));
        game.addEffect(effect, source);
    }
    permanent = game.getPermanent(source.getTargets().get(1).getFirstTarget());
    if (permanent != null) {
        ContinuousEffect effect = new BoostTargetEffect(-2, -2, Duration.EndOfTurn);
        effect.setTargetPointer(new FixedTarget(permanent, game));
        game.addEffect(effect, source);
    }
    return true;
}
Also used : FixedTarget(mage.target.targetpointer.FixedTarget) Permanent(mage.game.permanent.Permanent) TargetCreaturePermanent(mage.target.common.TargetCreaturePermanent) FilterCreaturePermanent(mage.filter.common.FilterCreaturePermanent) BoostTargetEffect(mage.abilities.effects.common.continuous.BoostTargetEffect) ContinuousEffect(mage.abilities.effects.ContinuousEffect)

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