Improved rule text generation for effects using DynamicValue.

This commit is contained in:
North 2011-06-05 15:37:06 +03:00
parent 1ed3f1f4f8
commit ca82485772
22 changed files with 143 additions and 164 deletions

View file

@ -77,10 +77,14 @@ public class DrawCardTargetEffect extends OneShotEffect<DrawCardTargetEffect> {
public String getText(Ability source) {
StringBuilder sb = new StringBuilder();
sb.append("Target player draws ").append(amount).append(" card");
if (amount instanceof StaticValue && amount.calculate(null, null) == 1) {
} else {
try {
if (Integer.parseInt(amount.toString()) > 1) {
sb.append("s");
}
} catch (Exception e) {
sb.append("s");
}
sb.append(amount.getMessage());
return sb.toString();
}