fix a few instances of cards incorrectly filtering only for creatures

This commit is contained in:
theelk801 2026-01-22 12:29:56 -05:00
parent 3c55e1006d
commit 693cd16645
10 changed files with 66 additions and 86 deletions

View file

@ -1,7 +1,5 @@
package mage.cards.a;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
@ -11,24 +9,20 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.filter.FilterPermanent;
import mage.target.TargetPermanent;
import java.util.UUID;
/**
*
* @author LoneFox
*/
public final class AliBaba extends CardImpl {
private static final FilterPermanent filter = new FilterPermanent("Wall");
static {
filter.add(SubType.WALL.getPredicate());
}
private static final FilterPermanent filter = new FilterPermanent(SubType.WALL, "Wall");
public AliBaba(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{R}");
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{R}");
this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.ROGUE);
this.power = new MageInt(1);

View file

@ -1,38 +1,39 @@
package mage.cards.a;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.IntPlusDynamicValue;
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect;
import mage.constants.SubType;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.TargetController;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.Predicates;
import java.util.UUID;
/**
*
* @author TheElk801
*/
public final class AysenCrusader extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Soldiers and Warriors you control");
private static final FilterPermanent filter = new FilterControlledPermanent("Soldiers and Warriors you control");
static {
filter.add(Predicates.or(
SubType.SOLDIER.getPredicate(),
SubType.WARRIOR.getPredicate()
));
filter.add(TargetController.YOU.getControllerPredicate());
}
private static final DynamicValue value = new IntPlusDynamicValue(2, new PermanentsOnBattlefieldCount(filter));
public AysenCrusader(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{W}{W}");
@ -42,7 +43,6 @@ public final class AysenCrusader extends CardImpl {
this.toughness = new MageInt(2);
// Aysen Crusader's power and toughness are each equal to 2 plus the number of Soldiers and Warriors you control.
DynamicValue value = new IntPlusDynamicValue(2, new PermanentsOnBattlefieldCount(filter));
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetBasePowerToughnessSourceEffect(value)));
}

View file

@ -13,12 +13,10 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.constants.Zone;
import mage.counters.CounterType;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.FilterPermanent;
import mage.filter.predicate.mageobject.AnotherPredicate;
import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
@ -27,10 +25,9 @@ import java.util.UUID;
*/
public final class BaronSengir extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("another target Vampire");
private static final FilterPermanent filter = new FilterPermanent(SubType.VAMPIRE, "another target Vampire");
static {
filter.add(SubType.VAMPIRE.getPredicate());
filter.add(AnotherPredicate.instance);
}

View file

@ -1,7 +1,5 @@
package mage.cards.d;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
@ -11,25 +9,21 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterCreaturePermanent;
import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/**
*
* @author Plopman
*/
public final class DwarvenDemolitionTeam extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Wall");
static{
filter.add(SubType.WALL.getPredicate());
}
private static final FilterPermanent filter = new FilterCreaturePermanent(SubType.WALL, "Wall");
public DwarvenDemolitionTeam(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{R}");
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{R}");
this.subtype.add(SubType.DWARF);
this.power = new MageInt(1);

View file

@ -1,36 +1,36 @@
package mage.cards.g;
import java.util.UUID;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.hint.Hint;
import mage.abilities.hint.ValueHint;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.TargetController;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.common.FilterControlledPermanent;
import mage.target.common.TargetPlayerOrPlaneswalker;
import java.util.UUID;
/**
*
* @author LevelX2
*/
public final class GoblinWarStrike extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Goblins you control");
static {
filter.add(SubType.GOBLIN.getPredicate());
filter.add(TargetController.YOU.getControllerPredicate());
}
private static final DynamicValue xValue = new PermanentsOnBattlefieldCount(
new FilterControlledPermanent(SubType.GOBLIN, "Goblins you control"), null
);
private static final Hint hint = new ValueHint("Goblins you control", xValue);
public GoblinWarStrike(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{R}");
// Goblin War Strike deals damage equal to the number of Goblins you control to target player.
this.getSpellAbility().addEffect(new DamageTargetEffect(new PermanentsOnBattlefieldCount(filter, null)));
this.getSpellAbility().addEffect(new DamageTargetEffect(xValue));
this.getSpellAbility().addTarget(new TargetPlayerOrPlaneswalker());
this.getSpellAbility().addHint(hint);
}
private GoblinWarStrike(final GoblinWarStrike card) {

View file

@ -1,7 +1,5 @@
package mage.cards.h;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
@ -19,19 +17,20 @@ import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterControlledLandPermanent;
import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game;
import mage.game.permanent.token.SandWarriorToken;
import mage.players.Player;
import java.util.UUID;
/**
*
* @author LevelX2
*/
public final class HazezonTamar extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Sand Warriors");
private static final FilterPermanent filter = new FilterPermanent("Sand Warriors");
static {
filter.add(SubType.SAND.getPredicate());
@ -49,6 +48,7 @@ public final class HazezonTamar extends CardImpl {
// When Hazezon Tamar enters the battlefield, create X 1/1 Sand Warrior creature tokens that are red, green, and white at the beginning of your next upkeep, where X is the number of lands you control at that time.
this.addAbility(new EntersBattlefieldTriggeredAbility(new HazezonTamarEntersEffect(), false));
// When Hazezon leaves the battlefield, exile all Sand Warriors.
this.addAbility(new LeavesBattlefieldTriggeredAbility(new ExileAllEffect(filter), false));
}

View file

@ -12,7 +12,7 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterCreaturePermanent;
import mage.target.TargetPermanent;
@ -24,6 +24,7 @@ import java.util.UUID;
public final class ThrullChampion extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent(SubType.THRULL, "Thrull creatures");
private static final FilterPermanent filter2 = new FilterPermanent(SubType.THRULL);
public ThrullChampion(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{B}");
@ -32,12 +33,13 @@ public final class ThrullChampion extends CardImpl {
this.toughness = new MageInt(2);
// Thrull creatures get +1/+1.
this.addAbility(new SimpleStaticAbility(new BoostAllEffect(1, 1, Duration.WhileOnBattlefield, filter, false)));
this.addAbility(new SimpleStaticAbility(new BoostAllEffect(
1, 1, Duration.WhileOnBattlefield, filter, false
)));
// {tap}: Gain control of target Thrull for as long as you control Thrull Champion.
Ability ability = new SimpleActivatedAbility(new GainControlTargetEffect(Duration.WhileControlled)
.setText("gain control of target Thrull for as long as you control {this}"), new TapSourceCost());
ability.addTarget(new TargetPermanent(filter));
Ability ability = new SimpleActivatedAbility(new GainControlTargetEffect(Duration.WhileControlled), new TapSourceCost());
ability.addTarget(new TargetPermanent(filter2));
this.addAbility(ability);
}

View file

@ -1,7 +1,5 @@
package mage.cards.t;
import java.util.UUID;
import mage.abilities.effects.common.DestroyAllEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -9,20 +7,17 @@ import mage.constants.CardType;
import mage.constants.SubType;
import mage.filter.FilterPermanent;
import java.util.UUID;
/**
*
* @author fireshoes
*/
public final class TivadarsCrusade extends CardImpl {
private static final FilterPermanent filter = new FilterPermanent("Goblins");
static {
filter.add(SubType.GOBLIN.getPredicate());
}
private static final FilterPermanent filter = new FilterPermanent(SubType.GOBLIN, "Goblins");
public TivadarsCrusade(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{1}{W}{W}");
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{W}{W}");
// Destroy all Goblins.
this.getSpellAbility().addEffect(new DestroyAllEffect(filter));

View file

@ -1,12 +1,9 @@
package mage.cards.z;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.RegenerateSourceEffect;
import mage.abilities.effects.common.continuous.GainAbilityAllEffect;
import mage.abilities.keyword.SwampwalkAbility;
@ -15,38 +12,35 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterCreaturePermanent;
import java.util.UUID;
/**
*
* @author KholdFuzion
*
*/
public final class ZombieMaster extends CardImpl {
private static final FilterPermanent filter = new FilterPermanent("Zombie creatures");
static {
filter.add(SubType.ZOMBIE.getPredicate());
}
private static final FilterPermanent filter = new FilterCreaturePermanent(SubType.ZOMBIE, "Zombie creatures");
private static final FilterPermanent filter2 = new FilterPermanent(SubType.ZOMBIE, "Zombies");
public ZombieMaster(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{B}{B}");
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{B}{B}");
this.subtype.add(SubType.ZOMBIE);
this.power = new MageInt(2);
this.toughness = new MageInt(3);
// Other Zombie creatures have swampwalk.
Effect effect = new GainAbilityAllEffect(new SwampwalkAbility(), Duration.WhileOnBattlefield, filter, true);
effect.setText("Other Zombie creatures have swampwalk. <i>(They can't be blocked as long as defending player controls a Swamp.)</i>");
this.addAbility(new SimpleStaticAbility(effect));
// Other Zombies have "{B}: Regenerate this permanent."
effect = new GainAbilityAllEffect(new SimpleActivatedAbility(new RegenerateSourceEffect(), new ManaCostsImpl<>("{B}")), Duration.WhileOnBattlefield, filter, true);
effect.setText("Other Zombies have \"{B}: Regenerate this permanent.\"");
this.addAbility(new SimpleStaticAbility(effect));
this.addAbility(new SimpleStaticAbility(new GainAbilityAllEffect(
new SwampwalkAbility(), Duration.WhileOnBattlefield, filter, true
)));
// Other Zombies have "{B}: Regenerate this permanent."
this.addAbility(new SimpleStaticAbility(new GainAbilityAllEffect(new SimpleActivatedAbility(
new RegenerateSourceEffect("this permanent"), new ManaCostsImpl<>("{B}")
), Duration.WhileOnBattlefield, filter2, true)));
}
private ZombieMaster(final ZombieMaster card) {

View file

@ -29,6 +29,10 @@ public class FilterPermanent extends FilterObject<Permanent> implements FilterIn
super(name);
}
public FilterPermanent(SubType subtype) {
this(subtype, subtype.getDescription());
}
public FilterPermanent(SubType subtype, String name) {
super(name);
this.add(subtype.getPredicate());