mirror of
https://github.com/correl/mage.git
synced 2024-12-25 03:00:15 +00:00
* Snapcaster Mage - Target in graveyard is now madatory.
This commit is contained in:
parent
42a8029c2d
commit
91d50d8d7b
1 changed files with 12 additions and 12 deletions
|
@ -28,13 +28,6 @@
|
||||||
package mage.sets.innistrad;
|
package mage.sets.innistrad;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.constants.CardType;
|
|
||||||
import mage.constants.Duration;
|
|
||||||
import mage.constants.Layer;
|
|
||||||
import mage.constants.Outcome;
|
|
||||||
import mage.constants.Rarity;
|
|
||||||
import mage.constants.SubLayer;
|
|
||||||
import mage.constants.TimingRule;
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.MageObject;
|
import mage.MageObject;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
|
@ -44,6 +37,13 @@ import mage.abilities.keyword.FlashAbility;
|
||||||
import mage.abilities.keyword.FlashbackAbility;
|
import mage.abilities.keyword.FlashbackAbility;
|
||||||
import mage.cards.Card;
|
import mage.cards.Card;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
|
import mage.constants.CardType;
|
||||||
|
import mage.constants.Duration;
|
||||||
|
import mage.constants.Layer;
|
||||||
|
import mage.constants.Outcome;
|
||||||
|
import mage.constants.Rarity;
|
||||||
|
import mage.constants.SubLayer;
|
||||||
|
import mage.constants.TimingRule;
|
||||||
import mage.filter.FilterCard;
|
import mage.filter.FilterCard;
|
||||||
import mage.filter.predicate.Predicates;
|
import mage.filter.predicate.Predicates;
|
||||||
import mage.filter.predicate.mageobject.CardTypePredicate;
|
import mage.filter.predicate.mageobject.CardTypePredicate;
|
||||||
|
@ -74,10 +74,11 @@ public class SnapcasterMage extends CardImpl<SnapcasterMage> {
|
||||||
this.power = new MageInt(2);
|
this.power = new MageInt(2);
|
||||||
this.toughness = new MageInt(1);
|
this.toughness = new MageInt(1);
|
||||||
|
|
||||||
|
// Flash
|
||||||
this.addAbility(FlashAbility.getInstance());
|
this.addAbility(FlashAbility.getInstance());
|
||||||
// When Snapcaster Mage enters the battlefield, target instant or sorcery card in your graveyard gains flashback until end of turn. The flashback cost is equal to its mana cost.
|
// When Snapcaster Mage enters the battlefield, target instant or sorcery card in your graveyard gains flashback until end of turn. The flashback cost is equal to its mana cost.
|
||||||
Ability ability = new EntersBattlefieldTriggeredAbility(new SnapcasterMageEffect());
|
Ability ability = new EntersBattlefieldTriggeredAbility(new SnapcasterMageEffect());
|
||||||
ability.addTarget(new TargetCardInYourGraveyard(filter));
|
ability.addTarget(new TargetCardInYourGraveyard(filter, true));
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -113,15 +114,14 @@ class SnapcasterMageEffect extends ContinuousEffectImpl<SnapcasterMageEffect> {
|
||||||
Card card = game.getCard(targetPointer.getFirst(game, source));
|
Card card = game.getCard(targetPointer.getFirst(game, source));
|
||||||
MageObject sourceObject = game.getObject(source.getSourceId());
|
MageObject sourceObject = game.getObject(source.getSourceId());
|
||||||
if (card != null && sourceObject != null) {
|
if (card != null && sourceObject != null) {
|
||||||
game.informPlayers(new StringBuilder(sourceObject.getName()).append(" gives Flashback to ").append(card.getName()).toString());
|
game.informPlayers(new StringBuilder(sourceObject.getName()).append(" gives flashback to ").append(card.getName()).toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Card card = game.getCard(targetPointer.getFirst(game, source));
|
Card card = game.getCard(targetPointer.getFirst(game, source));
|
||||||
MageObject sourceObject = game.getObject(source.getSourceId());
|
if (card != null) {
|
||||||
if (card != null && sourceObject != null) {
|
|
||||||
FlashbackAbility ability;
|
FlashbackAbility ability;
|
||||||
if (card.getCardType().contains(CardType.INSTANT)) {
|
if (card.getCardType().contains(CardType.INSTANT)) {
|
||||||
ability = new FlashbackAbility(card.getManaCost(), TimingRule.INSTANT);
|
ability = new FlashbackAbility(card.getManaCost(), TimingRule.INSTANT);
|
||||||
|
|
Loading…
Reference in a new issue