Fixed rule text generation

This commit is contained in:
LevelX2 2012-10-14 01:04:32 +02:00
parent 16854660f1
commit 1793c4cf1c
2 changed files with 12 additions and 4 deletions

View file

@ -58,6 +58,7 @@ public class EntersBattlefieldAbility extends StaticAbility<EntersBattlefieldAbi
public EntersBattlefieldAbility(EntersBattlefieldAbility ability) { public EntersBattlefieldAbility(EntersBattlefieldAbility ability) {
super(ability); super(ability);
this.generateRule = ability.generateRule;
} }
@Override @Override

View file

@ -81,15 +81,22 @@ public class CreateTokenEffect extends OneShotEffect<CreateTokenEffect> {
private void setText() { private void setText() {
StringBuilder sb = new StringBuilder("put "); StringBuilder sb = new StringBuilder("put ");
if (amount.toString().equals("1")) { if (amount.toString().equals("1")) {
sb.append("a"); sb.append("a ").append(token.getDescription());
} else { } else {
sb.append(amount.toString()); sb.append(amount.toString()).append(" ").append(token.getDescription());
if (token.getDescription().endsWith("token")) {
sb.append("s ");
} }
sb.append(" ").append(token.getDescription()).append(" onto the battlefield"); }
sb.append(" onto the battlefield");
String message = amount.getMessage(); String message = amount.getMessage();
if (message.length() > 0) { if (message.length() > 0) {
if (message.startsWith("the ") || message.contains("number ")) {
sb.append(", where X is ");
} else {
sb.append(" for each "); sb.append(" for each ");
} }
}
sb.append(message); sb.append(message);
staticText = sb.toString(); staticText = sb.toString();
} }