[filters] Replaced CardType conditions with Predicate

This commit is contained in:
North 2012-07-12 23:42:46 +03:00
parent 0d2053c634
commit ecf765ecf5
385 changed files with 1278 additions and 1249 deletions

View file

@ -35,6 +35,8 @@
package mage.client.deckeditor;
import mage.Constants.CardType;
import mage.MageObject;
import mage.ObjectColor;
import mage.cards.Card;
import mage.cards.ExpansionSet;
import mage.client.cards.BigCard;
@ -44,8 +46,12 @@ import mage.client.cards.ICardGrid;
import mage.client.constants.Constants.SortBy;
import mage.client.deckeditor.table.TableModel;
import mage.client.util.sets.ConstructedFormats;
import mage.filter.Filter.ComparisonScope;
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.ColorPredicate;
import mage.filter.predicate.mageobject.ColorlessPredicate;
import mage.sets.Sets;
import mage.view.CardsView;
@ -63,7 +69,7 @@ import java.util.List;
public class CardSelector extends javax.swing.JPanel implements ComponentListener {
private final List<Card> cards = new ArrayList<Card>();
private final FilterCard filter = new FilterCard();
private FilterCard filter = new FilterCard();
private BigCard bigCard;
private boolean limited = false;
@ -140,7 +146,7 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
for (Card card: sideboard) {
this.cards.add(card);
}
initFilter();
filterCards();
}
@ -153,37 +159,70 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
cbExpansionSet.insertItemAt("-- All sets", 0);
cbExpansionSet.insertItemAt("-- Standard", 1);
cbExpansionSet.setSelectedIndex(0);
initFilter();
if (this.cbExpansionSet.getSelectedItem() instanceof ExpansionSet) {
filterCards();
}
private void buildFilter() {
filter = new FilterCard();
ArrayList<Predicate<MageObject>> predicates = new ArrayList<Predicate<MageObject>>();
if (this.rdoGreen.isSelected()) {
predicates.add(new ColorPredicate(ObjectColor.GREEN));
}
if (this.rdoRed.isSelected()) {
predicates.add(new ColorPredicate(ObjectColor.RED));
}
if (this.rdoBlack.isSelected()) {
predicates.add(new ColorPredicate(ObjectColor.BLACK));
}
if (this.rdoBlue.isSelected()) {
predicates.add(new ColorPredicate(ObjectColor.BLUE));
}
if (this.rdoWhite.isSelected()) {
predicates.add(new ColorPredicate(ObjectColor.WHITE));
}
if (this.rdoColorless.isSelected()) {
predicates.add(new ColorlessPredicate());
}
filter.add(Predicates.or(predicates));
predicates.clear();
if (this.rdoLand.isSelected()) {
predicates.add(new CardTypePredicate(CardType.LAND));
}
if (this.rdoArtifacts.isSelected()) {
predicates.add(new CardTypePredicate(CardType.ARTIFACT));
}
if (this.rdoCreatures.isSelected()) {
predicates.add(new CardTypePredicate(CardType.CREATURE));
}
if (this.rdoEnchantments.isSelected()) {
predicates.add(new CardTypePredicate(CardType.ENCHANTMENT));
}
if (this.rdoInstants.isSelected()) {
predicates.add(new CardTypePredicate(CardType.INSTANT));
}
if (this.rdoSorceries.isSelected()) {
predicates.add(new CardTypePredicate(CardType.SORCERY));
}
if (this.rdoPlaneswalkers.isSelected()) {
predicates.add(new CardTypePredicate(CardType.PLANESWALKER));
}
filter.add(Predicates.or(predicates));
String name = jTextFieldSearch.getText().trim();
filter.setText(name);
if (this.cbExpansionSet.getSelectedItem() instanceof ExpansionSet) {
filter.getExpansionSetCode().add(((ExpansionSet) this.cbExpansionSet.getSelectedItem()).getCode());
} else if (this.cbExpansionSet.getSelectedItem().equals("-- Standard")) {
filter.getExpansionSetCode().addAll(ConstructedFormats.getSetsByFormat("Standard"));
}
filterCards();
}
private void initFilter() {
filter.setUseColor(true);
filter.getColor().setBlack(true);
filter.getColor().setBlue(true);
filter.getColor().setGreen(true);
filter.getColor().setWhite(true);
filter.getColor().setRed(true);
filter.setColorless(true);
filter.setUseColorless(true);
filter.setNotColor(false);
filter.setScopeColor(ComparisonScope.Any);
filter.getCardType().add(CardType.LAND);
filter.getCardType().add(CardType.ARTIFACT);
filter.getCardType().add(CardType.CREATURE);
filter.getCardType().add(CardType.ENCHANTMENT);
filter.getCardType().add(CardType.INSTANT);
filter.getCardType().add(CardType.PLANESWALKER);
filter.getCardType().add(CardType.SORCERY);
filter.setScopeCardType(ComparisonScope.Any);
}
private void filterCards() {
buildFilter();
try {
List<Card> filteredCards = new ArrayList<Card>();
setCursor(new Cursor(Cursor.WAIT_CURSOR));
@ -648,99 +687,62 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
}// </editor-fold>//GEN-END:initComponents
private void rdoGreenActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdoGreenActionPerformed
filter.getColor().setGreen(this.rdoGreen.isSelected());
filterCards();
}//GEN-LAST:event_rdoGreenActionPerformed
private void rdoBlackActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdoBlackActionPerformed
filter.getColor().setBlack(this.rdoBlack.isSelected());
filterCards();
}//GEN-LAST:event_rdoBlackActionPerformed
private void rdoWhiteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdoWhiteActionPerformed
filter.getColor().setWhite(this.rdoWhite.isSelected());
filterCards();
}//GEN-LAST:event_rdoWhiteActionPerformed
private void rdoRedActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdoRedActionPerformed
filter.getColor().setRed(this.rdoRed.isSelected());
filterCards();
}//GEN-LAST:event_rdoRedActionPerformed
private void rdoBlueActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdoBlueActionPerformed
filter.getColor().setBlue(this.rdoBlue.isSelected());
filterCards();
}//GEN-LAST:event_rdoBlueActionPerformed
private void rdoColorlessActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdoColorlessActionPerformed
filter.setColorless(this.rdoColorless.isSelected());
filterCards();
}//GEN-LAST:event_rdoColorlessActionPerformed
private void rdoLandActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdoLandActionPerformed
if (this.rdoLand.isSelected())
filter.getCardType().add(CardType.LAND);
else
filter.getCardType().remove(CardType.LAND);
filterCards();
}//GEN-LAST:event_rdoLandActionPerformed
private void rdoCreaturesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdoCreaturesActionPerformed
if (this.rdoCreatures.isSelected())
filter.getCardType().add(CardType.CREATURE);
else
filter.getCardType().remove(CardType.CREATURE);
filterCards();
}//GEN-LAST:event_rdoCreaturesActionPerformed
private void rdoArtifactsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdoArtifactsActionPerformed
if (this.rdoArtifacts.isSelected())
filter.getCardType().add(CardType.ARTIFACT);
else
filter.getCardType().remove(CardType.ARTIFACT);
filterCards();
}//GEN-LAST:event_rdoArtifactsActionPerformed
private void rdoEnchantmentsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdoEnchantmentsActionPerformed
if (this.rdoEnchantments.isSelected())
filter.getCardType().add(CardType.ENCHANTMENT);
else
filter.getCardType().remove(CardType.ENCHANTMENT);
filterCards();
}//GEN-LAST:event_rdoEnchantmentsActionPerformed
private void rdoInstantsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdoInstantsActionPerformed
if (this.rdoInstants.isSelected())
filter.getCardType().add(CardType.INSTANT);
else
filter.getCardType().remove(CardType.INSTANT);
filterCards();
}//GEN-LAST:event_rdoInstantsActionPerformed
private void rdoSorceriesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdoSorceriesActionPerformed
if (this.rdoSorceries.isSelected())
filter.getCardType().add(CardType.SORCERY);
else
filter.getCardType().remove(CardType.SORCERY);
filterCards();
}//GEN-LAST:event_rdoSorceriesActionPerformed
private void rdoPlaneswalkersActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdoPlaneswalkersActionPerformed
if (this.rdoPlaneswalkers.isSelected())
filter.getCardType().add(CardType.PLANESWALKER);
else
filter.getCardType().remove(CardType.PLANESWALKER);
filterCards();
}//GEN-LAST:event_rdoPlaneswalkersActionPerformed
private void cbExpansionSetActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbExpansionSetActionPerformed
filter.getExpansionSetCode().clear();
if (cbExpansionSet.getSelectedItem() instanceof ExpansionSet) {
filter.getExpansionSetCode().add(((ExpansionSet)this.cbExpansionSet.getSelectedItem()).getCode());
filterCards();
} else {
if (this.cbExpansionSet.getSelectedItem().equals("-- Standard")) {
filter.getExpansionSetCode().addAll(ConstructedFormats.getSetsByFormat("Standard"));
filterCards();
} else {
// auto switch for ListView for "All sets" (too many cards to load)
@ -838,14 +840,11 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
private void jButtonSearchActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonSearchActionPerformed
String name = jTextFieldSearch.getText().trim();
filter.setText(name);
filterCards();
}//GEN-LAST:event_jButtonSearchActionPerformed
private void jButtonCleanActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonCleanActionPerformed
jTextFieldSearch.setText("");
filter.setText("");
filterCards();
}//GEN-LAST:event_jButtonCleanActionPerformed

View file

@ -29,6 +29,8 @@
package mage.client.deckeditor.table;
import mage.Constants.CardType;
import mage.MageObject;
import mage.ObjectColor;
import mage.cards.Card;
import mage.cards.ExpansionSet;
import mage.client.cards.BigCard;
@ -37,8 +39,13 @@ import mage.client.cards.CardsStorage;
import mage.client.cards.ICardGrid;
import mage.client.constants.Constants.DeckEditorMode;
import mage.client.constants.Constants.SortBy;
import mage.filter.Filter.ComparisonScope;
import mage.client.util.sets.ConstructedFormats;
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.ColorPredicate;
import mage.filter.predicate.mageobject.ColorlessPredicate;
import mage.sets.Sets;
import mage.view.CardsView;
@ -59,7 +66,7 @@ import java.util.List;
public class CardTableSelector extends javax.swing.JPanel implements ComponentListener {
private final List<Card> cards = new ArrayList<Card>();
private final FilterCard filter = new FilterCard();
private FilterCard filter = new FilterCard();
private BigCard bigCard;
protected CardEventSource cardEventSource = new CardEventSource();
private DeckEditorMode mode = DeckEditorMode.Constructed;
@ -86,6 +93,64 @@ public class CardTableSelector extends javax.swing.JPanel implements ComponentLi
}
private void buildFilter() {
filter = new FilterCard();
ArrayList<Predicate<MageObject>> predicates = new ArrayList<Predicate<MageObject>>();
if (this.rdoGreen.isSelected()) {
predicates.add(new ColorPredicate(ObjectColor.GREEN));
}
if (this.rdoRed.isSelected()) {
predicates.add(new ColorPredicate(ObjectColor.RED));
}
if (this.rdoBlack.isSelected()) {
predicates.add(new ColorPredicate(ObjectColor.BLACK));
}
if (this.rdoBlue.isSelected()) {
predicates.add(new ColorPredicate(ObjectColor.BLUE));
}
if (this.rdoWhite.isSelected()) {
predicates.add(new ColorPredicate(ObjectColor.WHITE));
}
if (this.rdoColorless.isSelected()) {
predicates.add(new ColorlessPredicate());
}
filter.add(Predicates.or(predicates));
predicates.clear();
if (this.rdoLand.isSelected()) {
predicates.add(new CardTypePredicate(CardType.LAND));
}
if (this.rdoArtifacts.isSelected()) {
predicates.add(new CardTypePredicate(CardType.ARTIFACT));
}
if (this.rdoCreatures.isSelected()) {
predicates.add(new CardTypePredicate(CardType.CREATURE));
}
if (this.rdoEnchantments.isSelected()) {
predicates.add(new CardTypePredicate(CardType.ENCHANTMENT));
}
if (this.rdoInstants.isSelected()) {
predicates.add(new CardTypePredicate(CardType.INSTANT));
}
if (this.rdoSorceries.isSelected()) {
predicates.add(new CardTypePredicate(CardType.SORCERY));
}
if (this.rdoPlaneswalkers.isSelected()) {
predicates.add(new CardTypePredicate(CardType.PLANESWALKER));
}
filter.add(Predicates.or(predicates));
String name = jTextFieldSearch.getText().trim();
filter.setText(name);
if (this.cbExpansionSet.getSelectedItem() instanceof ExpansionSet) {
filter.getExpansionSetCode().add(((ExpansionSet) this.cbExpansionSet.getSelectedItem()).getCode());
} else if (this.cbExpansionSet.getSelectedItem().equals("-- Standard")) {
filter.getExpansionSetCode().addAll(ConstructedFormats.getSetsByFormat("Standard"));
}
}
public void loadCards(List<Card> sideboard, BigCard bigCard, boolean construct) {
this.bigCard = bigCard;
this.btnBooster.setVisible(false);
@ -95,7 +160,7 @@ public class CardTableSelector extends javax.swing.JPanel implements ComponentLi
for (Card card: sideboard) {
this.cards.add(card);
}
initFilter();
filterCards();
}
@ -114,35 +179,12 @@ public class CardTableSelector extends javax.swing.JPanel implements ComponentLi
cbExpansionSet.setModel(new DefaultComboBoxModel(l));
cbExpansionSet.insertItemAt("-- All sets -- ", 0);
cbExpansionSet.setSelectedIndex(0);
initFilter();
if (this.cbExpansionSet.getSelectedItem() instanceof ExpansionSet) {
filter.getExpansionSetCode().add(((ExpansionSet)this.cbExpansionSet.getSelectedItem()).getCode());
}
filterCards();
}
private void initFilter() {
filter.setUseColor(true);
filter.getColor().setBlack(true);
filter.getColor().setBlue(true);
filter.getColor().setGreen(true);
filter.getColor().setWhite(true);
filter.getColor().setRed(true);
filter.setColorless(true);
filter.setUseColorless(true);
filter.setNotColor(false);
filter.setScopeColor(ComparisonScope.Any);
filter.getCardType().add(CardType.LAND);
filter.getCardType().add(CardType.ARTIFACT);
filter.getCardType().add(CardType.CREATURE);
filter.getCardType().add(CardType.ENCHANTMENT);
filter.getCardType().add(CardType.INSTANT);
filter.getCardType().add(CardType.PLANESWALKER);
filter.getCardType().add(CardType.SORCERY);
filter.setScopeCardType(ComparisonScope.Any);
}
private void filterCards() {
buildFilter();
try {
List<Card> filteredCards = new ArrayList<Card>();
setCursor(new Cursor(Cursor.WAIT_CURSOR));
@ -539,96 +581,58 @@ public class CardTableSelector extends javax.swing.JPanel implements ComponentLi
}
private void rdoGreenActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdoGreenActionPerformed
filter.getColor().setGreen(this.rdoGreen.isSelected());
filterCards();
}//GEN-LAST:event_rdoGreenActionPerformed
private void rdoBlackActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdoBlackActionPerformed
filter.getColor().setBlack(this.rdoBlack.isSelected());
filterCards();
}//GEN-LAST:event_rdoBlackActionPerformed
private void rdoWhiteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdoWhiteActionPerformed
filter.getColor().setWhite(this.rdoWhite.isSelected());
filterCards();
}//GEN-LAST:event_rdoWhiteActionPerformed
private void rdoRedActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdoRedActionPerformed
filter.getColor().setRed(this.rdoRed.isSelected());
filterCards();
}//GEN-LAST:event_rdoRedActionPerformed
private void rdoBlueActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdoBlueActionPerformed
filter.getColor().setBlue(this.rdoBlue.isSelected());
filterCards();
}//GEN-LAST:event_rdoBlueActionPerformed
private void rdoColorlessActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdoColorlessActionPerformed
filter.setColorless(this.rdoColorless.isSelected());
filterCards();
}//GEN-LAST:event_rdoColorlessActionPerformed
private void rdoLandActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdoLandActionPerformed
if (this.rdoLand.isSelected())
filter.getCardType().add(CardType.LAND);
else
filter.getCardType().remove(CardType.LAND);
filterCards();
}//GEN-LAST:event_rdoLandActionPerformed
private void rdoCreaturesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdoCreaturesActionPerformed
if (this.rdoCreatures.isSelected())
filter.getCardType().add(CardType.CREATURE);
else
filter.getCardType().remove(CardType.CREATURE);
filterCards();
}//GEN-LAST:event_rdoCreaturesActionPerformed
private void rdoArtifactsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdoArtifactsActionPerformed
if (this.rdoArtifacts.isSelected())
filter.getCardType().add(CardType.ARTIFACT);
else
filter.getCardType().remove(CardType.ARTIFACT);
filterCards();
}//GEN-LAST:event_rdoArtifactsActionPerformed
private void rdoEnchantmentsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdoEnchantmentsActionPerformed
if (this.rdoEnchantments.isSelected())
filter.getCardType().add(CardType.ENCHANTMENT);
else
filter.getCardType().remove(CardType.ENCHANTMENT);
filterCards();
}//GEN-LAST:event_rdoEnchantmentsActionPerformed
private void rdoInstantsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdoInstantsActionPerformed
if (this.rdoInstants.isSelected())
filter.getCardType().add(CardType.INSTANT);
else
filter.getCardType().remove(CardType.INSTANT);
filterCards();
}//GEN-LAST:event_rdoInstantsActionPerformed
private void rdoSorceriesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdoSorceriesActionPerformed
if (this.rdoSorceries.isSelected())
filter.getCardType().add(CardType.SORCERY);
else
filter.getCardType().remove(CardType.SORCERY);
filterCards();
}//GEN-LAST:event_rdoSorceriesActionPerformed
private void rdoPlaneswalkersActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rdoPlaneswalkersActionPerformed
if (this.rdoPlaneswalkers.isSelected())
filter.getCardType().add(CardType.PLANESWALKER);
else
filter.getCardType().remove(CardType.PLANESWALKER);
filterCards();
}//GEN-LAST:event_rdoPlaneswalkersActionPerformed
private void cbExpansionSetActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbExpansionSetActionPerformed
filter.getExpansionSetCode().clear();
if (cbExpansionSet.getSelectedItem() instanceof ExpansionSet) {
filter.getExpansionSetCode().add(((ExpansionSet)this.cbExpansionSet.getSelectedItem()).getCode());
}
filterCards();
}//GEN-LAST:event_cbExpansionSetActionPerformed
@ -690,14 +694,11 @@ public class CardTableSelector extends javax.swing.JPanel implements ComponentLi
}
private void jButtonSearchActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
String name = jTextFieldSearch.getText().trim();
filter.setText(name);
filterCards();
}//GEN-LAST:event_jButton1ActionPerformed
private void jButtonCleanActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
jTextFieldSearch.setText("");
filter.setText("");
filterCards();
}//GEN-LAST:event_jButton2ActionPerformed

View file

@ -40,8 +40,8 @@ import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.mana.BlueManaAbility;
import mage.abilities.mana.WhiteManaAbility;
import mage.cards.CardImpl;
import mage.filter.Filter;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.filter.predicate.mageobject.SupertypePredicate;
import mage.target.common.TargetControlledPermanent;
@ -57,8 +57,7 @@ public class FieldmistBorderpost extends CardImpl<FieldmistBorderpost> {
static {
filter.add(new SupertypePredicate("Basic"));
filter.getCardType().add(CardType.LAND);
filter.setScopeCardType(Filter.ComparisonScope.Any);
filter.add(new CardTypePredicate(CardType.LAND));
}
public FieldmistBorderpost (UUID ownerId) {

View file

@ -41,6 +41,7 @@ import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.filter.Filter;
import mage.filter.FilterPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.Game;
import mage.players.Player;
@ -73,11 +74,10 @@ public class FiligreeAngel extends CardImpl<FiligreeAngel> {
}
class FiligreeAngelEffect extends OneShotEffect<FiligreeAngelEffect> {
private static FilterPermanent filter = new FilterPermanent();
private static final FilterPermanent filter = new FilterPermanent();
static {
filter.getCardType().add(CardType.ARTIFACT);
filter.setScopeCardType(Filter.ComparisonScope.All);
filter.add(new CardTypePredicate(CardType.ARTIFACT));
}
public FiligreeAngelEffect() {

View file

@ -40,8 +40,8 @@ import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.mana.GreenManaAbility;
import mage.abilities.mana.RedManaAbility;
import mage.cards.CardImpl;
import mage.filter.Filter;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.filter.predicate.mageobject.SupertypePredicate;
import mage.target.common.TargetControlledPermanent;
@ -57,8 +57,7 @@ public class FirewildBorderpost extends CardImpl<FirewildBorderpost> {
static {
filter.add(new SupertypePredicate("Basic"));
filter.getCardType().add(CardType.LAND);
filter.setScopeCardType(Filter.ComparisonScope.Any);
filter.add(new CardTypePredicate(CardType.LAND));
}
public FirewildBorderpost (UUID ownerId) {

View file

@ -40,8 +40,8 @@ import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.mana.BlackManaAbility;
import mage.abilities.mana.BlueManaAbility;
import mage.cards.CardImpl;
import mage.filter.Filter;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.filter.predicate.mageobject.SupertypePredicate;
import mage.target.common.TargetControlledPermanent;
@ -57,8 +57,7 @@ public class MistveinBorderpost extends CardImpl<MistveinBorderpost> {
static {
filter.add(new SupertypePredicate("Basic"));
filter.getCardType().add(CardType.LAND);
filter.setScopeCardType(Filter.ComparisonScope.Any);
filter.add(new CardTypePredicate(CardType.LAND));
}
public MistveinBorderpost (UUID ownerId) {

View file

@ -39,8 +39,9 @@ import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.abilities.keyword.ExaltedAbility;
import mage.cards.CardImpl;
import mage.filter.Filter.ComparisonScope;
import mage.filter.FilterPermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.target.TargetPermanent;
/**
@ -52,9 +53,9 @@ public class QasaliPridemage extends CardImpl<QasaliPridemage> {
private static final FilterPermanent filter = new FilterPermanent("artifact or enchantment");
static {
filter.getCardType().add(CardType.ARTIFACT);
filter.getCardType().add(CardType.ENCHANTMENT);
filter.setScopeCardType(ComparisonScope.Any);
filter.add(Predicates.or(
new CardTypePredicate(CardType.ARTIFACT),
new CardTypePredicate(CardType.ENCHANTMENT)));
}
public QasaliPridemage(UUID ownerId) {

View file

@ -40,6 +40,7 @@ import mage.abilities.effects.common.CantCounterSourceEffect;
import mage.cards.CardImpl;
import mage.filter.Filter;
import mage.filter.FilterSpell;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.filter.predicate.mageobject.PowerPredicate;
@ -52,7 +53,7 @@ public class SpellbreakerBehemoth extends CardImpl<SpellbreakerBehemoth> {
private static final FilterSpell filter = new FilterSpell("Creature spells you control with power 5 or greater");
static {
filter.getCardType().add(CardType.CREATURE);
filter.add(new CardTypePredicate(CardType.CREATURE));
filter.add(new PowerPredicate(Filter.ComparisonType.GreaterThan, 4));
}

View file

@ -40,8 +40,8 @@ import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.mana.BlackManaAbility;
import mage.abilities.mana.RedManaAbility;
import mage.cards.CardImpl;
import mage.filter.Filter;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.filter.predicate.mageobject.SupertypePredicate;
import mage.target.common.TargetControlledPermanent;
@ -57,8 +57,7 @@ public class VeinfireBorderpost extends CardImpl<VeinfireBorderpost> {
static {
filter.add(new SupertypePredicate("Basic"));
filter.getCardType().add(CardType.LAND);
filter.setScopeCardType(Filter.ComparisonScope.Any);
filter.add(new CardTypePredicate(CardType.LAND));
}
public VeinfireBorderpost (UUID ownerId) {

View file

@ -36,8 +36,8 @@ import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.cards.CardImpl;
import mage.filter.Filter;
import mage.filter.FilterPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.target.TargetPermanent;
/**
@ -48,8 +48,7 @@ public class VithianRenegades extends CardImpl<VithianRenegades> {
private static final FilterPermanent filter = new FilterPermanent("artifact");
static {
filter.getCardType().add(CardType.ARTIFACT);
filter.setScopeCardType(Filter.ComparisonScope.Any);
filter.add(new CardTypePredicate(CardType.ARTIFACT));
}
public VithianRenegades (UUID ownerId) {

View file

@ -40,8 +40,8 @@ import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.mana.GreenManaAbility;
import mage.abilities.mana.WhiteManaAbility;
import mage.cards.CardImpl;
import mage.filter.Filter;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.filter.predicate.mageobject.SupertypePredicate;
import mage.target.common.TargetControlledPermanent;
@ -57,8 +57,7 @@ public class WildfieldBorderpost extends CardImpl<WildfieldBorderpost> {
static {
filter.add(new SupertypePredicate("Basic"));
filter.getCardType().add(CardType.LAND);
filter.setScopeCardType(Filter.ComparisonScope.Any);
filter.add(new CardTypePredicate(CardType.LAND));
}
public WildfieldBorderpost (UUID ownerId) {

View file

@ -37,7 +37,6 @@ import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapTargetCost;
import mage.abilities.effects.common.TapTargetEffect;
import mage.cards.CardImpl;
import mage.filter.Filter;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.target.common.TargetControlledCreaturePermanent;
import mage.target.common.TargetCreaturePermanent;
@ -52,7 +51,6 @@ public class DiversionaryTactics extends CardImpl<DiversionaryTactics> {
static {
filter.setTapped(false);
filter.setUseTapped(true);
filter.setScopeCardType(Filter.ComparisonScope.Any);
}
public DiversionaryTactics(UUID ownerId) {

View file

@ -39,8 +39,8 @@ import mage.abilities.costs.common.SacrificeTargetCost;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.cards.CardImpl;
import mage.filter.Filter;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.permanent.token.Token;
import mage.target.common.TargetControlledPermanent;
@ -53,8 +53,7 @@ public class GoblinTrenches extends CardImpl<GoblinTrenches> {
final static FilterControlledPermanent filter = new FilterControlledPermanent("a land");
static {
filter.getCardType().add(CardType.LAND);
filter.setScopeCardType(Filter.ComparisonScope.Any);
filter.add(new CardTypePredicate(CardType.LAND));
}
public GoblinTrenches(UUID ownerId) {

View file

@ -36,8 +36,8 @@ import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.SacrificeTargetCost;
import mage.abilities.effects.common.GainLifeEffect;
import mage.cards.CardImpl;
import mage.filter.Filter;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.target.common.TargetControlledPermanent;
/**
@ -49,8 +49,7 @@ public class OvergrownEstate extends CardImpl<OvergrownEstate> {
private final static FilterControlledPermanent filter = new FilterControlledPermanent("a land");
static {
filter.getCardType().add(CardType.LAND);
filter.setScopeCardType(Filter.ComparisonScope.Any);
filter.add(new CardTypePredicate(CardType.LAND));
}
public OvergrownEstate(UUID ownerId) {

View file

@ -40,8 +40,8 @@ import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.ColoredManaCost;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.cards.CardImpl;
import mage.filter.Filter;
import mage.filter.FilterPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.target.TargetPermanent;
import mage.target.common.TargetControlledCreaturePermanent;
@ -54,8 +54,7 @@ public class QuagmireDruid extends CardImpl<QuagmireDruid> {
private final static FilterPermanent filter = new FilterPermanent("enchantment");
static {
filter.getCardType().add(CardType.ENCHANTMENT);
filter.setScopeCardType(Filter.ComparisonScope.Any);
filter.add(new CardTypePredicate(CardType.ENCHANTMENT));
}

View file

@ -34,8 +34,8 @@ import mage.Constants.Rarity;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.abilities.effects.common.DrawCardControllerEffect;
import mage.cards.CardImpl;
import mage.filter.Filter;
import mage.filter.FilterPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.target.TargetPermanent;
/**
@ -46,8 +46,7 @@ public class Smash extends CardImpl<Smash> {
private final static FilterPermanent filter = new FilterPermanent("artifact");
static {
filter.getCardType().add(CardType.ARTIFACT);
filter.setScopeCardType(Filter.ComparisonScope.Any);
filter.add(new CardTypePredicate(CardType.ARTIFACT));
}
public Smash(UUID ownerId) {

View file

@ -38,6 +38,7 @@ import mage.abilities.effects.common.DrawCardControllerEffect;
import mage.cards.CardImpl;
import mage.filter.Filter;
import mage.filter.FilterPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
@ -70,8 +71,7 @@ class TranquilPathEffect extends OneShotEffect<TranquilPathEffect> {
private final static FilterPermanent filter = new FilterPermanent("");
static {
filter.getCardType().add(CardType.ENCHANTMENT);
filter.setScopeCardType(Filter.ComparisonScope.Any);
filter.add(new CardTypePredicate(CardType.ENCHANTMENT));
}
public TranquilPathEffect() {

View file

@ -33,8 +33,9 @@ import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.PutOnLibraryTargetEffect;
import mage.abilities.keyword.MiracleAbility;
import mage.cards.CardImpl;
import mage.filter.Filter;
import mage.filter.FilterPermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.target.TargetPermanent;
import java.util.UUID;
@ -48,10 +49,10 @@ public class BanishingStroke extends CardImpl<BanishingStroke> {
private static final FilterPermanent filter = new FilterPermanent("artifact, creature, or enchantment");
static {
filter.getCardType().add(CardType.ARTIFACT);
filter.getCardType().add(CardType.CREATURE);
filter.getCardType().add(CardType.ENCHANTMENT);
filter.setScopeCardType(Filter.ComparisonScope.Any);
filter.add(Predicates.or(
new CardTypePredicate(CardType.ARTIFACT),
new CardTypePredicate(CardType.CREATURE),
new CardTypePredicate(CardType.ENCHANTMENT)));
}
public BanishingStroke(UUID ownerId) {

View file

@ -27,12 +27,13 @@
*/
package mage.sets.avacynrestored;
import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.cards.CardImpl;
import java.util.UUID;
import mage.abilities.effects.common.SacrificeAllEffect;
import mage.cards.CardImpl;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
/**
*
@ -43,7 +44,7 @@ public class BarterInBlood extends CardImpl<BarterInBlood> {
private static final FilterControlledPermanent filter = new FilterControlledPermanent("creature");
static {
filter.getCardType().add(CardType.CREATURE);
filter.add(new CardTypePredicate(CardType.CREATURE));
}
public BarterInBlood(UUID ownerId) {

View file

@ -41,6 +41,7 @@ import mage.cards.CardImpl;
import mage.filter.FilterCard;
import mage.filter.common.FilterAura;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
@ -91,7 +92,7 @@ class BrunaLightOfAlabasterEffect extends OneShotEffect<BrunaLightOfAlabasterEff
static {
filterAuraCard.add(new SubtypePredicate("Aura"));
filterAuraCard.getCardType().add(CardType.ENCHANTMENT);
filterAuraCard.add(new CardTypePredicate(CardType.ENCHANTMENT));
}
public BrunaLightOfAlabasterEffect() {

View file

@ -32,8 +32,8 @@ import mage.Constants.Rarity;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.abilities.effects.common.GainLifeEffect;
import mage.cards.CardImpl;
import mage.filter.Filter;
import mage.filter.FilterPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.target.TargetPermanent;
import java.util.UUID;
@ -46,8 +46,7 @@ public class Cursebreak extends CardImpl<Cursebreak> {
private static final FilterPermanent filter = new FilterPermanent("enchantment");
static {
filter.getCardType().add(CardType.ENCHANTMENT);
filter.setScopeCardType(Filter.ComparisonScope.Any);
filter.add(new CardTypePredicate(CardType.ENCHANTMENT));
}
public Cursebreak(UUID ownerId) {

View file

@ -37,10 +37,11 @@ import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.common.TapTargetCost;
import mage.abilities.effects.common.ExileTargetEffect;
import mage.cards.CardImpl;
import mage.filter.Filter;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.target.TargetPermanent;
import mage.target.common.TargetControlledPermanent;
@ -54,9 +55,9 @@ public class DevoutChaplain extends CardImpl<DevoutChaplain> {
private static final FilterPermanent filter = new FilterPermanent("artifact or enchantment");
static {
filter.getCardType().add(CardType.ARTIFACT);
filter.getCardType().add(CardType.ENCHANTMENT);
filter.setScopeCardType(Filter.ComparisonScope.Any);
filter.add(Predicates.or(
new CardTypePredicate(CardType.ARTIFACT),
new CardTypePredicate(CardType.ENCHANTMENT)));
}
private final static FilterControlledPermanent humanFilter = new FilterControlledPermanent("untapped Human you control");

View file

@ -42,8 +42,9 @@ import mage.abilities.effects.common.CopyTargetSpellEffect;
import mage.abilities.effects.common.continious.GainAbilityAttachedEffect;
import mage.abilities.keyword.EnchantAbility;
import mage.cards.CardImpl;
import mage.filter.Filter;
import mage.filter.FilterSpell;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.target.TargetPermanent;
import mage.target.TargetSpell;
import mage.target.common.TargetCreaturePermanent;
@ -56,9 +57,9 @@ public class DualCasting extends CardImpl<DualCasting> {
private static final FilterSpell filter = new FilterSpell("instant or sorcery spell");
static {
filter.getCardType().add(CardType.INSTANT);
filter.getCardType().add(CardType.SORCERY);
filter.setScopeCardType(Filter.ComparisonScope.Any);
filter.add(Predicates.or(
new CardTypePredicate(CardType.INSTANT),
new CardTypePredicate(CardType.SORCERY)));
}
public DualCasting(UUID ownerId) {

View file

@ -36,6 +36,7 @@ import mage.abilities.effects.OneShotEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.filter.FilterSpell;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.Game;
import mage.game.permanent.token.Token;
import mage.target.TargetSpell;
@ -51,7 +52,7 @@ public class GeistSnatch extends CardImpl<GeistSnatch> {
private static final FilterSpell filter = new FilterSpell("creature spell");
static {
filter.getCardType().add(CardType.CREATURE);
filter.add(new CardTypePredicate(CardType.CREATURE));
}
public GeistSnatch(UUID ownerId) {

View file

@ -34,8 +34,9 @@ import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.filter.Filter;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.common.TargetControlledPermanent;
@ -50,10 +51,10 @@ public class GhostlyFlicker extends CardImpl<GhostlyFlicker> {
private static final FilterControlledPermanent filter = new FilterControlledPermanent("artifacts, creatures, and/or lands you control");
static {
filter.getCardType().add(CardType.CREATURE);
filter.getCardType().add(CardType.LAND);
filter.getCardType().add(CardType.ARTIFACT);
filter.setScopeCardType(Filter.ComparisonScope.Any);
filter.add(Predicates.or(
new CardTypePredicate(CardType.CREATURE),
new CardTypePredicate(CardType.LAND),
new CardTypePredicate(CardType.ARTIFACT)));
}
public GhostlyFlicker(UUID ownerId) {

View file

@ -36,6 +36,7 @@ import mage.abilities.effects.common.DoIfCostPaid;
import mage.abilities.effects.common.DrawCardControllerEffect;
import mage.cards.CardImpl;
import mage.filter.FilterSpell;
import mage.filter.predicate.mageobject.CardTypePredicate;
import java.util.UUID;
@ -48,7 +49,7 @@ public class LunarMystic extends CardImpl<LunarMystic> {
private static final FilterSpell filter = new FilterSpell("an instant spell");
static {
filter.getCardType().add(CardType.INSTANT);
filter.add(new CardTypePredicate(CardType.INSTANT));
}
public LunarMystic(UUID ownerId) {

View file

@ -33,8 +33,9 @@ import mage.Constants.Rarity;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.abilities.effects.common.GainLifeEffect;
import mage.cards.CardImpl;
import mage.filter.Filter;
import mage.filter.FilterPermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.target.TargetPermanent;
/**
@ -46,9 +47,9 @@ public class NaturalEnd extends CardImpl<NaturalEnd> {
private static final FilterPermanent filter = new FilterPermanent("artifact or enchantment");
static {
filter.getCardType().add(CardType.ARTIFACT);
filter.getCardType().add(CardType.ENCHANTMENT);
filter.setScopeCardType(Filter.ComparisonScope.Any);
filter.add(Predicates.or(
new CardTypePredicate(CardType.ARTIFACT),
new CardTypePredicate(CardType.ENCHANTMENT)));
}
public NaturalEnd(UUID ownerId) {

View file

@ -38,6 +38,7 @@ import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl;
import mage.choices.ChoiceImpl;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
@ -111,7 +112,7 @@ class RiteOfRuinEffect extends OneShotEffect<RiteOfRuinEffect> {
int count = 1;
for (CardType cardType : order) {
FilterControlledPermanent filter = new FilterControlledPermanent(cardType + " permanent you control");
filter.getCardType().add(cardType);
filter.add(new CardTypePredicate(cardType));
for (UUID playerId : controller.getInRange()) {
int amount = Math.min(count, game.getBattlefield().countAll(filter, playerId, game));

View file

@ -36,6 +36,7 @@ import mage.abilities.common.DiesTriggeredAbility;
import mage.abilities.effects.common.SacrificeAllEffect;
import mage.cards.CardImpl;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
/**
*
@ -45,7 +46,7 @@ public class AkkiBlizzardHerder extends CardImpl<AkkiBlizzardHerder> {
private static final FilterControlledPermanent filter = new FilterControlledPermanent("land");
static {
filter.getCardType().add(CardType.LAND);
filter.add(new CardTypePredicate(CardType.LAND));
}
public AkkiBlizzardHerder(UUID ownerId) {

View file

@ -33,8 +33,8 @@ import mage.Constants.Rarity;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl;
import mage.filter.Filter;
import mage.filter.FilterPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
@ -70,8 +70,7 @@ class FinalJudgmentEffect extends OneShotEffect<FinalJudgmentEffect> {
private final static FilterPermanent filter = new FilterPermanent("");
static {
filter.getCardType().add(CardType.CREATURE);
filter.setScopeCardType(Filter.ComparisonScope.Any);
filter.add(new CardTypePredicate(CardType.CREATURE));
}
public FinalJudgmentEffect() {

View file

@ -40,8 +40,8 @@ import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.common.TapTargetEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.filter.Filter;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.target.common.TargetControlledPermanent;
import mage.target.common.TargetLandPermanent;
@ -54,8 +54,7 @@ public class Floodbringer extends CardImpl<Floodbringer> {
private final static FilterControlledPermanent filter = new FilterControlledPermanent("a land");
static {
filter.getCardType().add(CardType.LAND);
filter.setScopeCardType(Filter.ComparisonScope.Any);
filter.add(new CardTypePredicate(CardType.LAND));
}
public Floodbringer(UUID ownerId) {

View file

@ -39,8 +39,8 @@ import mage.abilities.common.ActivateOncePerTurnActivatedAbility;
import mage.abilities.costs.common.SacrificeTargetCost;
import mage.abilities.effects.common.continious.BoostSourceEffect;
import mage.cards.CardImpl;
import mage.filter.Filter;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.target.common.TargetControlledPermanent;
/**
@ -51,8 +51,7 @@ public class AkkiAvalanchers extends CardImpl<AkkiAvalanchers> {
private final static FilterControlledPermanent filter = new FilterControlledPermanent("a land");
static {
filter.getCardType().add(CardType.LAND);
filter.setScopeCardType(Filter.ComparisonScope.Any);
filter.add(new CardTypePredicate(CardType.LAND));
}
public AkkiAvalanchers(UUID ownerId) {

View file

@ -41,7 +41,6 @@ import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.UntapEnchantedEffect;
import mage.abilities.keyword.EnchantAbility;
import mage.cards.CardImpl;
import mage.filter.Filter;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.target.TargetPermanent;
import mage.target.common.TargetControlledCreaturePermanent;
@ -57,7 +56,6 @@ public class AuraOfDominion extends CardImpl<AuraOfDominion> {
static {
filter.setTapped(false);
filter.setUseTapped(true);
filter.setScopeCardType(Filter.ComparisonScope.Any);
}

View file

@ -37,6 +37,9 @@ import mage.ObjectColor;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.cards.CardImpl;
import mage.filter.FilterPermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.filter.predicate.mageobject.ColorPredicate;
import mage.target.TargetPermanent;
/**
@ -48,10 +51,11 @@ public class Befoul extends CardImpl<Befoul> {
public static final FilterPermanent filter = new FilterPermanent("land or nonblack creature");
static {
filter.getCardType().add(CardType.LAND);
filter.getCardType().add(CardType.CREATURE);
filter.setNotColor(true);
filter.setColor(ObjectColor.BLACK);
filter.add(Predicates.or(
new CardTypePredicate(CardType.LAND),
Predicates.and(
Predicates.not(new ColorPredicate(ObjectColor.BLACK)),
new CardTypePredicate(CardType.CREATURE))));
}
public Befoul (UUID ownerId) {
super(ownerId, 102, "Befoul", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{2}{B}{B}");

View file

@ -45,9 +45,9 @@ import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.continious.BoostSourceEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.filter.Filter;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.common.FilterLandCard;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.permanent.token.Token;
@ -137,8 +137,7 @@ class DokaiWeaverofLifeToken extends Token {
final static FilterControlledPermanent filterLands = new FilterControlledPermanent("lands");
static {
filterLands.getCardType().add(CardType.LAND);
filterLands.setScopeCardType(Filter.ComparisonScope.Any);
filterLands.add(new CardTypePredicate(CardType.LAND));
}
DokaiWeaverofLifeToken() {

View file

@ -34,8 +34,8 @@ import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.abilities.effects.common.DestroyAllEffect;
import mage.cards.CardImpl;
import mage.filter.Filter;
import mage.filter.FilterPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
/**
* @author Loki
@ -45,8 +45,7 @@ public class Cleanfall extends CardImpl<Cleanfall> {
private final static FilterPermanent filter = new FilterPermanent("enchantments");
static {
filter.getCardType().add(CardType.ENCHANTMENT);
filter.setScopeCardType(Filter.ComparisonScope.Any);
filter.add(new CardTypePredicate(CardType.ENCHANTMENT));
}
public Cleanfall(UUID ownerId) {

View file

@ -35,6 +35,7 @@ import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
import mage.cards.CardImpl;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.CardTypePredicate;
/**
*
@ -44,14 +45,14 @@ public class CommuneWithNature extends CardImpl<CommuneWithNature> {
private final static FilterCard filter = new FilterCard("creature card");
static {
filter.getCardType().add(CardType.CREATURE);
}
filter.add(new CardTypePredicate(CardType.CREATURE));
}
public CommuneWithNature (UUID ownerId) {
super(ownerId, 204, "Commune with Nature", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{G}");
this.expansionSetCode = "CHK";
this.color.setGreen(true);
this.color.setGreen(true);
// Look at the top five cards of your library. You may reveal a creature card from among them and put it into your hand. Put the rest on the bottom of your library in any order.
this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(new StaticValue(5), false, new StaticValue(1), filter, false));
@ -67,4 +68,3 @@ public class CommuneWithNature extends CardImpl<CommuneWithNature> {
}
}

View file

@ -38,6 +38,7 @@ import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.cards.CardImpl;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
@ -52,15 +53,15 @@ public class FeastOfWorms extends CardImpl<FeastOfWorms> {
private final static FilterControlledPermanent filter = new FilterControlledPermanent();
static {
filter.getCardType().add(CardType.LAND);
}
filter.add(new CardTypePredicate(CardType.LAND));
}
public FeastOfWorms (UUID ownerId) {
super(ownerId, 216, "Feast of Worms", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{3}{G}{G}");
this.expansionSetCode = "CHK";
this.subtype.add("Arcane");
this.color.setGreen(true);
this.color.setGreen(true);
// Destroy target land. If that land was legendary, its controller sacrifices another land.
this.getSpellAbility().addEffect(new DestroyTargetEffect());
@ -103,7 +104,7 @@ class FeastOfWormsEffect extends OneShotEffect<FeastOfWormsEffect> {
if (targetPlayer != null && permanent != null
&& (permanent.getSupertype().get(0).toString().equals("Legendary"))) {
FilterControlledPermanent filter = new FilterControlledPermanent("land to sacrifice");
filter.getCardType().add(CardType.LAND);
filter.add(new CardTypePredicate(CardType.LAND));
filter.getControllerId().add(targetPlayer.getId());
filter.setNotController(false);
TargetControlledPermanent target = new TargetControlledPermanent(1, 1, filter, false);

View file

@ -43,8 +43,8 @@ import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.effects.ReplacementEffectImpl;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.cards.CardImpl;
import mage.filter.Filter;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
@ -61,8 +61,7 @@ public class Frostwielder extends CardImpl<Frostwielder> {
private final static FilterControlledPermanent filter = new FilterControlledPermanent("a land");
static {
filter.getCardType().add(CardType.LAND);
filter.setScopeCardType(Filter.ComparisonScope.Any);
filter.add(new CardTypePredicate(CardType.LAND));
}
public Frostwielder(UUID ownerId) {

View file

@ -35,6 +35,7 @@ import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
import mage.abilities.effects.common.GainLifeEffect;
import mage.cards.CardImpl;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
/**
*
@ -44,8 +45,8 @@ public class JoyousRespite extends CardImpl<JoyousRespite> {
private final static FilterControlledPermanent filter = new FilterControlledPermanent();
static {
filter.getCardType().add(CardType.LAND);
}
filter.add(new CardTypePredicate(CardType.LAND));
}
public JoyousRespite (UUID ownerId) {

View file

@ -39,8 +39,8 @@ import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.SacrificeSourceCost;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.cards.CardImpl;
import mage.filter.Filter;
import mage.filter.FilterPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.target.TargetPermanent;
/**
@ -51,8 +51,7 @@ public class KamiOfAncientLaw extends CardImpl<KamiOfAncientLaw> {
private final static FilterPermanent filter = new FilterPermanent("enchantment");
static {
filter.getCardType().add(CardType.ENCHANTMENT);
filter.setScopeCardType(Filter.ComparisonScope.Any);
filter.add(new CardTypePredicate(CardType.ENCHANTMENT));
}
public KamiOfAncientLaw (UUID ownerId) {

View file

@ -45,8 +45,8 @@ import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.ReplacementEffectImpl;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.cards.CardImpl;
import mage.filter.Filter;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
@ -65,8 +65,7 @@ public class KumanoMasterYamabushi extends CardImpl<KumanoMasterYamabushi> {
private final static FilterControlledPermanent filter = new FilterControlledPermanent("a land");
static {
filter.getCardType().add(CardType.LAND);
filter.setScopeCardType(Filter.ComparisonScope.Any);
filter.add(new CardTypePredicate(CardType.LAND));
}
public KumanoMasterYamabushi(UUID ownerId) {
@ -131,11 +130,11 @@ class KumanaoMasterYamabushiEffect extends ReplacementEffectImpl<KumanaoMasterYa
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
if (event.getType() == EventType.ZONE_CHANGE && ((ZoneChangeEvent)event).isDiesEvent()) {
DamagedByWatcher watcher =
(DamagedByWatcher) game.getState().getWatchers().get("DamagedByWatcher", source.getSourceId());
if (watcher != null)
return watcher.damagedCreatures.contains(event.getTargetId());
}
DamagedByWatcher watcher = (DamagedByWatcher) game.getState().getWatchers().get("DamagedByWatcher", source.getSourceId());
if (watcher != null) {
return watcher.damagedCreatures.contains(event.getTargetId());
}
}
return false;
}

View file

@ -40,8 +40,8 @@ import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.ReplacementEffectImpl;
import mage.cards.CardImpl;
import mage.filter.Filter;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
@ -57,8 +57,7 @@ public class KumanosPupil extends CardImpl<KumanosPupil> {
private final static FilterControlledPermanent filter = new FilterControlledPermanent("a land");
static {
filter.getCardType().add(CardType.LAND);
filter.setScopeCardType(Filter.ComparisonScope.Any);
filter.add(new CardTypePredicate(CardType.LAND));
}
public KumanosPupil(UUID ownerId) {

View file

@ -41,8 +41,8 @@ import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.filter.Filter;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.permanent.token.Token;
import mage.target.common.TargetControlledPermanent;
@ -54,8 +54,7 @@ public class MelokuTheCloudedMirror extends CardImpl<MelokuTheCloudedMirror> {
private final static FilterControlledPermanent filter = new FilterControlledPermanent("a land");
static {
filter.getCardType().add(CardType.LAND);
filter.setScopeCardType(Filter.ComparisonScope.Any);
filter.add(new CardTypePredicate(CardType.LAND));
}
public MelokuTheCloudedMirror(UUID ownerId) {

View file

@ -50,6 +50,7 @@ import mage.abilities.keyword.IndestructibleAbility;
import mage.cards.CardImpl;
import mage.counters.CounterType;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.target.common.TargetCardInHand;
import mage.watchers.common.CastFromHandWatcher;
@ -60,7 +61,7 @@ public class MyojinOfLifesWeb extends CardImpl<MyojinOfLifesWeb> {
private static final FilterCard filter = new FilterCard("any number of creature cards from your hand");
static {
filter.getCardType().add(CardType.CREATURE);
filter.add(new CardTypePredicate(CardType.CREATURE));
filter.setTargetOwner(TargetController.YOU);
}

View file

@ -34,8 +34,9 @@ import mage.Constants.Rarity;
import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
import mage.cards.CardImpl;
import mage.filter.Filter.ComparisonScope;
import mage.filter.FilterCard;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
/**
*
@ -45,10 +46,10 @@ public class PeerThroughDepths extends CardImpl<PeerThroughDepths> {
private final static FilterCard filter = new FilterCard("instant or sorcery card");
static {
filter.getCardType().add(CardType.SORCERY);
filter.getCardType().add(CardType.INSTANT);
filter.setScopeCardType(ComparisonScope.Any);
}
filter.add(Predicates.or(
new CardTypePredicate(CardType.SORCERY),
new CardTypePredicate(CardType.INSTANT)));
}
public PeerThroughDepths (UUID ownerId) {

View file

@ -34,8 +34,8 @@ import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.cards.CardImpl;
import mage.filter.Filter;
import mage.filter.FilterPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.target.TargetPermanent;
/**
@ -46,8 +46,7 @@ public class QuietPurity extends CardImpl<QuietPurity> {
private static final FilterPermanent filter = new FilterPermanent("Enchantment");
static {
filter.getCardType().add(CardType.ENCHANTMENT);
filter.setScopeCardType(Filter.ComparisonScope.Any);
filter.add(new CardTypePredicate(CardType.ENCHANTMENT));
}
public QuietPurity(UUID ownerId) {

View file

@ -41,8 +41,8 @@ import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.common.DrawDiscardControllerEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.filter.Filter;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.target.common.TargetControlledPermanent;
/**
@ -53,8 +53,7 @@ public class SoratamiCloudskater extends CardImpl<SoratamiCloudskater> {
private final static FilterControlledPermanent filter = new FilterControlledPermanent("a land");
static {
filter.getCardType().add(CardType.LAND);
filter.setScopeCardType(Filter.ComparisonScope.Any);
filter.add(new CardTypePredicate(CardType.LAND));
}
public SoratamiCloudskater(UUID ownerId) {

View file

@ -45,6 +45,7 @@ import mage.cards.CardImpl;
import mage.filter.Filter;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.filter.predicate.mageobject.PowerPredicate;
import mage.target.common.TargetControlledPermanent;
import mage.target.common.TargetCreaturePermanent;
@ -58,8 +59,7 @@ public class SoratamiMirrorGuard extends CardImpl<SoratamiMirrorGuard> {
private final static FilterCreaturePermanent filterCreature = new FilterCreaturePermanent("creature with power 2 or less");
static {
filter.getCardType().add(CardType.LAND);
filter.setScopeCardType(Filter.ComparisonScope.Any);
filter.add(new CardTypePredicate(CardType.LAND));
filterCreature.add(new PowerPredicate(Filter.ComparisonType.LessThan, 3));
}

View file

@ -41,8 +41,8 @@ import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.common.ReturnToHandTargetEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.filter.Filter;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.target.common.TargetControlledPermanent;
import mage.target.common.TargetCreaturePermanent;
@ -54,8 +54,7 @@ public class SoratamiMirrorMage extends CardImpl<SoratamiMirrorMage> {
private final static FilterControlledPermanent filter = new FilterControlledPermanent("lands");
static {
filter.getCardType().add(CardType.LAND);
filter.setScopeCardType(Filter.ComparisonScope.Any);
filter.add(new CardTypePredicate(CardType.LAND));
}
public SoratamiMirrorMage(UUID ownerId) {

View file

@ -42,8 +42,8 @@ import mage.abilities.effects.common.continious.GainAbilityTargetEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.abilities.keyword.ShroudAbility;
import mage.cards.CardImpl;
import mage.filter.Filter;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.target.common.TargetControlledCreaturePermanent;
import mage.target.common.TargetControlledPermanent;
@ -55,8 +55,7 @@ public class SoratamiRainshaper extends CardImpl<SoratamiRainshaper> {
private final static FilterControlledPermanent filter = new FilterControlledPermanent("a land");
static {
filter.getCardType().add(CardType.LAND);
filter.setScopeCardType(Filter.ComparisonScope.Any);
filter.add(new CardTypePredicate(CardType.LAND));
}
public SoratamiRainshaper(UUID ownerId) {

View file

@ -41,8 +41,8 @@ import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.common.CounterUnlessPaysEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.filter.Filter;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.target.TargetSpell;
import mage.target.common.TargetControlledPermanent;
@ -54,8 +54,7 @@ public class SoratamiSavant extends CardImpl<SoratamiSavant> {
private final static FilterControlledPermanent filter = new FilterControlledPermanent("a land");
static {
filter.getCardType().add(CardType.LAND);
filter.setScopeCardType(Filter.ComparisonScope.Any);
filter.add(new CardTypePredicate(CardType.LAND));
}
public SoratamiSavant(UUID ownerId) {

View file

@ -42,8 +42,8 @@ import mage.abilities.effects.OneShotEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.filter.Filter;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.Game;
import mage.players.Player;
import mage.target.common.TargetControlledPermanent;
@ -56,8 +56,7 @@ public class SoratamiSeer extends CardImpl<SoratamiSeer> {
private final static FilterControlledPermanent filter = new FilterControlledPermanent("lands");
static {
filter.getCardType().add(CardType.LAND);
filter.setScopeCardType(Filter.ComparisonScope.Any);
filter.add(new CardTypePredicate(CardType.LAND));
}
public SoratamiSeer(UUID ownerId) {

View file

@ -36,8 +36,8 @@ import mage.Constants.Rarity;
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
import mage.abilities.effects.common.continious.BoostTargetEffect;
import mage.cards.CardImpl;
import mage.filter.Filter;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.target.common.TargetCreaturePermanent;
/**
@ -48,8 +48,7 @@ public class StrengthOfCedars extends CardImpl<StrengthOfCedars> {
private final static FilterControlledPermanent filter = new FilterControlledPermanent("land your control");
static {
filter.getCardType().add(CardType.LAND);
filter.setScopeCardType(Filter.ComparisonScope.Any);
filter.add(new CardTypePredicate(CardType.LAND));
}
public StrengthOfCedars (UUID ownerId) {

View file

@ -35,6 +35,7 @@ import mage.Constants.Rarity;
import mage.abilities.effects.common.search.SearchLibraryRevealPutInHandEffect;
import mage.cards.CardImpl;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.filter.predicate.mageobject.SupertypePredicate;
import mage.target.common.TargetCardInLibrary;
@ -46,7 +47,7 @@ public class TimeOfNeed extends CardImpl<TimeOfNeed> {
private final static FilterCard filter = new FilterCard("legendary creature card");
static {
filter.getCardType().add(CardType.CREATURE);
filter.add(new CardTypePredicate(CardType.CREATURE));
filter.add(new SupertypePredicate("Legendary"));
}

View file

@ -40,9 +40,10 @@ import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.common.CopyTargetSpellEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.filter.Filter;
import mage.filter.FilterSpell;
import mage.filter.common.FilterLandPermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.target.TargetSpell;
import mage.target.common.TargetControlledPermanent;
@ -55,9 +56,9 @@ public class UyoSilentProphet extends CardImpl<UyoSilentProphet> {
private final static FilterSpell filter = new FilterSpell("instant or sorcery spell");
static {
filter.getCardType().add(CardType.INSTANT);
filter.getCardType().add(CardType.SORCERY);
filter.setScopeCardType(Filter.ComparisonScope.Any);
filter.add(Predicates.or(
new CardTypePredicate(CardType.INSTANT),
new CardTypePredicate(CardType.SORCERY)));
}
public UyoSilentProphet(UUID ownerId) {

View file

@ -34,6 +34,8 @@ import mage.abilities.effects.common.CounterTargetEffect;
import mage.abilities.effects.common.LoseLifeControllerEffect;
import mage.cards.CardImpl;
import mage.filter.FilterSpell;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.target.TargetSpell;
/**
@ -45,7 +47,7 @@ public class Countersquall extends CardImpl<Countersquall> {
private static final FilterSpell filter = new FilterSpell("noncreature spell");
static {
filter.getNotCardType().add(CardType.CREATURE);
filter.add(Predicates.not(new CardTypePredicate(CardType.CREATURE)));
}
public Countersquall(UUID ownerId) {

View file

@ -39,8 +39,8 @@ import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.effects.common.ReturnToHandTargetEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.filter.Filter;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.target.common.TargetControlledPermanent;
/**
@ -51,8 +51,7 @@ public class Esperzoa extends CardImpl<Esperzoa> {
private final static FilterControlledPermanent filter = new FilterControlledPermanent("artifact");
static {
filter.getCardType().add(CardType.ARTIFACT);
filter.setScopeCardType(Filter.ComparisonScope.Any);
filter.add(new CardTypePredicate(CardType.ARTIFACT));
}
public Esperzoa (UUID ownerId) {

View file

@ -41,8 +41,9 @@ import mage.abilities.effects.common.DestroyTargetEffect;
import mage.abilities.effects.common.UntapSourceEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.filter.Filter.ComparisonScope;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.target.common.TargetControlledPermanent;
/**
@ -53,9 +54,9 @@ public class EtherswornAdjudicator extends CardImpl<EtherswornAdjudicator> {
private static final FilterControlledPermanent filter = new FilterControlledPermanent("creature or enchantment");
static {
filter.getCardType().add(CardType.CREATURE);
filter.getCardType().add(CardType.ENCHANTMENT);
filter.setScopeCardType(ComparisonScope.Any);
filter.add(Predicates.or(
new CardTypePredicate(CardType.CREATURE),
new CardTypePredicate(CardType.ENCHANTMENT)));
}
public EtherswornAdjudicator(UUID ownerId) {

View file

@ -38,6 +38,7 @@ import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.CardTypePredicate;
/**
*
@ -47,7 +48,7 @@ public class FaerieMechanist extends CardImpl<FaerieMechanist> {
private final static FilterCard filter = new FilterCard("artifact card");
static {
filter.getCardType().add(CardType.ARTIFACT);
filter.add(new CardTypePredicate(CardType.ARTIFACT));
}
public FaerieMechanist(UUID ownerId) {

View file

@ -36,8 +36,9 @@ import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.cards.CardImpl;
import mage.filter.Filter.ComparisonScope;
import mage.filter.FilterPermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
@ -52,9 +53,9 @@ public class FiligreeFracture extends CardImpl<FiligreeFracture> {
private static final FilterPermanent filter = new FilterPermanent("artifact or enchantment");
static {
filter.getCardType().add(CardType.ARTIFACT);
filter.getCardType().add(CardType.ENCHANTMENT);
filter.setScopeCardType(ComparisonScope.Any);
filter.add(Predicates.or(
new CardTypePredicate(CardType.ARTIFACT),
new CardTypePredicate(CardType.ENCHANTMENT)));
}
public FiligreeFracture(UUID ownerId) {

View file

@ -44,8 +44,8 @@ import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.cards.CardImpl;
import mage.counters.CounterType;
import mage.filter.Filter;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.target.TargetPlayer;
import mage.target.common.TargetControlledPermanent;
@ -54,11 +54,10 @@ import mage.target.common.TargetControlledPermanent;
* @author Loki
*/
public class GoblinRazerunners extends CardImpl<GoblinRazerunners> {
private static FilterControlledPermanent filter = new FilterControlledPermanent("a land");
private static final FilterControlledPermanent filter = new FilterControlledPermanent("a land");
static {
filter.getCardType().add(CardType.LAND);
filter.setScopeCardType(Filter.ComparisonScope.Any);
filter.add(new CardTypePredicate(CardType.LAND));
}
public GoblinRazerunners (UUID ownerId) {

View file

@ -44,10 +44,10 @@ import mage.abilities.dynamicvalue.common.CardsInControllerGraveyardCount;
import mage.abilities.effects.common.continious.BoostSourceEffect;
import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect;
import mage.cards.CardImpl;
import mage.filter.Filter.ComparisonScope;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.common.FilterLandCard;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.target.common.TargetCardInLibrary;
import mage.target.common.TargetControlledPermanent;
@ -61,8 +61,7 @@ public class KnightOfTheReliquary extends CardImpl<KnightOfTheReliquary> {
private static final FilterControlledPermanent filter = new FilterControlledPermanent("Forest or Plains");
static {
filter.getCardType().add(CardType.LAND);
filter.setScopeCardType(ComparisonScope.Any);
filter.add(new CardTypePredicate(CardType.LAND));
filter.add(Predicates.or(new SubtypePredicate("Forest"), new SubtypePredicate("Plains")));
}

View file

@ -35,8 +35,8 @@ import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.abilities.keyword.CyclingAbility;
import mage.cards.CardImpl;
import mage.filter.Filter.ComparisonScope;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.target.common.TargetCreaturePermanent;
/**
@ -48,8 +48,7 @@ public class MoltenFrame extends CardImpl<MoltenFrame> {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("artifact creature");
static {
filter.getCardType().add(CardType.ARTIFACT);
filter.setScopeCardType(ComparisonScope.Any);
filter.add(new CardTypePredicate(CardType.ARTIFACT));
}
public MoltenFrame(UUID ownerId) {

View file

@ -42,6 +42,8 @@ import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.cards.CardImpl;
import mage.counters.CounterType;
import mage.filter.FilterPermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.target.TargetPermanent;
import mage.target.TargetPlayer;
import mage.target.common.TargetCreaturePermanent;
@ -55,7 +57,7 @@ public class NicolBolasPlaneswalker extends CardImpl<NicolBolasPlaneswalker> {
private static final FilterPermanent filter = new FilterPermanent("noncreature permanent");
static {
filter.getNotCardType().add(CardType.CREATURE);
filter.add(Predicates.not(new CardTypePredicate(CardType.CREATURE)));
}
public NicolBolasPlaneswalker(UUID ownerId) {

View file

@ -35,6 +35,7 @@ import mage.abilities.common.SpellCastTriggeredAbility;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.cards.CardImpl;
import mage.filter.FilterSpell;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.permanent.token.AngelToken;
/**
@ -46,7 +47,7 @@ public class SigilOfTheEmptyThrone extends CardImpl<SigilOfTheEmptyThrone> {
private static final FilterSpell filter = new FilterSpell("an enchantment spell");
static {
filter.getCardType().add(CardType.ENCHANTMENT);
filter.add(new CardTypePredicate(CardType.ENCHANTMENT));
}
public SigilOfTheEmptyThrone(UUID ownerId) {

View file

@ -43,8 +43,8 @@ import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.TransformSourceEffect;
import mage.abilities.keyword.TransformAbility;
import mage.cards.CardImpl;
import mage.filter.Filter;
import mage.filter.FilterPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
@ -95,8 +95,7 @@ class WerewolfRansackerAbility extends TriggeredAbilityImpl<WerewolfRansackerAbi
private static final FilterPermanent filter = new FilterPermanent("artifact");
static {
filter.getCardType().add(CardType.ARTIFACT);
filter.setScopeCardType(Filter.ComparisonScope.Any);
filter.add(new CardTypePredicate(CardType.ARTIFACT));
}
public WerewolfRansackerAbility() {

View file

@ -34,6 +34,7 @@ import mage.abilities.effects.common.CounterTargetEffect;
import mage.abilities.effects.common.DrawCardControllerEffect;
import mage.cards.CardImpl;
import mage.filter.FilterSpell;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.target.TargetSpell;
/**
@ -45,7 +46,7 @@ public class BoneToAsh extends CardImpl<BoneToAsh> {
private static final FilterSpell filter = new FilterSpell("creature spell");
static {
filter.getCardType().add(CardType.CREATURE);
filter.add(new CardTypePredicate(CardType.CREATURE));
}
public BoneToAsh(UUID ownerId) {

View file

@ -27,16 +27,20 @@
*/
package mage.sets.darkascension;
import java.util.ArrayList;
import java.util.UUID;
import mage.Constants;
import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.filter.Filter;
import mage.filter.FilterCard;
import mage.filter.predicate.Predicate;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.Game;
import mage.game.stack.StackObject;
import mage.players.Player;
@ -94,11 +98,13 @@ class CounterlashEffect extends OneShotEffect<CounterlashEffect> {
game.getStack().counter(source.getFirstTarget(), source.getSourceId(), game);
if (player.chooseUse(Constants.Outcome.PutCardInPlay, "Cast a nonland card in your hand that shares a card type with that spell without paying its mana cost?", game)) {
FilterCard filter = new FilterCard();
ArrayList<Predicate<MageObject>> types = new ArrayList<Predicate<MageObject>>();
for (CardType type: stackObject.getCardType()) {
if (type != CardType.LAND)
filter.getCardType().add(type);
if (type != CardType.LAND) {
types.add(new CardTypePredicate(type));
}
}
filter.setScopeCardType(Filter.ComparisonScope.Any);
filter.add(Predicates.or(types));
TargetCardInHand target = new TargetCardInHand(filter);
if (player.choose(Constants.Outcome.PutCardInPlay, target, source.getSourceId(), game)) {
Card card = player.getHand().get(target.getFirstTarget(), game);

View file

@ -38,8 +38,9 @@ import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.AttachEffect;
import mage.abilities.keyword.EnchantAbility;
import mage.cards.CardImpl;
import mage.filter.Filter;
import mage.filter.FilterSpell;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
@ -87,9 +88,9 @@ class CurseOfEchoesCopyTriggeredAbility extends TriggeredAbilityImpl<CurseOfEcho
private static final FilterSpell filter = new FilterSpell();
static {
filter.getCardType().add(CardType.INSTANT);
filter.getCardType().add(CardType.SORCERY);
filter.setScopeCardType(Filter.ComparisonScope.Any);
filter.add(Predicates.or(
new CardTypePredicate(CardType.INSTANT),
new CardTypePredicate(CardType.SORCERY)));
}
public CurseOfEchoesCopyTriggeredAbility() {

View file

@ -36,8 +36,8 @@ import mage.abilities.Ability;
import mage.abilities.common.BeginningOfYourEndStepTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl;
import mage.filter.Filter;
import mage.filter.common.FilterNonTokenPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.permanent.token.WolfToken;
@ -76,8 +76,7 @@ class FeedThePackEffect extends OneShotEffect<FeedThePackEffect> {
private static final FilterNonTokenPermanent filter = new FilterNonTokenPermanent("nontoken creature");
static {
filter.getCardType().add(CardType.CREATURE);
filter.setScopeCardType(Filter.ComparisonScope.Any);
filter.add(new CardTypePredicate(CardType.CREATURE));
filter.setTargetController(Constants.TargetController.YOU);
}

View file

@ -36,8 +36,9 @@ import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.keyword.FlashbackAbility;
import mage.cards.CardImpl;
import mage.filter.Filter;
import mage.filter.FilterSpell;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.Game;
import mage.game.stack.Spell;
import mage.target.TargetSpell;
@ -51,9 +52,9 @@ public class IncreasingVengeance extends CardImpl<IncreasingVengeance> {
private final static FilterSpell filter = new FilterSpell("instant or sorcery spell");
static {
filter.getCardType().add(CardType.INSTANT);
filter.getCardType().add(CardType.SORCERY);
filter.setScopeCardType(Filter.ComparisonScope.Any);
filter.add(Predicates.or(
new CardTypePredicate(CardType.INSTANT),
new CardTypePredicate(CardType.SORCERY)));
filter.setTargetController(Constants.TargetController.YOU);
}

View file

@ -36,8 +36,9 @@ import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.ReturnToHandTargetEffect;
import mage.abilities.keyword.FlashbackAbility;
import mage.cards.CardImpl;
import mage.filter.Filter;
import mage.filter.FilterCard;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.target.common.TargetCardInYourGraveyard;
/**
@ -48,9 +49,9 @@ public class MysticRetrieval extends CardImpl<MysticRetrieval> {
private static final FilterCard filter = new FilterCard("instant or sorcery card from your graveyard");
static {
filter.getCardType().add(CardType.INSTANT);
filter.getCardType().add(CardType.SORCERY);
filter.setScopeCardType(Filter.ComparisonScope.Any);
filter.add(Predicates.or(
new CardTypePredicate(CardType.INSTANT),
new CardTypePredicate(CardType.SORCERY)));
}
public MysticRetrieval(UUID ownerId) {

View file

@ -36,6 +36,7 @@ import mage.abilities.effects.common.DestroyTargetEffect;
import mage.abilities.keyword.FlashbackAbility;
import mage.cards.CardImpl;
import mage.filter.FilterPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.target.TargetPermanent;
/**
@ -47,7 +48,7 @@ public class RayOfRevelation extends CardImpl<RayOfRevelation> {
private static final FilterPermanent filter = new FilterPermanent("enchantment");
static {
filter.getCardType().add(CardType.ENCHANTMENT);
filter.add(new CardTypePredicate(CardType.ENCHANTMENT));
}
public RayOfRevelation(UUID ownerId) {

View file

@ -46,8 +46,9 @@ import mage.abilities.keyword.LifelinkAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.counters.CounterType;
import mage.filter.Filter;
import mage.filter.FilterPermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.Game;
import mage.game.command.Emblem;
import mage.game.permanent.Permanent;
@ -66,9 +67,9 @@ public class SorinLordOfInnistrad extends CardImpl<SorinLordOfInnistrad> {
private static final FilterPermanent filter = new FilterPermanent("creature or planeswalker");
static {
filter.getCardType().add(CardType.CREATURE);
filter.getCardType().add(CardType.PLANESWALKER);
filter.setScopeCardType(Filter.ComparisonScope.Any);
filter.add(Predicates.or(
new CardTypePredicate(CardType.CREATURE),
new CardTypePredicate(CardType.PLANESWALKER)));
}
public SorinLordOfInnistrad(UUID ownerId) {

View file

@ -43,8 +43,8 @@ import mage.abilities.effects.common.DrawCardControllerEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.cards.CardImpl;
import mage.counters.CounterType;
import mage.filter.Filter;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.target.common.TargetControlledPermanent;
/**
@ -56,8 +56,7 @@ public class ArcaneSpyglass extends CardImpl<ArcaneSpyglass> {
private final static FilterControlledPermanent filter = new FilterControlledPermanent("a land");
static {
filter.getCardType().add(CardType.LAND);
filter.setScopeCardType(Filter.ComparisonScope.Any);
filter.add(new CardTypePredicate(CardType.LAND));
}
public ArcaneSpyglass (UUID ownerId) {

View file

@ -41,8 +41,8 @@ import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.effects.common.counter.AddCountersTargetEffect;
import mage.cards.CardImpl;
import mage.counters.CounterType;
import mage.filter.Filter;
import mage.filter.FilterPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.target.TargetPermanent;
/**
@ -53,8 +53,7 @@ public class Coretapper extends CardImpl<Coretapper> {
private final static FilterPermanent filter = new FilterPermanent("artifact");
static {
filter.getCardType().add(CardType.ARTIFACT);
filter.setScopeCardType(Filter.ComparisonScope.Any);
filter.add(new CardTypePredicate(CardType.ARTIFACT));
}
public Coretapper(UUID ownerId) {

View file

@ -37,8 +37,8 @@ import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.common.continious.GainAbilityControlledEffect;
import mage.abilities.keyword.IndestructibleAbility;
import mage.cards.CardImpl;
import mage.filter.Filter;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
/**
* @author Loki
@ -48,8 +48,7 @@ public class DarksteelForge extends CardImpl<DarksteelForge> {
private final static FilterControlledPermanent filter = new FilterControlledPermanent("Artifacts");
static {
filter.getCardType().add(CardType.ARTIFACT);
filter.setScopeCardType(Filter.ComparisonScope.Any);
filter.add(new CardTypePredicate(CardType.ARTIFACT));
}
public DarksteelForge(UUID ownerId) {

View file

@ -35,8 +35,8 @@ import mage.Constants.Rarity;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl;
import mage.filter.Filter;
import mage.filter.FilterPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.TargetPermanent;
@ -48,8 +48,7 @@ public class EchoingCalm extends CardImpl<EchoingCalm> {
private final static FilterPermanent filter = new FilterPermanent("enchantment");
static {
filter.getCardType().add(CardType.ENCHANTMENT);
filter.setScopeCardType(Filter.ComparisonScope.Any);
filter.add(new CardTypePredicate(CardType.ENCHANTMENT));
}
public EchoingCalm(UUID ownerId) {

View file

@ -40,6 +40,7 @@ import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.filter.Filter;
import mage.filter.FilterPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.Game;
import mage.players.Player;
@ -77,8 +78,7 @@ class EmissaryOfHopeEffect extends OneShotEffect<EmissaryOfHopeEffect> {
private final static FilterPermanent filter = new FilterPermanent("artifact");
static {
filter.getCardType().add(CardType.ARTIFACT);
filter.setScopeCardType(Filter.ComparisonScope.Any);
filter.add(new CardTypePredicate(CardType.ARTIFACT));
filter.setTargetController(Constants.TargetController.YOU);
}

View file

@ -39,8 +39,8 @@ import mage.abilities.costs.common.SacrificeTargetCost;
import mage.abilities.effects.common.BasicManaEffect;
import mage.abilities.mana.BasicManaAbility;
import mage.cards.CardImpl;
import mage.filter.Filter;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.target.common.TargetControlledPermanent;
/**
@ -51,8 +51,7 @@ public class KrarkClanStoker extends CardImpl<KrarkClanStoker> {
private final static FilterControlledPermanent filter = new FilterControlledPermanent("an artifact");
static {
filter.getCardType().add(CardType.ARTIFACT);
filter.setScopeCardType(Filter.ComparisonScope.Any);
filter.add(new CardTypePredicate(CardType.ARTIFACT));
}
public KrarkClanStoker(UUID ownerId) {

View file

@ -37,6 +37,7 @@ import mage.abilities.effects.common.continious.GainAbilityControlledEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
/**
* @author Loki
@ -46,8 +47,8 @@ public class MagneticFlux extends CardImpl<MagneticFlux> {
private final static FilterControlledPermanent filter = new FilterControlledPermanent("Artifact creatures");
static {
filter.getCardType().add(CardType.ARTIFACT);
filter.getCardType().add(CardType.CREATURE);
filter.add(new CardTypePredicate(CardType.ARTIFACT));
filter.add(new CardTypePredicate(CardType.CREATURE));
}
public MagneticFlux(UUID ownerId) {

View file

@ -39,8 +39,8 @@ import mage.abilities.costs.common.DiscardTargetCost;
import mage.abilities.effects.common.ReturnToHandSourceEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.filter.Filter;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.target.common.TargetCardInHand;
/**
@ -51,8 +51,7 @@ public class NeurokProdigy extends CardImpl<NeurokProdigy> {
private final static FilterCard filter = new FilterCard("an artifact card");
static {
filter.getCardType().add(CardType.ARTIFACT);
filter.setScopeCardType(Filter.ComparisonScope.Any);
filter.add(new CardTypePredicate(CardType.ARTIFACT));
}
public NeurokProdigy(UUID ownerId) {

View file

@ -34,8 +34,8 @@ import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.cards.CardImpl;
import mage.filter.Filter;
import mage.filter.FilterPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.target.TargetPermanent;
/**
@ -46,8 +46,7 @@ public class Oxidize extends CardImpl<Oxidize> {
private final static FilterPermanent filter = new FilterPermanent("artifact");
static {
filter.getCardType().add(CardType.ARTIFACT);
filter.setScopeCardType(Filter.ComparisonScope.Any);
filter.add(new CardTypePredicate(CardType.ARTIFACT));
}
public Oxidize(UUID ownerId) {

View file

@ -40,8 +40,8 @@ import mage.abilities.costs.common.SacrificeSourceCost;
import mage.abilities.effects.common.RegenerateTargetEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.filter.Filter;
import mage.filter.FilterPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.target.TargetPermanent;
/**
@ -52,8 +52,7 @@ public class PteronGhost extends CardImpl<PteronGhost> {
private final static FilterPermanent filter = new FilterPermanent("artifact");
static {
filter.getCardType().add(CardType.ARTIFACT);
filter.setScopeCardType(Filter.ComparisonScope.Any);
filter.add(new CardTypePredicate(CardType.ARTIFACT));
}
public PteronGhost(UUID ownerId) {

View file

@ -40,9 +40,9 @@ import mage.abilities.costs.common.SacrificeTargetCost;
import mage.abilities.effects.common.continious.GainAbilityTargetEffect;
import mage.abilities.keyword.IndestructibleAbility;
import mage.cards.CardImpl;
import mage.filter.Filter;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.target.TargetPermanent;
import mage.target.common.TargetControlledPermanent;
@ -55,10 +55,8 @@ public class SlobadGoblinTinkerer extends CardImpl<SlobadGoblinTinkerer> {
private final static FilterControlledPermanent filterControlled = new FilterControlledPermanent("an artifact");
static {
filter.getCardType().add(CardType.ARTIFACT);
filter.setScopeCardType(Filter.ComparisonScope.Any);
filterControlled.getCardType().add(CardType.ARTIFACT);
filterControlled.setScopeCardType(Filter.ComparisonScope.Any);
filter.add(new CardTypePredicate(CardType.ARTIFACT));
filterControlled.add(new CardTypePredicate(CardType.ARTIFACT));
}
public SlobadGoblinTinkerer(UUID ownerId) {

View file

@ -36,8 +36,9 @@ import mage.Constants.Rarity;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl;
import mage.filter.Filter;
import mage.filter.FilterPermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
@ -71,9 +72,7 @@ class SoulscourEffect extends OneShotEffect<SoulscourEffect> {
private final static FilterPermanent filter = new FilterPermanent("");
static {
filter.getCardType().add(CardType.ARTIFACT);
filter.getNotCardType().add(true);
filter.setScopeCardType(Filter.ComparisonScope.Any);
filter.add(Predicates.not(new CardTypePredicate(CardType.ARTIFACT)));
}
public SoulscourEffect() {

View file

@ -42,6 +42,7 @@ import mage.abilities.costs.mana.ColoredManaCost;
import mage.abilities.effects.common.search.SearchLibraryRevealPutInHandEffect;
import mage.cards.CardImpl;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.target.common.TargetCardInLibrary;
@ -53,7 +54,7 @@ public class SteelshaperApprentice extends CardImpl<SteelshaperApprentice> {
private static final FilterCard filter = new FilterCard("Equipment card");
static {
filter.getCardType().add(CardType.ARTIFACT);
filter.add(new CardTypePredicate(CardType.ARTIFACT));
filter.add(new SubtypePredicate("Equipment"));
}

View file

@ -40,8 +40,9 @@ import mage.abilities.costs.common.SacrificeSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.cards.CardImpl;
import mage.filter.Filter;
import mage.filter.FilterPermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.target.TargetPermanent;
/**
@ -52,9 +53,9 @@ public class ViridianZealot extends CardImpl<ViridianZealot> {
private static final FilterPermanent filter = new FilterPermanent("artifact or enchantment");
static {
filter.getCardType().add(CardType.ARTIFACT);
filter.getCardType().add(CardType.ENCHANTMENT);
filter.setScopeCardType(Filter.ComparisonScope.Any);
filter.add(Predicates.or(
new CardTypePredicate(CardType.ARTIFACT),
new CardTypePredicate(CardType.ENCHANTMENT)));
}
public ViridianZealot(UUID ownerId) {

View file

@ -39,8 +39,8 @@ import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.common.UntapTargetEffect;
import mage.cards.CardImpl;
import mage.filter.Filter;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.target.common.TargetCreaturePermanent;
/**
@ -51,8 +51,7 @@ public class VoltaicConstruct extends CardImpl<VoltaicConstruct> {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("artifact");
static {
filter.getCardType().add(CardType.ARTIFACT);
filter.setScopeCardType(Filter.ComparisonScope.Any);
filter.add(new CardTypePredicate(CardType.ARTIFACT));
}
public VoltaicConstruct(UUID ownerId) {

View file

@ -41,8 +41,8 @@ import mage.abilities.effects.common.BasicManaEffect;
import mage.abilities.effects.common.ReturnToHandTargetEffect;
import mage.abilities.mana.SimpleManaAbility;
import mage.cards.CardImpl;
import mage.filter.Filter;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.target.Target;
import mage.target.common.TargetControlledPermanent;
@ -54,8 +54,7 @@ public class AzoriusChancery extends CardImpl<AzoriusChancery> {
private final static FilterControlledPermanent filter = new FilterControlledPermanent("land you control");
static {
filter.getCardType().add(CardType.LAND);
filter.setScopeCardType(Filter.ComparisonScope.Any);
filter.add(new CardTypePredicate(CardType.LAND));
}
public AzoriusChancery(UUID ownerId) {

View file

@ -36,8 +36,9 @@ import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.cards.CardImpl;
import mage.filter.Filter;
import mage.filter.FilterPermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.target.TargetPermanent;
/**
@ -48,9 +49,9 @@ public class IndrikStomphowler extends CardImpl<IndrikStomphowler> {
private final static FilterPermanent filter = new FilterPermanent("artifact or enchantment");
static {
filter.getCardType().add(CardType.ARTIFACT);
filter.getCardType().add(CardType.ENCHANTMENT);
filter.setScopeCardType(Filter.ComparisonScope.Any);
filter.add(Predicates.or(
new CardTypePredicate(CardType.ARTIFACT),
new CardTypePredicate(CardType.ENCHANTMENT)));
}
public IndrikStomphowler(UUID ownerId) {

View file

@ -41,8 +41,8 @@ import mage.abilities.effects.common.BasicManaEffect;
import mage.abilities.effects.common.ReturnToHandTargetEffect;
import mage.abilities.mana.SimpleManaAbility;
import mage.cards.CardImpl;
import mage.filter.Filter;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.target.Target;
import mage.target.common.TargetControlledPermanent;
@ -53,8 +53,7 @@ public class RakdosCarnarium extends CardImpl<RakdosCarnarium> {
private final static FilterControlledPermanent filter = new FilterControlledPermanent("land you control");
static {
filter.getCardType().add(CardType.LAND);
filter.setScopeCardType(Filter.ComparisonScope.Any);
filter.add(new CardTypePredicate(CardType.LAND));
}
public RakdosCarnarium(UUID ownerId) {

View file

@ -41,8 +41,8 @@ import mage.abilities.effects.common.BasicManaEffect;
import mage.abilities.effects.common.ReturnToHandTargetEffect;
import mage.abilities.mana.SimpleManaAbility;
import mage.cards.CardImpl;
import mage.filter.Filter;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.target.Target;
import mage.target.common.TargetControlledPermanent;
@ -54,8 +54,7 @@ public class SimicGrowthChamber extends CardImpl<SimicGrowthChamber> {
private final static FilterControlledPermanent filter = new FilterControlledPermanent("land you control");
static {
filter.getCardType().add(CardType.LAND);
filter.setScopeCardType(Filter.ComparisonScope.Any);
filter.add(new CardTypePredicate(CardType.LAND));
}
public SimicGrowthChamber(UUID ownerId) {

View file

@ -42,6 +42,7 @@ import mage.abilities.keyword.FlyingAbility;
import mage.abilities.keyword.PersistAbility;
import mage.cards.CardImpl;
import mage.filter.FilterPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.target.TargetPermanent;
/**
@ -49,10 +50,10 @@ import mage.target.TargetPermanent;
* @author Loki
*/
public class KithkinSpellduster extends CardImpl<KithkinSpellduster> {
private static FilterPermanent filter = new FilterPermanent("enchantment");
private static final FilterPermanent filter = new FilterPermanent("enchantment");
static {
filter.getCardType().add(CardType.ENCHANTMENT);
filter.add(new CardTypePredicate(CardType.ENCHANTMENT));
}
public KithkinSpellduster(UUID ownerId) {

View file

@ -36,8 +36,8 @@ import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.effects.common.ReturnToHandTargetEffect;
import mage.cards.CardImpl;
import mage.filter.Filter;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.target.common.TargetControlledPermanent;
/**
@ -48,8 +48,7 @@ public class NoggleBridgebreaker extends CardImpl<NoggleBridgebreaker> {
private final static FilterControlledPermanent filter = new FilterControlledPermanent("land you control");
static {
filter.getCardType().add(CardType.LAND);
filter.setScopeCardType(Filter.ComparisonScope.Any);
filter.add(new CardTypePredicate(CardType.LAND));
}
public NoggleBridgebreaker(UUID ownerId) {

View file

@ -41,8 +41,8 @@ import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.common.DrawCardControllerEffect;
import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect;
import mage.cards.CardImpl;
import mage.filter.Filter;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.target.common.TargetCardInYourGraveyard;
/**
@ -53,9 +53,8 @@ public class Scarecrone extends CardImpl<Scarecrone> {
private final static FilterCard filter = new FilterCard("artifact creature card from your graveyard");
static {
filter.getCardType().add(CardType.ARTIFACT);
filter.getCardType().add(CardType.CREATURE);
filter.setScopeCardType(Filter.ComparisonScope.All);
filter.add(new CardTypePredicate(CardType.ARTIFACT));
filter.add(new CardTypePredicate(CardType.CREATURE));
}
public Scarecrone(UUID ownerId) {

View file

@ -44,6 +44,8 @@ import mage.cards.CardImpl;
import mage.counters.CounterType;
import mage.filter.Filter;
import mage.filter.FilterPermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.target.TargetPermanent;
/**
@ -54,9 +56,9 @@ public class WickerboughElder extends CardImpl<WickerboughElder> {
private final static FilterPermanent filter = new FilterPermanent("artifact or enchantment");
static {
filter.getCardType().add(CardType.ARTIFACT);
filter.getCardType().add(CardType.ENCHANTMENT);
filter.setScopeCardType(Filter.ComparisonScope.Any);
filter.add(Predicates.or(
new CardTypePredicate(CardType.ARTIFACT),
new CardTypePredicate(CardType.ENCHANTMENT)));
}
public WickerboughElder(UUID ownerId) {

View file

@ -36,6 +36,8 @@ import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DamageControllerEffect;
import mage.cards.CardImpl;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.TargetPermanent;
@ -49,7 +51,7 @@ public class AshesToAshes extends CardImpl<AshesToAshes> {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("nonartifact creature");
static {
filter.getNotCardType().add(CardType.ARTIFACT);
filter.add(Predicates.not(new CardTypePredicate(CardType.ARTIFACT)));
}
public AshesToAshes(UUID ownerId) {

View file

@ -35,8 +35,8 @@ import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility;
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.cards.CardImpl;
import mage.filter.Filter;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.permanent.token.Token;
/**
@ -47,8 +47,7 @@ public class DuneBroodNephilim extends CardImpl<DuneBroodNephilim> {
final static FilterControlledPermanent filterLands = new FilterControlledPermanent("land you control");
static {
filterLands.getCardType().add(CardType.LAND);
filterLands.setScopeCardType(Filter.ComparisonScope.Any);
filterLands.add(new CardTypePredicate(CardType.LAND));
}
public DuneBroodNephilim(UUID ownerId) {

Some files were not shown because too many files have changed in this diff Show more