Fixes in texts.

This commit is contained in:
magenoxx 2011-08-09 09:28:06 +04:00
parent b559ea03d7
commit 3961f64c7c
3 changed files with 21 additions and 16 deletions

View file

@ -39,6 +39,10 @@ import mage.abilities.effects.EntersBattlefieldEffect;
*/ */
public class EntersBattlefieldAbility extends StaticAbility<EntersBattlefieldAbility> { public class EntersBattlefieldAbility extends StaticAbility<EntersBattlefieldAbility> {
public EntersBattlefieldAbility(Effect effect) {
super(Zone.BATTLEFIELD, new EntersBattlefieldEffect(effect, ""));
}
public EntersBattlefieldAbility(Effect effect, String rule) { public EntersBattlefieldAbility(Effect effect, String rule) {
super(Zone.BATTLEFIELD, new EntersBattlefieldEffect(effect, rule)); super(Zone.BATTLEFIELD, new EntersBattlefieldEffect(effect, rule));
} }

View file

@ -47,13 +47,15 @@ public class RemoveCountersSourceCost extends CostImpl<RemoveCountersSourceCost>
public RemoveCountersSourceCost(String name, int amount) { public RemoveCountersSourceCost(String name, int amount) {
this.amount = amount; this.amount = amount;
this.name = name; this.name = name;
this.text = "Remove " + amount + " " + name + " counters from {this}"; this.text = "Remove " + (amount == 1 ? "a" : amount) + " " + name + " counter"
+ (amount != 1 ? "s" : "") + " from {this}";
} }
public RemoveCountersSourceCost(Counter counter) { public RemoveCountersSourceCost(Counter counter) {
this.amount = counter.getCount(); this.amount = counter.getCount();
this.name = counter.getName(); this.name = counter.getName();
this.text = "Remove " + amount + " " + name + " counters from {this}"; this.text = "Remove " + (amount == 1 ? "a" : amount) + " " + name + " counter"
+ (amount != 1 ? "s" : "") + "from {this}";
} }
public RemoveCountersSourceCost(RemoveCountersSourceCost cost) { public RemoveCountersSourceCost(RemoveCountersSourceCost cost) {

View file

@ -37,16 +37,15 @@ import mage.game.Game;
import mage.players.Player; import mage.players.Player;
/** /**
*
* @author BetaSteward_at_googlemail.com * @author BetaSteward_at_googlemail.com
*/ */
public class DrawCardControllerEffect extends OneShotEffect<DrawCardControllerEffect> { public class DrawCardControllerEffect extends OneShotEffect<DrawCardControllerEffect> {
protected DynamicValue amount; protected DynamicValue amount;
public DrawCardControllerEffect(int amount) { public DrawCardControllerEffect(int amount) {
this(new StaticValue(amount)); this(new StaticValue(amount));
} }
public DrawCardControllerEffect(DynamicValue amount) { public DrawCardControllerEffect(DynamicValue amount) {
super(Outcome.DrawCard); super(Outcome.DrawCard);
@ -76,16 +75,16 @@ public class DrawCardControllerEffect extends OneShotEffect<DrawCardControllerEf
private void setText() { private void setText() {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sb.append("draw ").append(amount).append(" card"); boolean oneCard = amount instanceof StaticValue && amount.calculate(null, null) == 1;
if (amount instanceof StaticValue && amount.calculate(null, null) == 1) { sb.append("draw ").append(oneCard ? "a" : amount).append(" card");
} else { if (!oneCard) {
sb.append("s"); sb.append("s");
} }
String message = amount.getMessage(); String message = amount.getMessage();
if (message.length() > 0) { if (message.length() > 0) {
sb.append(" for each "); sb.append(" for each ");
} }
sb.append(message); sb.append(message);
staticText = sb.toString(); staticText = sb.toString();
} }