mirror of
https://github.com/magefree/mage.git
synced 2025-12-20 10:40:06 -08:00
fix filter
This commit is contained in:
parent
35e906513c
commit
4ce2e561fb
1 changed files with 6 additions and 2 deletions
|
|
@ -12,9 +12,11 @@ import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.SubType;
|
import mage.constants.SubType;
|
||||||
import mage.constants.SuperType;
|
import mage.constants.SuperType;
|
||||||
|
import mage.filter.FilterPermanent;
|
||||||
import mage.filter.StaticFilters;
|
import mage.filter.StaticFilters;
|
||||||
import mage.filter.common.FilterControlledPermanent;
|
import mage.filter.common.FilterControlledPermanent;
|
||||||
import mage.filter.predicate.permanent.TappedPredicate;
|
import mage.filter.predicate.permanent.TappedPredicate;
|
||||||
|
import mage.filter.predicate.permanent.TokenPredicate;
|
||||||
import mage.game.permanent.token.FoodToken;
|
import mage.game.permanent.token.FoodToken;
|
||||||
import mage.target.common.TargetControlledPermanent;
|
import mage.target.common.TargetControlledPermanent;
|
||||||
|
|
||||||
|
|
@ -27,9 +29,11 @@ public final class TheCabbageMerchant extends CardImpl {
|
||||||
|
|
||||||
private static final FilterControlledPermanent filter
|
private static final FilterControlledPermanent filter
|
||||||
= new FilterControlledPermanent(SubType.FOOD, "untapped Foods you control");
|
= new FilterControlledPermanent(SubType.FOOD, "untapped Foods you control");
|
||||||
|
private static final FilterPermanent filter2 = new FilterControlledPermanent(SubType.FOOD, "Food token");
|
||||||
|
|
||||||
static {
|
static {
|
||||||
filter.add(TappedPredicate.UNTAPPED);
|
filter.add(TappedPredicate.UNTAPPED);
|
||||||
|
filter2.add(TokenPredicate.TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
public TheCabbageMerchant(UUID ownerId, CardSetInfo setInfo) {
|
public TheCabbageMerchant(UUID ownerId, CardSetInfo setInfo) {
|
||||||
|
|
@ -43,13 +47,13 @@ public final class TheCabbageMerchant extends CardImpl {
|
||||||
|
|
||||||
// Whenever an opponent casts a noncreature spell, create a Food token.
|
// Whenever an opponent casts a noncreature spell, create a Food token.
|
||||||
this.addAbility(new SpellCastOpponentTriggeredAbility(
|
this.addAbility(new SpellCastOpponentTriggeredAbility(
|
||||||
new CreateTokenEffect(new FoodToken()), StaticFilters.FILTER_SPELL_NON_CREATURE, false
|
new CreateTokenEffect(new FoodToken()), StaticFilters.FILTER_SPELL_A_NON_CREATURE, false
|
||||||
));
|
));
|
||||||
|
|
||||||
// Whenever a creature deals combat damage to you, sacrifice a Food token.
|
// Whenever a creature deals combat damage to you, sacrifice a Food token.
|
||||||
this.addAbility(new DealsDamageToYouAllTriggeredAbility(
|
this.addAbility(new DealsDamageToYouAllTriggeredAbility(
|
||||||
StaticFilters.FILTER_PERMANENT_CREATURE,
|
StaticFilters.FILTER_PERMANENT_CREATURE,
|
||||||
new SacrificeControllerEffect(StaticFilters.FILTER_CONTROLLED_FOOD, 1, ""), true
|
new SacrificeControllerEffect(filter2, 1, ""), true
|
||||||
));
|
));
|
||||||
|
|
||||||
// Tap two untapped Foods you control: Add one mana of any color.
|
// Tap two untapped Foods you control: Add one mana of any color.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue