Search in sources :

Example 1 with BoostTargetEffect

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

the class NyleasColossusEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Permanent permanent = game.getPermanent(source.getFirstTarget());
    if (permanent == null) {
        return false;
    }
    int power = permanent.getPower().getValue();
    int toughness = permanent.getToughness().getValue();
    game.addEffect(new BoostTargetEffect(power, toughness, 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 2 with BoostTargetEffect

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

the class ToxicStenchEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    ContinuousEffect effect = new BoostTargetEffect(-1, -1, Duration.EndOfTurn);
    Permanent permanent = game.getPermanent(source.getFirstTarget());
    if (permanent != null) {
        effect.setTargetPointer(new FixedTarget(permanent, game));
        game.addEffect(effect, source);
        return true;
    }
    return false;
}
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 3 with BoostTargetEffect

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

the class ZulaportDuelistEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    game.addEffect(new BoostTargetEffect(-2, 0), source);
    Permanent permanent = game.getPermanent(source.getFirstTarget());
    if (permanent == null) {
        return false;
    }
    Player player = game.getPlayer(permanent.getControllerId());
    if (player == null) {
        return false;
    }
    player.millCards(2, source, game);
    return true;
}
Also used : Player(mage.players.Player) Permanent(mage.game.permanent.Permanent) TargetCreaturePermanent(mage.target.common.TargetCreaturePermanent) BoostTargetEffect(mage.abilities.effects.common.continuous.BoostTargetEffect)

Example 4 with BoostTargetEffect

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

the class AleatoryEffect 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 5 with BoostTargetEffect

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

the class CemeteryDesecratorRemoveCountersEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Player controller = game.getPlayer(source.getControllerId());
    if (controller != null) {
        TargetCardInGraveyard target = new TargetCardInGraveyard(filter);
        target.setNotTarget(true);
        controller.choose(outcome, target, source.getSourceId(), game);
        Card card = game.getCard(target.getFirstTarget());
        if (card != null) {
            int manaValue = card.getManaValue();
            if (controller.moveCards(card, Zone.EXILED, source, game)) {
                ReflexiveTriggeredAbility ability = new ReflexiveTriggeredAbility(new CemeteryDesecratorRemoveCountersEffect(manaValue), false, triggerText);
                ability.addTarget(new TargetPermanent());
                Mode mode = new Mode(new BoostTargetEffect(-manaValue, -manaValue, Duration.EndOfTurn).setText("Target creature an opponent controls gets -X/-X until end of turn, where X is the mana value of the exiled card"));
                mode.addTarget(new TargetOpponentsCreaturePermanent());
                ability.addMode(mode);
                game.fireReflexiveTriggeredAbility(ability, source);
                return true;
            }
        }
    }
    return false;
}
Also used : Player(mage.players.Player) TargetCardInGraveyard(mage.target.common.TargetCardInGraveyard) Mode(mage.abilities.Mode) BoostTargetEffect(mage.abilities.effects.common.continuous.BoostTargetEffect) TargetOpponentsCreaturePermanent(mage.target.common.TargetOpponentsCreaturePermanent) ReflexiveTriggeredAbility(mage.abilities.common.delayed.ReflexiveTriggeredAbility) TargetPermanent(mage.target.TargetPermanent) FilterCard(mage.filter.FilterCard) 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