forked from External/mage
refactored all usages of CardTypePredicate to match the new implementation
This commit is contained in:
parent
f685ee3d69
commit
688be783aa
1069 changed files with 1619 additions and 2732 deletions
|
|
@ -15,7 +15,6 @@ import mage.constants.Zone;
|
|||
import mage.filter.FilterCard;
|
||||
import mage.filter.predicate.Predicate;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.predicate.mageobject.CardTypePredicate;
|
||||
import mage.filter.predicate.mageobject.SubtypePredicate;
|
||||
import mage.target.common.TargetCardInLibrary;
|
||||
|
||||
|
|
@ -42,7 +41,7 @@ public class FetchLandActivatedAbility extends ActivatedAbilityImpl {
|
|||
}
|
||||
addCost(new SacrificeSourceCost());
|
||||
FilterCard filter = new FilterCard(subTypeNames(subtypes));
|
||||
filter.add(new CardTypePredicate(CardType.LAND));
|
||||
filter.add(CardType.LAND.getPredicate());
|
||||
List<Predicate<MageObject>> subtypePredicates = new ArrayList<>();
|
||||
for (SubType subtype : subtypes) {
|
||||
subtypePredicates.add(new SubtypePredicate(subtype));
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ import mage.constants.SuperType;
|
|||
import mage.constants.Zone;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.predicate.mageobject.CardTypePredicate;
|
||||
import mage.filter.predicate.mageobject.SupertypePredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
|
|
@ -43,8 +42,8 @@ class LegendarySpellAbilityCheckEffect extends ContinuousRuleModifyingEffectImpl
|
|||
Predicates.and(
|
||||
new SupertypePredicate(SuperType.LEGENDARY),
|
||||
Predicates.or(
|
||||
new CardTypePredicate(CardType.CREATURE),
|
||||
new CardTypePredicate(CardType.PLANESWALKER)
|
||||
CardType.CREATURE.getPredicate(),
|
||||
CardType.PLANESWALKER.getPredicate()
|
||||
)
|
||||
)
|
||||
);
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ import mage.abilities.Ability;
|
|||
import mage.abilities.condition.Condition;
|
||||
import mage.constants.CardType;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.predicate.mageobject.CardTypePredicate;
|
||||
import mage.game.Game;
|
||||
|
||||
/**
|
||||
|
|
@ -17,7 +16,7 @@ public enum MetalcraftCondition implements Condition {
|
|||
private static final FilterPermanent filter = new FilterPermanent("artifact");
|
||||
|
||||
static {
|
||||
filter.add(new CardTypePredicate(CardType.ARTIFACT));
|
||||
filter.add(CardType.ARTIFACT.getPredicate());
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ import mage.abilities.condition.Condition;
|
|||
import mage.constants.CardType;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.predicate.mageobject.CardTypePredicate;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
|
|
@ -25,7 +24,7 @@ public enum SpellMasteryCondition implements Condition {
|
|||
private static final FilterCard filter = new FilterCard();
|
||||
|
||||
static {
|
||||
filter.add(Predicates.or(new CardTypePredicate(CardType.INSTANT), new CardTypePredicate(CardType.SORCERY)));
|
||||
filter.add(Predicates.or(CardType.INSTANT.getPredicate(), CardType.SORCERY.getPredicate()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@ import mage.constants.Zone;
|
|||
import mage.filter.common.FilterControlledPermanent;
|
||||
import mage.filter.predicate.Predicate;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.predicate.mageobject.CardTypePredicate;
|
||||
import mage.filter.predicate.mageobject.SubtypePredicate;
|
||||
import mage.filter.predicate.permanent.AnotherPredicate;
|
||||
import mage.game.Game;
|
||||
|
|
@ -97,7 +96,7 @@ public class ChampionAbility extends StaticAbility {
|
|||
filter.add(Predicates.or(subtypesPredicates));
|
||||
}
|
||||
if (requiresCreature) {
|
||||
filter.add(new CardTypePredicate(CardType.CREATURE));
|
||||
filter.add(CardType.CREATURE.getPredicate());
|
||||
}
|
||||
filter.add(AnotherPredicate.instance);
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@ import mage.constants.Outcome;
|
|||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterControlledPermanent;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.predicate.mageobject.CardTypePredicate;
|
||||
import mage.filter.predicate.mageobject.SharesColorWithSourcePredicate;
|
||||
import mage.filter.predicate.permanent.TappedPredicate;
|
||||
import mage.game.Game;
|
||||
|
|
@ -56,7 +55,7 @@ public class ConspireAbility extends StaticAbility implements OptionalAdditional
|
|||
static {
|
||||
filter.add(Predicates.not(TappedPredicate.instance));
|
||||
filter.add(new SharesColorWithSourcePredicate());
|
||||
filter.add(new CardTypePredicate(CardType.CREATURE));
|
||||
filter.add(CardType.CREATURE.getPredicate());
|
||||
}
|
||||
|
||||
public enum ConspireTargets {
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@ import mage.constants.Outcome;
|
|||
import mage.constants.Zone;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.common.FilterArtifactPermanent;
|
||||
import mage.filter.predicate.mageobject.CardTypePredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.events.ZoneChangeEvent;
|
||||
|
|
@ -43,7 +42,7 @@ public class ModularAbility extends DiesTriggeredAbility {
|
|||
private static final FilterArtifactPermanent filter = new FilterArtifactPermanent("artifact creature");
|
||||
|
||||
static {
|
||||
filter.add(new CardTypePredicate(CardType.CREATURE));
|
||||
filter.add(CardType.CREATURE.getPredicate());
|
||||
}
|
||||
private int amount;
|
||||
private boolean sunburst;
|
||||
|
|
@ -136,7 +135,7 @@ class ModularDistributeCounterEffect extends OneShotEffect {
|
|||
private static final FilterArtifactPermanent filter = new FilterArtifactPermanent("artifact creature");
|
||||
|
||||
static {
|
||||
filter.add(new CardTypePredicate(CardType.CREATURE));
|
||||
filter.add(CardType.CREATURE.getPredicate());
|
||||
}
|
||||
|
||||
public ModularDistributeCounterEffect() {
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ import mage.constants.CardType;
|
|||
import mage.constants.Duration;
|
||||
import mage.filter.FilterSpell;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.predicate.mageobject.CardTypePredicate;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -19,7 +18,7 @@ public class ProwessAbility extends SpellCastControllerTriggeredAbility {
|
|||
private static final FilterSpell filterNonCreatureSpell = new FilterSpell("noncreature spell");
|
||||
|
||||
static {
|
||||
filterNonCreatureSpell.add(Predicates.not(new CardTypePredicate(CardType.CREATURE)));
|
||||
filterNonCreatureSpell.add(Predicates.not(CardType.CREATURE.getPredicate()));
|
||||
}
|
||||
|
||||
public ProwessAbility() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue