[refactoring] reused FilterBlockingCreature

This commit is contained in:
North 2012-07-04 23:57:06 +03:00
parent f4bd912583
commit 979571a2f2
3 changed files with 11 additions and 20 deletions

View file

@ -38,6 +38,7 @@ import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.continious.BoostTargetEffect;
import mage.cards.CardImpl;
import mage.filter.common.FilterBlockingCreature;
import mage.filter.common.FilterCreaturePermanent;
import mage.target.common.TargetCreaturePermanent;
@ -47,12 +48,7 @@ import mage.target.common.TargetCreaturePermanent;
*/
public class KithkinShielddare extends CardImpl<KithkinShielddare> {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("blocking creature");
static {
filter.setBlocking(true);
filter.setUseBlocking(true);
}
private static final FilterCreaturePermanent filter = new FilterBlockingCreature("blocking creature");
public KithkinShielddare(UUID ownerId) {
super(ownerId, 10, "Kithkin Shielddare", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{W}");

View file

@ -29,12 +29,13 @@ package mage.sets.tempest;
import java.util.UUID;
import mage.Constants;
import mage.Constants.CardType;
import mage.Constants.Duration;
import mage.Constants.Rarity;
import mage.abilities.effects.common.DrawCardControllerEffect;
import mage.abilities.effects.common.continious.BoostTargetEffect;
import mage.cards.CardImpl;
import mage.filter.common.FilterBlockingCreature;
import mage.filter.common.FilterCreaturePermanent;
import mage.target.common.TargetCreaturePermanent;
@ -44,19 +45,17 @@ import mage.target.common.TargetCreaturePermanent;
*/
public class Gallantry extends CardImpl<Gallantry> {
private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("blocking creature");
static {
filter.setUseBlocking(true);
filter.setBlocking(true);
}
private final static FilterCreaturePermanent filter = new FilterBlockingCreature("blocking creature");
public Gallantry(UUID ownerId) {
super(ownerId, 232, "Gallantry", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{1}{W}");
this.expansionSetCode = "TMP";
this.color.setWhite(true);
this.getSpellAbility().addEffect(new BoostTargetEffect(4, 4, Constants.Duration.EndOfTurn));
// Target blocking creature gets +4/+4 until end of turn.
this.getSpellAbility().addEffect(new BoostTargetEffect(4, 4, Duration.EndOfTurn));
this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter));
// Draw a card.
this.getSpellAbility().addEffect(new DrawCardControllerEffect(1));
}

View file

@ -33,6 +33,7 @@ import mage.Constants.Duration;
import mage.Constants.Rarity;
import mage.abilities.effects.common.continious.BoostTargetEffect;
import mage.cards.CardImpl;
import mage.filter.common.FilterBlockingCreature;
import mage.filter.common.FilterCreaturePermanent;
import mage.target.common.TargetCreaturePermanent;
@ -42,12 +43,7 @@ import mage.target.common.TargetCreaturePermanent;
*/
public class Righteousness extends CardImpl<Righteousness> {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("blocking creature");
static {
filter.setBlocking(true);
filter.setUseBlocking(true);
}
private static final FilterCreaturePermanent filter = new FilterBlockingCreature("blocking creature");
public Righteousness(UUID ownerId) {
super(ownerId, 36, "Righteousness", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{W}");