Search in sources :

Example 31 with BoostTargetEffect

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

the class LilianaOfTheDarkRealmsEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Player player = game.getPlayer(source.getControllerId());
    if (player == null) {
        return false;
    }
    int swamps = game.getBattlefield().count(filter, source.getSourceId(), source.getControllerId(), game);
    if (swamps < 1) {
        return false;
    }
    String plusMessage = "+" + swamps + "/+" + swamps;
    String minusMessage = "-" + swamps + "/-" + swamps;
    if (!player.chooseUse(outcome, "Give " + plusMessage + " or " + minusMessage + "?", null, plusMessage, minusMessage, source, game)) {
        swamps *= -1;
    }
    game.addEffect(new BoostTargetEffect(swamps, swamps, Duration.EndOfTurn), source);
    return true;
}
Also used : Player(mage.players.Player) BoostTargetEffect(mage.abilities.effects.common.continuous.BoostTargetEffect)

Example 32 with BoostTargetEffect

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

the class NantukoMentorEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Permanent targetPermanent = game.getPermanent(getTargetPointer().getFirst(game, source));
    if (targetPermanent != null) {
        ContinuousEffect effect = new BoostTargetEffect(targetPermanent.getPower().getValue(), targetPermanent.getPower().getValue(), Duration.EndOfTurn);
        effect.setTargetPointer(new FixedTarget(targetPermanent, game));
        game.addEffect(effect, source);
    }
    return true;
}
Also used : FixedTarget(mage.target.targetpointer.FixedTarget) Permanent(mage.game.permanent.Permanent) TargetCreaturePermanent(mage.target.common.TargetCreaturePermanent) BoostTargetEffect(mage.abilities.effects.common.continuous.BoostTargetEffect) ContinuousEffect(mage.abilities.effects.ContinuousEffect)

Example 33 with BoostTargetEffect

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

the class OliviasMidnightAmbushEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    int boost = NightCondition.instance.apply(game, source) ? -13 : -2;
    game.addEffect(new BoostTargetEffect(boost, boost), source);
    return true;
}
Also used : BoostTargetEffect(mage.abilities.effects.common.continuous.BoostTargetEffect) DayNightHint(mage.abilities.hint.common.DayNightHint)

Example 34 with BoostTargetEffect

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

the class SharedAnimosityEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source));
    if (permanent == null) {
        return false;
    }
    FilterPermanent filter = new FilterAttackingCreature();
    filter.add(new SharesCreatureTypePredicate(permanent));
    filter.add(AnotherPredicate.instance);
    int count = game.getBattlefield().count(filter, permanent.getId(), source.getControllerId(), game);
    if (count > 0) {
        game.addEffect(new BoostTargetEffect(count, 0, Duration.EndOfTurn).setTargetPointer(new FixedTarget(permanent, game)), source);
    }
    return true;
}
Also used : FilterAttackingCreature(mage.filter.common.FilterAttackingCreature) FixedTarget(mage.target.targetpointer.FixedTarget) FilterPermanent(mage.filter.FilterPermanent) FilterPermanent(mage.filter.FilterPermanent) Permanent(mage.game.permanent.Permanent) SharesCreatureTypePredicate(mage.filter.predicate.mageobject.SharesCreatureTypePredicate) BoostTargetEffect(mage.abilities.effects.common.continuous.BoostTargetEffect)

Example 35 with BoostTargetEffect

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

the class WillOfTheAllHunterEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Permanent permanent = game.getPermanent(source.getFirstTarget());
    if (permanent == null) {
        return false;
    }
    if (permanent.getBlocking() > 0) {
        return permanent.addCounters(CounterType.P1P1.createInstance(2), source.getControllerId(), source, game);
    }
    game.addEffect(new BoostTargetEffect(2, 2), source);
    return true;
}
Also used : Permanent(mage.game.permanent.Permanent) TargetCreaturePermanent(mage.target.common.TargetCreaturePermanent) BoostTargetEffect(mage.abilities.effects.common.continuous.BoostTargetEffect)

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