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;
}
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;
}
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;
}
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;
}
Aggregations