forked from External/mage
[SPM] Implement Spider-Sense
This commit is contained in:
parent
30ca433785
commit
c091795a97
2 changed files with 64 additions and 0 deletions
61
Mage.Sets/src/mage/cards/s/SpiderSense.java
Normal file
61
Mage.Sets/src/mage/cards/s/SpiderSense.java
Normal file
|
|
@ -0,0 +1,61 @@
|
||||||
|
package mage.cards.s;
|
||||||
|
|
||||||
|
import mage.abilities.Ability;
|
||||||
|
import mage.abilities.effects.common.CounterTargetEffect;
|
||||||
|
import mage.abilities.keyword.WebSlingingAbility;
|
||||||
|
import mage.cards.CardImpl;
|
||||||
|
import mage.cards.CardSetInfo;
|
||||||
|
import mage.constants.CardType;
|
||||||
|
import mage.filter.FilterStackObject;
|
||||||
|
import mage.filter.predicate.Predicate;
|
||||||
|
import mage.game.Game;
|
||||||
|
import mage.game.stack.Spell;
|
||||||
|
import mage.game.stack.StackObject;
|
||||||
|
import mage.target.TargetStackObject;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author TheElk801
|
||||||
|
*/
|
||||||
|
public final class SpiderSense extends CardImpl {
|
||||||
|
|
||||||
|
private static final FilterStackObject filter
|
||||||
|
= new FilterStackObject("instant spell, sorcery spell, or triggered ability");
|
||||||
|
|
||||||
|
static {
|
||||||
|
filter.add(SpiderSensePredicate.instance);
|
||||||
|
}
|
||||||
|
|
||||||
|
public SpiderSense(UUID ownerId, CardSetInfo setInfo) {
|
||||||
|
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{U}");
|
||||||
|
|
||||||
|
// Web-slinging {U}
|
||||||
|
this.addAbility(new WebSlingingAbility(this, "{U}"));
|
||||||
|
|
||||||
|
// Counter target instant spell, sorcery spell, or triggered ability.
|
||||||
|
this.getSpellAbility().addEffect(new CounterTargetEffect());
|
||||||
|
this.getSpellAbility().addTarget(new TargetStackObject(filter));
|
||||||
|
}
|
||||||
|
|
||||||
|
private SpiderSense(final SpiderSense card) {
|
||||||
|
super(card);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SpiderSense copy() {
|
||||||
|
return new SpiderSense(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
enum SpiderSensePredicate implements Predicate<StackObject> {
|
||||||
|
instance;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean apply(StackObject input, Game game) {
|
||||||
|
if (input instanceof Spell) {
|
||||||
|
return input.isInstantOrSorcery(game);
|
||||||
|
}
|
||||||
|
return input instanceof Ability && ((Ability) input).isTriggeredAbility();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -201,6 +201,9 @@ public final class MarvelsSpiderMan extends ExpansionSet {
|
||||||
cards.add(new SetCardInfo("Spider-Punk", 210, Rarity.RARE, mage.cards.s.SpiderPunk.class, NON_FULL_USE_VARIOUS));
|
cards.add(new SetCardInfo("Spider-Punk", 210, Rarity.RARE, mage.cards.s.SpiderPunk.class, NON_FULL_USE_VARIOUS));
|
||||||
cards.add(new SetCardInfo("Spider-Punk", 92, Rarity.RARE, mage.cards.s.SpiderPunk.class, NON_FULL_USE_VARIOUS));
|
cards.add(new SetCardInfo("Spider-Punk", 92, Rarity.RARE, mage.cards.s.SpiderPunk.class, NON_FULL_USE_VARIOUS));
|
||||||
cards.add(new SetCardInfo("Spider-Rex, Daring Dino", 116, Rarity.COMMON, mage.cards.s.SpiderRexDaringDino.class));
|
cards.add(new SetCardInfo("Spider-Rex, Daring Dino", 116, Rarity.COMMON, mage.cards.s.SpiderRexDaringDino.class));
|
||||||
|
cards.add(new SetCardInfo("Spider-Sense", 254, Rarity.RARE, mage.cards.s.SpiderSense.class, NON_FULL_USE_VARIOUS));
|
||||||
|
cards.add(new SetCardInfo("Spider-Sense", 284, Rarity.RARE, mage.cards.s.SpiderSense.class, NON_FULL_USE_VARIOUS));
|
||||||
|
cards.add(new SetCardInfo("Spider-Sense", 46, Rarity.RARE, mage.cards.s.SpiderSense.class, NON_FULL_USE_VARIOUS));
|
||||||
cards.add(new SetCardInfo("Spider-Suit", 176, Rarity.UNCOMMON, mage.cards.s.SpiderSuit.class));
|
cards.add(new SetCardInfo("Spider-Suit", 176, Rarity.UNCOMMON, mage.cards.s.SpiderSuit.class));
|
||||||
cards.add(new SetCardInfo("Spider-UK", 17, Rarity.UNCOMMON, mage.cards.s.SpiderUK.class));
|
cards.add(new SetCardInfo("Spider-UK", 17, Rarity.UNCOMMON, mage.cards.s.SpiderUK.class));
|
||||||
cards.add(new SetCardInfo("Spider-Woman, Stunning Savior", 152, Rarity.RARE, mage.cards.s.SpiderWomanStunningSavior.class, NON_FULL_USE_VARIOUS));
|
cards.add(new SetCardInfo("Spider-Woman, Stunning Savior", 152, Rarity.RARE, mage.cards.s.SpiderWomanStunningSavior.class, NON_FULL_USE_VARIOUS));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue