mirror of
https://github.com/correl/mage.git
synced 2024-12-26 11:09:27 +00:00
[VOW] Implemented Wash Away
This commit is contained in:
parent
d2de2229e9
commit
4088159bf9
3 changed files with 53 additions and 4 deletions
49
Mage.Sets/src/mage/cards/w/WashAway.java
Normal file
49
Mage.Sets/src/mage/cards/w/WashAway.java
Normal file
|
@ -0,0 +1,49 @@
|
|||
package mage.cards.w;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.common.CounterTargetEffect;
|
||||
import mage.abilities.keyword.CleaveAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.FilterSpell;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.predicate.card.CastFromZonePredicate;
|
||||
import mage.target.TargetSpell;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class WashAway extends CardImpl {
|
||||
|
||||
private static final FilterSpell filter = new FilterSpell("spell [that wasn't cast from its owner's hand]");
|
||||
|
||||
static {
|
||||
filter.add(Predicates.not(new CastFromZonePredicate(Zone.HAND)));
|
||||
}
|
||||
|
||||
public WashAway(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{U}");
|
||||
|
||||
// Cleave {1}{U}{U}
|
||||
Ability ability = new CleaveAbility(this, new CounterTargetEffect(), "{1}{U}{U}");
|
||||
ability.addTarget(new TargetSpell());
|
||||
this.addAbility(ability);
|
||||
|
||||
// Counter target spell [that wasn't cast from its owner's hand].
|
||||
this.getSpellAbility().addEffect(new CounterTargetEffect());
|
||||
this.getSpellAbility().addTarget(new TargetSpell(filter));
|
||||
}
|
||||
|
||||
private WashAway(final WashAway card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WashAway copy() {
|
||||
return new WashAway(this);
|
||||
}
|
||||
}
|
|
@ -169,6 +169,7 @@ public final class InnistradCrimsonVow extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Voice of the Blessed", 44, Rarity.RARE, mage.cards.v.VoiceOfTheBlessed.class));
|
||||
cards.add(new SetCardInfo("Volatile Arsonist", 181, Rarity.MYTHIC, mage.cards.v.VolatileArsonist.class));
|
||||
cards.add(new SetCardInfo("Voldaren Estate", 267, Rarity.RARE, mage.cards.v.VoldarenEstate.class));
|
||||
cards.add(new SetCardInfo("Wash Away", 87, Rarity.UNCOMMON, mage.cards.w.WashAway.class));
|
||||
cards.add(new SetCardInfo("Weary Prisoner", 184, Rarity.COMMON, mage.cards.w.WearyPrisoner.class));
|
||||
cards.add(new SetCardInfo("Weaver of Blossoms", 226, Rarity.COMMON, mage.cards.w.WeaverOfBlossoms.class));
|
||||
cards.add(new SetCardInfo("Wedding Announcement", 45, Rarity.RARE, mage.cards.w.WeddingAnnouncement.class));
|
||||
|
|
|
@ -1,16 +1,15 @@
|
|||
package mage.filter.predicate.card;
|
||||
|
||||
import mage.cards.Card;
|
||||
import mage.MageObject;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.predicate.Predicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.stack.Spell;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class CastFromZonePredicate implements Predicate<Card> {
|
||||
public class CastFromZonePredicate implements Predicate<MageObject> {
|
||||
|
||||
private final Zone zone;
|
||||
|
||||
|
@ -19,7 +18,7 @@ public class CastFromZonePredicate implements Predicate<Card> {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Card input, Game game) {
|
||||
public boolean apply(MageObject input, Game game) {
|
||||
if (input instanceof Spell) {
|
||||
return zone.match(((Spell) input).getFromZone());
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue