use of mage.abilities.effects.common.ReturnToBattlefieldUnderYourControlTargetEffect in project mage by magefree.
the class SirensRuseEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
boolean isPirate = false;
Player player = game.getPlayer(source.getControllerId());
Permanent permanent = game.getPermanent(source.getFirstTarget());
if (permanent != null && permanent.hasSubtype(SubType.PIRATE, game)) {
isPirate = true;
}
if (super.apply(game, source)) {
new ReturnToBattlefieldUnderYourControlTargetEffect(false).apply(game, source);
if (isPirate && player != null) {
player.drawCards(1, source, game);
}
return true;
}
return false;
}
use of mage.abilities.effects.common.ReturnToBattlefieldUnderYourControlTargetEffect in project mage by magefree.
the class ThunderkinAwakenerEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
Card creatureCard = game.getCard(this.getTargetPointer().getFirst(game, source));
if (controller != null && creatureCard != null) {
// Return that card to the battlefield tapped and attacking
Effect effect = new ReturnToBattlefieldUnderYourControlTargetEffect(false, true, true);
effect.setTargetPointer(new FixedTarget(creatureCard.getId()));
effect.apply(game, source);
Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source));
if (permanent != null) {
// Sacrifice it at the beginning of the next end step
SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("Sacrifice " + permanent.getName(), source.getControllerId());
sacrificeEffect.setTargetPointer(new FixedTarget(permanent, game));
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect);
game.addDelayedTriggeredAbility(delayedAbility, source);
// info
InfoEffect.addInfoToPermanent(game, source, permanent, "<i><b>Warning</b>: It will be sacrificed at the beginning of the next end step<i>");
}
return true;
}
return false;
}
use of mage.abilities.effects.common.ReturnToBattlefieldUnderYourControlTargetEffect in project mage by magefree.
the class MarchesaTheBlackRoseEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Card card = game.getCard(getTargetPointer().getFirst(game, source));
if (card != null) {
Effect effect = new ReturnToBattlefieldUnderYourControlTargetEffect();
effect.setText("return that card to the battlefield under your control at the beginning of the next end step");
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(effect);
delayedAbility.getEffects().get(0).setTargetPointer(getTargetPointer());
game.addDelayedTriggeredAbility(delayedAbility, source);
return true;
}
return false;
}
use of mage.abilities.effects.common.ReturnToBattlefieldUnderYourControlTargetEffect in project mage by magefree.
the class ArgentSphinxEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
Permanent permanent = source.getSourcePermanentIfItStillExists(game);
if (player == null || permanent == null) {
return false;
}
Card card = permanent.getMainCard();
player.moveCards(permanent, Zone.EXILED, source, game);
// create delayed triggered ability
game.addDelayedTriggeredAbility(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new ReturnToBattlefieldUnderYourControlTargetEffect().setText("Return it to the battlefield under your control at the beginning of the next end step").setTargetPointer(new FixedTarget(card, game))), source);
return true;
}
Aggregations