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) {
super(ability);
this.generateRule = ability.generateRule;
}
@Override

View file

@ -81,14 +81,21 @@ public class CreateTokenEffect extends OneShotEffect<CreateTokenEffect> {
private void setText() {
StringBuilder sb = new StringBuilder("put ");
if (amount.toString().equals("1")) {
sb.append("a");
sb.append("a ").append(token.getDescription());
} 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();
if (message.length() > 0) {
sb.append(" for each ");
if (message.startsWith("the ") || message.contains("number ")) {
sb.append(", where X is ");
} else {
sb.append(" for each ");
}
}
sb.append(message);
staticText = sb.toString();