mirror of
https://github.com/correl/mage.git
synced 2025-01-13 19:11:33 +00:00
Changed some classes to use number as text in rule text instead of digits.
This commit is contained in:
parent
ebe3c92b9d
commit
fd0cbb6551
7 changed files with 19 additions and 10 deletions
|
@ -35,6 +35,7 @@ import mage.abilities.effects.OneShotEffect;
|
|||
import mage.cards.Card;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -101,7 +102,7 @@ public class DiscardControllerEffect extends OneShotEffect<DiscardControllerEffe
|
|||
if (amount.toString().equals("1")) {
|
||||
sb.append("a");
|
||||
} else {
|
||||
sb.append(amount);
|
||||
sb.append(CardUtil.numberToText(amount.toString()));
|
||||
}
|
||||
sb.append(" card");
|
||||
try {
|
||||
|
|
|
@ -10,6 +10,7 @@ import mage.abilities.effects.OneShotEffect;
|
|||
import mage.cards.Card;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
|
||||
public class DiscardEachPlayerEffect extends OneShotEffect<DiscardEachPlayerEffect> {
|
||||
|
@ -67,7 +68,7 @@ public class DiscardEachPlayerEffect extends OneShotEffect<DiscardEachPlayerEffe
|
|||
public String getText(Mode mode) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("Each player discards ");
|
||||
sb.append(amount).append(" card");
|
||||
sb.append(CardUtil.numberToText(amount.toString())).append(" card");
|
||||
try {
|
||||
if (Integer.parseInt(amount.toString()) > 1) {
|
||||
sb.append("s");
|
||||
|
|
|
@ -36,6 +36,7 @@ import mage.abilities.effects.OneShotEffect;
|
|||
import mage.cards.Card;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -105,7 +106,7 @@ public class DiscardTargetEffect extends OneShotEffect<DiscardTargetEffect> {
|
|||
sb.append("Target ").append(mode.getTargets().get(0).getTargetName());
|
||||
}
|
||||
sb.append(" discards ");
|
||||
sb.append(amount).append(" card");
|
||||
sb.append(CardUtil.numberToText(amount.toString())).append(" card");
|
||||
try {
|
||||
if (Integer.parseInt(amount.toString()) > 1) {
|
||||
sb.append("s");
|
||||
|
|
|
@ -34,6 +34,7 @@ import mage.abilities.Ability;
|
|||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -46,7 +47,7 @@ public class DrawCardAllEffect extends OneShotEffect<DrawCardAllEffect> {
|
|||
public DrawCardAllEffect(int amount) {
|
||||
super(Outcome.DrawCard);
|
||||
this.amount = amount;
|
||||
staticText = "Each player draws " + Integer.toString(amount) + " card" + (amount == 1?"":"s");
|
||||
staticText = "Each player draws " + CardUtil.numberToText(amount) + " card" + (amount == 1?"":"s");
|
||||
}
|
||||
|
||||
public DrawCardAllEffect(final DrawCardAllEffect effect) {
|
||||
|
|
|
@ -36,6 +36,7 @@ import mage.abilities.dynamicvalue.common.StaticValue;
|
|||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
/**
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
|
@ -77,8 +78,8 @@ public class DrawCardControllerEffect extends OneShotEffect<DrawCardControllerEf
|
|||
private void setText() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
boolean oneCard = (amount instanceof StaticValue && amount.calculate(null, null) == 1)
|
||||
|| amount instanceof PermanentsOnBattlefieldCount || amount.toString() == "1";
|
||||
sb.append("draw ").append(oneCard ? "a" : amount).append(" card");
|
||||
|| amount instanceof PermanentsOnBattlefieldCount || amount.toString().equals("1");
|
||||
sb.append("draw ").append(oneCard ? "a" : CardUtil.numberToText(amount.toString())).append(" card");
|
||||
if (!oneCard) {
|
||||
sb.append("s");
|
||||
}
|
||||
|
|
|
@ -36,6 +36,7 @@ import mage.abilities.dynamicvalue.common.StaticValue;
|
|||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -82,7 +83,7 @@ public class DrawCardTargetEffect extends OneShotEffect<DrawCardTargetEffect> {
|
|||
} else {
|
||||
sb.append("that player");
|
||||
}
|
||||
sb.append(" draws ").append(amount).append(" card");
|
||||
sb.append(" draws ").append(CardUtil.numberToText(amount.toString())).append(" card");
|
||||
try {
|
||||
if (Integer.parseInt(amount.toString()) > 1) {
|
||||
sb.append("s");
|
||||
|
|
|
@ -38,6 +38,7 @@ import mage.abilities.effects.OneShotEffect;
|
|||
import mage.cards.Card;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -78,10 +79,12 @@ public class PutLibraryIntoGraveTargetEffect extends OneShotEffect<PutLibraryInt
|
|||
int cardsCount = Math.min(amount.calculate(game, source), player.getLibrary().size());
|
||||
for (int i = 0; i < cardsCount; i++) {
|
||||
Card card = player.getLibrary().removeFromTop(game);
|
||||
if (card != null)
|
||||
if (card != null) {
|
||||
card.moveToZone(Zone.GRAVEYARD, source.getId(), game, false);
|
||||
else
|
||||
}
|
||||
else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
@ -98,7 +101,7 @@ public class PutLibraryIntoGraveTargetEffect extends OneShotEffect<PutLibraryInt
|
|||
if (amount.toString().equals("1")) {
|
||||
sb.append("card ");
|
||||
} else {
|
||||
sb.append(amount.toString()).append(" cards ");
|
||||
sb.append(CardUtil.numberToText(amount.toString())).append(" cards ");
|
||||
}
|
||||
} else {
|
||||
sb.append(" X cards ");
|
||||
|
|
Loading…
Reference in a new issue