Search in sources :

Example 1 with TargetCreaturesWithDifferentPowers

use of mage.target.common.TargetCreaturesWithDifferentPowers in project mage by magefree.

the class SigardasVanguardEffect method apply.

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

Example 2 with TargetCreaturesWithDifferentPowers

use of mage.target.common.TargetCreaturesWithDifferentPowers 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)

Aggregations

GainAbilityTargetEffect (mage.abilities.effects.common.continuous.GainAbilityTargetEffect)2 CardsImpl (mage.cards.CardsImpl)2 Player (mage.players.Player)2 TargetPermanent (mage.target.TargetPermanent)2 TargetCreaturesWithDifferentPowers (mage.target.common.TargetCreaturesWithDifferentPowers)2 FixedTargets (mage.target.targetpointer.FixedTargets)2 BoostTargetEffect (mage.abilities.effects.common.continuous.BoostTargetEffect)1 Cards (mage.cards.Cards)1 Permanent (mage.game.permanent.Permanent)1