trap subtype

This commit is contained in:
igoudt 2017-07-25 23:11:47 +02:00
parent 60b9cd1157
commit 3fb0e04352
18 changed files with 84 additions and 69 deletions

View file

@ -27,8 +27,6 @@
*/ */
package mage.cards.b; package mage.cards.b;
import java.util.List;
import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.condition.Condition; import mage.abilities.condition.Condition;
import mage.abilities.costs.AlternativeCostSourceAbility; import mage.abilities.costs.AlternativeCostSourceAbility;
@ -37,11 +35,15 @@ import mage.abilities.effects.common.CreateTokenEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.SubType;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.game.permanent.token.BeastToken2; import mage.game.permanent.token.BeastToken2;
import mage.watchers.common.PermanentsEnteredBattlefieldWatcher; import mage.watchers.common.PermanentsEnteredBattlefieldWatcher;
import java.util.List;
import java.util.UUID;
/** /**
* @author jeffwadsworth * @author jeffwadsworth
*/ */
@ -49,7 +51,7 @@ public class BalothCageTrap extends CardImpl {
public BalothCageTrap(UUID ownerId, CardSetInfo setInfo) { public BalothCageTrap(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{3}{G}{G}"); super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{3}{G}{G}");
this.subtype.add("Trap"); this.subtype.add(SubType.TRAP);
// If an opponent had an artifact enter the battlefield under his or her control this turn, you may pay {1}{G} rather than pay Baloth Cage Trap's mana cost. // If an opponent had an artifact enter the battlefield under his or her control this turn, you may pay {1}{G} rather than pay Baloth Cage Trap's mana cost.
this.addAbility(new AlternativeCostSourceAbility(new ManaCostsImpl("{1}{G}"), BalothCageTrapCondition.instance), new PermanentsEnteredBattlefieldWatcher()); this.addAbility(new AlternativeCostSourceAbility(new ManaCostsImpl("{1}{G}"), BalothCageTrapCondition.instance), new PermanentsEnteredBattlefieldWatcher());

View file

@ -27,9 +27,6 @@
*/ */
package mage.cards.c; package mage.cards.c;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.condition.Condition; import mage.abilities.condition.Condition;
import mage.abilities.costs.AlternativeCostSourceAbility; import mage.abilities.costs.AlternativeCostSourceAbility;
@ -38,6 +35,7 @@ import mage.abilities.effects.common.CreateTokenEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.WatcherScope; import mage.constants.WatcherScope;
import mage.game.Game; import mage.game.Game;
import mage.game.events.GameEvent; import mage.game.events.GameEvent;
@ -47,6 +45,10 @@ import mage.game.permanent.token.SnakeToken;
import mage.game.stack.StackObject; import mage.game.stack.StackObject;
import mage.watchers.Watcher; import mage.watchers.Watcher;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
/** /**
* @author Rafbill * @author Rafbill
*/ */
@ -54,7 +56,7 @@ public class CobraTrap extends CardImpl {
public CobraTrap(UUID ownerId, CardSetInfo setInfo) { public CobraTrap(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{4}{G}{G}"); super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{4}{G}{G}");
this.subtype.add("Trap"); this.subtype.add(SubType.TRAP);
// If a noncreature permanent under your control was destroyed this turn by a spell or ability an opponent controlled, you may pay {G} rather than pay Cobra Trap's mana cost. // If a noncreature permanent under your control was destroyed this turn by a spell or ability an opponent controlled, you may pay {G} rather than pay Cobra Trap's mana cost.
this.addAbility(new AlternativeCostSourceAbility(new ManaCostsImpl("{G}"), CobraTrapCondition.instance), new CobraTrapWatcher()); this.addAbility(new AlternativeCostSourceAbility(new ManaCostsImpl("{G}"), CobraTrapCondition.instance), new CobraTrapWatcher());

View file

@ -27,11 +27,6 @@
*/ */
package mage.cards.i; package mage.cards.i;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
import mage.MageObjectReference; import mage.MageObjectReference;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.condition.Condition; import mage.abilities.condition.Condition;
@ -41,6 +36,7 @@ import mage.abilities.effects.common.DamageTargetEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.WatcherScope; import mage.constants.WatcherScope;
import mage.game.Game; import mage.game.Game;
import mage.game.events.GameEvent; import mage.game.events.GameEvent;
@ -48,6 +44,8 @@ import mage.game.permanent.Permanent;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
import mage.watchers.Watcher; import mage.watchers.Watcher;
import java.util.*;
/** /**
* @author jeffwadsworth * @author jeffwadsworth
*/ */
@ -55,7 +53,7 @@ public class InfernoTrap extends CardImpl {
public InfernoTrap(UUID ownerId, CardSetInfo setInfo) { public InfernoTrap(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{3}{R}"); super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{3}{R}");
this.subtype.add("Trap"); this.subtype.add(SubType.TRAP);
// If you've been dealt damage by two or more creatures this turn, you may pay {R} rather than pay Inferno Trap's mana cost. // If you've been dealt damage by two or more creatures this turn, you may pay {R} rather than pay Inferno Trap's mana cost.
this.addAbility(new AlternativeCostSourceAbility(new ManaCostsImpl("{R}"), InfernoTrapCondition.instance), new InfernoTrapWatcher()); this.addAbility(new AlternativeCostSourceAbility(new ManaCostsImpl("{R}"), InfernoTrapCondition.instance), new InfernoTrapWatcher());

View file

@ -27,8 +27,6 @@
*/ */
package mage.cards.l; package mage.cards.l;
import java.util.List;
import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.condition.Condition; import mage.abilities.condition.Condition;
import mage.abilities.costs.AlternativeCostSourceAbility; import mage.abilities.costs.AlternativeCostSourceAbility;
@ -38,6 +36,7 @@ import mage.abilities.effects.common.DestroyTargetEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.SubType;
import mage.filter.StaticFilters; import mage.filter.StaticFilters;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game; import mage.game.Game;
@ -45,6 +44,9 @@ import mage.game.permanent.Permanent;
import mage.target.common.TargetLandPermanent; import mage.target.common.TargetLandPermanent;
import mage.watchers.common.PermanentsEnteredBattlefieldWatcher; import mage.watchers.common.PermanentsEnteredBattlefieldWatcher;
import java.util.List;
import java.util.UUID;
/** /**
* *
* @author jeffwadsworth * @author jeffwadsworth
@ -53,7 +55,7 @@ public class LavaballTrap extends CardImpl {
public LavaballTrap(UUID ownerId, CardSetInfo setInfo) { public LavaballTrap(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{6}{R}{R}"); super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{6}{R}{R}");
this.subtype.add("Trap"); this.subtype.add(SubType.TRAP);
// If an opponent had two or more lands enter the battlefield under his or her control this turn, you may pay {3}{R}{R} rather than pay Lavaball Trap's mana cost. // If an opponent had two or more lands enter the battlefield under his or her control this turn, you may pay {3}{R}{R} rather than pay Lavaball Trap's mana cost.
this.addAbility(new AlternativeCostSourceAbility(new ManaCostsImpl("{3}{R}{R}"), LavaballTrapCondition.instance), new PermanentsEnteredBattlefieldWatcher()); this.addAbility(new AlternativeCostSourceAbility(new ManaCostsImpl("{3}{R}{R}"), LavaballTrapCondition.instance), new PermanentsEnteredBattlefieldWatcher());

View file

@ -27,7 +27,6 @@
*/ */
package mage.cards.l; package mage.cards.l;
import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.condition.Condition; import mage.abilities.condition.Condition;
import mage.abilities.costs.AlternativeCostSourceAbility; import mage.abilities.costs.AlternativeCostSourceAbility;
@ -37,10 +36,13 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.SubType;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.AttackingPredicate; import mage.filter.predicate.permanent.AttackingPredicate;
import mage.game.Game; import mage.game.Game;
import java.util.UUID;
/** /**
* *
* @author jeffwadsworth * @author jeffwadsworth
@ -55,7 +57,7 @@ public class LethargyTrap extends CardImpl {
public LethargyTrap(UUID ownerId, CardSetInfo setInfo) { public LethargyTrap(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{3}{U}"); super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{3}{U}");
this.subtype.add("Trap"); this.subtype.add(SubType.TRAP);
// If three or more creatures are attacking, you may pay {U} rather than pay Lethargy Trap's mana cost. // If three or more creatures are attacking, you may pay {U} rather than pay Lethargy Trap's mana cost.
this.addAbility(new AlternativeCostSourceAbility(new ManaCostsImpl("{U}"), LethargyTrapCondition.instance)); this.addAbility(new AlternativeCostSourceAbility(new ManaCostsImpl("{U}"), LethargyTrapCondition.instance));

View file

@ -27,7 +27,6 @@
*/ */
package mage.cards.m; package mage.cards.m;
import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.condition.Condition; import mage.abilities.condition.Condition;
import mage.abilities.costs.AlternativeCostSourceAbility; import mage.abilities.costs.AlternativeCostSourceAbility;
@ -36,11 +35,14 @@ import mage.abilities.effects.common.ExileTargetEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.SubType;
import mage.filter.FilterSpell; import mage.filter.FilterSpell;
import mage.game.Game; import mage.game.Game;
import mage.target.TargetSpell; import mage.target.TargetSpell;
import mage.watchers.common.CastSpellLastTurnWatcher; import mage.watchers.common.CastSpellLastTurnWatcher;
import java.util.UUID;
/** /**
* @author Rafbill * @author Rafbill
*/ */
@ -50,7 +52,7 @@ public class MindbreakTrap extends CardImpl {
public MindbreakTrap(UUID ownerId, CardSetInfo setInfo) { public MindbreakTrap(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{U}{U}"); super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{U}{U}");
this.subtype.add("Trap"); this.subtype.add(SubType.TRAP);
// If an opponent cast three or more spells this turn, you may pay {0} rather than pay Mindbreak Trap's mana cost. // If an opponent cast three or more spells this turn, you may pay {0} rather than pay Mindbreak Trap's mana cost.
this.addAbility(new AlternativeCostSourceAbility(new GenericManaCost(0), MindbreakTrapCondition.instance)); this.addAbility(new AlternativeCostSourceAbility(new GenericManaCost(0), MindbreakTrapCondition.instance));

View file

@ -27,7 +27,6 @@
*/ */
package mage.cards.n; package mage.cards.n;
import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.condition.Condition; import mage.abilities.condition.Condition;
import mage.abilities.costs.AlternativeCostSourceAbility; import mage.abilities.costs.AlternativeCostSourceAbility;
@ -37,10 +36,13 @@ import mage.abilities.effects.common.LoseLifeTargetEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.SubType;
import mage.game.Game; import mage.game.Game;
import mage.target.TargetPlayer; import mage.target.TargetPlayer;
import mage.watchers.common.PlayerGainedLifeWatcher; import mage.watchers.common.PlayerGainedLifeWatcher;
import java.util.UUID;
/** /**
* @author LevelX2 * @author LevelX2
*/ */
@ -48,7 +50,7 @@ public class NeedlebiteTrap extends CardImpl {
public NeedlebiteTrap(UUID ownerId, CardSetInfo setInfo) { public NeedlebiteTrap(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{5}{B}{B}"); super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{5}{B}{B}");
this.subtype.add("Trap"); this.subtype.add(SubType.TRAP);
// If an opponent gained life this turn, you may pay {B} rather than pay Needlebite Trap's mana cost. // If an opponent gained life this turn, you may pay {B} rather than pay Needlebite Trap's mana cost.
this.addAbility(new AlternativeCostSourceAbility(new ManaCostsImpl("{B}"), NeedlebiteTrapCondition.instance), new PlayerGainedLifeWatcher()); this.addAbility(new AlternativeCostSourceAbility(new ManaCostsImpl("{B}"), NeedlebiteTrapCondition.instance), new PlayerGainedLifeWatcher());

View file

@ -27,7 +27,6 @@
*/ */
package mage.cards.n; package mage.cards.n;
import java.util.UUID;
import mage.ObjectColor; import mage.ObjectColor;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility; import mage.abilities.DelayedTriggeredAbility;
@ -41,10 +40,7 @@ import mage.abilities.effects.common.ExileTargetEffect;
import mage.abilities.effects.common.PutTokenOntoBattlefieldCopyTargetEffect; import mage.abilities.effects.common.PutTokenOntoBattlefieldCopyTargetEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.*;
import mage.constants.ComparisonType;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.ColorPredicate; import mage.filter.predicate.mageobject.ColorPredicate;
import mage.filter.predicate.permanent.AttackingPredicate; import mage.filter.predicate.permanent.AttackingPredicate;
@ -54,6 +50,8 @@ import mage.players.Player;
import mage.target.common.TargetAttackingCreature; import mage.target.common.TargetAttackingCreature;
import mage.target.targetpointer.FixedTarget; import mage.target.targetpointer.FixedTarget;
import java.util.UUID;
/** /**
* *
* @author jeffwadsworth * @author jeffwadsworth
@ -69,7 +67,7 @@ public class NemesisTrap extends CardImpl {
public NemesisTrap(UUID ownerId, CardSetInfo setInfo) { public NemesisTrap(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{4}{B}{B}"); super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{4}{B}{B}");
this.subtype.add("Trap"); this.subtype.add(SubType.TRAP);
// If a white creature is attacking, you may pay {B}{B} rather than pay Nemesis Trap's mana cost. // If a white creature is attacking, you may pay {B}{B} rather than pay Nemesis Trap's mana cost.
this.addAbility(new AlternativeCostSourceAbility(new ManaCostsImpl("{B}{B}"), new PermanentsOnTheBattlefieldCondition(filter, ComparisonType.MORE_THAN, 0, false))); this.addAbility(new AlternativeCostSourceAbility(new ManaCostsImpl("{B}{B}"), new PermanentsOnTheBattlefieldCondition(filter, ComparisonType.MORE_THAN, 0, false)));

View file

@ -27,8 +27,6 @@
*/ */
package mage.cards.p; package mage.cards.p;
import java.util.List;
import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.condition.Condition; import mage.abilities.condition.Condition;
import mage.abilities.costs.AlternativeCostSourceAbility; import mage.abilities.costs.AlternativeCostSourceAbility;
@ -37,12 +35,16 @@ import mage.abilities.effects.common.DontUntapInControllersNextUntapStepTargetEf
import mage.abilities.effects.common.TapTargetEffect; import mage.abilities.effects.common.TapTargetEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.*; import mage.constants.CardType;
import mage.constants.SubType;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
import mage.watchers.common.PermanentsEnteredBattlefieldWatcher; import mage.watchers.common.PermanentsEnteredBattlefieldWatcher;
import java.util.List;
import java.util.UUID;
/** /**
* *
* @author jeffwadsworth * @author jeffwadsworth
@ -51,7 +53,7 @@ public class PermafrostTrap extends CardImpl {
public PermafrostTrap(UUID ownerId, CardSetInfo setInfo) { public PermafrostTrap(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{2}{U}{U}"); super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{2}{U}{U}");
this.subtype.add("Trap"); this.subtype.add(SubType.TRAP);
// If an opponent had a green creature enter the battlefield under his or her control this turn, you may pay {U} rather than pay Permafrost Trap's mana cost. // If an opponent had a green creature enter the battlefield under his or her control this turn, you may pay {U} rather than pay Permafrost Trap's mana cost.
this.addAbility(new AlternativeCostSourceAbility(new ManaCostsImpl("{U}"), PermafrostTrapCondition.instance), new PermanentsEnteredBattlefieldWatcher()); this.addAbility(new AlternativeCostSourceAbility(new ManaCostsImpl("{U}"), PermafrostTrapCondition.instance), new PermanentsEnteredBattlefieldWatcher());

View file

@ -27,7 +27,6 @@
*/ */
package mage.cards.p; package mage.cards.p;
import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.condition.Condition; import mage.abilities.condition.Condition;
import mage.abilities.costs.AlternativeCostSourceAbility; import mage.abilities.costs.AlternativeCostSourceAbility;
@ -37,12 +36,15 @@ import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.SubType;
import mage.filter.common.FilterAttackingCreature; import mage.filter.common.FilterAttackingCreature;
import mage.filter.predicate.Predicates; import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.AbilityPredicate; import mage.filter.predicate.mageobject.AbilityPredicate;
import mage.game.Game; import mage.game.Game;
import mage.target.common.TargetAttackingCreature; import mage.target.common.TargetAttackingCreature;
import java.util.UUID;
/** /**
* *
* @author jeffwadsworth * @author jeffwadsworth
@ -57,7 +59,7 @@ public class PitfallTrap extends CardImpl {
public PitfallTrap(UUID ownerId, CardSetInfo setInfo) { public PitfallTrap(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{2}{W}"); super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{2}{W}");
this.subtype.add("Trap"); this.subtype.add(SubType.TRAP);
// If exactly one creature is attacking, you may pay {W} rather than pay Pitfall Trap's mana cost. // If exactly one creature is attacking, you may pay {W} rather than pay Pitfall Trap's mana cost.
this.addAbility(new AlternativeCostSourceAbility(new ManaCostsImpl("{W}"), PitfallTrapCondition.instance)); this.addAbility(new AlternativeCostSourceAbility(new ManaCostsImpl("{W}"), PitfallTrapCondition.instance));

View file

@ -27,7 +27,6 @@
*/ */
package mage.cards.r; package mage.cards.r;
import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.condition.Condition; import mage.abilities.condition.Condition;
import mage.abilities.costs.AlternativeCostSourceAbility; import mage.abilities.costs.AlternativeCostSourceAbility;
@ -36,10 +35,13 @@ import mage.abilities.effects.common.ExileGraveyardAllTargetPlayerEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.SubType;
import mage.game.Game; import mage.game.Game;
import mage.target.TargetPlayer; import mage.target.TargetPlayer;
import mage.watchers.common.CardsPutIntoGraveyardWatcher; import mage.watchers.common.CardsPutIntoGraveyardWatcher;
import java.util.UUID;
/** /**
* *
* @author LevelX2 * @author LevelX2
@ -48,7 +50,7 @@ public class RavenousTrap extends CardImpl {
public RavenousTrap(UUID ownerId, CardSetInfo setInfo) { public RavenousTrap(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{2}{B}{B}"); super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{2}{B}{B}");
this.subtype.add("Trap"); this.subtype.add(SubType.TRAP);
// If an opponent had three or more cards put into his or her graveyard from anywhere this turn, you may pay {0} rather than pay Ravenous Trap's mana cost. // If an opponent had three or more cards put into his or her graveyard from anywhere this turn, you may pay {0} rather than pay Ravenous Trap's mana cost.
this.addAbility(new AlternativeCostSourceAbility(new ManaCostsImpl("{0}"), RavenousTrapCondition.instance), new CardsPutIntoGraveyardWatcher()); this.addAbility(new AlternativeCostSourceAbility(new ManaCostsImpl("{0}"), RavenousTrapCondition.instance), new CardsPutIntoGraveyardWatcher());

View file

@ -27,8 +27,6 @@
*/ */
package mage.cards.r; package mage.cards.r;
import java.util.List;
import java.util.UUID;
import mage.MageObject; import mage.MageObject;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.condition.Condition; import mage.abilities.condition.Condition;
@ -41,6 +39,7 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Duration; import mage.constants.Duration;
import mage.constants.Outcome; import mage.constants.Outcome;
import mage.constants.SubType;
import mage.game.Game; import mage.game.Game;
import mage.game.events.GameEvent; import mage.game.events.GameEvent;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
@ -51,6 +50,9 @@ import mage.target.TargetSource;
import mage.target.common.TargetCreatureOrPlayer; import mage.target.common.TargetCreatureOrPlayer;
import mage.watchers.common.SpellsCastWatcher; import mage.watchers.common.SpellsCastWatcher;
import java.util.List;
import java.util.UUID;
/** /**
* @author jeffwadsworth * @author jeffwadsworth
*/ */
@ -58,7 +60,7 @@ public class RefractionTrap extends CardImpl {
public RefractionTrap(UUID ownerId, CardSetInfo setInfo) { public RefractionTrap(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{3}{W}"); super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{3}{W}");
this.subtype.add("Trap"); this.subtype.add(SubType.TRAP);
// If an opponent cast a red instant or sorcery spell this turn, you may pay {W} rather than pay Refraction Trap's mana cost. // If an opponent cast a red instant or sorcery spell this turn, you may pay {W} rather than pay Refraction Trap's mana cost.
this.addAbility(new AlternativeCostSourceAbility(new ManaCostsImpl("{W}"), RefractionTrapCondition.instance), new SpellsCastWatcher()); this.addAbility(new AlternativeCostSourceAbility(new ManaCostsImpl("{W}"), RefractionTrapCondition.instance), new SpellsCastWatcher());

View file

@ -27,8 +27,6 @@
*/ */
package mage.cards.r; package mage.cards.r;
import java.util.List;
import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.condition.Condition; import mage.abilities.condition.Condition;
import mage.abilities.costs.AlternativeCostSourceAbility; import mage.abilities.costs.AlternativeCostSourceAbility;
@ -37,6 +35,7 @@ import mage.abilities.effects.common.ChooseNewTargetsTargetEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.SubType;
import mage.filter.FilterSpell; import mage.filter.FilterSpell;
import mage.filter.predicate.mageobject.NumberOfTargetsPredicate; import mage.filter.predicate.mageobject.NumberOfTargetsPredicate;
import mage.game.Game; import mage.game.Game;
@ -44,6 +43,9 @@ import mage.game.stack.Spell;
import mage.target.TargetSpell; import mage.target.TargetSpell;
import mage.watchers.common.SpellsCastWatcher; import mage.watchers.common.SpellsCastWatcher;
import java.util.List;
import java.util.UUID;
/** /**
* @author jeffwadsworth * @author jeffwadsworth
*/ */
@ -57,7 +59,7 @@ public class RicochetTrap extends CardImpl {
public RicochetTrap(UUID ownerId, CardSetInfo setInfo) { public RicochetTrap(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{3}{R}"); super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{3}{R}");
this.subtype.add("Trap"); this.subtype.add(SubType.TRAP);
// If an opponent cast a blue spell this turn, you may pay {R} rather than pay Ricochet Trap's mana cost. // If an opponent cast a blue spell this turn, you may pay {R} rather than pay Ricochet Trap's mana cost.
this.addAbility(new AlternativeCostSourceAbility(new ManaCostsImpl("{R}"), RicochetTrapCondition.instance)); this.addAbility(new AlternativeCostSourceAbility(new ManaCostsImpl("{R}"), RicochetTrapCondition.instance));

View file

@ -27,7 +27,6 @@
*/ */
package mage.cards.r; package mage.cards.r;
import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.condition.Condition; import mage.abilities.condition.Condition;
import mage.abilities.costs.AlternativeCostSourceAbility; import mage.abilities.costs.AlternativeCostSourceAbility;
@ -38,11 +37,14 @@ import mage.abilities.effects.common.DamageTargetEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.SubType;
import mage.game.Game; import mage.game.Game;
import mage.players.Player; import mage.players.Player;
import mage.target.TargetPlayer; import mage.target.TargetPlayer;
import mage.watchers.common.CardsAmountDrawnThisTurnWatcher; import mage.watchers.common.CardsAmountDrawnThisTurnWatcher;
import java.util.UUID;
/** /**
* *
* @author jeffwadsworth * @author jeffwadsworth
@ -51,7 +53,7 @@ public class RuneflareTrap extends CardImpl {
public RuneflareTrap(UUID ownerId, CardSetInfo setInfo) { public RuneflareTrap(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{4}{R}{R}"); super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{4}{R}{R}");
this.subtype.add("Trap"); this.subtype.add(SubType.TRAP);
// If an opponent drew three or more cards this turn, you may pay {R} rather than pay Runeflare Trap's mana cost. // If an opponent drew three or more cards this turn, you may pay {R} rather than pay Runeflare Trap's mana cost.
this.addAbility(new AlternativeCostSourceAbility(new ManaCostsImpl("{R}"), RuneflareTrapCondition.instance), new CardsAmountDrawnThisTurnWatcher()); this.addAbility(new AlternativeCostSourceAbility(new ManaCostsImpl("{R}"), RuneflareTrapCondition.instance), new CardsAmountDrawnThisTurnWatcher());

View file

@ -27,7 +27,6 @@
*/ */
package mage.cards.s; package mage.cards.s;
import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.condition.Condition; import mage.abilities.condition.Condition;
import mage.abilities.costs.AlternativeCostSourceAbility; import mage.abilities.costs.AlternativeCostSourceAbility;
@ -37,12 +36,15 @@ import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.SubType;
import mage.filter.common.FilterAttackingCreature; import mage.filter.common.FilterAttackingCreature;
import mage.filter.predicate.mageobject.AbilityPredicate; import mage.filter.predicate.mageobject.AbilityPredicate;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.target.common.TargetAttackingCreature; import mage.target.common.TargetAttackingCreature;
import java.util.UUID;
/** /**
* @author jeffwadsworth * @author jeffwadsworth
*/ */
@ -56,7 +58,7 @@ public class SlingbowTrap extends CardImpl {
public SlingbowTrap(UUID ownerId, CardSetInfo setInfo) { public SlingbowTrap(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{3}{G}"); super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{3}{G}");
this.subtype.add("Trap"); this.subtype.add(SubType.TRAP);
// If a black creature with flying is attacking, you may pay {G} rather than pay Slingbow Trap's mana cost. // If a black creature with flying is attacking, you may pay {G} rather than pay Slingbow Trap's mana cost.
this.addAbility(new AlternativeCostSourceAbility(new ManaCostsImpl("{G}"), SlingbowTrapCondition.instance)); this.addAbility(new AlternativeCostSourceAbility(new ManaCostsImpl("{G}"), SlingbowTrapCondition.instance));

View file

@ -27,7 +27,6 @@
*/ */
package mage.cards.s; package mage.cards.s;
import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.SpellAbility; import mage.abilities.SpellAbility;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
@ -36,17 +35,15 @@ import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.cost.CostModificationEffectImpl; import mage.abilities.effects.common.cost.CostModificationEffectImpl;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.*;
import mage.constants.CostModificationType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.AttackingPredicate; import mage.filter.predicate.permanent.AttackingPredicate;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.token.StoneTrapIdolToken; import mage.game.permanent.token.StoneTrapIdolToken;
import mage.util.CardUtil; import mage.util.CardUtil;
import java.util.UUID;
/** /**
* *
* @author jeffwadsworth * @author jeffwadsworth
@ -55,7 +52,7 @@ public class StoneIdolTrap extends CardImpl {
public StoneIdolTrap(UUID ownerId, CardSetInfo setInfo) { public StoneIdolTrap(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{5}{R}"); super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{5}{R}");
this.subtype.add("Trap"); this.subtype.add(SubType.TRAP);
// Stone Idol Trap costs {1} less to cast for each attacking creature. // Stone Idol Trap costs {1} less to cast for each attacking creature.
Ability ability = new SimpleStaticAbility(Zone.ALL, new StoneIdolTrapCostReductionEffect()); Ability ability = new SimpleStaticAbility(Zone.ALL, new StoneIdolTrapCostReductionEffect());

View file

@ -27,23 +27,13 @@
*/ */
package mage.cards.s; package mage.cards.s;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.condition.Condition; import mage.abilities.condition.Condition;
import mage.abilities.costs.AlternativeCostSourceAbility; import mage.abilities.costs.AlternativeCostSourceAbility;
import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
import mage.cards.Card; import mage.cards.*;
import mage.cards.CardImpl; import mage.constants.*;
import mage.cards.CardSetInfo;
import mage.cards.Cards;
import mage.cards.CardsImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.WatcherScope;
import mage.constants.Zone;
import mage.filter.common.FilterCreatureCard; import mage.filter.common.FilterCreatureCard;
import mage.game.Game; import mage.game.Game;
import mage.game.events.GameEvent; import mage.game.events.GameEvent;
@ -54,6 +44,10 @@ import mage.players.Player;
import mage.target.TargetCard; import mage.target.TargetCard;
import mage.watchers.Watcher; import mage.watchers.Watcher;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
/** /**
* *
* @author Rafbill * @author Rafbill
@ -62,7 +56,7 @@ public class SummoningTrap extends CardImpl {
public SummoningTrap(UUID ownerId, CardSetInfo setInfo) { public SummoningTrap(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{4}{G}{G}"); super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{4}{G}{G}");
this.subtype.add("Trap"); this.subtype.add(SubType.TRAP);
// If a creature spell you cast this turn was countered by a spell or ability an opponent controlled, you may pay {0} rather than pay Summoning Trap's mana cost. // If a creature spell you cast this turn was countered by a spell or ability an opponent controlled, you may pay {0} rather than pay Summoning Trap's mana cost.
this.addAbility(new AlternativeCostSourceAbility(new ManaCostsImpl("{0}"), SummoningTrapCondition.instance), new SummoningTrapWatcher()); this.addAbility(new AlternativeCostSourceAbility(new ManaCostsImpl("{0}"), SummoningTrapCondition.instance), new SummoningTrapWatcher());

View file

@ -27,8 +27,6 @@
*/ */
package mage.cards.w; package mage.cards.w;
import java.util.List;
import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.condition.Condition; import mage.abilities.condition.Condition;
import mage.abilities.costs.AlternativeCostSourceAbility; import mage.abilities.costs.AlternativeCostSourceAbility;
@ -37,11 +35,15 @@ import mage.abilities.effects.common.ReturnToHandTargetEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.SubType;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
import mage.watchers.common.PermanentsEnteredBattlefieldWatcher; import mage.watchers.common.PermanentsEnteredBattlefieldWatcher;
import java.util.List;
import java.util.UUID;
/** /**
* @author jeffwadsworth * @author jeffwadsworth
*/ */
@ -49,7 +51,7 @@ public class WhiplashTrap extends CardImpl {
public WhiplashTrap(UUID ownerId, CardSetInfo setInfo) { public WhiplashTrap(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{3}{U}{U}"); super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{3}{U}{U}");
this.subtype.add("Trap"); this.subtype.add(SubType.TRAP);
// If an opponent had two or more creatures enter the battlefield under his or her control this turn, you may pay {U} rather than pay Whiplash Trap's mana cost. // If an opponent had two or more creatures enter the battlefield under his or her control this turn, you may pay {U} rather than pay Whiplash Trap's mana cost.
this.addAbility(new AlternativeCostSourceAbility(new ManaCostsImpl("{U}"), WhiplashTrapCondition.instance), new PermanentsEnteredBattlefieldWatcher()); this.addAbility(new AlternativeCostSourceAbility(new ManaCostsImpl("{U}"), WhiplashTrapCondition.instance), new PermanentsEnteredBattlefieldWatcher());