From 979571a2f2d2842f66b36748cba5e48f8baf4cf9 Mon Sep 17 00:00:00 2001 From: North Date: Wed, 4 Jul 2012 23:57:06 +0300 Subject: [PATCH] [refactoring] reused FilterBlockingCreature --- .../mage/sets/shadowmoor/KithkinShielddare.java | 8 ++------ Mage.Sets/src/mage/sets/tempest/Gallantry.java | 15 +++++++-------- Mage.Sets/src/mage/sets/tenth/Righteousness.java | 8 ++------ 3 files changed, 11 insertions(+), 20 deletions(-) diff --git a/Mage.Sets/src/mage/sets/shadowmoor/KithkinShielddare.java b/Mage.Sets/src/mage/sets/shadowmoor/KithkinShielddare.java index 8dce1dde94..10253acd04 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/KithkinShielddare.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/KithkinShielddare.java @@ -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 { - 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}"); diff --git a/Mage.Sets/src/mage/sets/tempest/Gallantry.java b/Mage.Sets/src/mage/sets/tempest/Gallantry.java index ddcea6f999..aee2d9a7a6 100644 --- a/Mage.Sets/src/mage/sets/tempest/Gallantry.java +++ b/Mage.Sets/src/mage/sets/tempest/Gallantry.java @@ -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 { - 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)); } diff --git a/Mage.Sets/src/mage/sets/tenth/Righteousness.java b/Mage.Sets/src/mage/sets/tenth/Righteousness.java index af4af7af12..bd8441f4af 100644 --- a/Mage.Sets/src/mage/sets/tenth/Righteousness.java +++ b/Mage.Sets/src/mage/sets/tenth/Righteousness.java @@ -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 { - 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}");