[ISD] Devil's Play

This commit is contained in:
Loki 2011-10-07 23:11:41 +03:00
parent 9fcc526e9a
commit 6eb6532614
3 changed files with 76 additions and 1 deletions

View file

@ -0,0 +1,69 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.innistrad;
import java.util.UUID;
import mage.Constants;
import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.dynamicvalue.common.ManacostVariableValue;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.keyword.FlashbackAbility;
import mage.cards.CardImpl;
import mage.target.common.TargetCreatureOrPlayer;
/**
*
* @author Loki
*/
public class DevilsPlay extends CardImpl<DevilsPlay> {
public DevilsPlay(UUID ownerId) {
super(ownerId, 140, "Devil's Play", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{X}{R}");
this.expansionSetCode = "ISD";
this.color.setRed(true);
// Devil's Play deals X damage to target creature or player.
this.getSpellAbility().addEffect(new DamageTargetEffect(new ManacostVariableValue()));
this.getSpellAbility().addTarget(new TargetCreatureOrPlayer());
// Flashback {X}{R}{R}{R}
this.addAbility(new FlashbackAbility(new ManaCostsImpl("{X}{R}{R}{R}"), Constants.TimingRule.SORCERY));
}
public DevilsPlay(final DevilsPlay card) {
super(card);
}
@Override
public DevilsPlay copy() {
return new DevilsPlay(this);
}
}

View file

@ -81,7 +81,7 @@ class MirrorMadPhantasmEffect extends OneShotEffect<MirrorMadPhantasmEffect> {
public MirrorMadPhantasmEffect() {
super(Outcome.Detriment);
this.staticText = "Mirror-Mad Phantasm's owner shuffles it into his or her library. If that player does, he or she reveals cards from the top of that library until a card named Mirror-Mad Phantasm is revealed. That player puts that card onto the battlefield and all other cards revealed this way into his or her graveyard";
this.staticText = "{this}'s owner shuffles it into his or her library. If that player does, he or she reveals cards from the top of that library until a card named Mirror-Mad Phantasm is revealed. That player puts that card onto the battlefield and all other cards revealed this way into his or her graveyard";
}
public MirrorMadPhantasmEffect(final MirrorMadPhantasmEffect effect) {

View file

@ -31,6 +31,8 @@ import mage.Constants;
import mage.abilities.Ability;
import mage.abilities.ActivatedAbilityImpl;
import mage.abilities.DelayedTriggeredAbility;
import mage.abilities.costs.Cost;
import mage.abilities.costs.mana.ManaCost;
import mage.abilities.costs.mana.ManaCosts;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
@ -111,6 +113,10 @@ class FlashbackEffect extends OneShotEffect<FlashbackEffect> {
if (target != null) {
Player controller = game.getPlayer(target.getOwnerId());
if (controller != null) {
target.getSpellAbility().getManaCostsToPay().clear();
for (Cost cost: source.getManaCostsToPay()) {
target.getSpellAbility().getManaCostsToPay().add((ManaCost) cost.copy());
}
return controller.cast(target.getSpellAbility(), game, true);
}
}