updated some more of the mill templating

This commit is contained in:
Evan Kranzler 2020-06-07 19:29:00 -04:00
parent c4283cd591
commit 0590243d6d
2 changed files with 12 additions and 21 deletions

View file

@ -1,9 +1,5 @@
package mage.abilities.costs.common;
import java.util.LinkedHashSet;
import java.util.Set;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.costs.Cost;
import mage.abilities.costs.CostImpl;
@ -13,6 +9,10 @@ import mage.game.Game;
import mage.players.Player;
import mage.util.CardUtil;
import java.util.LinkedHashSet;
import java.util.Set;
import java.util.UUID;
public class PutTopCardOfYourLibraryToGraveyardCost extends CostImpl {
private final int numberOfCards;
@ -27,7 +27,7 @@ public class PutTopCardOfYourLibraryToGraveyardCost extends CostImpl {
this.text = setText();
}
public PutTopCardOfYourLibraryToGraveyardCost(PutTopCardOfYourLibraryToGraveyardCost cost) {
private PutTopCardOfYourLibraryToGraveyardCost(final PutTopCardOfYourLibraryToGraveyardCost cost) {
super(cost);
this.numberOfCards = cost.numberOfCards;
this.cardsMovedToGraveyard.addAll(cost.getCardsMovedToGraveyard());
@ -60,13 +60,6 @@ public class PutTopCardOfYourLibraryToGraveyardCost extends CostImpl {
}
private String setText() {
StringBuilder sb = new StringBuilder("Put the top ");
if (numberOfCards == 1) {
sb.append("card");
} else {
sb.append(CardUtil.numberToText(numberOfCards)).append(" cards");
}
sb.append(" of your library into your graveyard");
return sb.toString();
return "mill " + (numberOfCards == 1 ? "a card" : CardUtil.numberToText(numberOfCards) + " cards");
}
}

View file

@ -1,7 +1,5 @@
package mage.abilities.effects.common;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.StaticValue;
@ -13,8 +11,9 @@ import mage.game.Game;
import mage.players.Player;
import mage.util.CardUtil;
import java.util.UUID;
/**
*
* @author LevelX2
*/
public class PutTopCardOfLibraryIntoGraveEachPlayerEffect extends OneShotEffect {
@ -33,7 +32,7 @@ public class PutTopCardOfLibraryIntoGraveEachPlayerEffect extends OneShotEffect
this.staticText = setText();
}
public PutTopCardOfLibraryIntoGraveEachPlayerEffect(final PutTopCardOfLibraryIntoGraveEachPlayerEffect effect) {
private PutTopCardOfLibraryIntoGraveEachPlayerEffect(final PutTopCardOfLibraryIntoGraveEachPlayerEffect effect) {
super(effect);
this.numberCards = effect.numberCards;
this.targetController = effect.targetController;
@ -96,14 +95,13 @@ public class PutTopCardOfLibraryIntoGraveEachPlayerEffect extends OneShotEffect
default:
throw new UnsupportedOperationException("TargetController type not supported.");
}
sb.append("puts the top ");
if(numberCards.toString().equals("1")) {
sb.append("card");
sb.append("mills ");
if (numberCards.toString().equals("1")) {
sb.append("a card");
} else {
sb.append(CardUtil.numberToText(numberCards.toString()));
sb.append(" cards");
}
sb.append(" of their library into their graveyard");
return sb.toString();
}
}