Search in sources :

Example 1 with UntapSourceEffect

use of mage.abilities.effects.common.UntapSourceEffect in project mage by magefree.

the class RodOfSpankingEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Player target = game.getPlayer(source.getFirstTarget());
    new DamageTargetEffect(1).apply(game, source);
    if (target != null) {
        if (target.chooseUse(Outcome.Untap, "Say \"Thank you, sir. May I have another?\"", source, game)) {
            game.informPlayers(target.getLogName() + ": Thank you, sir. May I have another?");
        } else {
            new UntapSourceEffect().apply(game, source);
        }
        return true;
    }
    return false;
}
Also used : TargetPlayer(mage.target.TargetPlayer) Player(mage.players.Player) UntapSourceEffect(mage.abilities.effects.common.UntapSourceEffect) DamageTargetEffect(mage.abilities.effects.common.DamageTargetEffect)

Example 2 with UntapSourceEffect

use of mage.abilities.effects.common.UntapSourceEffect in project mage by magefree.

the class LobeLobberEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Player controller = game.getPlayer(source.getControllerId());
    Permanent equipment = game.getPermanent(source.getSourceId());
    Player player = game.getPlayer(source.getFirstTarget());
    if (controller != null && equipment != null && player != null) {
        player.damage(1, source.getSourceId(), source, game);
        int amount = controller.rollDice(outcome, source, game, 6);
        if (amount >= 5) {
            new UntapSourceEffect().apply(game, source);
        }
        return true;
    }
    return false;
}
Also used : TargetPlayer(mage.target.TargetPlayer) Player(mage.players.Player) Permanent(mage.game.permanent.Permanent) UntapSourceEffect(mage.abilities.effects.common.UntapSourceEffect)

Example 3 with UntapSourceEffect

use of mage.abilities.effects.common.UntapSourceEffect in project mage by magefree.

the class HarshDeceiverEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Player controller = game.getPlayer(source.getControllerId());
    MageObject sourceObject = source.getSourceObject(game);
    if (controller != null && sourceObject != null) {
        Card card = controller.getLibrary().getFromTop(game);
        if (card != null) {
            Cards cards = new CardsImpl(card);
            controller.revealCards(sourceObject.getIdName(), cards, game);
            if (card.isLand(game)) {
                new UntapSourceEffect().apply(game, source);
                game.addEffect(new BoostSourceEffect(1, 1, Duration.EndOfTurn), source);
            }
        }
        return true;
    }
    return false;
}
Also used : BoostSourceEffect(mage.abilities.effects.common.continuous.BoostSourceEffect) Player(mage.players.Player) MageObject(mage.MageObject) UntapSourceEffect(mage.abilities.effects.common.UntapSourceEffect) Cards(mage.cards.Cards) CardsImpl(mage.cards.CardsImpl) Card(mage.cards.Card)

Example 4 with UntapSourceEffect

use of mage.abilities.effects.common.UntapSourceEffect in project mage by magefree.

the class AzorsGatewayEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Player controller = game.getPlayer(source.getControllerId());
    UUID exileId = CardUtil.getCardExileZoneId(game, source);
    MageObject sourceObject = source.getSourceObject(game);
    if (controller != null && exileId != null && sourceObject != null) {
        controller.drawCards(1, source, game);
        TargetCardInHand target = new TargetCardInHand();
        controller.choose(outcome, target, source.getSourceId(), game);
        Card cardToExile = game.getCard(target.getFirstTarget());
        if (cardToExile != null) {
            controller.moveCardsToExile(cardToExile, source, game, true, exileId, sourceObject.getIdName());
        }
        Set<Integer> usedCMC = new HashSet<>();
        ExileZone exileZone = game.getExile().getExileZone(exileId);
        if (exileZone != null) {
            for (Card card : exileZone.getCards(game)) {
                usedCMC.add(card.getManaValue());
            }
            if (usedCMC.size() > 4) {
                controller.gainLife(4, game, source);
                new UntapSourceEffect().apply(game, source);
                new TransformSourceEffect().apply(game, source);
            }
        }
        return true;
    }
    return false;
}
Also used : Player(mage.players.Player) TargetCardInHand(mage.target.common.TargetCardInHand) TransformSourceEffect(mage.abilities.effects.common.TransformSourceEffect) MageObject(mage.MageObject) UntapSourceEffect(mage.abilities.effects.common.UntapSourceEffect) ExileZone(mage.game.ExileZone) UUID(java.util.UUID) Card(mage.cards.Card) HashSet(java.util.HashSet)

Aggregations

UntapSourceEffect (mage.abilities.effects.common.UntapSourceEffect)4 Player (mage.players.Player)4 MageObject (mage.MageObject)2 Card (mage.cards.Card)2 TargetPlayer (mage.target.TargetPlayer)2 HashSet (java.util.HashSet)1 UUID (java.util.UUID)1 DamageTargetEffect (mage.abilities.effects.common.DamageTargetEffect)1 TransformSourceEffect (mage.abilities.effects.common.TransformSourceEffect)1 BoostSourceEffect (mage.abilities.effects.common.continuous.BoostSourceEffect)1 Cards (mage.cards.Cards)1 CardsImpl (mage.cards.CardsImpl)1 ExileZone (mage.game.ExileZone)1 Permanent (mage.game.permanent.Permanent)1 TargetCardInHand (mage.target.common.TargetCardInHand)1