Fix some cards that care about subtypes to include non-creature cards of the subtype

This commit is contained in:
LoneFox 2015-10-27 13:26:18 +02:00
parent ad8074a650
commit 3562047beb
9 changed files with 56 additions and 35 deletions

View file

@ -34,7 +34,9 @@ import mage.abilities.effects.common.DynamicManaEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
/**
*
@ -42,12 +44,18 @@ import mage.filter.common.FilterCreaturePermanent;
*/
public class BrightstoneRitual extends CardImpl {
private static final FilterPermanent filter = new FilterPermanent("Goblin on the battlefield");
static {
filter.add(new SubtypePredicate("Goblin"));
}
public BrightstoneRitual(UUID ownerId) {
super(ownerId, 191, "Brightstone Ritual", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{R}");
this.expansionSetCode = "ONS";
// Add {R} to your mana pool for each Goblin on the battlefield.
this.getSpellAbility().addEffect(new DynamicManaEffect(Mana.RedMana, new PermanentsOnBattlefieldCount(new FilterCreaturePermanent("Goblin","Goblin on the battlefield"))));
this.getSpellAbility().addEffect(new DynamicManaEffect(Mana.RedMana, new PermanentsOnBattlefieldCount(filter)));
}
public BrightstoneRitual(final BrightstoneRitual card) {

View file

@ -33,25 +33,26 @@ import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.SacrificeTargetCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.GainLifeEffect;
import mage.abilities.effects.common.LoseLifeTargetEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.target.TargetPlayer;
import mage.target.common.TargetControlledCreaturePermanent;
import mage.target.common.TargetControlledPermanent;
/**
*
* @author fireshoes
*/
public class CabalArchon extends CardImpl {
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("Cleric");
private static final FilterControlledPermanent filter = new FilterControlledPermanent("a Cleric");
static {
filter.add(new SubtypePredicate("Cleric"));
}
@ -66,8 +67,10 @@ public class CabalArchon extends CardImpl {
// {B}, Sacrifice a Cleric: Target player loses 2 life and you gain 2 life.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new LoseLifeTargetEffect(2), new ManaCostsImpl("{B}"));
ability.addEffect(new GainLifeEffect(2));
ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(1, 1, filter, false)));
Effect effect = new GainLifeEffect(2);
effect.setText("and you gain 2 life");
ability.addEffect(effect);
ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(1, 1, filter, false)));
ability.addTarget(new TargetPlayer());
this.addAbility(ability);
}

View file

@ -28,20 +28,20 @@
package mage.sets.onslaught;
import java.util.UUID;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.CountersCount;
import mage.abilities.dynamicvalue.common.ManacostVariableValue;
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
import mage.abilities.dynamicvalue.common.SignInversionDynamicValue;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.continuous.BoostTargetEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.counters.CounterType;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.target.common.TargetCreaturePermanent;
@ -51,13 +51,21 @@ import mage.target.common.TargetCreaturePermanent;
*/
public class FeedingFrenzy extends CardImpl {
private static final FilterPermanent filter = new FilterPermanent();
static {
filter.add(new SubtypePredicate("Zombie"));
}
public FeedingFrenzy(UUID ownerId) {
super(ownerId, 147, "Feeding Frenzy", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{2}{B}");
this.expansionSetCode = "ONS";
// Target creature gets -X/-X until end of turn, where X is the number of Zombies on the battlefield.
DynamicValue x = new PermanentsOnBattlefieldCount(new FilterCreaturePermanent("Zombie", "Zombie on the battlefield"), -1);
this.getSpellAbility().addEffect(new BoostTargetEffect(x, x, Duration.EndOfTurn));
DynamicValue x = new PermanentsOnBattlefieldCount(filter, -1);
Effect effect = new BoostTargetEffect(x, x, Duration.EndOfTurn);
effect.setText("Target creature gets -X/-X until end of turn, where X is the number of Zombies on the battlefield");
this.getSpellAbility().addEffect(effect);
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
}

View file

@ -38,17 +38,18 @@ import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.target.common.TargetControlledCreaturePermanent;
import mage.target.common.TargetControlledPermanent;
/**
*
* @author emerald000
*/
public class RiptideLaboratory extends CardImpl {
private final static FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("Wizard");
private final static FilterControlledPermanent filter = new FilterControlledPermanent("Wizard you control");
static {
filter.add(new SubtypePredicate("Wizard"));
}
@ -59,11 +60,11 @@ public class RiptideLaboratory extends CardImpl {
// {tap}: Add {1} to your mana pool.
this.addAbility(new ColorlessManaAbility());
// {1}{U}, {tap}: Return target Wizard you control to its owner's hand.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ReturnToHandTargetEffect(), new ManaCostsImpl("{1}{U}"));
ability.addCost(new TapSourceCost());
ability.addTarget(new TargetControlledCreaturePermanent(filter));
ability.addTarget(new TargetControlledPermanent(filter));
this.addAbility(ability);
}

View file

@ -38,12 +38,12 @@ import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.filter.predicate.permanent.TappedPredicate;
import mage.game.permanent.token.Token;
import mage.target.common.TargetControlledCreaturePermanent;
import mage.target.common.TargetControlledPermanent;
/**
*
@ -51,7 +51,7 @@ import mage.target.common.TargetControlledCreaturePermanent;
*/
public class VoiceOfTheWoods extends CardImpl {
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("untapped Elves you control");
private static final FilterControlledPermanent filter = new FilterControlledPermanent("untapped Elves you control");
static {
filter.add(Predicates.not(new TappedPredicate()));
@ -69,7 +69,7 @@ public class VoiceOfTheWoods extends CardImpl {
// Tap five untapped Elves you control: Put a 7/7 green Elemental creature token with trample onto the battlefield.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD,
new CreateTokenEffect(new VoiceOfTheWoodsElementalToken()),
new TapTargetCost(new TargetControlledCreaturePermanent(5,5, filter, false)));
new TapTargetCost(new TargetControlledPermanent(5,5, filter, false)));
this.addAbility(ability);
}
@ -97,4 +97,4 @@ class VoiceOfTheWoodsElementalToken extends Token {
addAbility(TrampleAbility.getInstance());
}
}
}

View file

@ -37,7 +37,7 @@ import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.FilterPermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
/**
@ -46,7 +46,7 @@ import mage.filter.predicate.mageobject.SubtypePredicate;
*/
public class Wellwisher extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Elf on the battlefield");
private static final FilterPermanent filter = new FilterPermanent("Elf on the battlefield");
static {
filter.add(new SubtypePredicate("Elf"));

View file

@ -34,7 +34,7 @@ import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.filter.common.FilterCreatureCard;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.target.common.TargetCardInLibrary;
@ -44,7 +44,7 @@ import mage.target.common.TargetCardInLibrary;
*/
public class WirewoodHerald extends CardImpl {
private static final FilterCreatureCard filter = new FilterCreatureCard("Elf card");
private static final FilterCard filter = new FilterCard("Elf card");
static {
filter.add(new SubtypePredicate("Elf"));

View file

@ -38,9 +38,9 @@ import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.FilterPermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.target.common.TargetCreaturePermanent;
import mage.target.TargetPermanent;
/**
*
@ -48,7 +48,8 @@ import mage.target.common.TargetCreaturePermanent;
*/
public class WirewoodLodge extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Elf");
private static final FilterPermanent filter = new FilterPermanent("Elf");
static {
filter.add(new SubtypePredicate("Elf"));
}
@ -56,14 +57,14 @@ public class WirewoodLodge extends CardImpl {
public WirewoodLodge(UUID ownerId) {
super(ownerId, 329, "Wirewood Lodge", Rarity.RARE, new CardType[]{CardType.LAND}, "");
this.expansionSetCode = "ONS";
// {T}: Add {1} to your mana pool.
this.addAbility(new ColorlessManaAbility());
// {G}, {T}: Untap target Elf.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new UntapTargetEffect(), new ManaCostsImpl("{G}"));
ability.addCost(new TapSourceCost());
ability.addTarget(new TargetCreaturePermanent(filter));
ability.addTarget(new TargetPermanent(filter));
this.addAbility(ability);
}

View file

@ -35,7 +35,7 @@ import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.FilterPermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
/**
@ -44,7 +44,7 @@ import mage.filter.predicate.mageobject.SubtypePredicate;
*/
public class WirewoodSavage extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("a Beast");
private static final FilterPermanent filter = new FilterPermanent("a Beast");
static {
filter.add(new SubtypePredicate("Beast"));