mirror of
https://github.com/correl/mage.git
synced 2024-12-26 11:09:27 +00:00
Reffactoring
This commit is contained in:
parent
f1140eb2fb
commit
c66fb996b8
3 changed files with 14 additions and 15 deletions
|
@ -64,7 +64,7 @@ public class CivilizedScholar extends CardImpl<CivilizedScholar> {
|
||||||
this.toughness = new MageInt(1);
|
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.
|
// {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.addAbility(new TransformAbility());
|
||||||
|
|
||||||
this.addWatcher(new HomicidalBrute.HomicidalBruteWatcher());
|
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);
|
super(Constants.Outcome.DrawCard);
|
||||||
staticText = "Draw a card, then discard a card";
|
staticText = "Draw a card, then discard a card";
|
||||||
}
|
}
|
||||||
|
|
||||||
public DrawDiscardControllerEffect(final DrawDiscardControllerEffect effect) {
|
public CivilizedScholarEffect(final CivilizedScholarEffect effect) {
|
||||||
super(effect);
|
super(effect);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DrawDiscardControllerEffect copy() {
|
public CivilizedScholarEffect copy() {
|
||||||
return new DrawDiscardControllerEffect(this);
|
return new CivilizedScholarEffect(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -120,4 +120,3 @@ class DrawDiscardControllerEffect extends OneShotEffect<DrawDiscardControllerEff
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@ package mage.sets.tenth;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.Constants.CardType;
|
import mage.Constants.CardType;
|
||||||
import mage.Constants.Rarity;
|
import mage.Constants.Rarity;
|
||||||
import mage.abilities.effects.common.DiscardSourceEffect;
|
import mage.abilities.effects.common.DiscardControllerEffect;
|
||||||
import mage.abilities.effects.common.DrawCardControllerEffect;
|
import mage.abilities.effects.common.DrawCardControllerEffect;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ public class Sift extends CardImpl<Sift> {
|
||||||
|
|
||||||
// Draw three cards, then discard a card.
|
// Draw three cards, then discard a card.
|
||||||
this.getSpellAbility().addEffect(new DrawCardControllerEffect(3));
|
this.getSpellAbility().addEffect(new DrawCardControllerEffect(3));
|
||||||
this.getSpellAbility().addEffect(new DiscardSourceEffect(1));
|
this.getSpellAbility().addEffect(new DiscardControllerEffect(1));
|
||||||
}
|
}
|
||||||
|
|
||||||
public Sift(final Sift card) {
|
public Sift(final Sift card) {
|
||||||
|
|
|
@ -39,28 +39,28 @@ import mage.players.Player;
|
||||||
*
|
*
|
||||||
* @author BetaSteward_at_googlemail.com
|
* @author BetaSteward_at_googlemail.com
|
||||||
*/
|
*/
|
||||||
public class DiscardSourceEffect extends OneShotEffect<DiscardSourceEffect> {
|
public class DiscardControllerEffect extends OneShotEffect<DiscardControllerEffect> {
|
||||||
|
|
||||||
protected DynamicValue amount;
|
protected DynamicValue amount;
|
||||||
|
|
||||||
public DiscardSourceEffect(DynamicValue amount) {
|
public DiscardControllerEffect(DynamicValue amount) {
|
||||||
super(Outcome.Discard);
|
super(Outcome.Discard);
|
||||||
this.amount = amount;
|
this.amount = amount;
|
||||||
setText();
|
setText();
|
||||||
}
|
}
|
||||||
|
|
||||||
public DiscardSourceEffect(int amount) {
|
public DiscardControllerEffect(int amount) {
|
||||||
this(new StaticValue(amount));
|
this(new StaticValue(amount));
|
||||||
}
|
}
|
||||||
|
|
||||||
public DiscardSourceEffect(final DiscardSourceEffect effect) {
|
public DiscardControllerEffect(final DiscardControllerEffect effect) {
|
||||||
super(effect);
|
super(effect);
|
||||||
this.amount = effect.amount.clone();
|
this.amount = effect.amount.clone();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DiscardSourceEffect copy() {
|
public DiscardControllerEffect copy() {
|
||||||
return new DiscardSourceEffect(this);
|
return new DiscardControllerEffect(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
Loading…
Reference in a new issue