minor refactoring

This commit is contained in:
North 2012-03-05 22:59:40 +02:00
parent 0075799681
commit 8aed29b3ab
3 changed files with 55 additions and 12 deletions

View file

@ -30,8 +30,6 @@
package mage.sets.championsofkamigawa;
import java.util.UUID;
import mage.Constants;
import mage.Constants.CardType;
import mage.Constants.Rarity;
@ -39,7 +37,6 @@ import mage.abilities.Mode;
import mage.abilities.common.CantBlockAbility;
import mage.abilities.effects.common.continious.GainAbilityTargetEffect;
import mage.cards.CardImpl;
import mage.filter.common.FilterCreaturePermanent;
import mage.target.Target;
import mage.target.common.TargetCreaturePermanent;
@ -53,13 +50,13 @@ public class UnearthlyBlizzard extends CardImpl<UnearthlyBlizzard> {
this.expansionSetCode = "CHK";
this.subtype.add("Arcane");
this.color.setRed(true);
Target target = new TargetCreaturePermanent(0,3);
target.setTargetName("Select up to three creatures that can't block this turn.");
Target target = new TargetCreaturePermanent(0, 3);
target.setTargetName("Select up to three creatures that can't block this turn.");
// Up to three target creatures can't block this turn.
this.getSpellAbility().addEffect(new UnearthlyBlizzardEffect());
this.getSpellAbility().addTarget(target);
this.getSpellAbility().addTarget(target);
}
@ -91,6 +88,6 @@ class UnearthlyBlizzardEffect extends GainAbilityTargetEffect {
@Override
public String getText(Mode mode) {
return staticText;
return staticText;
}
}

View file

@ -32,6 +32,7 @@ import mage.Constants.CardType;
import mage.Constants.Duration;
import mage.Constants.Rarity;
import mage.Constants.TimingRule;
import mage.abilities.Mode;
import mage.abilities.common.CantBlockAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.continious.GainAbilityTargetEffect;
@ -52,7 +53,7 @@ public class NightbirdsClutches extends CardImpl<NightbirdsClutches> {
this.color.setRed(true);
// Up to two target creatures can't block this turn.
this.getSpellAbility().addEffect(new GainAbilityTargetEffect(CantBlockAbility.getInstance(), Duration.EndOfTurn));
this.getSpellAbility().addEffect(new NightbirdsClutchesEffect());
this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, 2));
// Flashback {3}{R}
this.addAbility(new FlashbackAbility(new ManaCostsImpl("{3}{R}"), TimingRule.SORCERY));
@ -67,3 +68,25 @@ public class NightbirdsClutches extends CardImpl<NightbirdsClutches> {
return new NightbirdsClutches(this);
}
}
class NightbirdsClutchesEffect extends GainAbilityTargetEffect {
public NightbirdsClutchesEffect() {
super(CantBlockAbility.getInstance(), Duration.EndOfTurn);
staticText = "Up to two target creatures can't block this turn";
}
public NightbirdsClutchesEffect(final NightbirdsClutchesEffect effect) {
super(effect);
}
@Override
public NightbirdsClutchesEffect copy() {
return new NightbirdsClutchesEffect(this);
}
@Override
public String getText(Mode mode) {
return staticText;
}
}

View file

@ -31,6 +31,7 @@ import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Duration;
import mage.Constants.Rarity;
import mage.abilities.Mode;
import mage.abilities.common.CantBlockAbility;
import mage.abilities.effects.common.continious.GainAbilityTargetEffect;
import mage.cards.CardImpl;
@ -49,8 +50,8 @@ public class PanicAttack extends CardImpl<PanicAttack> {
this.color.setRed(true);
// Up to three target creatures can't block this turn.
this.getSpellAbility().addEffect(new GainAbilityTargetEffect(CantBlockAbility.getInstance(), Duration.EndOfTurn));
this.getSpellAbility().addTarget(new TargetCreaturePermanent(1, 3));
this.getSpellAbility().addEffect(new PanicAttackEffect());
this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, 3));
}
public PanicAttack(final PanicAttack card) {
@ -62,3 +63,25 @@ public class PanicAttack extends CardImpl<PanicAttack> {
return new PanicAttack(this);
}
}
class PanicAttackEffect extends GainAbilityTargetEffect {
public PanicAttackEffect() {
super(CantBlockAbility.getInstance(), Duration.EndOfTurn);
staticText = "Up to three target creatures can't block this turn";
}
public PanicAttackEffect(final PanicAttackEffect effect) {
super(effect);
}
@Override
public PanicAttackEffect copy() {
return new PanicAttackEffect(this);
}
@Override
public String getText(Mode mode) {
return staticText;
}
}