Reffactoring

This commit is contained in:
North 2011-09-30 07:44:24 +03:00
parent f1140eb2fb
commit c66fb996b8
3 changed files with 14 additions and 15 deletions

View file

@ -64,7 +64,7 @@ public class CivilizedScholar extends CardImpl<CivilizedScholar> {
this.toughness = new MageInt(1);
// {tap}: Draw a card, then discard a card. If a creature card is discarded this way, untap Civilized Scholar, then transform it.
this.addAbility(new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new DrawDiscardControllerEffect(), new TapSourceCost()));
this.addAbility(new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new CivilizedScholarEffect(), new TapSourceCost()));
this.addAbility(new TransformAbility());
this.addWatcher(new HomicidalBrute.HomicidalBruteWatcher());
@ -80,20 +80,20 @@ public class CivilizedScholar extends CardImpl<CivilizedScholar> {
}
}
class DrawDiscardControllerEffect extends OneShotEffect<DrawDiscardControllerEffect> {
class CivilizedScholarEffect extends OneShotEffect<CivilizedScholarEffect> {
public DrawDiscardControllerEffect() {
public CivilizedScholarEffect() {
super(Constants.Outcome.DrawCard);
staticText = "Draw a card, then discard a card";
}
public DrawDiscardControllerEffect(final DrawDiscardControllerEffect effect) {
public CivilizedScholarEffect(final CivilizedScholarEffect effect) {
super(effect);
}
@Override
public DrawDiscardControllerEffect copy() {
return new DrawDiscardControllerEffect(this);
public CivilizedScholarEffect copy() {
return new CivilizedScholarEffect(this);
}
@Override
@ -120,4 +120,3 @@ class DrawDiscardControllerEffect extends OneShotEffect<DrawDiscardControllerEff
return false;
}
}

View file

@ -30,7 +30,7 @@ package mage.sets.tenth;
import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.abilities.effects.common.DiscardSourceEffect;
import mage.abilities.effects.common.DiscardControllerEffect;
import mage.abilities.effects.common.DrawCardControllerEffect;
import mage.cards.CardImpl;
@ -48,7 +48,7 @@ public class Sift extends CardImpl<Sift> {
// Draw three cards, then discard a card.
this.getSpellAbility().addEffect(new DrawCardControllerEffect(3));
this.getSpellAbility().addEffect(new DiscardSourceEffect(1));
this.getSpellAbility().addEffect(new DiscardControllerEffect(1));
}
public Sift(final Sift card) {

View file

@ -39,28 +39,28 @@ import mage.players.Player;
*
* @author BetaSteward_at_googlemail.com
*/
public class DiscardSourceEffect extends OneShotEffect<DiscardSourceEffect> {
public class DiscardControllerEffect extends OneShotEffect<DiscardControllerEffect> {
protected DynamicValue amount;
public DiscardSourceEffect(DynamicValue amount) {
public DiscardControllerEffect(DynamicValue amount) {
super(Outcome.Discard);
this.amount = amount;
setText();
}
public DiscardSourceEffect(int amount) {
public DiscardControllerEffect(int amount) {
this(new StaticValue(amount));
}
public DiscardSourceEffect(final DiscardSourceEffect effect) {
public DiscardControllerEffect(final DiscardControllerEffect effect) {
super(effect);
this.amount = effect.amount.clone();
}
@Override
public DiscardSourceEffect copy() {
return new DiscardSourceEffect(this);
public DiscardControllerEffect copy() {
return new DiscardControllerEffect(this);
}
@Override