mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 04:52:07 -08:00
Merge pull request #2536 from nigelzor/shortcut-filters
use TargetArtifactPermanent, etc.
This commit is contained in:
commit
0ad74e8a9b
159 changed files with 256 additions and 1037 deletions
|
|
@ -28,15 +28,13 @@
|
|||
|
||||
package mage.abilities.keyword;
|
||||
|
||||
import mage.constants.TargetController;
|
||||
import mage.constants.TimingRule;
|
||||
import mage.constants.Zone;
|
||||
import mage.abilities.ActivatedAbilityImpl;
|
||||
import mage.abilities.costs.Cost;
|
||||
import mage.abilities.effects.common.AttachEffect;
|
||||
import mage.filter.common.FilterLandPermanent;
|
||||
import mage.filter.predicate.permanent.ControllerPredicate;
|
||||
import mage.target.common.TargetLandPermanent;
|
||||
import mage.filter.common.FilterControlledLandPermanent;
|
||||
import mage.target.TargetPermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -45,16 +43,9 @@ import mage.target.common.TargetLandPermanent;
|
|||
|
||||
//20091005 - 702.64
|
||||
public class FortifyAbility extends ActivatedAbilityImpl {
|
||||
|
||||
private static final FilterLandPermanent filter = new FilterLandPermanent("land you control");
|
||||
|
||||
static {
|
||||
filter.add(new ControllerPredicate(TargetController.YOU));
|
||||
}
|
||||
|
||||
public FortifyAbility(Zone zone, AttachEffect effect, Cost cost) {
|
||||
super(zone, effect, cost);
|
||||
this.addTarget(new TargetLandPermanent(filter));
|
||||
this.addTarget(new TargetPermanent(new FilterControlledLandPermanent()));
|
||||
timing = TimingRule.SORCERY;
|
||||
}
|
||||
|
||||
|
|
@ -66,6 +57,4 @@ public class FortifyAbility extends ActivatedAbilityImpl {
|
|||
public FortifyAbility copy() {
|
||||
return new FortifyAbility(this);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -147,8 +147,6 @@ public interface Card extends MageObject {
|
|||
|
||||
List<Mana> getMana();
|
||||
|
||||
void build();
|
||||
|
||||
/**
|
||||
*
|
||||
* @return true if there exists various art images for this card
|
||||
|
|
|
|||
|
|
@ -190,7 +190,6 @@ public abstract class CardImpl extends MageObjectImpl implements Card {
|
|||
Constructor<?> con = clazz.getConstructor(UUID.class, CardSetInfo.class);
|
||||
card = (Card) con.newInstance(null, setInfo);
|
||||
}
|
||||
card.build();
|
||||
return card;
|
||||
} catch (Exception e) {
|
||||
logger.fatal("Error loading card: " + clazz.getCanonicalName(), e);
|
||||
|
|
@ -597,10 +596,6 @@ public abstract class CardImpl extends MageObjectImpl implements Card {
|
|||
return splitCard;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void build() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getUsesVariousArt() {
|
||||
return usesVariousArt;
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ public class FilterArtifactOrEnchantmentPermanent extends FilterPermanent {
|
|||
|
||||
public FilterArtifactOrEnchantmentPermanent(String name) {
|
||||
super(name);
|
||||
this.add(Predicates.or(new CardTypePredicate(CardType.ARTIFACT),new CardTypePredicate(CardType.ENCHANTMENT)));
|
||||
this.add(Predicates.or(new CardTypePredicate(CardType.ARTIFACT), new CardTypePredicate(CardType.ENCHANTMENT)));
|
||||
}
|
||||
|
||||
public FilterArtifactOrEnchantmentPermanent(final FilterArtifactOrEnchantmentPermanent filter) {
|
||||
|
|
|
|||
|
|
@ -30,8 +30,10 @@ package mage.filter.common;
|
|||
|
||||
import mage.constants.CardType;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.predicate.mageobject.CardTypePredicate;
|
||||
import mage.filter.predicate.mageobject.SubtypePredicate;
|
||||
import mage.filter.predicate.mageobject.SupertypePredicate;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -53,6 +55,18 @@ public class FilterLandPermanent extends FilterPermanent {
|
|||
this.add(new CardTypePredicate(CardType.LAND));
|
||||
this.add(new SubtypePredicate(subtype));
|
||||
}
|
||||
|
||||
public static FilterLandPermanent nonbasicLand() {
|
||||
FilterLandPermanent filter = new FilterLandPermanent("nonbasic land");
|
||||
filter.add(Predicates.not(new SupertypePredicate("Basic")));
|
||||
return filter;
|
||||
}
|
||||
|
||||
public static FilterLandPermanent nonbasicLands() {
|
||||
FilterLandPermanent filter = new FilterLandPermanent("nonbasic lands");
|
||||
filter.add(Predicates.not(new SupertypePredicate("Basic")));
|
||||
return filter;
|
||||
}
|
||||
|
||||
public FilterLandPermanent(final FilterLandPermanent filter) {
|
||||
super(filter);
|
||||
|
|
|
|||
|
|
@ -840,10 +840,6 @@ public class Spell extends StackObjImpl implements Card {
|
|||
return isCopiedSpell();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void build() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Counters getCounters(Game game) {
|
||||
return card.getCounters(game);
|
||||
|
|
|
|||
|
|
@ -55,7 +55,6 @@ public class TargetArtifactPermanent extends TargetPermanent {
|
|||
|
||||
public TargetArtifactPermanent(int minNumTargets, int maxNumTargets, FilterArtifactPermanent filter, boolean notTarget) {
|
||||
super(minNumTargets, maxNumTargets, filter, notTarget);
|
||||
this.targetName = filter.getMessage();
|
||||
}
|
||||
|
||||
public TargetArtifactPermanent(final TargetArtifactPermanent target) {
|
||||
|
|
|
|||
|
|
@ -47,7 +47,6 @@ public class TargetAttackingCreature extends TargetPermanent {
|
|||
|
||||
public TargetAttackingCreature(int minNumTargets, int maxNumTargets, FilterAttackingCreature filter, boolean notTarget) {
|
||||
super(minNumTargets, maxNumTargets, filter, notTarget);
|
||||
this.targetName = filter.getMessage();
|
||||
}
|
||||
|
||||
public TargetAttackingCreature(final TargetAttackingCreature target) {
|
||||
|
|
|
|||
|
|
@ -47,7 +47,6 @@ public class TargetAttackingOrBlockingCreature extends TargetPermanent {
|
|||
|
||||
public TargetAttackingOrBlockingCreature(int minNumTargets, int maxNumTargets, FilterAttackingOrBlockingCreature filter, boolean notTarget) {
|
||||
super(minNumTargets, maxNumTargets, filter, notTarget);
|
||||
this.targetName = filter.getMessage();
|
||||
}
|
||||
|
||||
public TargetAttackingOrBlockingCreature(final TargetAttackingOrBlockingCreature target) {
|
||||
|
|
|
|||
|
|
@ -47,7 +47,6 @@ public class TargetCardInASingleGraveyard extends TargetCard {
|
|||
|
||||
public TargetCardInASingleGraveyard(int minNumTargets, int maxNumTargets, FilterCard filter) {
|
||||
super(minNumTargets, maxNumTargets, Zone.GRAVEYARD, filter);
|
||||
this.targetName = filter.getMessage();
|
||||
}
|
||||
|
||||
public TargetCardInASingleGraveyard(final TargetCardInASingleGraveyard target) {
|
||||
|
|
|
|||
|
|
@ -73,7 +73,6 @@ public class TargetCardInExile extends TargetCard {
|
|||
} else {
|
||||
this.allExileZones = allExileZones;
|
||||
}
|
||||
this.targetName = filter.getMessage();
|
||||
}
|
||||
|
||||
public TargetCardInExile(final TargetCardInExile target) {
|
||||
|
|
|
|||
|
|
@ -56,7 +56,6 @@ public class TargetCardInGraveyard extends TargetCard {
|
|||
|
||||
public TargetCardInGraveyard(int minNumTargets, int maxNumTargets, FilterCard filter) {
|
||||
super(minNumTargets, maxNumTargets, Zone.GRAVEYARD, filter);
|
||||
this.targetName = filter.getMessage();
|
||||
}
|
||||
|
||||
public TargetCardInGraveyard(final TargetCardInGraveyard target) {
|
||||
|
|
|
|||
|
|
@ -60,7 +60,6 @@ public class TargetCardInHand extends TargetCard {
|
|||
|
||||
public TargetCardInHand(int minNumTargets, int maxNumTargets, FilterCard filter) {
|
||||
super(minNumTargets, maxNumTargets, Zone.HAND, filter);
|
||||
this.targetName = filter.getMessage();
|
||||
}
|
||||
|
||||
public TargetCardInHand(final TargetCardInHand target) {
|
||||
|
|
|
|||
|
|
@ -26,7 +26,6 @@ public class TargetCardInOpponentsGraveyard extends TargetCard {
|
|||
|
||||
public TargetCardInOpponentsGraveyard(int minNumTargets, int maxNumTargets, FilterCard filter, boolean allFromOneOpponent) {
|
||||
super(minNumTargets, maxNumTargets, Zone.GRAVEYARD, filter);
|
||||
this.targetName = filter.getMessage();
|
||||
this.allFromOneOpponent = allFromOneOpponent;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -60,7 +60,6 @@ public class TargetCardInYourGraveyard extends TargetCard {
|
|||
|
||||
public TargetCardInYourGraveyard(int minNumTargets, int maxNumTargets, FilterCard filter) {
|
||||
super(minNumTargets, maxNumTargets, Zone.GRAVEYARD, filter);
|
||||
this.targetName = filter.getMessage();
|
||||
}
|
||||
|
||||
public TargetCardInYourGraveyard(final TargetCardInYourGraveyard target) {
|
||||
|
|
|
|||
|
|
@ -53,7 +53,6 @@ public class TargetControlledCreaturePermanent extends TargetControlledPermanent
|
|||
|
||||
public TargetControlledCreaturePermanent(int minNumTargets, int maxNumTargets, FilterControlledCreaturePermanent filter, boolean notTarget) {
|
||||
super(minNumTargets, maxNumTargets, filter, notTarget);
|
||||
this.targetName = filter.getMessage();
|
||||
}
|
||||
|
||||
public TargetControlledCreaturePermanent(final TargetControlledCreaturePermanent target) {
|
||||
|
|
|
|||
|
|
@ -51,7 +51,6 @@ public class TargetControlledPermanent extends TargetPermanent {
|
|||
|
||||
public TargetControlledPermanent(int minNumTargets, int maxNumTargets, FilterControlledPermanent filter, boolean notTarget) {
|
||||
super(minNumTargets, maxNumTargets, filter, notTarget);
|
||||
this.targetName = filter.getMessage();
|
||||
}
|
||||
|
||||
public TargetControlledPermanent(final TargetControlledPermanent target) {
|
||||
|
|
|
|||
|
|
@ -46,7 +46,6 @@ public class TargetCreatureOrPlaneswalker extends TargetPermanent {
|
|||
|
||||
public TargetCreatureOrPlaneswalker(int minNumTargets, int maxNumTargets, FilterCreatureOrPlaneswalkerPermanent filter, boolean notTarget) {
|
||||
super(minNumTargets, maxNumTargets, filter, notTarget);
|
||||
this.targetName = filter.getMessage();
|
||||
}
|
||||
|
||||
public TargetCreatureOrPlaneswalker(final TargetCreatureOrPlaneswalker target) {
|
||||
|
|
|
|||
|
|
@ -55,7 +55,6 @@ public class TargetCreaturePermanent extends TargetPermanent {
|
|||
|
||||
public TargetCreaturePermanent(int minNumTargets, int maxNumTargets, FilterCreaturePermanent filter, boolean notTarget) {
|
||||
super(minNumTargets, maxNumTargets, filter, notTarget);
|
||||
this.targetName = filter.getMessage();
|
||||
}
|
||||
|
||||
public TargetCreaturePermanent(final TargetCreaturePermanent target) {
|
||||
|
|
|
|||
|
|
@ -51,7 +51,6 @@ public class TargetEnchantmentPermanent extends TargetPermanent {
|
|||
|
||||
public TargetEnchantmentPermanent(int minNumTargets, int maxNumTargets, FilterEnchantmentPermanent filter, boolean notTarget) {
|
||||
super(minNumTargets, maxNumTargets, filter, notTarget);
|
||||
this.targetName = filter.getMessage();
|
||||
}
|
||||
|
||||
public TargetEnchantmentPermanent(final TargetEnchantmentPermanent target) {
|
||||
|
|
|
|||
|
|
@ -51,7 +51,6 @@ public class TargetLandPermanent extends TargetPermanent {
|
|||
|
||||
public TargetLandPermanent(int minNumTargets, int maxNumTargets, FilterLandPermanent filter, boolean notTarget) {
|
||||
super(minNumTargets, maxNumTargets, filter, notTarget);
|
||||
this.targetName = filter.getMessage();
|
||||
}
|
||||
|
||||
public TargetLandPermanent(final TargetLandPermanent target) {
|
||||
|
|
|
|||
|
|
@ -55,7 +55,6 @@ public class TargetNonlandPermanent extends TargetPermanent {
|
|||
|
||||
public TargetNonlandPermanent(int minNumTargets, int maxNumTargets, FilterNonlandPermanent filter, boolean notTarget) {
|
||||
super(minNumTargets, maxNumTargets, filter, notTarget);
|
||||
this.targetName = filter.getMessage();
|
||||
}
|
||||
|
||||
public TargetNonlandPermanent(final TargetNonlandPermanent target) {
|
||||
|
|
|
|||
|
|
@ -25,12 +25,10 @@ public class TargetOpponentsChoicePermanent extends TargetPermanent {
|
|||
|
||||
public TargetOpponentsChoicePermanent(FilterPermanent filter) {
|
||||
super(1, 1, filter, false);
|
||||
this.targetName = filter.getMessage();
|
||||
}
|
||||
|
||||
public TargetOpponentsChoicePermanent(int minNumTargets, int maxNumTargets, FilterPermanent filter, boolean notTarget, boolean dontTargetPlayer) {
|
||||
super(minNumTargets, maxNumTargets, filter, notTarget);
|
||||
this.targetName = filter.getMessage();
|
||||
this.dontTargetPlayer = dontTargetPlayer;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -75,7 +75,6 @@ public class TargetSpellOrPermanent extends TargetImpl {
|
|||
this.minNumberOfTargets = minNumTargets;
|
||||
this.maxNumberOfTargets = maxNumTargets;
|
||||
this.zone = Zone.ALL;
|
||||
this.targetName = filter.getMessage();
|
||||
this.notTarget = notTarget;
|
||||
this.filter = filter;
|
||||
this.targetName = filter.getMessage();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue