Search in sources :

Example 71 with BoostTargetEffect

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

the class CankerousThirstEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Player controller = game.getPlayer(source.getControllerId());
    if (controller != null) {
        if (new ManaWasSpentCondition(ColoredManaSymbol.B).apply(game, source)) {
            Permanent targetCreature1 = game.getPermanent(getTargetPointer().getFirst(game, source));
            if (targetCreature1 != null && controller.chooseUse(Outcome.UnboostCreature, "Let " + targetCreature1.getIdName() + " get -3/-3 until end of turn?", source, game)) {
                ContinuousEffect effect = new BoostTargetEffect(-3, -3, Duration.EndOfTurn);
                effect.setTargetPointer(new FixedTarget(targetCreature1, game));
                game.addEffect(effect, source);
            }
        }
        if (new ManaWasSpentCondition(ColoredManaSymbol.G).apply(game, source)) {
            Permanent targetCreature2 = game.getPermanent(source.getTargets().get(1).getFirstTarget());
            if (targetCreature2 != null && controller.chooseUse(Outcome.UnboostCreature, "Let " + targetCreature2.getIdName() + " get +3/+3 until end of turn?", source, game)) {
                ContinuousEffect effect = new BoostTargetEffect(+3, +3, Duration.EndOfTurn);
                effect.setTargetPointer(new FixedTarget(targetCreature2, 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) TargetCreaturePermanent(mage.target.common.TargetCreaturePermanent) FilterCreaturePermanent(mage.filter.common.FilterCreaturePermanent) ManaWasSpentCondition(mage.abilities.condition.common.ManaWasSpentCondition) BoostTargetEffect(mage.abilities.effects.common.continuous.BoostTargetEffect) ContinuousEffect(mage.abilities.effects.ContinuousEffect)

Example 72 with BoostTargetEffect

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

the class AkromaVisionOfIxidorEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    for (Permanent permanent : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_CONTROLLED_ANOTHER_CREATURE, source.getControllerId(), source.getSourceId(), game)) {
        Abilities abilities = permanent.getAbilities(game);
        int count = classes.stream().map(clazz -> abilities.stream().anyMatch(clazz::isInstance)).mapToInt(b -> b ? 1 : 0).sum();
        if (count > 0) {
            ContinuousEffect effect = new BoostTargetEffect(count, count, Duration.EndOfTurn);
            effect.setTargetPointer(new FixedTarget(permanent.getId(), game));
            game.addEffect(effect, source);
        }
    }
    return true;
}
Also used : BeginningOfCombatTriggeredAbility(mage.abilities.common.BeginningOfCombatTriggeredAbility) BoostTargetEffect(mage.abilities.effects.common.continuous.BoostTargetEffect) StaticFilters(mage.filter.StaticFilters) Arrays(java.util.Arrays) mage.abilities.keyword(mage.abilities.keyword) Set(java.util.Set) OneShotEffect(mage.abilities.effects.OneShotEffect) UUID(java.util.UUID) MageInt(mage.MageInt) ContinuousEffect(mage.abilities.effects.ContinuousEffect) FixedTarget(mage.target.targetpointer.FixedTarget) CardSetInfo(mage.cards.CardSetInfo) HashSet(java.util.HashSet) Game(mage.game.Game) CardImpl(mage.cards.CardImpl) Permanent(mage.game.permanent.Permanent) mage.constants(mage.constants) Abilities(mage.abilities.Abilities) Ability(mage.abilities.Ability) FixedTarget(mage.target.targetpointer.FixedTarget) Abilities(mage.abilities.Abilities) Permanent(mage.game.permanent.Permanent) BoostTargetEffect(mage.abilities.effects.common.continuous.BoostTargetEffect) ContinuousEffect(mage.abilities.effects.ContinuousEffect)

Example 73 with BoostTargetEffect

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

the class ArahboEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Permanent creature = game.getPermanent(targetPointer.getFirst(game, source));
    if (creature != null && creature.isCreature(game)) {
        int pow = creature.getPower().getValue();
        ContinuousEffect effect = new BoostTargetEffect(pow, pow, Duration.EndOfTurn);
        effect.setTargetPointer(new FixedTarget(creature, game));
        game.addEffect(effect, source);
        effect = new GainAbilityTargetEffect(TrampleAbility.getInstance(), Duration.EndOfTurn);
        effect.setTargetPointer(new FixedTarget(creature, game));
        game.addEffect(effect, source);
    }
    return true;
}
Also used : FixedTarget(mage.target.targetpointer.FixedTarget) Permanent(mage.game.permanent.Permanent) TargetCreaturePermanent(mage.target.common.TargetCreaturePermanent) FilterControlledCreaturePermanent(mage.filter.common.FilterControlledCreaturePermanent) FilterCreaturePermanent(mage.filter.common.FilterCreaturePermanent) BoostTargetEffect(mage.abilities.effects.common.continuous.BoostTargetEffect) GainAbilityTargetEffect(mage.abilities.effects.common.continuous.GainAbilityTargetEffect) ContinuousEffect(mage.abilities.effects.ContinuousEffect)

Example 74 with BoostTargetEffect

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

the class BerserkMurlodontEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source));
    if (permanent == null) {
        return false;
    }
    int blockers = game.getCombat().getGroups().stream().filter(combatGroup -> combatGroup.getAttackers().contains(permanent.getId())).map(CombatGroup::getBlockers).mapToInt(List::size).sum();
    game.addEffect(new BoostTargetEffect(blockers, blockers, Duration.EndOfTurn).setTargetPointer(new FixedTarget(permanent, game)), source);
    return true;
}
Also used : BoostTargetEffect(mage.abilities.effects.common.continuous.BoostTargetEffect) BecomesBlockedAllTriggeredAbility(mage.abilities.common.BecomesBlockedAllTriggeredAbility) Outcome(mage.constants.Outcome) OneShotEffect(mage.abilities.effects.OneShotEffect) UUID(java.util.UUID) MageInt(mage.MageInt) SubType(mage.constants.SubType) FixedTarget(mage.target.targetpointer.FixedTarget) CardSetInfo(mage.cards.CardSetInfo) Duration(mage.constants.Duration) Game(mage.game.Game) List(java.util.List) CardImpl(mage.cards.CardImpl) Permanent(mage.game.permanent.Permanent) CardType(mage.constants.CardType) FilterCreaturePermanent(mage.filter.common.FilterCreaturePermanent) CombatGroup(mage.game.combat.CombatGroup) Ability(mage.abilities.Ability) FixedTarget(mage.target.targetpointer.FixedTarget) Permanent(mage.game.permanent.Permanent) FilterCreaturePermanent(mage.filter.common.FilterCreaturePermanent) BoostTargetEffect(mage.abilities.effects.common.continuous.BoostTargetEffect) CombatGroup(mage.game.combat.CombatGroup)

Example 75 with BoostTargetEffect

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

the class ClearTheStageEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    game.addEffect(new BoostTargetEffect(-3, -3), source);
    if (!FerociousCondition.instance.apply(game, source)) {
        return true;
    }
    Player player = game.getPlayer(source.getControllerId());
    if (player == null || !player.chooseUse(Outcome.Benefit, "Return a creature card from your graveyard to your hand?", source, game)) {
        return false;
    }
    Card card = game.getCard(source.getTargets().get(1).getFirstTarget());
    if (card == null) {
        return false;
    }
    return player.moveCards(card, Zone.HAND, source, game);
}
Also used : Player(mage.players.Player) BoostTargetEffect(mage.abilities.effects.common.continuous.BoostTargetEffect) FilterCard(mage.filter.FilterCard) FilterCreatureCard(mage.filter.common.FilterCreatureCard) 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