* Quick Sliver - Fixed that Sliver cards could be cast from every zone.

This commit is contained in:
LevelX2 2013-11-17 08:38:50 +01:00
parent a8ee9eb27d
commit 07ac55cdc4

View file

@ -29,19 +29,16 @@ package mage.sets.legions;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.AsThoughEffectImpl;
import mage.abilities.effects.common.continious.CastAsThoughItHadFlashEffect;
import mage.abilities.keyword.FlashAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.constants.AsThoughEffectType;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.filter.common.FilterCreatureCard;
import mage.filter.predicate.mageobject.SubtypePredicate;
/**
*
@ -49,6 +46,11 @@ import mage.game.Game;
*/
public class QuickSliver extends CardImpl<QuickSliver> {
private static final FilterCreatureCard filter = new FilterCreatureCard("Sliver cards");
static {
filter.add(new SubtypePredicate("Sliver"));
}
public QuickSliver(UUID ownerId) {
super(ownerId, 136, "Quick Sliver", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{G}");
this.expansionSetCode = "LGN";
@ -61,7 +63,7 @@ public class QuickSliver extends CardImpl<QuickSliver> {
// Flash
this.addAbility(FlashAbility.getInstance());
// Any player may play Sliver cards as though they had flash.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new QuickSliverEffect()));
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CastAsThoughItHadFlashEffect(Duration.WhileOnBattlefield, filter, true)));
}
public QuickSliver(final QuickSliver card) {
@ -73,37 +75,3 @@ public class QuickSliver extends CardImpl<QuickSliver> {
return new QuickSliver(this);
}
}
class QuickSliverEffect extends AsThoughEffectImpl<QuickSliverEffect> {
public QuickSliverEffect() {
super(AsThoughEffectType.CAST, Duration.WhileOnBattlefield, Outcome.Benefit);
staticText = "Any player may play Sliver cards as though they had flash";
}
public QuickSliverEffect(final QuickSliverEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
return true;
}
@Override
public QuickSliverEffect copy() {
return new QuickSliverEffect(this);
}
@Override
public boolean applies(UUID sourceId, Ability source, Game game) {
Card card = game.getCard(sourceId);
if (card != null) {
if (card.hasSubtype("Sliver")) {
return true;
}
}
return false;
}
}